Detailed description of local machine apache configuration based on domain name Virtual Machine
Source: Internet
Author: User
The following describes how to configure a domain name-based virtual host for apache on a local machine. if you need it, refer to it.
1. open the httpd. conf file of apache and find # Virtual hosts
# Include conf/extra/httpd-vhosts.conf
This section removes "#" before Include conf/extra/httpd-vhosts.conf.
2. modify the hosts file in the (win7) c:/windows/system32/drivers/etc/directory. Add 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
The default NameVirtualHost is as follows:
NameVirtualHost *: 80
Modify and restart the server.
Enter the http://x.acme.com in your browser to go to your Directory.
Of course, if you want to add a virtual host to an existing web server, if you want to use the localhost service, you need to add something to the above:
Add 127.0.0.1 localhost to the hosts file.
And add in the httpd-vhosts.conf file:
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.