Java的使用Drupal-6 / PHP [英] Java with Drupal-6/PHP

查看:164
本文介绍了Java的使用Drupal-6 / PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的不喜欢PHP,但我pretty舒适Java编写的。我有一个已经被部署到Apache / Linux服务器稳定的Drupal安装。我不知道如果服务器目前支持Java。 (怎样才能做到这一点?我在桌面应用程序的Java编程,但从未在网上了。)

I really dislike PHP, but am pretty comfortable in Java. I have a stable Drupal installation that has been deployed to an Apache/Linux server. I don't know if the server currently supports Java. (What does it take to do that? I have programming in desktop apps for Java but never online before.)

有关开发新的模块,为我的网站,在那里我可以编写Java并以某种方式把它与PHP?

For developing new modules for my site, is there any way that I can write Java and somehow have it work with the PHP?

推荐答案

要一个(网络)服务器上使用Java,你可能需要:

To use Java on a (web) server, you'll probably need:


  • 已安装的Java虚拟机,

  • 一个servlet容器,或者如果你将使用一些先进的科技股像EJB的一个完整的应用服务器。

理论上你可以运行没有安装servlet容器的Web应用程序,但需要一个嵌入式Servlet容器或一些黑客,但。大多数的servlet容器或应用服务器可以作为前端Web服务器,但如果你决定将其向后一步移动的Apache httpd的后面,然后用的 mod_jk连接插件,你就可以加载从Apache Web服务器的平衡或代理请求你的servlet容器(注意,不只是Tomcat的:Glassfish和的JBoss可作为孔)并隐藏直接网络接入了Java容器和提供的安全性和负载处理额外的层

Theoretically you could run a web application without an installed servlet container, but that needs an embedded servlet container or some hacking, though. Most servlet containers or app servers can be used as frontend web servers, but if you decide to move them one step backwards behind the Apache httpd, then with the mod_jk connector plugin, you'll be able to load balance or proxy requests from the Apache web server to your servlet container (note, not just Tomcat: Glassfish and JBoss can be used as well) and hide the Java container from direct web access and provide an additional layer of security and load handling.

如果不知为何,你想运行PHP和Java在一起,这是可能有一些轻微的黑客攻击:使用的(这是一个Java实现PHP语言的)一个合适的服务器上(我preFER Glassfish的第三版),包你的应用程序作为一个WAR文件,你就可以运行Java应用程序服务器上大多数PHP应用程序(不,这并不意味着任何一种呆滞的)。

If somehow you'd like to run PHP and Java together, that is possible with some mild hacking: use Quercus (which is a Java implementation of the PHP language) on a suitable server (I'd prefer Glassfish v3), pack your app as a war file and you'll be able to run most PHP applications on a Java app server (and no, this doesn't mean any kind of sluggishness).

和,当然,如果你逼退从Apache的前端到后端的Java servlet容器原来Drupal的应用,那么你就可以运行Java和PHP并排Apps方面,离开了唯一的工作为Apache是负载平衡。如果你有兴趣,请检查栎和Drupal HOWTO。

And, of course, if you push back the original Drupal application from the frontend Apache to a backend Java servlet container, then you'll be able to run Java and PHP apps side by side and the only job left for Apache is to load balance. If you are interested, check the Quercus and Drupal howto.

还有一件事我忘了:如果你想在Java中创建新的Drupal的插件/模块,这将只与栎或者如果Java工作和PHP应用程序通过Web服务或类似的Protobuf一个跨语言的框架连接或储蓄(所以视图部分可能是Drupal的插件,用PHP编写的,和业务逻辑在Java中的远程服务器上运行)。请注意,我不是一个有经验的Drupal的插件开发者。

One more thing I forgot: if you'd like to create new Drupal plugins/modules in Java, that would only work with Quercus or if the Java and PHP apps are connected via web services or a cross-language framework like Protobuf or Thrift (so the view part could be Drupal plugin written in PHP, and business logic in Java running on a remote server). Note that I'm not an experienced Drupal plugin developer.

这篇关于Java的使用Drupal-6 / PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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