开发者

Configuring Passenger with Ruby 1.9.2 + Rails 3.1.0rc4 and Ruby 1.8.6 + Rails 2.3.11

How can I configure Passenger to run two different projects under these requirements? First project is Redmine (Rails 2.3.11 and Ruby 1.8.6) and second one is something like a mini-blog (Rails 3开发者_如何转开发.1.0rc4 and Ruby 1.9.2).

OS: Ubuntu Server


Personally, I prefer nginx to Apache, but you can do this with both.

First, the bad news - you cannot do this with a single installation of either Apache or nginx - passenger is compiled against a single specific ruby interpreter that you are using. Now, the good news is that since you have rvm setup, it is trivial to manage multiple ruby interpreters.

You need to have two separate http server (Apache or nginx) installations - one will be the default and answer on port 80, and the other will need to answer on another port (this will not be publicly used). You need to compile passenger for one ruby and http server (Apache or nginx), and another passenger for the other ruby and http server (both http servers can be Apache, both can be nginx, or if you want to make things "interesting", you can have one of each). I highly recommend using ruby 1.9 with your default (port 80) passenger since any new apps you run on the server will be using ruby 1.9+/rails 3+.

Once you have each http server + ruby + passenger setup, you will need to configure your secondary site (running on the not-port-80 web server) as a proxy + reverse proxy from the port 80 http server to the secondary http server (e.g. port 5000).

I have this configuration running for a couple different clients (on different production servers) and do not have any trouble. In one case, we are using passenger standalone servers for the secondary ruby/passenger combination rather than having a full nginx installation - this has proven to be quite stable, but creating functional init scripts that worked as we wanted was a bit fun.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜