一衫贬,http.conf 修改部分配置
// 開(kāi)啟rewrite 下面配置前的#去掉
LoadModule rewrite_module modules/mod_rewrite.so
// 開(kāi)啟目錄訪問(wèn)權(quán)限鳞尔,Directory改成如下配置
<Directory />
AllowOverride all
Require all granted
</Directory>
二血当,http.conf 文檔末尾增加自定義項(xiàng)目目錄配置
<Directory />
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Allow from all
</Directory>
<VirtualHost *:80>
#本地項(xiàng)目路徑
DocumentRoot "D:/www/"
#自定義域名訪問(wèn) 隨便寫(xiě)
ServerName test.com
</VirtualHost>
三攒庵,增加自定義域名到host文件中
a, 打開(kāi)系統(tǒng)hosts文件偿短,路徑是C:\Windows\System32\drivers\etc\hosts
b, 文檔末尾增加 127.0.0.1 test.com
c, 有時(shí)候hosts文檔修改無(wú)法保存澄峰,這是系統(tǒng)權(quán)限問(wèn)題,需要修改etc目錄下的所有文件權(quán)限給你的系統(tǒng)登錄用戶即可