Apache--Configure the virtual directory

Source: Internet
Author: User

Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/48142201
First, the configuration

The Apache configuration virtual directory is mainly modified httpd.conf files.

Open a httpd.conf file and find the following code:

<ifmodule dir_module>    DirectoryIndex index.html</ifmodule>
:

Add the following code below this code:

#配置虚拟目录 <ifmodule dir_module>   #配置欢迎页面   directoryindex index.html index.htm index.php   #站点别名   Alias/apache "D:/apache"   <directory d:/apache>        #这是访问权限的设置Order allow,denyallow from all   </ Directory></ifmodule>
Such as:

Note: Paths in 1 and 22 locations must be the same


Then find the code:

DocumentRoot "D:/program Files (x86)/apache software Foundation/apache2.2/htdocs"
To comment it out

Such as

Here, the configuration is complete

Second, the test

Create a new Apache folder under D, then create a new index.html file and type "How are you?" "Text is used for testing.

Such as:

In the browser address bar, enter http://127.0.0.1:8080 to display "How are you?" ", the configuration succeeds. such as:

Third, attention

My Apache port configuration is 8080, you can according to their own needs to configure their own port number. The specific configuration is to find the following code in the httpd.conf file:

Listen 8080
Such as:

You can modify 8080 to the port you need, and you can continue to add the listen port number below to listen to multiple ports

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Apache--Configure the virtual directory

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.