简体   繁体   中英

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 (eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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