Restart of services if port no is changed in /etc/services in RHEL

I had a doubt if any services need to be restarted if port no in /etc/services in an RHEL setup is changed. For eg, the port no of 443 for SSL may need to be changed.

I hope my query is clear whether any services need to be restarted if port no in /etc/services is changed.

Please revert with the reply to my query

Regards

/etc/services is not a configuration file. Changing port numbers in it isn't likely to do anything except mislabel your netstat listings.

Thanks Corona688 for your answer. But, my question is how to change port of SSL which is 443 by default.

Also, can you please clarify with the help of an example how changing /etc/services is going to mislabel the netstat listings?

Regards

You need to replace the port 443 with an unused port in your Apache configurations (If using Apache as web-server) and do a httpd restart.

Changes in /etc/services may not require any other services restart.

Thanks for your answer but how to change the port for SSL, is it from the SSL configuration file ssl.conf found in /etc/httpd/conf.d/ssl.conf?

Regards

Yes, look for the port 443 entries and alter to the desired port. Always keep a conf backup before any changes.

netstat will label connections 'http', 'ssh' and so forth matching common port numbers given in /etc/services, which is just a list of traditionally used port numbers. Give it wrong numbers, and netstat will label the wrong things.

But, would changing the SSL port in /etc/httpd/conf.d/ssl.conf also change the port in /etc/services? Also, will the netstat command take the ports nos from the actual port in the respective configuration file or from /etc/services?

Confirmations on these queries will reaffirm the understandings.

Regards

You must edit the /etc/services conf manually to update the new port.

In Unix /etc/services file maps port numbers to named services which uses by netstat.

Maybe I'm missing something here, but I don't recall seeing "why" you are wanting to change the default SSL port. Do you have an app that is trying to use this port for some other reason?

My suggestion is to change w/e other software is wanting this port so as not to conflict with a standard port setting.

Regards,

Kelam

No, it would not... /etc/services is a list of traditional port numbers. It's used to label label outgoing connections, too, so altering it will mislabel anything you connect to on standard ports.

If you moved your https port onto a number not specified in /etc/services, it would just show as a port number in netstat. If you moved it to the same port as some other service, it would show as the wrong service in netstat, because you intentionally made the choice to move it onto a nonstandard port. You shouldn't edit /etc/services to fix that, simply remember what you did.