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.

Apache restarts

Discussion in 'EasyApache' started by Mr. Fern, Mar 14, 2006.

  1. Mr. Fern

    Mr. Fern Registered

    Joined:
    Mar 14, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Does Cpanel start Apache differently than it normally starts without Cpanel?

    The reason I ask this is because I've been getting this problem:
    [crit] (98)Address already in use: make_sock: could not bind to port 80


    I have another web server (lighttpd) running on one of the ips for the machine and have apache running on the rest.

    The configuration is properly set up, because when I use apachectl to restart, it restarts with no problem. It only seems to happen when Cpanel is restarting Apache.

    I had this problem when I first installed the server but (thought) I got it sorted out. Then yesterday and today the same problem happening again.
     
  2. rustelekom

    rustelekom Well-Known Member
    PartnerNOC

    Joined:
    Nov 13, 2003
    Messages:
    290
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    moscow
    i am sure that for custom configuration you should edit cpanel files, like /scripts/restartsrv_httpd and may be also appropriate chkservd file. as i remember cpanel check 80 port and if some progam listen it apache shouldn't start.
     
  3. Mr. Fern

    Mr. Fern Registered

    Joined:
    Mar 14, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Thanks a lot for the feedback. I'll make sure to check over those things. Appreciate it.
     
  4. Mr. Fern

    Mr. Fern Registered

    Joined:
    Mar 14, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Well I went over restartsrv_httpd, but most of the functionality is encapsulated in functions defined elsewhere. But the file did help some. I was reminded that WHM starts the service with the "-DSSL" option.

    The directive in Apache is written as
    <IfDefine SSL>
    Listen 80
    Listen 443
    </IfDefine>

    So that was the problem. It was causing it to try to listen to Port 80 for all IPs, and one's already in use, causing the issue. When I was using apachectl I didn't have SSL defined, that's why it worked fine with apachectl and not WHM's restart.

    I just have to change that Define, replace Listen 80 with Listen [ip]:80 for all the ips available to Apache.
     
Loading...

Share This Page