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

How can I open ports tcp 5222 and udp 5222 on a centos 5 box running with cpanel,

I've tried doing it through iptables then when i've restarted the tables it freezes and timesout when i reload it seems that the iptables have reverted to what they were at before.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

You need to check what firewall you're running, on cPanel servers, it's common that apf or csf are running, type "csf" or "apf", if you get an answer for apf, I can't help you, never used it.

If you get something like csf help, edit /etc/csf/csf.conf and modify the TCP_IN and TCP_OUT variables and then issue "service csf restart".

If you get nothing for all those, you might just have a saved set, check out and see if there are any rules at /etc/sysconfig/iptables

share|improve this answer
hi, this is great, turns out i have csf and that worked within seconds of me changing it... thanks for the fast response –  Neil Ashley Hickman Aug 4 '09 at 20:01

Sounds like your method of connecting is getting cut off. How are you going about it? If it's by SSH, then you'll also need to open tcp/22. VNC uses 5900 for display :0, 5901 for display :1, etc. I'd also allow anything from interface "lo"; this ensures that the localhost can talk to itself, thereby enabling things like X and the font server, assuming you're using the GUI. It will also enable mysql, smtp, and other services. I haven't used postgresql, but I'm fairly sure it will use the same method.

The method of updating iptables you're using seems sound, otherwise.

share|improve this answer

Your Answer


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.