1. 修改 apache 設定檔,開啟 httpd.conf 檔,如果是透過 Include conf/extra/httpd-vhosts.conf 設定 VHost 的話,則開啟此一檔案。
2. 修改或加入以下代碼:
DocumentRoot "D:\Wamp\www"
ServerName localhost
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
ServerName MailParserWeb
DocumentRoot D:\Wamp\www\MailParserWeb\public
AllowOverride All
第一個 VirtualHost 是個留原本的 localhost 路徑,如果此一 VirtualHost 刪掉的話,都會指到後面的 VirtualHost裡。
第二個 VirtualHost 是欲增加的 Host ,其中「ServerName」名稱,需在 host 檔裡設定。
3. 開啟 Windows 裡的 host 檔,在 C:\WINDOWS\system32\drivers\etc\host ,加入以下:
127.0.0.1 MailParserWeb
即可。
4. 如果要在 NetBenas 裡,可以直接執行,需要修改其參數。在專案名稱下按右鍵,選擇
Properties -> Run Configuration
將「Project URL: 」 修改為 「http://MailParserWeb」即可。
沒有留言:
張貼留言