Search code examples
apache2tomcat7mod-jkubuntu-13.10

Apache 2.4.6 and Apache Tomcat 7.0.42 on Port 80


On my Ubuntu 13.10 I have installed Apache and Tomcat. I am trying to get tomcat to work on port 80 with no luck at all. I have looked at using mod_jk following several online tutorials with no success. What I am trying to achieve is I have a webapp on tomcat running as the root application. Therefore the current url is www.example.com:8080. I also have apache which is on the url www.example.com. I want to be able to access files on the apache webserver for e.g www.example.com/somefile but also have my webapp running at the sametime on www.example.com. Please can anyone help.


Solution

  • So I managed to solve this problem by Using Mod_Proxy. Editing the 000-Deafult.conf file in /etc/apache2/sites-enabled and adding the following lines:

    ProxyPass /SomeUrl !
    ProxyPass / http://localhost:8080/
    

    The first line indicates what you don't want to proxy and the second one indicates what to proxy.In this case forward the ROOT app of Tomcat at port 8080 to the root of the Apache web server

    Also edited the server.xml file in /etc/tomcat7 and added the following

    <Connector port="8080" protocol="AJP/1.3" proxyName="www.mydomain.com" proxyPort="80"/>