PHP 虚拟主机

来源:互联网 发布:java异常的程序 编辑:程序博客网 时间:2024/04/30 12:18

1.在httpd.conf中把对这句的注释去掉 

#Virtual hosts conf

Include conf/extra/httpd-vhosts.conf

2.准备网站页面,假设是  d:/myweb/index.html

3.设置httpd-vhosts.conf

<VirtualHost 127.0.0.1:80>

DocumentRoot "d:/myweb"

DirectoryIndex  index.html

<Directory />

Option FollowSymLinks

Allow Override None

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

4.修改window目录下,system32\drivers\etc\hosts文件

添加地址和域名的映射关系

127.0.0.1   www.sohu.com


如果不让修改,就另存然后拷贝回来覆盖。这样搜狐的首页就会在本机被重新定向为自己准备的网页

0 0
原创粉丝点击