# Setting up shared hosting on dedicated server

**URL:** <https://www.ruby-forum.com/t/setting-up-shared-hosting-on-dedicated-server/114735>\
**Category:** Deployment\
**Created:** [September 17, 2007, 1:24pm UTC](https://www.ruby-forum.com/t/setting-up-shared-hosting-on-dedicated-server/114735 "2007-09-17T13:24:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bakki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@bakki](https://www.ruby-forum.com/u/bakki)\
**Post date:** [September 17, 2007, 1:24pm UTC](https://www.ruby-forum.com/t/setting-up-shared-hosting-on-dedicated-server/114735/1 "2007-09-17T13:24:54Z")

</div>

I have read Ezra’s book and the O’Reilly shortcuts and various other  
resources on the Net and most assume you have one app which you deploy  
to shared host, VPS or dedicated host.

Our situation is that we have an ASP app which will be by paid up  
subscription and so the same app will be used by multiple customers  
with their own private db. In addition within the rails tree there is  
a folder for customer uploads and assets.

My client seems to be set on using a dedicated server with shared host  
architecture rather than recommended (Ezra’s) VPS slices. I’d like to  
use nginx, mognrel\_cluster. The reason why my client is set on shared  
hosting configuration over VPS is that the other contractor on the  
project is convinced that long term maintenance of various open  
source libraries (we need a dozen or more such as wv, enscript,  
antiword, pdf2html etc) on each slice negates the benefit of VPS.

I am looking at nginx cookbook section on the wiki and I see that they  
have for shared hosting:

http {  
server {  
listen 80;  
server\_name [www.domain1.com](http://www.domain1.com);  
access\_log logs/domain1.access.log main;

```
    location / {
        index index.html;
        root /var/www/domain1.com/htdocs;
    }
}

server {
    listen 80;
    server_name www.domain2.com;
    access_log logs/domain2.access.log main;

    location / {
        index index.html;
        root /var/www/domain2.com/htdocs;
    }
}

```

}

However when I see the config file for nginx/mongrel I see that the  
directive:

upstream mongrel {  
server 127.0.0.1:8000;  
server 127.0.0.1:8001;  
}

goes in the http section and not the server section. So the question I  
have is, how do I setup mutliple customers on the same box with  
private mySQL databases?

This is NOT a very high volume site. There may be 1-2 dozen customers  
on the box each with 1-40 users. I would very much appreciate any  
suggestions, pointers and arguments for/against shared host/VPS  
configurations which I can present to my client. THe main argument  
against VPS seems to be the overhead of creating the VPSs and  
installation/maintenance of libraries. BTW we will be deploying on  
Debian Etch.

Thank you very much for your time.

-bakki

---

<div class="post-metadata">

**Author:** ![bakki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@bakki](https://www.ruby-forum.com/u/bakki)\
**Post date:** [September 25, 2007, 11:01pm UTC](https://www.ruby-forum.com/t/setting-up-shared-hosting-on-dedicated-server/114735/2 "2007-09-25T23:01:15Z")

</div>

Hi Bakki,

More than 90% of the Rails applications we host consume less than 60MB  
of RAM per Mongrel instance.

We offer fully managed dedicated servers… and fully managed means we  
setup the server, setup the Rails applications and even customize your  
Capistrano recipes. Just contact us (support -at- speedyrails -dot-  
com) and we will be glad to send you our current dedicated server  
quotes.

Thanks,  
Maykel

–  
Maykel Rodriguez

> **[Home - Speedyrails](https://www.speedyrails.com/)**
>
> Speedyrails is an AWS Advanced Consulting Partner. We leverage our extensive AWS knowledge to provide exceptional managed services.

Easy to use Rails hosting

---

<div class="post-metadata">

**Author:** ![bakki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@bakki](https://www.ruby-forum.com/u/bakki)\
**Post date:** [September 25, 2007, 11:01pm UTC](https://www.ruby-forum.com/t/setting-up-shared-hosting-on-dedicated-server/114735/3 "2007-09-25T23:01:43Z")

</div>

Hello Maykel,

Thanks for that insight. Our plan is to keep adding customers to the  
first box and get a second box when we start running out of resources.  
I was actually thinking that each mongrel would be more like 70-120MB  
based on Ezra’s talk at RailsConf2007. I will have a better handle on  
this after some test deployments and testing. BTW, I was looking at  
[speedyrails.com](http://speedyrails.com) and was wondering what your dedicated server fees are.

-bakki

On Sep 16, 7:36 pm, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![bakki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@bakki](https://www.ruby-forum.com/u/bakki)\
**Post date:** [September 25, 2007, 11:02pm UTC](https://www.ruby-forum.com/t/setting-up-shared-hosting-on-dedicated-server/114735/4 "2007-09-25T23:02:35Z")

</div>

On Sep 16, 2007, at 11:33 AM, bakki wrote:

> My client seems to be set on using a dedicated server with shared host  
> http {
> 
> }  
> have is, how do I setup mutliple customers on the same box with  
> private mySQL databases?

Private databases or database servers? In our shared environment,  
we’ve given the ability to our customers to run their own instance of  
PostgreSQL or MySQL on their own ports. (everybody is provided a port  
range for mongrels, postgresql, nginx… etc)

> This is NOT a very high volume site. There may be 1-2 dozen customers  
> on the box each with 1-40 users. I would very much appreciate any  
> suggestions, pointers and arguments for/against shared host/VPS  
> configurations which I can present to my client. THe main argument  
> against VPS seems to be the overhead of creating the VPSs and  
> installation/maintenance of libraries. BTW we will be deploying on  
> Debian Etch.

Interesting “argument” reasons. We’ve been doing Rails hosting in a  
shared environment for over two and a half years… and we’re phasing  
it out in favor of our new VPS-solution, Rails Boxcar[1], because  
it’s been too much of an overhead to make sure everyones applications  
were playing nice in the same CPU/memory space. If you restrict the  
memory space too much, stuff starts to get quirky… if you open it  
up… one persons application bug or hit on DIGG can bring all the  
customers sites to a halt. Granted, one could argue that those users  
are “getting what they pay for”… but the support calls _still_ come  
in and this isn’t an appropriate response to them.

Setting up a VPS isn’t terribly difficult and when done right…  
shouldn’t take more work than setting up a new shared user account.

[1] [http://railsboxcar.com/](http://railsboxcar.com/)

My two cents,

Robby

–  
Robby R.  
Founder and Executive Director

PLANET ARGON, LLC  
Design, Development, and Hosting with Ruby on Rails

> **[Planet Argon](https://www.planetargon.com/)**
>
> Planet Argon is a Ruby on Rails development agency specializing in maintenance and support for existing Rails apps. Based in Portland, OR, Planet Argon has been a member of the Rails community since 2004.

[http://www.robbyonrails.com/](http://www.robbyonrails.com/)

+1 503 445 2457  
+1 877 55 ARGON [toll free]  
+1 815 642 4068 [fax]

---

<div class="post-metadata">

**Author:** ![bakki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@bakki](https://www.ruby-forum.com/u/bakki)\
**Post date:** [September 25, 2007, 11:04pm UTC](https://www.ruby-forum.com/t/setting-up-shared-hosting-on-dedicated-server/114735/5 "2007-09-25T23:04:58Z")

</div>

Hi Robby,

Love your blog. Thanks for the reply.

On 9/16/07, Robby R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Private databases or database servers? In our shared environment,

These will be private databases all running under mySQL. So it will be  
something like:  
client1\_production  
client2\_production…

etc.

> up… one persons application bug or hit on DIGG can bring all the  
> customers sites to a halt. Granted, one could argue that those users  
> are “getting what they pay for”… but the support calls _still_ come  
> in and this isn’t an appropriate response to them.

In our case all clients will be running the an instance of the same  
app. We can allocate resources to the clients based on their needs and  
requests.  
I do prefer the VPS route and need more ammunition to convince my  
client.  
I can see the problems of a shared environment where each client runs  
a different app and the bugs are not the same for all as in our case.  
Still a bug one client hits can have the same result.

Can you give a bit of info on how you setup your shared environments  
particularly with NGINX? I’ve got it running and am playing around  
with the config file but am not clear on how to setup the server  
section. Again my confusion comes from the fact that the upstream  
mongrel section is NOT in the server section for each shared host. So  
how can I allocate a mongrel\_cluster to each domain?

> –  
> Robby R.  
> Founder and Executive Director

Thanks again for your input.

-bakki

---

<div class="post-metadata">

**Author:** ![bakki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@bakki](https://www.ruby-forum.com/u/bakki)\
**Post date:** [September 25, 2007, 11:06pm UTC](https://www.ruby-forum.com/t/setting-up-shared-hosting-on-dedicated-server/114735/6 "2007-09-25T23:06:38Z")

</div>

Hi Bakki,

Thanks for the update! Feel free to contact us in the future if you’re  
looking for reliable RoR hosting.

–  
Maykel Rodriguez

> **[Home - Speedyrails](https://www.speedyrails.com/)**
>
> Speedyrails is an AWS Advanced Consulting Partner. We leverage our extensive AWS knowledge to provide exceptional managed services.

Easy to use Rails hosting

---

<div class="post-metadata">

**Author:** ![bakki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@bakki](https://www.ruby-forum.com/u/bakki)\
**Post date:** [September 25, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/setting-up-shared-hosting-on-dedicated-server/114735/7 "2007-09-25T23:08:06Z")

</div>

I’d like to thank you all for your responses. On how to setup shared  
hosts which was one of my original questions, I found the answer here.  
[http://brainspl.at/articles/2006/09/12/new-nginx-conf-with-rails-caching](http://brainspl.at/articles/2006/09/12/new-nginx-conf-with-rails-caching)  
The nginx.conf file Ezra has posted on his blog explains every thing I  
wanted to know. Thank you Ezra.

Maykel, in our situation the other contractor on the project has  
convinced our client that going with a ‘rails specialized’ hosting  
company is not necessary as long as you have your own box you can do  
whatever you want with it. So the decision was based entirely on cost  
and this other contractor’s endorsement of the hosting company because  
they have several non-rails apps being hosted successfully there. I  
would have preferred a ‘rails specialized’ host but then their  
argument is ‘that’s why we have you’ (meaning me) to take care of ALL  
Rails issues…though I am primarily a Rails developer. But if I push  
the point too much I’ll be cutting my own legs 🙂  
-bakki

On Sep 16, 9:43 pm, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![bakki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@bakki](https://www.ruby-forum.com/u/bakki)\
**Post date:** [September 25, 2007, 11:08pm UTC](https://www.ruby-forum.com/t/setting-up-shared-hosting-on-dedicated-server/114735/8 "2007-09-25T23:08:13Z")

</div>

For what it’s wroth, from our experience with our virtual and  
dedicated customers, we recommend 96-128 Megs per Mongrel instance.

–

Jesse P., Blue Box Group, LLC

On Sep 16, 2007, at 6:43 PM, removed\_email\_address@domain.invalid wrote:

> More than 90% of the Rails applications we host consume less than 60MB  
> of RAM per Mongrel instance.

–

Jesse P.  
Blue Box Group, LLC

p. +1.800.613.4305 x801  
e. removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![bakki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@bakki](https://www.ruby-forum.com/u/bakki)\
**Post date:** [September 25, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/setting-up-shared-hosting-on-dedicated-server/114735/9 "2007-09-25T23:10:29Z")

</div>

Hi Bakki,

> This is NOT a very high volume site. There may be 1-2 dozen customers  
> on the box each with 1-40 users. I would very much appreciate any  
> …  
> In our case all clients will be running the an instance of the same  
> app. We can allocate resources to the clients based on their needs and  
> requests.

Having 1-2 dozen customers, each one running a Rails application, each  
Rails app with let’s say two Mongrel instances will result in  
something like 24-48 Mongrel instances running in a server. We  
([www.speedyrails.com](http://www.speedyrails.com)) guarantee 60MB of RAM for every single Mongrel  
instance on our shared servers, so considering this amount of memory  
you would need 2GB-4GB of RAM on your VPS/Server.

I would recommend you estimating at least the amount of memory you  
will need to select the proper Shared/VPS/Dedicated solution.

Regards,

–  
Maykel Rodriguez

> **[Home - Speedyrails](https://www.speedyrails.com/)**
>
> Speedyrails is an AWS Advanced Consulting Partner. We leverage our extensive AWS knowledge to provide exceptional managed services.

Easy to use Rails hosting
