Question

How to deploy Ruby on Rails inside Apache LAMP configured?

Posted July 29, 2014 2.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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
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.

Submit an Answer