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.

thttpd, apache and Cpanel

Discussion in 'EasyApache' started by arn, May 10, 2006.

  1. arn

    arn Member

    Joined:
    Aug 3, 2002
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    I went about wanting to install thttpd alongside apache under cpanel. Doing this requires a few not-so-obvious steps, so I thought I'd post my process here so others can benefit. I had a hard time finding information on it.

    thttpd is a light efficient web server useful for delivering static files (images, etc...). It takes up less resources than apache, and can be useful for high traffic situations.

    thttpd requires its own IP address to bind to. So, in order to do this, you need a spare IP and also need to tell Apache to ignore the other IP.

    I installed thttpd with the rpm since it also provided the startup scripts. You can compile it yourself, of course.

    The main issue because cpanel and apache.

    In order to tell apache to listen to specific ports, you need to specify using the LISTEN directive. Normall, Apache binds to all addresses.

    At first, I just added:
    Listen 1.2.3.4:80
    Listen 2.3.4.5:80

    to my httpd.conf, but apache would fail when restarting in CPANEL saying that the IP was already bound. The problem turned out to be:

    <IfDefine SSL>
    Listen 80
    Listen 443
    </IfDefine>

    This definition later in httpd.conf. CPanel starts it with the SSL flag on. So, these Listen directives were causing problems.

    I ended up commenting out the whole SSL directive and added the following instead

    Listen 443
    Listen 1.2.3.4:80
    Listen 2.3.4.5:80

    This time, Apache restarted and appeared to be working, but CPnale said Apache had failed. This appears to be due to the way CPanel checks to see if Apache is running. It connects to the localhost.

    So...

    Listen 443
    Listen 1.2.3.4:80
    Listen 2.3.4.5:80
    Listen 127.0.0.1:80

    that's what you have to add in the end (and comment out the SSL directive above)

    hope it helps
    arn
     
Loading...

Share This Page