Windows配置本地域名

来源:互联网 发布:网络加速器免费 编辑:程序博客网 时间:2024/06/05 16:55

1. hosts文件   C:\Windows\System32\drivers\etc

添加如下代码:

127.0.0.1      www.blog.com

127.0.0.1      blog.com

2. 修改Apache中的httpd.conf文件

Include conf/extra/httpd-vhosts.conf去掉前面的’ # ’

3、找到httpd-vhosts.conf文件(-)

然后添加以下内容

<VirtualHost *:80>  

    ServerAdmin webmaster@dummy-host2.example.com  

    DocumentRoot "F:\web\www\laravel\blog\public\index.php"    //这个为您的项目目录  

    ServerName www.blog.com                       //这个为您在host中配置  

    ErrorLog "logs/dummy-host2.example.com-error.log"  

    CustomLog "logs/dummy-host2.example.com-access.log" common  

</VirtualHost>

Httpd.conf中目录的含义:

http://blog.csdn.net/u011685720/article/details/48680203

 

httpd-vhosts.conf上面有一行

<VirtualHost _default_:80>

DocumentRoot "${SRVROOT}/htdocs"

 

DocumentRoot "${SRVROOT}/htdocs"改成DocumentRoot "F:\web\www"(你自己定义的web根目录)

 

打开浏览器,访问www.blog.com



原创粉丝点击