Changing Ports - AidanP017/Aidan-SYS-255 GitHub Wiki
To change ports for an httpd web server, take the following steps:
- Open /etc/httpd/conf/httpd.conf with a text editor (vim or nano).
-
- Where it says “Listen <Port #>”, change the port number to the desired value.
-
- Save your changes and exit the text editor.
- Restart the web server: systemctl restart httpd
- Verify that the server is active: systemctl status httpd
- Add the new port to the firewall: firewall-cmd –zone=public –add-port=#/tcp –permanent
- Reload the firewall: firewall-cmd –reload
- Verify that the port has been added to the firewall: firewall-cmd –list-all
- Load the page in a browser by typing in the following: :<Port #>