apache配置虚拟目录

1.打开apche配置文件httpd.conf,将Include conf/extra/httpd-vhosts.conf前面的#去掉;

2.在apache的目录下进入conf/extra;找到http-vhosts.conf文件,打开后在最后一行添加上如下代码后重启apache;

 1 <VirtualHost *:80>
 2     ServerAdmin webmaster@dummy-host2.hleclerc-PC.ingenidev
 3     DocumentRoot "C:/wamp/www/hsy"
 4     ServerName hsy.com
 5     DirectoryIndex index.php
 6     DirectoryIndex index.html
 7     DirectoryIndex index.htm
 8     ErrorLog "logs/dummy-host2.hleclerc-PC.ingenidev-error.log"
 9     CustomLog "logs/dummy-host2.hleclerc-PC.ingenidev-access.log" common
10 </VirtualHost>

3.进入C:\WINDOWS\system32\drivers\etc目录,打开hosts文件,在下面添加127.0.0.1 test.com。

原文链接:https://www.cnblogs.com/thinksasa/archive/2012/11/08/2760055.html
本文来源 爱码网,其版权均为 原网址 所有 与本站无关,文章内容系作者个人观点,不代表 本站 对观点赞同或支持。如需转载,请注明文章来源。

© 版权声明

相关文章