Enabling the firewall and port 8080

Apache Tomcat runs on port 8080. Follow these steps to enable the firewall, if it's disabled:

  1. Enable the firewall using the following command:
        sudo ufw enable 
  1. Allow traffic on port 8080:
        sudo ufw allow 8080 
  1. Enable OpenSSH to allow SSH connections using the following command:
        sudo ufw enable "OpenSSH" 
  1. Check the firewall status using the following command:
        sudo ufw status 
  1. You should see the following output:
        Status: active  
        To                         Action      From 
        --                         ------      ---- 
        8080                       ALLOW       Anywhere 
        OpenSSH                    ALLOW       Anywhere 
        8080 (v6)                  ALLOW       Anywhere (v6) 
        OpenSSH (v6)               ALLOW       Anywhere (v6) 
  1. You should now be able to access the Apache Tomcat server page at http://<IP address of the Apache Tomcat>:8080.