在本地環境配置本地可用的域名站點
阿新 • • 發佈:2018-12-30
1.先安裝好wamp環境並啟動,開啟配置檔案httpd.conf,搜 httpd-vhosts.conf
Include conf/extra/httpd-vhosts.conf //去掉前面的#,這樣就開啟了httpd-vhosts虛擬主機模組
搜Directory 約160行
<Directory />
Options FollowSymLinks //(選)Options Indexes FollowSymLinks 加索引
#AllowOverride None #建立
AllowOverride All
Order deny,allow
#Deny from all
Allow from all
#Satisfy all
</Directory>
#DocumentRoot "C:/wamp/www" 約150行更改網站根目錄
DocumentRoot "D:/www"
2.開啟擴充套件配置檔案 \conf\extra httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "G:/wamp/www/808"
ServerName www.test.com
</VirtualHost>
3.開啟本地 C:\Windows\System32\drivers\etc hosts 複製出來修改後再覆蓋
127.0.0.1 www.test.com