How to set virtual server for Zend Framework? zend server VirtualHost
程序员文章站
2022-03-04 16:13:57
...
1、
Try to add a host to zend.conf or add
Include conf/extra/httpd-vhosts.conf
to htppd.conf
2、Edit httpd-vhosts.conf:
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
DocumentRoot "C:\Zend\Apache2/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "E:\www\home-local\public"
ServerName home.local
ErrorLog "E:\www\home-local\logs\error.log"
<Directory "E:\www\home-local" >
Options Indexes FollowSymLinks
AllowOverride all
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
3、
Change. C:\Windows\System32\drivers\etc\hosts
127.0.0.1 dev.zendapp
Restart Your Server