標籤:
接觸過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 多連接埠、多網站配置