apache 2.4 配置多埠虛擬目錄
1、配置httpd.conf
#Listen 0.0.0.0:80
Listen 80
Listen 81
2、開啟虛擬站點
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
#修改為
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
3、配置conf/extra/httpd-vhosts.conf
<VirtualHost *:81>
ServerAdmin [email protected]
DocumentRoot "/data/wwwroot"
ServerName 81
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" common
<Directory "/data/wwwroot">
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
4、訪問站點出現you don't have permission to access / on this server(Apache Server許可權訪問問題)
修改httpd.conf:
<Directory />
AllowOverride none
Require all denied
</Directory>
<Directory />
AllowOverride none
# Require all denied
</Directory>