简体   繁体   English

mod_perl和Passenger如何在同一Apache服务器上运行?

[英]How can mod_perl and Passenger run on the same Apache server?

Is this even possible? 这有可能吗?

I have a Rails app running on Passenger and a mod_perl site that need to run on the same server. 我有一个运行在Passenger上的Rails应用程序和一个需要在同一服务器上运行的mod_perl站点。 I've tried setting up two VirtualHosts and I've tried just using one VH and an Alias/Location for the mod_perl. 我尝试设置两个VirtualHost,并且尝试使用一个VH和一个Alias / Location作为mod_perl。 In both cases, Passenger tries to serve the mod_perl app and tells me it can't find the correct files. 在这两种情况下,Passenger都尝试提供mod_perl应用程序,并告诉我找不到正确的文件。 Anyone know what I'm doing wrong? 有人知道我在做什么错吗?

Here's my setup atm: 这是我的设置atm:

NameVirtualHost *:80
RailsAutoDetect off
<VirtualHost *:80>
   DocumentRoot (home of rails app)/public
   RailsBaseURI /
</VirtualHost>

 PerlModule Apache::DBI
 PerlRequire /opt/rt3/bin/webmux.pl


Alias /rt /opt/rt3/share/html <== mod_perl app
<Location /rt>
  AddDefaultCharset UTF-8
  SetHandler perl-script
  PerlHandler RT::Mason
</Location>

Well, for right now I've just set them up as two different VirtualHosts using different ports to connect. 好吧,目前,我只是将它们设置为两个使用不同端口进行连接的虚拟主机。 That works, but it's a little messy for my site to use and if anyone has a better idea, I'm all ears. 那行得通,但是我的网站使用起来有点混乱,如果有人有更好的主意,我会很高兴。 Thanks. 谢谢。

Edit: Got it working! 编辑:正常工作! I ended up setting up two VirtualServers on different ports, then used mod-proxy to redirect traffic to the /rt site to the mod-perl VirtualServer (leaving the Passenger one as the default). 我最终在不同的端口上设置了两个VirtualServer,然后使用mod-proxy将到/ rt站点的流量重定向到mod-perl VirtualServer(将“乘客”作为默认值)。 This works great, and best of all my mod_perl site believes it's still in the same place as Passenger, which smooths out a lot of compatibility issues I was dealing with as well. 这很好用,而且我所有的mod_perl网站中最好的地方是,它仍然与Passenger处于同一位置,这也消除了我正在处理的许多兼容性问题。 I knew I was missing something simple! 我知道我缺少一些简单的东西! Just putting this up in case anyone else is having issues with this. 只是提出来,以防其他人对此有疑问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM