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