How to bind apache to one IP rather than all

denisdekat09

Well-Known Member
Mar 2, 2002
266
0
316
San Francisco
Hello,

I am trying to bind apache to listen to only one IP on the server rahter than all of them I believe this should be possible :)

I am seeing this in the conf file:

# BindAddress: You can support virtual hosts with this option. This directive
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the <VirtualHost> and Listen directives.
#
#BindAddress *


Does anyone know if I set this to bind will it mess up virtual hosting? I looked arround in the apache site and was not too clear on what to configure.

Or should it be the Listen and Port directives? I am seeign these:

Port 80

##
## SSL Support
##
## When we also provide SSL we have to listen to the
## standard HTTP port (see above) and to the HTTPS port
##
<IfDefine SSL>
Listen 80
Listen 443
</IfDefine>


Thank you :)
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
31
473
Go on, have a guess
IIRC, you need to change the Listen directive so that instead of:

Listen 80

You have:

Listen 11.22.33.44:80

Then restart httpd. Where 11.22.33.44 is the IP address you want to listen on. It'll work so long as you obviously haven't got any domains using a different IP address than the one you're listening on.