Tomcat – How to Change Port to 80 with Apache

tomcat

I have a VPS that had Apache. Later Tomcat was installed with the cPanel EasyApache thing. JSPs will work as Mysite.com/file.jsp or mysite.com:8080/file.jsp. However, JForum uses web.XML to map some servlets to URLs. Without the port 8080 in the URL, I get file not found. Is there any way to get the servlets to map on port 80 like the JSPs without killing Apache?

Best Answer

You can use mod_proxy for passing the data over to tomcat.

you could use something in the lines of:

ProxyPass /myservlet http://localhost:8080/myservlet
ProxyPassReverse /myservlet http://localhost:8080/myservlet

That will proxy the data to the tomcat instance and rewrite replies so that they match the given path. I would recommend using something like nginx for plain proxying, but if you already need apache for something, it can be done with it too.

Related Topic