neri
By:
neri

How to deploy Ruby on Rails inside Apache LAMP configured?

July 29, 2014 1.4k views

I've a droplet with Ubuntu 12 and LAMP but I want to deploy an Rails app on alias /dir.
Ex: domain.com - Is the LAMP and I need to deploy the app on domain.com/app.

My site-available:

Alias /redmine/ "/var/www/nerijunior.com/redmine/public"
<Directory "/var/www/nerijunior.com/redmine/public">
        Options Indexes -MultiViews FollowSymLinks
        AllowOverride All
        Order deny,allow
        Allow from all
    </Directory>

The passenger is installed and ok, but when I access /redmine the response is 404.

Thanks.

1 Answer

Assuming Passenger is set up correctly, you still need to configure the Rails app to work correctly from a subdirectory. It looks like you are installing Redmine

First you need to make sure the Rails app is configured to work correctly from a subdirectory. It looks like you are installing Redmine, so check out this. In $REDMINE_HOME/config/environment.rb you need to add Redmine::Utils::relative_url_root = "/redmine"

Also in your Apache configuration, you need:

    <Location /redmine>
        PassengerBaseURI /redmine
        PassengerAppRoot /var/www/nerijunior.com/redmine
    </Location>

Checkout the Passenger docs for deploying to a subfolder.

Have another answer? Share your knowledge.