Apache多端口配置

  • 默认为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
    DocumentRootD:/software/wamp/www/pfws/″
    </VirtualHost>

备注:其实上面的添加的配置代码不一定是这些,特别是在开发环境中安装的集成环境,最好是找到http.conf 原先就有的Directory 设置,直接复制一份代码,修改下DocumentRoot 配置下Listen就可以,实践证明这样出错的几率最低。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值