Reverse proxy for Tomcat and Apache

Since the default port on which Tomcat operates is port 8080, you might want to provide users with the ability to access your web application without the need to succeed the domain name with :8080. This can be achieved by means of a reverse proxy. This article details the installation of mod_proxy in Apache. This however does not allow the forwarding of requests from port 80 to 8080. To achieve this, begin with the following:

sudo nano /etc/apache/sites-enabled/000-default.conf

Just under DocumentRoot /var/www/html you can paste the following:

ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://YOUR-LOCAL-IP:8080/
ProxyPassReverse / http://YOUR-LOCAL-IP:8080/

Save the file with CTRL + O and restart Apache with:

sudo systemctl restart apache2