Apache 多連接埠、多網站配置

來源:互聯網
上載者:User

標籤:

接觸過TPshop的都知道它必須放在網站的根目錄下,那根目錄所有的檔案都會別當作TPshop的一部分,這就不能訪問其他的php檔案。下面我說一下我的配置過程,如果有誤請指出。

一、修改Apache的設定檔:

1、添加:  Listen 8080    #新添加的連接埠

2、去掉 Include conf/extra/httpd-vhosts.conf 前面的 #

3、去掉ServerName

4、把

DocumentRoot "E:\wamp\www"

<Directory "E:\wamp\www">
    #
    Options Indexes FollowSymLinks
  #
    AllowOverride None
    Require all granted
</Directory>

#這是第一個連接埠的

複製一份,放在下面,修改一下DocumentRoot,就是第二個連接埠的網站目錄。

 

二、 修改conf/extra/httpd-vhosts.conf

1、修改<VirtualHost *:80>,結果如下

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "E:/wamp/www/"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error.log"
    CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

2、添加
<VirtualHost *:8080>
    ServerAdmin [email protected]
    DocumentRoot "F:/www/"
    ServerName dummy-host2.example.com
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

Apache 多連接埠、多網站配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.