Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to setup a shared hosting server especially for hosting RoR applications. What is the best way to achieve this? Currently I am hosting a LAMP shared hosting server. I have some scripts with which I manage the accounts.

projectadd <redcolor>

creates a user, homedir for redcolor and a folder structure under his home dir like /home/redcolor/{www,logs,files,dbdumps}. And a mysql database gets created for that user and the credentials are populated in a text file in his homedir. An apache vhost also gets created as .com.

This is required for internal usage in our company and we also have a bunch of rails projects getting on board and I need to facilitate the same for rails developers.

What is the best way to host rails sites from user home dirs? I considered rvm but how can I handle the Passenger ruby path in the apache vhost? Is there any way in which i create a very generic vhost and leave everything to user's .htaccess? How can this be done for rails apps?

share|improve this question

1 Answer 1

I guess your setup works like a charm with php based applications, to work around similar setup with ROR, enable the passenger module in apache conf file, once you done setting up the path of passenger in apache conf you dont need to enable the path in vhost. Hope you understand my point below is the sample configuration for your reference.

1) open apache2.com with the editor and insert below passenger path

2) **#Load passenger module

LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/ext/apache2/mod_passenger.so

PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19

PassengerRuby /usr/local/bin/ruby**

3) Restart apache.

4) Vhost config file.

    ServerName <domain-name>
    DocumentRoot /var/www/<domain-name>/current/public
    RailsEnv production (this is optional)
    <Directory /var/www/<domain-name>/current/public>
            Options -Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all



share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.