Apache-configure a virtual host and an apache Virtual Host

Source: Internet
Author: User

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.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.