Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm setting up a server with cPanel and would like for apache to listen to port 8080 by default instead of port 80. (This is because I want to setup varnish cache to listen on 80 and direct traffic through it to the 8080 apache). I can probably go in and change the configuration files for apache directly but they will get re-generated whenever something's changed in cPanel. So, is there a way to do this from the cPanel/WHM frontend?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

After looking into this a bit further, I can see a better solution is available:

In the tweak settings area of cPanel, look for the Apache non-SSL IP/port, and here you can tell cPanel to change from the default (0.0.0.0:80) to your requirements (0.0.0.0:8080), this should preserve the alteration through an Apache rebuild, although you may still need to disable the service manager (I'm not sure about this, would be worth testing).

To stop cPanel resetting your apache port, You will need to disable monitoring for HTTPD in the WHM interface by going to WHM -> Service Configuration -> Service Manager and unchecking HTTPD from the monitor column. You can then change the port in the httpd.conf and WHM will not go creating a new apache instance on port 80.

Regards, Phil,

share|improve this answer
    
But what happens when I create a new account or modify a previous account? That will be create to (or modified to) listen on 80, right? So, that doesn't seem a very good solution. –  recluze Jul 12 '11 at 7:13
    
considering your situation, I have updated the solution to deal with this problem. –  PhilB Jul 12 '11 at 8:57
    
Thanks. Tweak settings is exactly right and it doesn't require changes to the monitor. –  recluze Jul 13 '11 at 4:38
    
accepting this answer is misleading for anyone who doesn't read the comments. –  lunixbochs Jul 13 '11 at 14:06

It seems disabling monitoring daemons to not interfere with an alternate port was only necessary pre-11.28.

While using this option to configure Apache to listen on a port other than the default has previously broken the functionality of various utilities on the server, with version 11.28, those failures no longer occur.

See the WHM/cPanel docs on the subject. If you're running 11.28+, it should work to just change the port in Tweak Settings.

Also note the option in Tweak Settings should map to the config option apache_port=80 in /var/cpanel/cpanel.config.

share|improve this answer
    
Yep, I figured out the tweak settings options out late last night. Thanks anyway :) –  recluze Jul 13 '11 at 4:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.