259844236_o
 
對於想要針對不同資料夾去給予相對應的 Port 可以使用以下方式來設定,
開啟設定檔『httpd.conf』有兩種方式,選擇您對您便利的方式即可。
 
步驟1 - 『httpd.conf』開啟方式一:
點選右下方WampServer狀態,移到『Apache』後並點選『httpd.conf』
259844673_o
  
步驟2 - 『httpd.conf』開啟方式二:
開啟檔案總管找到預設目錄『C:\wamp\bin\apache\apache2.2.22\conf\』
這目錄下你會看到其中一個檔案叫『httpd.conf』,不是『httpd.conf.build』
用記事本開啟『httpd.conf』
 
步驟3:搜尋(Ctrl+F)內容找到『Listen 80
在這行的下一行加入同樣開頭為 
Listen ,只是後面數字為你要增加的 Port,
例如
Listen 999
 
步驟4:搜尋
DocumentRoot "c:/wamp/www/"』如果找不到可以改搜尋如下
『symbolic links and aliases may be used to point to other locations.』,
如果有找到該串文字,替換的內容如下,如果沒找到則在該串字下一行加入此內容,
但開頭不要加上『#』,基本上如果沒看到可以找找開頭訊息『DocumentRoot
 
<VirtualHost *:80>
ServerName localhost
DocumentRoot "c:/wamp/www/"
</VirtualHost>
<VirtualHost *:999>
ServerName localhost
DocumentRoot "c:/wamp/www/目錄名稱/"
</VirtualHost>
 
如此完成後,例如原本 127.0.0.1/aaa/ ,經過加上如 Port 999 後,
則瀏覽則變為 127.0.0.1:999 就等同於你在瀏覽  
127.0.0.1/aaa/。

arrow
arrow

    咖啡 發表在 痞客邦 留言(0) 人氣()