您的位置:首页 > 运维架构 > Apache

Apache多端口配置

2016-12-26 23:18 351 查看
默认为80端口

Listen 80

增加监听接口(可以添加多个)

Listen 2525

Listen 2424

添加配置(两种方法)

1.统一配置在extra/httpd-vhosts.conf中

在http.conf中找到

# Virtual hosts
# Include conf/extratpd-vhosts.conf


打开


# Virtual hosts
Include conf/extratpd-vhosts.conf


打开extratpd-vhosts.conf 添加 配置

<VirtualHost *:2525>
ServerAdmin webmaster@dummy-host.localhost
DocumentRoot "D:/software/wamp/www/pfws/"
ServerName localhost
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common

<Directory D:/software/wamp/www/pfws/>
Options FollowSymLinks
AllowOverride all
Order deny,allow
Allow from all
</Directory>
</VirtualHost>


2.http.conf最后面添加

NameVirtualHost *:2525
<VirtualHost *:2525>
ServerName localhost:2525
DocumentRoot “D:/software/wamp/www/pfws/″
</VirtualHost>


备注:其实上面的添加的配置代码不一定是这些,特别是在开发环境中安装的集成环境,最好是找到http.conf 原先就有的Directory 设置,直接复制一份代码,修改下DocumentRoot 配置下Listen就可以,实践证明这样出错的几率最低。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: