Apache的端口转发80至8080,访问应用程序的托管无论是在阿帕奇(80),即phpMyAdmin的和Tomcat(8080)

Apache的端口转发80至8080,访问应用程序的托管无论是在阿帕奇(80),即phpMyAdmin的和Tomcat(8080)

问题描述:

我要访问Tomcat服务器(8080)现在可以通过 HTTP访问承载的应用程序的myapp':/ /example.com:8080/myapp 在 http://example.com/myapp (Apache服务器,端口80)。我应该能行吗?如果我使用端口转发80到8080,我将能够访问phpMyAdmin的,还是在端口80上运行其他应用程序?哪种方法我应该遵循来完成任务?

I want to access an application 'myapp' hosted in tomcat server(8080) currently can be accessed by http://example.com:8080/myapp in http://example.com/myapp (apache server, port 80). What should I do for that? If I use port forwarding 80 to 8080 will I be able to access phpMyadmin, or any other applications running in port 80? Which method I should follow to accomplish the task?

我使用的Ubuntu服务器14.04。

I am using Ubuntu server 14.04.

使用mod_proxy的。加载模块...
在你的虚拟主机二定义:

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

但是,这将在你的Tomcat应用程序只有相对链接工作。

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