Http://jingyan.baidu.com/article/5225f26b07605be6fa090890.html
Allows Apache to load the virtual host module at boot time.
Open the Apache installation directory under the conf/httpd.conf file, find the following two lines of text, the first # number is removed, and then saved.
#LoadModule Vhost_alias_module modules/mod_vhost_alias.so
#Include conf/extra/httpd-vhosts.conf
Then find DocumentRoot and directory in the same file and change to the top level directory of the Site Directory
For example, sites are placed in D:/APPSERV/WWW/1 and D:/APPSERV/WWW/2, then the following form is changed
DocumentRoot "D:/appserv/www"
<directory "D:/appserv/www" >
After the configuration is complete, you can open the Apache installation directory under the/conf/extra/httpd-vhosts.conf file and add the following at the end:
DocumentRoot is the file placement path, servername is the site domain name:
<VirtualHost*:80>
DocumentRoot "D:/APPSERV/WWW/1"
ServerName www.xxx.com
</VirtualHost>
<VirtualHost*:80>
DocumentRoot "D:/APPSERV/WWW/2"
ServerName www.xxx2.com
</VirtualHost>
The final restart of the Apache service is configured to complete.
My personal configuration Apache encountered a problem, such as my website www.stzjz.com
Directly enter the domain name opens the result is the Appserv interface
:
- 6
My solution is to
Apache install directory under the/conf/extra/httpd-vhosts.conf file, add the following at the end:
<VirtualHost*:80>
DocumentRoot "D:/appserv/www"
ServerName 127.0.0.1
</VirtualHost>
Configuring the Apache Apache server How to configure multiple sites