dev_cw

Well-Known Member
Jun 30, 2004
59
1
158
Hello,

1) I am wondering if there is a feature in WHM to change the port for apache? Or is the only way to do this manually in httpd.conf? Also will cPanel try to change it back to 80 during updates?

2) If we change the apache port will this break anything in cPanel?

I am setting up pound as a proxy/load balancer in order to use mongrel to handle Ruby/Rails requests. However for this to work pound needs to be listening to port 80 and then proxy the requests to the correct locations. For example all static requests go to apache and all ruby/rails related requests will be sent to mongrel (which runs on it's own port). With apache2.2 this can be done natively but with 1.3 we need to use something like pound.

Thanks,
Shane
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,462
25
473
Go on, have a guess
You would have to do that manually by editing httpd.conf. cPanel shouldn't change the port specification within the file. However, you will have to stop chkservd from monitoring httpd in WHM > Service Manager, as that checks on port 80.
 

dev_cw

Well-Known Member
Jun 30, 2004
59
1
158
Code:
However, you will have to stop chkservd from monitoring httpd in WHM > Service Manager, as that checks on port 80
Yes, I was receiving warnings that httpd was down so I turned it off. Can we edit the chkservd script to monitor on a different port? I think I recall seeing a mention of this but I could not remember where.

This would be a good feature for cPanel to add, i notice that a few other control panels allow you to change the port from within the panel.

Thanks.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
10
313
Houston, TX
cPanel Access Level
Root Administrator
Code:
However, you will have to stop chkservd from monitoring httpd in WHM > Service Manager, as that checks on port 80
Yes, I was receiving warnings that httpd was down so I turned it off. Can we edit the chkservd script to monitor on a different port? I think I recall seeing a mention of this but I could not remember where.

This would be a good feature for cPanel to add, i notice that a few other control panels allow you to change the port from within the panel.

Thanks.
You don't need to edit the script, all you need to do is edit the configuration file the script uses. The configuration file for chkservd is located within /etc (I believe it's /etc/chkserv.d/chkservd.conf). The syntax for doing port-based monitoring is as follows:

service[serviceName] = port,send,response,restart

serviceName = Name of service
response = Expected Response
restart = Full path to restart service
send = What data to send

So if you have a line in there still for monitoring port 80, all you would need to do is change the port to whatever your new port is and chkservd will monitor that port instead.
 

dev_cw

Well-Known Member
Jun 30, 2004
59
1
158
cPanelDavidG, thanks for the great tip, my problems are solved. Sure is useful to have a config file :)
 

sldubr

Member
Aug 31, 2007
10
0
51
Thanks for a good theme.
But there was one more problem. When I Create a "New Account" in a config of the apache add: NameVirtualHost xx.xxx.xxx.xxx:80
<VirtualHost хх.хх.ххх.ххх>

But instruction NameVirtualHost is not necessary. It is necessary that it was added only
<VirtualHost хх.хх.ххх.ххх:85>


Is it possible to make?

WBR
Slava Dubrovskiy
 

thewird

Well-Known Member
Jan 4, 2006
54
0
156
Toronto
How would you change the apache port now that all virtualhosts are like this...

<VirtualHost хх.хх.ххх.ххх:80>

thewird
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,578
53
308
cPanel Access Level
Root Administrator
1. Login to WHM as root
2. Click Tweak Settings
3. Scroll down to find this setting:
The port on which Apache listens for HTTP connections. Specifying a specific IP will prevent Apache from listening on all other IPs. (default: 0.0.0.0:80)
4. Change the value to the port number you want
5. Scroll to bottom of page and click Save
6. Login to server via SSH
7. Execute /scripts/rebuildhttpdconf as root
8. Restart Apache