免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 11462 | 回复: 8
打印 上一主题 下一主题

[Web] Apache 可以listen 多个端口不? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-09-25 17:19 |只看该作者 |倒序浏览
比如我有两个网卡,同时绑在一个apache上提供服务.

论坛徽章:
5
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:53:172015亚冠之水原三星
日期:2015-06-02 16:34:202015年亚冠纪念徽章
日期:2015-10-19 18:13:37程序设计版块每日发帖之星
日期:2015-11-08 06:20:00
2 [报告]
发表于 2007-09-25 18:04 |只看该作者
可以, 一个Listen就行 Listen 80 不要加IP

论坛徽章:
0
3 [报告]
发表于 2007-09-25 18:05 |只看该作者
可以监听多网卡 多端口

论坛徽章:
0
4 [报告]
发表于 2007-09-25 20:13 |只看该作者
当然可以

论坛徽章:
0
5 [报告]
发表于 2007-09-26 00:09 |只看该作者
考虑下做基于端口的虚拟主机。

论坛徽章:
0
6 [报告]
发表于 2007-09-26 09:16 |只看该作者
原帖由 swordfish.cn 于 2007-9-26 00:09 发表
考虑下做基于端口的虚拟主机。

这个是我在http.conf找到的片断:
[code]#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80

<IfDefine SSL>
Listen 80
Listen 443
LoadModule ssl_module modules/ApacheModuleSSL.dll
SSLMutex sem
SSLRandomSeed startup builtin
SSLSessionCache none
SSLLog logs/SSL.log
SSLLogLevel warn
<VirtualHost localhost:443>
SSLEngine On
SSLCertificateFile conf/ssl.crt/server.crt
SSLCertificateKeyFile conf/ssl.key/server.key
#SSLCipherSuite ALL:!ADH:!EXP56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
#SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
#SSLProtocol all -SSLv3
</VirtualHost>
</IfDefine>

#<VirtualHost *>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
[code]
要怎么改呢?

论坛徽章:
0
7 [报告]
发表于 2007-09-26 09:24 |只看该作者

s

试了一下
多加一行Listen 最行.
但基于端口的VirtualHost怎么写呀?

论坛徽章:
0
8 [报告]
发表于 2007-10-12 12:25 |只看该作者
<VirtualHost *:要监听的端口>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/dummy-host.example.com
    ServerName dummy-host.example.com
</VirtualHost>

论坛徽章:
0
9 [报告]
发表于 2007-10-15 14:39 |只看该作者
Thanks very much.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP