有一个网络服务器提供动态 JSP 内容,但我们也想提供一些 PHP 内容。
是否可以在 Apache Tomcat 6.0.32 上安装 PHP 5 和 MySQL,而无需停止当前内容的服务、卸载 Tomcat、安装 Apache HTTP Server(通过 AppServ,XAMPP 或类似的东西,只需点击几下即可安装 PHP、MySQL 和 phpMyAdmin),然后配置 Apache Tomcat 连接器?
目前我没有机会配置提到的“目标”网络服务器,但我在本地计算机上安装了 Tomcat,因此使用我自己的网络服务器我可以尝试执行建议的任何操作。
我知道有很多与以下相关的问题这个话题甚至在 stackoverflow 上,但没有一个回答我的问题。
先感谢您!
There's a webserver which serves dynamic JSP contents, but we would like to serve some PHP contents too.
Is it possible to install PHP 5 and MySQL on Apache Tomcat 6.0.32 WITHOUT stopping the service of current contents, uninstalling Tomcat, installing the Apache HTTP Server (via AppServ, XAMPP or something similar which installs PHP, MySQL and phpMyAdmin too with just some simple clicks), and after that, configuring the Apache Tomcat Connector?
Currently I don't have the opportunity to configure the mentioned "target" webserver, but I installed Tomcat on my local machine, so with my own webserver I can try doing anything suggested.
I know there are lots of questions related to the topic even on stackoverflow, but none of them answered my question.
Thank you in advance!
发布评论
评论(3)
您可以使用 Quercus 或 JSR223 + PHP-bridge 使用 Java 读取/解析/运行 PHP 文件。
至于MySQL,由于它只是一个简单且独立的数据库服务器,因此不需要特定的Web服务器。 MySQL 完全不关心你正在运行的网络服务器。只需按照通常的方式安装和配置即可。
哦,请注意 Apache Tomcat 连接器需要 Apache HTTPD 服务器。因此,如果您不想安装 Apache HTTPD,那么 Tomcat Connector 对您来说毫无价值。
You could use Quercus or JSR223 + PHP-bridge to read/parse/run PHP files using Java.
As to MySQL, as being just a simple and standalone DB server, it doesn't require a specific webserver. MySQL totally doesn't care wat webserver you're running. Just install and configure it the usual way.
Oh, please note that the Apache Tomcat Connector requires Apache HTTPD server. So if you don't want to install Apache HTTPD, then the Tomcat Connector is worthless to you.
Tomcat 支持CGI 那么为什么不安装php5-cgi呢?
Tomcat supports CGI so why not install php5-cgi?
我不知道是否可以在没有HTTPD的情况下安装Apache Tomcat,但我可以部分回答你的问题:
默认情况下,这是不可能的。我不知道为什么,但是包安装程序(我在 EC2 上使用了 YUM)也要求您安装 HTTPD 作为 PHP 的依赖项。因此,如果您的软件包安装程序也需要此功能,则需要从源代码构建 PHP(但这并不难)。 编辑:我正在使用 FastCGI,“仅”PHP 可能不起作用,但它会让我感到惊讶。 (FastCGI 可以正常工作,就像 MySQL 一样,您可以在单独的服务器上安装 PHP-FastCGI)。
MySQL 是完全独立的。由于您还可以在没有 PHP 和 HTTP 服务器的情况下将其安装在单独的服务器(数据库服务器)上,因此可以在没有 HTTPD 的情况下安装 MySQL。
I don't know whether it's possible to install Apache Tomcat without HTTPD, but I can answer your question partially:
By default, it's not possible. I don't know why, but package-installers (I used YUM at EC2) require you to install HTTPD too as a dependency of PHP. So if your package-installer requires this too, you need to build PHP from source (which isn't very hard though). Edit: I'm using FastCGI, 'just' PHP might not work, but it would surprise me though. (FastCGI works since, just like MySQL, you can install PHP-FastCGI on a separate server).
MySQL is fully independant. Since you can also install it on a separate server (db-server) without PHP and a HTTP-server, it's possible to install MySQL without HTTPD.