Apache 多端口配置方法

首先修改httpd.conf配置文件。

添加8080端口

Listen 8080

打开虚拟配置文件

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

编辑虚拟配置文件conf/extra/httpd-vhosts.conf

添加

 <VirtualHost *:8080>
 DocumentRoot "/xxx/xxx/xxx"
ServerName localhost
<Directory "/xxx/xxx/xxx">
   Require all granted
</Directory>
</VirtualHost>

/*如果虚拟配置文件中没有80的配置会出现80端口404的情况

解决方法

添加一个同样的80端口配置,同时删除原有的80端口配置。

猜你喜欢

转载自www.cnblogs.com/wlgclining/p/9057233.html