WebFaction
Community site: login 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 11 Mar '11, 07:51

jbrowning
111
accept rate: 0%


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.

permanent link

answered 11 Mar '11, 08:11

tie
1.4k13
accept rate: 44%

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:

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;
}
permanent link

answered 11 Mar '11, 08:26

jbrowning
111
accept rate: 0%

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:

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.

(11 Mar '11, 10:07) seanf
Your answer
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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×186
×108
×81
×25

question asked: 11 Mar '11, 07:51

question was seen: 8,126 times

last updated: 11 Mar '11, 10:07

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM