The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to bind apache to one IP rather than all

Discussion in 'Bind / DNS / Nameserver Issues' started by denisdekat09, Mar 20, 2007.

  1. denisdekat09

    denisdekat09 Well-Known Member

    Joined:
    Mar 2, 2002
    Messages:
    265
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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 :)
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    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.
     
  3. denisdekat09

    denisdekat09 Well-Known Member

    Joined:
    Mar 2, 2002
    Messages:
    265
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Francisco
Loading...

Share This Page