Apache-configure a virtual host and an apache Virtual Host
Reprinted please indicate the source: http://blog.csdn.net/l1028386804/article/details/48140649
1. Modify the httpd. conf file
First, find the httpd. conf file in the conf directory of Apache installation, such:
Open the file and find the following code in the file:
DocumentRoot "D:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs"
This line of code indicates the default access path of apache. First, comment out this line of code, for example:
Find the following code in the httpd. conf file:
# Virtual hosts#Include conf/extra/httpd-vhosts.conf
Open a comment on the # Include conf/extra/httpd-vhosts.conf line of code
For example:
2. Modify the httpd-vhosts.conf File
Find the httpd-vhosts.conf file in the extra directory under the conf directory, that is, the file referenced in the httpd. conf file.
Then add the following code to the httpd-vhosts.conf file:
# Configure our own virtual host <VirtualHost 127.0.0.1: 8080> # configure the access root directory DocumentRoot "d:/Apache" # configure the DirectoryIndex index.html index.htm index on the welcome homepage. php <Directory/> Options FollowSymLinks # Do not allow others to modify our page AllowOverride None # Set the access permission Order Allow, deny allow from All </Directory> </VirtualHost>
For specific configuration information, see the preceding code comment. Now, we have completed the configuration of the virtual host. How is it? Is it easy?
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.