PHP和Java是两种语言对吗,两种不同的语言PHP和Java在相同的应用程序上,PHP上的Apache和Java上的Tomcat...

I am also finding tough to categorize this question. So please bear with me to explain the issue.

We have two different applications:

PHP on XAMPP and

Java on Tomcat

Now we have a business case to merge both the products. ie., PHP product should be looking no different from the Java application and also it should be part of Java app. (appears in the one of the tab in Java app)

The CSS part can be taken care. But the complex part is how to collate these two application?

Also we are using Tomcat for Java and Apache for PHP,

in such case how do we bundle the product as one.

I tried googling, but most of them point to having apache and tomcat connector etc.

But I am still not clear on how to achieve this seamless integration.

Misc Info:

--- Java App: DB: MySQL, Maven, Servlet, Spring, Struts, Hibernate

--- PHP App: XAMPP (or somecases LAMP)

Please let me know if I had missed out any details.

解决方案

I am able to get Apache talk to Tomcat through mod_proxy.

I actually referred to the below links to get this working (mostly changes to httpd.conf in Apache and server.xml in Tomcat):

I then configured PHP with Apache following [this link][1] and got the PHP configured with Apache.

So as a test program, I am able to reach servlet programs (Tomcat) from a Apache like http://localhost/example/servlet then access PHP programs too with a URL like http://localhost/phptest

ZeissS, Paul and Vincent. Thanks all for your help. Even though I have a long way to go, this looks like the starting point.

=== httpd.conf in Apache server ===

# enable the below or add new

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_http_module modules/mod_proxy_http.so

# Start Modules for PHP

LoadModule php5_module "c:/php/php5apache2_2.dll"

AddHandler application/x-httpd-php .php

# configure the path to php.ini

PHPIniDir "c:/windows"

# Just at the end of 'Main' server configuration - add the below

ProxyRequests On

ProxyVia On

Order deny,allow

Allow from all

ProxyPass /examples http://localhost:8080/examples/

ProxyPass /servlets http://localhost:8080/examples/servlets/

ProxyPass /jsp http://localhost:8080/examples/jsp/

ProxyPassReverse /examples http://localhost:8080/examples/

# Finish Modules for PHP

=== server.xml in Tomcat ===

maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

enableLookups="false" redirectPort="8443" acceptCount="100"

connectionTimeout="20000" disableUploadTimeout="true"

proxyName="http://localhost" proxyPort="80"/>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值