The hostname and port that the web server is using will be listed in the /etc/httpd/conf/httpd.conf file. In this example, the hostname is www.example.com and the port is 80. In this example, navigating to www.example.com will cause the web server to server it's default document.
ServerName www.example.com Listen 192.168.0.22:80
If you need to configure HTTPD to listen for connections on a different port of than 80, in the /etc/httpd/conf/httpd.conf file, ensure you have the following configuration. In this example, port 12345 is used. Use your preferred IP address and port number. Also ensure the port number is not already associated with a service in the /etc/services file.
Add the port number to the http_port_t context.
[root@server1 ~]# semanage port -a -t http_port_t -p tcp 12345
Ensure the port number is in the http_port_t context.
[root@server1 ~]# semanage port -l | grep -w http_port_t http_port_t tcp 12345, 80, 443, 488, 8008, 8009, 8443
Restart HTTPD, and ensure HTTPD is active and running.
[root@server1 ~]# systemctl restart httpd [root@server1 ~]# systemctl status httpd
Use the apachectl configtest command can be used to verify the configuaration of HTTPD is OK.
[root@server1 ~]# apachectl configtest . . . Syntax OK
Update iptables to allow connections on port 12345.
Restart iptables, and ensure iptables is active and running.
[root@server1 ~]# systemctl restart iptables [root@server1 ~]# systemctl status iptables
From a PC in the same subnet as the HTTPD web server, ensure you get the default HTTPD page when navigating to http://192.168.0.22:12345.