Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

closed as off-topic by Jenny D, Sven Apr 15 '15 at 8:27

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

Admin panels are off topic (see this for some reasons). The community has decided that we want to close both old and new questions when such an admin panel is relevant (link 1, link 2). – Sven Apr 15 '15 at 8:27
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

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