apache 配置 httpd-vhost.conf 。VirtualHost 配置更改域名,埠 。 無法訪問 localhost
阿新 • • 發佈:2019-01-01
《《 如果無法訪問 localhost 有可能是 Include conf/extra/httpd-vhosts.conf 註釋開啟,然後 httpd-vhosts.conf 檔案內容出錯 。 Include conf/extra/httpd 檔案在 httpd.conf 裡 》》
1、開啟安裝的 apache 配置檔案 httpd.conf
eg: D:\phpStudy\Apache\conf\httpd.conf
2、將檔案註釋開啟,引用 httpd-vhosts.conf 檔案
httpd.conf / #Include conf/extra/httpd-vhosts.conf ** 將前面 # 註釋去掉 ** Include conf/extra/httpd-vhosts.conf
3、開啟 httpd-vhosts.conf 檔案
extra 目錄下
eg: D:\phpStudy\Apache\conf\extra\httpd-vhosts.conf
4、增加修改配置
Listen 8099 要監聽的埠
<VirtualHost localhost:8099> 訪問的域名加路徑
DocumentRoot "E:\work\lasque" 從新定義訪問的路徑
ServerName localhost:8099 伺服器名
</VirtualHost>
小提示:注意把我寫的中文刪掉哦~
5、從新啟動apache,輸入 localhost:8099 訪問即可