I am having a Amazon EC2 Ubuntu instance. I have installed LAMP server and tomcat 7. I also have application running in tomcat.

Now, my URL for apache is - http://ec2-54-xx-xx-xx.us-west-2.compute.amazonaws.com/

My URL for tomcat application is: http://ec2-54-xx-xx-xx.us-west-2.compute.amazonaws.com:8080

Instead of writing the 8080 part, I would like to call this directly via the URL http://ec2-54-xx-xx-xx.us-west-2.compute.amazonaws.com/.

I went through lot of tutorials, all are invalid, out dated or missing details. I am apache2, so the files inside the apache2 directory are below.

enter image description here

How can I do this "properly"? Because I will purchase a domain name in this weekend and I will replace the long amazon URL with this one soon as well.


On Tomcat's web you have a HowTo explaining how to use apache to connect to Tomcat, so users will connect to apache (without need of specify a port) then apache will pass requests to Tomcat.

You can also user ProxyPass on your apache and just forward requests to Tomcat, you only need to search on internet next keywords apache tomcat proxypass

  • andswer is not clear. Can you please provide step by step instructions? The tomcat tutorial is one of worst guided one, I have checked that before too.. – PeakGen Jul 24 '15 at 10:46
  • 1
    I've seen worse than the one hosted in tomcat :). Anyway you can use this one from HowToForge. I instead prefer ProxyPass in apache, there are lot of resources available on how to configure apache for this purpose. If you found troubles, then you can ask later. As you know, the aim of this site is not to provide step by step instructions, but offer solutions to well defined problems. – alphamikevictor Jul 24 '15 at 12:08

your virtual host look like this. and also enable the proxy modules.

    ServerName  ec2-54-xx-xx-xx.us-west-2.compute.amazonaws.com/
    ProxyPreserveHost On
    ProxyPass           /whateveryouwanttogive http://ec2-54-xx-xx-xx.us-west-2.compute.amazonaws.com:8080/contextpath/
    ProxyPassReverse    /whateveryouwanttogive http://ec2-54-xx-xx-xx.us-west-2.compute.amazonaws.com:8080/contextpath/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.