为什么我的虚拟端口链接到apache中的原始端口?

时间:2016-08-22 11:37:47

标签: php windows apache server

我正在尝试创建两个端口8081来在我的计算中呈现不同的文件。为此,我做了一个虚拟主机。我的httpd-vhost.conf如下:

<VirtualHost *:81>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "D:\Softwear\Apache\httpd-2.4.23-win64-VC14\Apache24\htdocs\2"
    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>


<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "D:\Softwear\Apache\httpd-2.4.23-win64-VC14\Apache24\htdocs"
    ServerName dummy-host2.example.com
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

在我的httpd.conf文件中,我在Listen 81行以下添加了Listen 80。问题是localhost:80localhost:81都是localhost:80的位置。

当我运行httpd.exe -S时,我没有提及81端口:

D:\Softwear\Apache\httpd-2.4.23-win64-VC14\Apache24\bin>httpd.exe -S
VirtualHost configuration:
ServerRoot: "D:/Softwear/Apache/httpd-2.4.23-win64-VC14/Apache24"
Main DocumentRoot: "D:/Softwear/Apache/httpd-2.4.23-win64-VC14/Apache24/htdocs"
Main ErrorLog: "D:/Softwear/Apache/httpd-2.4.23-win64-VC14/Apache24/logs/error.log"
Mutex default: dir="D:/Softwear/Apache/httpd-2.4.23-win64-VC14/Apache24/logs/" mechanism=default
PidFile: "D:/Softwear/Apache/httpd-2.4.23-win64-VC14/Apache24/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG

0 个答案:

没有答案