wamp多網站配置,wamp網站配置_PHP教程

來源:互聯網
上載者:User

wamp多網站配置,wamp網站配置


網上方法五花白門,特意記錄一下,需要的朋友自行拿去就好。

需要修改的檔案:httpd.conf / httpd-vhosts.conf / hosts

對應路徑:

httpd.conf:wamp\bin\apache\Apache2.2.21\conf

httpd-vhosts.conf:wamp\bin\apache\Apache2.2.21\conf\extra

hosts:c\Windows\System32\drivers\etc

修改流程:

1,開啟httpd.conf,約466行:#Include conf/extra/httpd-info.conf,刪除#;

2,還是httpd.conf,約188行:


  Options FollowSymLinks
  AllowOverride None
  Order deny,allow
  Deny from all

改為:


  Options FollowSymLinks
  AllowOverride None
  Order deny,allow
  #Deny from all
  Allow from all
  #允許所有訪問
  Satisfy all

3,開啟httpd-vhosts.conf,在最下方空白處添加以下代碼(自行修改wamp安裝路徑):


ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "f:/wamp/www"
ServerName localhost
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common



ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "f:/wamp/www2"
ServerName www2.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common

4,最後一步:開啟hosts檔案,在最後一行下面添加以下代碼:

127.0.0.1 localhost

127.0.0.1 www2.com

重啟wamp之後,localhost與www2.com即可區分開發,多網站配置成功。

http://www.bkjia.com/PHPjc/1051882.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1051882.htmlTechArticlewamp多網站配置,wamp網站配置 網上方法五花白門,特意記錄一下,需要的朋友自行拿去就好。 需要修改的檔案:httpd.conf / httpd-vhosts.conf /...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.