单个Apache服务器可以同时处理Tomcat和PHP吗? [英] Can a single Apache server handle both Tomcat and PHP?

查看:186
本文介绍了单个Apache服务器可以同时处理Tomcat和PHP吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要求在同一个Apache上运行同时具有Java应用程序和PHP应用程序的单个服务器。这可能吗?



这个问题可能非常愚蠢,但我对java要求或安装程序一无所知。



<我可以做同样的事情,让java应用程序在一个端口上运行,而PHP应用程序在另一个端口上运行,两者都在同一个Apache上吗?

解决方案

是的,你可以做到这一点。基本上你必须在一个端口上运行Apache(+ PHP)服务器,在另一个端口上运行Tomcat服务器。




  • 你可以将第二个端口暴露给外界,并让您的URL使用端口 80 用于Apache / PHP或(比如) 8080 用于Java服务器。这很简单,但您可能会发现上游防火墙阻止远程Web浏览器连接到 80 以外的任何端口。


  • 您可以将Apache服务器配置为Java服务器的反向代理。因此,例如,Apache服务器可能会识别 http://site.com/javaapp/foo.html 是针对Java服务器的,并将该URL的请求转发给 http:// localhost:8080 / javaapp / foo.html




关于使用mod_proxy配置正向和反向代理的Apache文档有一整章。


I have a requirement as to have a single server with both a Java application and a PHP application, running on the same Apache. Is this possible?

This question may be very silly but I have no clue about java requirements or installation procedures.

Can I do such a thing that as to have the java application running on one port and the PHP application on another port, both on the same Apache?

解决方案

Yes you can do that. Essentially you have to run the Apache (+ PHP) server on one port and the Tomcat server on a different port.

  • You can expose the 2nd port to the outside world, and have your URLs use either port 80 for Apache / PHP or (say) 8080 for the Java server. This simple, but you may find that upstream firewalls prevent a remote web browser from connecting to any port other than 80.

  • You can configure your Apache server as a reverse proxy for the Java server. So for instance, the Apache server might recognize that http://site.com/javaapp/foo.html is for the Java server, and relay requests for that URL to http://localhost:8080/javaapp/foo.html.

There is a whole chapter of the Apache documentation about configuring forward and reverse proxies using mod_proxy.

这篇关于单个Apache服务器可以同时处理Tomcat和PHP吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆