multiple independent rails apps on same server using passenger

493 views
Skip to first unread message

Jon Heckman

unread,
Aug 2, 2015, 2:42:51 PM8/2/15
to Phusion Passenger Discussions
Hi,
I am trying to find a guide for start to finish how to build a passenger server and run multiple rails apps on it. 
So far I followed this guide which allowed me to get an app up and running https://www.digitalocean.com/community/tutorials/how-to-deploy-rails-apps-using-passenger-with-nginx-on-centos-6-5

However I can't figure out where to go after that. 

The end goal is that I have a few smaller rails apps (with little traffic) on a single passenger server, each with their own domain.

Any pointers to more a good resource would be much appreciated.

Jon

Hongli Lai

unread,
Aug 3, 2015, 3:28:40 AM8/3/15
to phusion-passenger
You just add more virtualhost entries to your Nginx config file, one
for each app. https://www.phusionpassenger.com/library/deploy/nginx/deploy/ruby/
> --
> You received this message because you are subscribed to the Google Groups
> "Phusion Passenger Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phusion-passen...@googlegroups.com.
> To post to this group, send email to phusion-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/phusion-passenger.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phusion-passenger/ec81c101-11a8-451e-9397-70134791a7d4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Phusion B.V. | Web Application deployment, scaling, and monitoring solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 63501007 (The Netherlands)

Jon Heckman

unread,
Aug 3, 2015, 7:15:34 PM8/3/15
to Phusion Passenger Discussions, hon...@phusion.nl
So I would have multiple "server" blocks inside one "http" block?

Daniel Knoppel

unread,
Aug 3, 2015, 8:29:56 PM8/3/15
to Phusion Passenger Discussions, hon...@phusion.nl
On Tuesday, August 4, 2015 at 1:15:34 AM UTC+2, Jon Heckman wrote:
So I would have multiple "server" blocks inside one "http" block?


Yes, you needed that anyway to configure different server_names and/or ports for your apps.

- Daniel

Jon Heckman

unread,
Aug 3, 2015, 9:41:27 PM8/3/15
to Phusion Passenger Discussions, hon...@phusion.nl
Thank you
Hopefully last question. Is there a recommended way of deploying apps with their own domains to the same passenger server (these are low traffic apps that each having a dedicated server is not worth it)? Maybe I am missing the documentation that explains how this works, but since in DNS I can't point a domain to IP and port.

Hongli Lai

unread,
Aug 4, 2015, 4:28:30 AM8/4/15
to Jon Heckman, Phusion Passenger Discussions
You can configure the DNS entries of each domain to point to the IP
address of that single server you have. Then within that single
server, you simply configure Nginx to handle different domain name
differently (with `server` blocks in the configuration file).

This isn't really the responsibility of Passenger, so we don't
document it. But if you Google for documentation on virtual hosts, you
should be able to find a lot of documentation on how this works.

Daniel Knoppel

unread,
Aug 4, 2015, 4:30:07 AM8/4/15
to Phusion Passenger Discussions, hon...@phusion.nl
I'm not sure I understand the question, passenger already saves resources by using the same server for multiple apps by default (even when using multiple server blocks).

- Daniel
Reply all
Reply to author
Forward
0 new messages