Summarize
1
Open the Appserv installation directory, locate the httpd.conf file, and remove the # number in front of the following two lines, respectively.
#LoadModule Vhost_alias_module modules/mod_vhost_alias.so
Remove # means enable Apache's virtual host feature.
2
#Include conf/extra/httpd-vhosts.conf
Getting rid of this line means importing the virtual host configuration from the conf/extra/httpd-vhosts.conf file.
3
Httpd.conf, find such a paragraph:
<directory/>
Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all
Satisfy All
</Directory>
Then try to change the deny from all to allow, and then restart Apache after saving
Or it will appear.
Forbidden
You don't have permission to access/on the this server.
--------------------------------------------------------------------------------
apache/2.2.4 (WIN32) php/5.2.1 Server at test.com Port 80
4 in Extra/httpd-vhosts.conf
#NameVirtualHost *:80 to get rid of #
Otherwise, only the first address can take effect.
Configuration
Appserv setting up multiple virtual directories for an IP address
Go down and download the Appserv-2.5.exe and install it.
First step: Find the local Hosts file to add
www.xxx.com 127.0.0.1
Bbs.xxx.com 127.0.0.1
Room.xxx.com 127.0.0.1
Step Two:
Open the Appserv installation directory
Open the Conf folder under Apache files
Open a httpd.conf file, open the way select "Open With Notepad"
Step Three:
Find "ServerName www.xxx.com:80"
Add the following
ServerName bbs.xxx.com:80
ServerName room.xxx.com:80
Locate "DocumentRoot yyy" {where yyy is the default directory set at installation, where yyy cannot have double quotes}
Add the same "DocumentRoot zzz" {zzz is the virtual directory address you specified, and you want to set up several virtual directories to copy them several times}
Find "<directory zzz>" {The above mentioned in zzz, and the difference is that the zzz here is to be enclosed in double quotation marks}
Copy all content between <directory zzz> to </Directory>, number is the number of items set virtual directory
Fourth Step:
Open the Appserv installation directory, locate the httpd.conf file, and remove the # number in front of the following two lines, respectively.
#LoadModule Vhost_alias_module modules/mod_vhost_alias.so
Remove # means enable Apache's virtual host feature.
Fifth Step:
#Include conf/extra/httpd-vhosts.conf
Getting rid of this line means importing the virtual host configuration from the conf/extra/httpd-vhosts.conf file.
Sixth step:
Open the extra directory in the httpd-vhosts.conf file, nothing, directly at the bottom of the file to add their own to add
Information about the virtual host. as shown below. is to give an administrator mailbox, indicate the root directory of this site, the domain name, and the wrong
The location where the log is stored incorrectly. Note that the directory interval is best used/rather than \.
<virtualhost *:80>
ServerAdmin
DocumentRoot E:/appserv259/www/dede
ServerName www.xxx.com
Errorlog E:/appserv259/www/dede/error.log
Customlog Logs/dummy-host2.appservnetwork.com-access_log Common
</VirtualHost>
<virtualhost *:80>
ServerAdmin
DocumentRoot E:/appserv259/www/phpcms
ServerName www.bbs.com
Errorlog E:/appserv259/www/dede/error.log
Customlog Logs/dummy-host2.appservnetwork.com-access_log Common
</VirtualHost>
<virtualhost *:80>
ServerAdmin
DocumentRoot E:/appserv259/www/phpcms
ServerName www.room.com
Errorlog E:/appserv259/www/dede/error.log
Customlog Logs/dummy-host2.appservnetwork.com-access_log Common
</VirtualHost>
* The diagonal of the above path can be left oblique right oblique.
Seventh Step:
Appserv Apache service will be restarted, you can put a index.html file in the root directory of each website, such as
If you can see it, the explanation is right.
One thing to emphasize is that the virtual directory must be set in the installation directory
Httpd.conf, find such a paragraph:
<directory/>
Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all
Satisfy All
</Directory>
Then try to change the deny from all to allow, and then restart Apache after saving