problem with iptables and cpanel on a new installation

pikuser5

Member
Mar 3, 2010
16
0
51
hi,
today i have installed centos 5.6 and cpanel on my ovh server.

but with iptables enabled i can't access whm and other...

if i type /etc/init.d/iptables stop ----- all works ok.
i have installed cfs...
what should i do with iptables?

thank's
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
By "i have installed cfs" do you mean that you've installed CSF for ConfigServer Security & Firewall on the machine?

You likely need the cPanel, WHM and webmail ports to be opened:

cPanel ports - 2082 (non-secure) and 2083 (secure)
WHM ports - 2086 (non-secure) and 2087 (secure)
webmail ports - 2095 (non-secure) and 2096 (secure)

If you were only running iptables without CSF, you could run these commands to add those ports to iptables:

Code:
/sbin/iptables -I INPUT -p tcp -m tcp --dport 2082:2083 -j ACCEPT
/sbin/iptables -I INPUT -p tcp -m tcp --dport 2086:2087 -j ACCEPT
/sbin/iptables -I INPUT -p tcp -m tcp --dport 2095:2096 -j ACCEPT
After adding the ports, you would then save the configuration:

Code:
service iptables save
For CSF, you'd have to go into the Firewall configuration area and find the TCP_IN section, then add the ports there I believe.