HTTPD Change Port Lab - savannahc502/SavC-TechJournal-SEC260 GitHub Wiki

Scope: Apache, which uses HTTPD, listens on port 80 -- this is why browsers assume port 80 when creating HTTP requests from URLs. However, a server admin can change the port to something other than 80. This lab requires me to change my Apache CentOS web server's configuration to listen on port 8008 instead of 80.



  • As a privileged user or root, run vi /etc/httpd/conf/httpd.conf
  • Scroll to where it says "Listen 80" > "Listen 8008"
    • Save the change
  • Restart httpd
    • systemctl start httpd
    • systemctl restart httpd

Now, if I attempt to navigate to my server with the new port, 10.0.17.50:8008, it will still fail. This is because the firewall permissions need to be changed on the server.

  • firewall-cmd --add-port=8008/tcp --permanent
  • firewall-cmd --reload

Navigation to the server in a web browser should work now. However, you may need to clear your cache/browser history. Additionally, since I completed this lab after HTML Links and URL Lab, I will need to change my relative and absolute paths in the hyperlinks of my web pages to include the new 8008 port specification.