Windows配置本地域名
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
總結
以上是生活随笔為你收集整理的Windows配置本地域名的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: windows10配置php7.1+ap
- 下一篇: Centos7+nginx1.12+my