Apache 多端口

接触过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 webmaster@dummy-host.example.com
    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 webmaster@dummy-host2.example.com
    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>

posted @ 2016-10-12 18:41  Burning_Leaf  阅读(923)  评论(2编辑  收藏  举报