login community faq

In order to keep my memory footprint to a minimum, I would like to know if it's possible to serve more than one application on WebFaction from a single Passenger instance. I just need to create an additional server entry, but I can't find a way to manually proxy it. It seems like it'd be a waste if I created more than one Passenger/Rails "application" if I already have nginx up and running with the first one.

Is this possible?

asked Mar 11 '11 at 07:51

jbrowning's gravatar image

jbrowning
11


Using multiple Rails applications suggests "smart-lvl2" spawning method (see this), which takes much more memory than the "conservative" spawning we are using by default. In general, you should just stick with the one-app-per server scheme for Rails applications.

answered Mar 11 '11 at 08:11

tie's gravatar image

tie
139113

Just found the answer to my own question:

Create a "Custom Application" in the WebFaction control panel which will assign a port number. Then, modify nginx.conf to add an additional server directive like so:

1
2
3
4
5
6
server {
    listen             00000; # Replace with the "Custom Application" port number
    passenger_enabled  on;
    root               /home/username/webapps/passenger_app_name/new_app/public;
    server_name        localhost;
}

answered Mar 11 '11 at 08:26

jbrowning's gravatar image

jbrowning
11

You don't need to use multiple ports - you should be able to just use the domain name for the second site in the server_name directive, eg:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
server {
    passenger_enabled  on;
    root               /home/username/webapps/passenger_app_name/app1/public;
    server_name        domain1.com www.domain1.com;
}
server {
    passenger_enabled  on;
    root               /home/username/webapps/passenger_app_name/app2/public;
    server_name        domain2.com www.domain2.com;
}

Then just assign your passenger app to whatever site in the control panel.

(Mar 11 '11 at 10:07) seanf ♦♦ seanf's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×127
×76
×56
×17

Asked: Mar 11 '11 at 07:51

Seen: 2,310 times

Last updated: Mar 11 '11 at 10:07

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited