0

I have a domain with correctly configured DNS's called mydomain.com that points to my Ubuntu 16.04.3 server in 11.11.11.11, so when I introduce mydomain.com in a browser, I get to the default page of the Apache installed in such server.

I also have a Tomcat 7 installed in the same server with a JSF APP running on it, so when I introduce http://11.11.11.11:8080/myappname/ in my browser my APP appears in the browser.

I would like to redirect from Apache to my Tomcat, so everytime someone writes mydomain.com on its browser my APP appears.

In order to do so, I have installed and configured mod_proxy according to many tutorials I have read (like this one or this other ). My configuration in the .CONF file of the Apache default site is:

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/myappname/
ProxyPassReverse / http://127.0.0.1:8080/myappname/

With this configuration, everytime I write mydomain.com in the browser, the main page of my JSF APP is shown, BUT IN PLAIN TEXT WITHOUT PICTURES/CSS AND ANY URL OR DYNAMIC PART WORKS.

If I check the "performance" section in Mozilla tools I can see a lot of errors like these:

http://www.mydomaincom/myappname/javax.faces.resource/theme.css.xhtml[HTTP/1.1 500 Internal server error]
http://www.mydomaincom/myappname/images/EN.png [HTTP/1.1 404 Not Found 249ms]

In the other hand I have discovered that with this config:

ProxyPass /myappname 127.0.0.1:8080/myappname 
ProxyPassReverse /myappname 127.0.0.1:8080/myappname 

everytime I write in my browser mydomain.com/myappname the page shows well and no error are thrown. Obviously I don't want to use such configuration, I would like to write JUST mydomain.com

I have tried MANY other mod_proxy configurations with other parameters (ProxyRequests, DefaultType, ProxyPassReverseCookiePath, ProxyPassReverseCookieDomain...) but none of them seems to work...

What is the problem?

Thanks in advance for your patiente and help!

BTW: I know that Tomcat shouldn't be publicly exposed, I will take care of it later...

1 Answer 1

0

Add a RewriteRule

RewriteRule ^/$ /myappname

in combination with the ProxyPass /myappname.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .