java - Use apache as frontend to Glassfish -
is possible @ i'm trying do?
i have domain - example.com - installed on webserver ubuntu 16.04/apache.
behind apache i'm running standard glassfish (payara actually) on standard port 8080.
on payara have webapp - mywebapp - deployed on root context /
when point broser directly port 8080 shows web app expect:
http://example.com:8080/ => webapp shown.
1) first want hide payara behind apache , make sure when people write
http://example.com/ redirected https://example.com => mywebapp shown.
this part works using ajp , certificates in place.
in default.conf in
<virtualhost *:80>
have inserted following line:
redirect permanent / https://example.com
it takes care of redirection https. i'm in doubt if right way it.
everything else in conf file standard.
in ssl.conf file in the
<virtualhost *.443>
i have inserted
servername example.com
and paths ssl certificates. it's working expected.
further more have added
proxypass / ajp://127.0.0.1:8009 proxypassreverse / ajp://127.0.0.1:8009
again, works well. if write
http://example.com
i'm redirected
https://example.com/ => mywebapp shown.
this perfect.
but if write
http://example.com/phpmyadmin
for instance i'm not shown phpmyadmin page.
how can accomplish , possible @ all?
thanks help.
kim
you have conflict in following configuration:
proxypass / ajp://127.0.0.1:8009 proxypassreverse / ajp://127.0.0.1:8009
this sends http requests, http://example.com/phpmyadmin payara server
what need instead like
proxypass /mywebapp ajp://127.0.0.1:8009 proxypassreverse /mywebapp ajp://127.0.0.1:8009
so relative urls start /mywebapp redirected payara server , /phpmyadmin still hosted apache.
the apache documentation mentions:
only specific uris can proxied, shown in example:
proxypass "/images" "http://www.example.com/" proxypassreverse "/images" "http://www.example.com/"
in above, requests start /images path proxied specified backend, otherwise handled locally.
Comments
Post a Comment