apache2.4 的多端口虚拟主机

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

去掉 http.conf 红色语句前边的#(注释符号)

在httpd-vhosts.conf 中复制一段已有的端口

#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot "XXXXXXXXXXXXXXXXXXXXXX"
#    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>

 

在这个端口中添加

<Directory "XXXXXXXXXXXXXXX">
        Options Indexes FollowSymLinks  
        AllowOverride None
        Require all granted
 </Directory>

这段即可,最后添加监听端口

Listen XXXXX

 

posted @ 2016-03-08 00:09  小小逼  阅读(376)  评论(0编辑  收藏  举报