Chinaunix

标题: Apache 可以listen 多个端口不? [打印本页]

作者: rrrrrrrr8    时间: 2007-09-25 17:19
标题: Apache 可以listen 多个端口不?
比如我有两个网卡,同时绑在一个apache上提供服务.
作者: xinglp    时间: 2007-09-25 18:04
可以, 一个Listen就行 Listen 80 不要加IP
作者: npcomet    时间: 2007-09-25 18:05
可以监听多网卡 多端口
作者: xpowner    时间: 2007-09-25 20:13
当然可以
作者: swordfish.cn    时间: 2007-09-26 00:09
考虑下做基于端口的虚拟主机。
作者: rrrrrrrr8    时间: 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]
要怎么改呢?
作者: rrrrrrrr8    时间: 2007-09-26 09:24
标题: s
试了一下
多加一行Listen 最行.
但基于端口的VirtualHost怎么写呀?
作者: npcomet    时间: 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>
作者: rrrrrrrr8    时间: 2007-10-15 14:39
Thanks very much.




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2