Change Openfire Default Ports

Hello Guys,

Is it possible to change the default ports for Openfire to ports 443 or 21 ?

I have search the threads and found that it is possible throught port mirroring ?

I understand that Openfire does not run as root so ports <1024 is not possible. Is there a work around ?

Ports for what? There are a lot of ports used by openfire. You can change the admin ports by editing your openfire.xml file.

Hi Todd,

Appreciate your reply.

Well its ports for Client to Server Connection.

I need to get that on port 21 or port 443 in order to get the server to work in my school. The school has apparently blocked all the other ports.

Any work around ?

Hi,

use linux iptables or better ask your school to open port 5222.

On the main page (/index.jsp) there is an “Edit” button at the bottom of the page. There you can modify the ports.

LG

Thanks for the reply LG.

However, I think its rather impossible to ask the school to open the ports. Would need to go through alot of stuff and would be quite a headache.

I know of the button at the bottom which lets me edit the ports.

However, when I try to place the port for client connections on 443 or 21 and save, I head back to the main page the port does not show.

Is there any way to force client connections on those ports ?

Tell as what you want to achieve. I mean how you want to connect to a server (internal, external) and where the server will be as i dont uderstand currently why you should open any ports? Do you want to have server in school and to be able to connect to it from the Internet?

The ports you are mentioning a the low ones and they are reserved for the other services (SSL, FTP), maybe that’s why Openfire is not accepting them. Also, i may be wrong but you can broke something on your network by using these ports for the Openfire (few services on the same port, conflicts). If you’ll be able to redirect it to port 21 then maybe the school’s ftp will stop working for the external users.

Anyway, i dont understand what is your network setup right now and we need more info about that.

Hi wroot, first of all, thanks for you reply.

Alright, the openfire server is currently hosted externally. Outside of my school. The school blocks ports, hence leaving me unable to connect to the openfire server on the default port of 5222.

I would like the openfire server to listen on either port 21 or port 443 to enable the connection from school to the openfire server, hosted externally =p

Hosting the openfire server on lets say, port 21, will not affect my school in anyway.

I’m running my test server on a windows box with admin rights and i was able to change client port to 21. So this is a one workaround - to run Openfire with root, though i dont know how this will act on a linux box. I know this is not security wise, but as a workaround… Also you can try this just to make sure you will have a successful connection. Maybe there are more blocks in the way.

Hi Guys,

After a long and tiring process of finding a work around. I finally found it!

Alright so my server is hosted on a VPS.

And somehow I cant execute the IPTables command of “iptables -t nat -A PREROUTING -p tcp --dport 21 -j REDIRECT --to-port 5222”.

This is due to my VPS not having permissions to nat or something like that.

Hence, I found another work around.

# cat > /etc/xinetd.d/redirect26
service redirect26
{
        port                    = 26
        type                    = UNLISTED
        disable                 = no
        socket_type             = stream
        wait                    = no
        user                    = root
        redirect                = 127.0.0.1 25
}
<press Ctrl+D>
# chkconfig --level 2345 xinetd on
# service xinetd restart

Kudos to the other person who posted this here!

Hi Deek,

I am also working in my school. They have simiary blocked all ports except 21 and 443. How did you find a workaround. The link in your answer leads to nowhere .

Thank you