现有的Apache PHP服务器上的Railo-Tomcat

我需要在现有的PHP服务器(Linux)上运行ColdFusion应用程序。 我在服务器上安装了tomcat,但是Railo占用了所有的stream量。 我希望它安装,只有在/ webapps / ROOT /通过Railo服务器,其他所有通过现有的PHP服务器的请求。 服务器不是我自己的,我的安装Railo打破其他用户的网站。

有什么办法可以做到这一点?

PS:我对Linux不是很熟练,拥有它的公司完全没有支持,所以和他们交谈正在向前迈进两步。

您需要安装mod_jkmod_proxy来将请求从Apache转发到Tomcat。

这是一个mod_jk的例子。

  1. 安装Tomcat
  2. 将* .war文件下载到webapps文件夹并重命名为railo.war
  3. 安装mod_jk
  4. 创build/编辑workers.properties文件如下:

     worker.list=worker1 worker.worker1.type=ajp13 worker.worker1.host=127.0.0.1 worker.worker1.port=8009 
  5. 创build一个mod_jk.conf文件:

     LoadModule jk_module modules/mod_jk.so JkWorkersFile /etc/httpd/conf/workers.properties JkShmFile /var/log/httpd/jk.shm JkLogFile /var/log/httpd/mod_jk.log JkLogLevel info JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " <VirtualHost *:80> ServerName your.domain.com JkMount /railo/* worker1 </VirtualHost> 
  6. 为Tomcat添加虚拟主机:

      <Host name="your.domain.com" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="/railo" docBase="railo"/> </Host> 

这意味着http://your.domain.com/railo的请求将转发到Tomcat,&#x5728;railo情况下,其他请求仍由Apache提供。

Mod Proxy示例(简单介绍Jamie Krug):

httpd.conf文件

 <Proxy *> Allow from 127.0.0.1 </Proxy> ProxyPreserveHost On ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://localhost:8009/$1$2 <VirtualHost *:80> ServerName testhost1 DocumentRoot "/path/to/testhost1" DirectoryIndex index.html index.cfm ErrorLog "logs/testhost1-error.log" CustomLog "logs/testhost1-access.log" common </VirtualHost> <VirtualHost *:80> ServerName testhost2 DocumentRoot "/path/to/testhost2" DirectoryIndex index.html index.cfm ErrorLog "logs/testhost2-error.log" CustomLog "logs/testhost2-access.log" common </VirtualHost> 

server.xml(Tomcat)

确保这些定义在LOCALHOST的定义之上

 <Host name="testhost1" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="/path/to/testhost1" /> </Host> <Host name="testhost2" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="/path/to/testhost2" /> </Host>