标签:des style blog http io color ar os 使用
1、找到C:\Windows\System32\drivers\etc下的hosts文件,在文件最后增加以下内容:
127.0.0.1 mysite.net
需要注意的是,此hosts文件可能会不让保存,解决的方法是将此hosts文件拷贝至其它位置(比如桌面),修改完毕后拷贝回来,将原文件覆盖即可。
2、打开Apache的配置文件httpd.conf,找到Include conf/extra/httpd-vhosts.conf这行,如果这一句前面有#的话,将其去掉。
3、打开Apache中conf\extra下的httpd-vhosts.conf文件,在最后写入:
(1)PHP2.2下
NameVirtualHost *:80 <VirtualHost *:80> ServerName mysite.net DocumentRoot "D:\xampp\htdocs\mysite" <Directory "D:\xampp\htdocs\mysite"> Options FollowSymLinks IncludesNOEXEC Indexes DirectoryIndex index.html index.htm index.shtml default.html default.htm index.php default.php AllowOverride All Order Deny,Allow Deny from All Allow from 127.0.0.1 </Directory> </VirtualHost>
(2)PHP2.4下
<VirtualHost 127.0.0.1:80> ServerName mysite.net DocumentRoot "D:\xampp\htdocs\mysite" <Directory "D:\xampp\htdocs\mysite"> Options FollowSymLinks IncludesNOEXEC Indexes DirectoryIndex index.html index.htm index.shtml default.html default.htm index.php default.php AllowOverride All Require all denied Require ip 127.0.0.1 ::1 Require local </Directory> </VirtualHost>
博客声明:
本博客中的所有文章,除标题中注明“转载”字样外,其余所有文章均为本人原创或在查阅资料后总结完成,引用非转载文章时请注明此声明。—— 博客园-pallee
Windows环境的apache下Virtual Host 设置
标签:des style blog http io color ar os 使用
原文地址:http://www.cnblogs.com/pallee/p/4078349.html