how do I configure Apache 2.4 to have a domain name poiting to my webapp

181 views Asked by At

I have a war file developed under Eclipse using Struts2 MVC framework running in a Tomcat 7.

I have fronted tomcat with Apache 2.4.7 via mod_proxy_ajp.

So, I enabled mod_proxy and mod_proxy_ajp and added the following in my default enabled site configuration file (/etc/apache2/sites-enabled/000-default.conf):

<VirtualHost *:80>
     ............
     ............
     # this will forward the requests to /my-app to tomcat7
     ProxyPass /my-app ajp://localhost:8009/my-app  
     ProxyPassReverse /my-app ajp://localhost:8009/my-app  

     # this will pass all the requests from httpd to tomcat7
     ProxyPass / ajp://localhost:8009/ 
     ProxyPassReverse / ajp://localhost:8009/  
</VirtualHost *:80>

This works fine, when I put in my browser:

localhost/my-app,

Apache2 redirects the request to Tomcat and then to my-app and all the requests to Apache2 in localhost are redirected to Tomcat.

my question is, how can I, using this configuration, point my domain name (I have a domain name and a static ip adresse) to my-app when a user introduces my domain name in his browser ?

I’m under Xubuntu 14.04 LTS, Apache 2.4.7, Tomcat 7.0.52.

0

There are 0 answers