Apache Port Forwarding 80 to 8080 and Accessing Applications Hosted Both in Apache (80), I.E PHPmyadmin and Tomcat (8080)

Apache Port forwarding 80 to 8080 and accessing applications hosted both in Apache (80), i.e phpMyadmin and Tomcat (8080)

Use mod_proxy. Load module...
Second define in your virtual host:

    ProxyPass        /myapp         http://example.com:8080/myapp
ProxyPassReverse /myapp http://example.com:8080/myapp

But this will work when your tomcat apps has only relative links.

How to publish a tomcat webapp while running on port 8080?

You should keep Tomcat running on 8080 and use a reverse proxy on port 80 to route only what you want to the "inner" Tomcat instance.

Easy configuration for domain:8080 to 80 Tomcat

Yes, you can use Apache Mod_Proxy for this. You use Apache2 as a front-end to your Tomcat instance.

Here is a configuration example:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName site.domain.com
Redirect / /tomcat-context/
ProxyPass /tomcat-context/ http://127.0.0.1:tomcat-port/tomcat-context/
ProxyPassReverse /tomcat-context/ http://site.domain.com/tomcat-context/
ProxyPreserveHost On
</VirtualHost>

You can find more infos here.

It may seem a bit hard to grasp at first if you're not an Apache2 expert (I am not), but once you've configured your first frontend, adding more and more tomcat instances behind it is a breeze.

Or if you're lazy, change the connector port from 8080 to 80 in the conf/server.xml file in your tomcat home directory.

Easy configuration for domain:8080 to 80 Tomcat

Yes, you can use Apache Mod_Proxy for this. You use Apache2 as a front-end to your Tomcat instance.

Here is a configuration example:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName site.domain.com
Redirect / /tomcat-context/
ProxyPass /tomcat-context/ http://127.0.0.1:tomcat-port/tomcat-context/
ProxyPassReverse /tomcat-context/ http://site.domain.com/tomcat-context/
ProxyPreserveHost On
</VirtualHost>

You can find more infos here.

It may seem a bit hard to grasp at first if you're not an Apache2 expert (I am not), but once you've configured your first frontend, adding more and more tomcat instances behind it is a breeze.

Or if you're lazy, change the connector port from 8080 to 80 in the conf/server.xml file in your tomcat home directory.



Related Topics



Leave a reply



Submit