1. Open the Apache httpd.conf file and 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 paragraph: 127.0.0.1 x.acme.com (the domain name you use to access)
3. I use the Wamp package, so go to the C:/wamp/bin/apache/apache2.2.11/conf/extra directory Modify File httpd-vhosts.conf
Namevirtualhost defaults to the following:
Namevirtualhost *:80
Fix it and reboot the server.
Enter the http://x.acme.com in the browser to your directory.
Of course if you want to add the virtual host to the existing Web server, then the original localhost service to be able to use, you need to add something on the basis of:
In the Hosts file, add: 127.0.0.1 localhost
and add in the httpd-vhosts.conf file:
<virtualhost *:80>
ServerAdmin localhost@xxx.com
DocumentRoot "/var/www/"
ServerName localhost
ErrorLog "Logs/localhost-error.log"
Customlog "Logs/localhost-access.log" common
</VirtualHost>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.