我正在尝试创建两个端口80
和81
来在我的计算中呈现不同的文件。为此,我做了一个虚拟主机。我的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:80
和localhost: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