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


 ServerAdmin [email protected]
 DocumentRoot "/data/wwwroot"
 ServerName 81
 ErrorLog "logs/dummy-host.localhost-error.log"
 CustomLog "logs/dummy-host.localhost-access.log" common
 
  Options FollowSymLinks
  AllowOverride None
  Require all granted
 

4、访问站点出现you don't have permission to access / on this server(Apache Server权限访问问题)
修改httpd.conf:
 

 AllowOverride none
 Require all denied


 AllowOverride none
# Require all denied

 

你可能感兴趣的:(服务器应用)