Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2005

    Having issues binding a specific IP to port 80


    I have a linux server which is CentOS 4.4/cpanel with 5 IPs

    Here's why I'm trying to bind apache to a specific IP instead of all the IPs. I have a chat software which allows me to run it on port 80.

    Basically I would bind the main IP (where all the sites are), leaving me the rest of the IPs, one of which I can use to run the chat on port 80.

    So I basically find this in httpd.conf

    # Listen: Allows you to bind Apache to specific IP addresses and/or
    # ports, instead of the default. See also the <VirtualHost>
    # directive.
    #Listen 3000

    Listen xx.xx.xx.xx:80

    I substituted the IP in there and restarted apache. It wouldn't start and I get this error in the log

    [crit] (98)Address already in use: make_sock: could not bind to address xx.xx.xx.xx port 80

    I commented out the Listen line and restarted Apache

    Then I ran the command

    netstat -lnp | grep ''

    The only thing I see was

    apache (httpd) and my shoutcast server (which was using 8000 and 8001).

    I then ran the command

    killall -9 httpd


    netstat -lnp | grep ''
    (to make sure there wasn't anything using 80)

    restarted Apache (as root and removing the comment in httpd.conf)

    and still get

    [crit] (98)Address already in use: make_sock: could not bind to address xx.xx.xx.xx port 80

    So I'm at a loss what to do next. Anyone have any ideas or have seen this problem before?

    I'm sure there's a simple solution. I just can't see it.

    BTW Cpanel wouldn't have anything to do with that would it?

  2. #2
    Join Date
    Jun 2003
    First thing is have you tried stopping / starting APache (not a restart but a full stop / start)
    Russ Foster - Industry Curmudgeon

  3. #3
    Join Date
    Oct 2005
    oh man a2b2

    This is hilarious.

    Its working. Man I can't believe that I didn't do that.

    Thanks for the advice!

    I do have a problem though. Cpanel doesn't like the edit, hence when I restart apache from WHM it fails to start.

    But I can start it from command line no problem.

    Any idea what might be?

    Thanks alot. Chat is running on port 80 now

  4. #4
    Join Date
    Apr 2002
    Auckland - New Zealand
    Tou'll need to comment these bits out too, if you haven't already

    <IfDefine SSL>
    Listen 80
    Listen 443

    change to

    #<IfDefine SSL>
    #Listen 80
    #Listen 443
    or remove completely.

    And add


    For your each ip that you use on the machine.

  5. #5
    Join Date
    Oct 2005
    Hey Steve.

    I did that yet WHM still have problems restarting ummm

    works all ok in command line.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts