1. Open the Apache httpd.conf file to find
# Virtual Hosts
#Include conf/extra/httpd-vhosts.conf
This section removes the "#" in front of the include conf/extra/httpd-vhosts.conf.
2. Modify the Hosts file located in the (Win7) c:/windows/system32/drivers/etc/directory
Add a section: 127.0.0.1 x.acme.com (the domain name you use to access)
3. I use the Wamp package, so to the C:/wamp/bin/apache/apache2.2.11/conf/extra directory
Modify File httpd-vhosts.conf
Namevirtualhost default is as follows:
Namevirtualhost *:80
Increase:
ServerAdmin x@acme.com
DocumentRoot "/var/www/html"
ServerName x.acme.com
Errorlog "Logs/x.acme.com-error.log"
Customlog "Logs/x.acme.com-access.log" common
Change it and restart the server.
Enter http://x.acme.com in the browser to go to your directory.
Of course if you want to add the virtual host on the existing Web server, then the original localhost service to be able to use, you need to add something on the basis above:
In the Hosts file, add: 127.0.0.1 localhost
and add in the httpd-vhosts.conf file:
ServerAdmin localhost@xxx.com
DocumentRoot "/var/www/"
ServerName localhost
Errorlog "Logs/localhost-error.log"
Customlog "Logs/localhost-access.log" common
http://www.bkjia.com/PHPjc/328189.html www.bkjia.com true http://www.bkjia.com/PHPjc/328189.html techarticle 1. Open the Apache httpd.conf file to find the # Virtual hosts #Include conf/extra/httpd-vhosts.conf This section of include conf/extra/ Httpd-vhosts.conf in front of the "#" removed. 2. Modify the location ( ...