Report this

What is the reason for this report?

How to deploy Ruby on Rails inside Apache LAMP configured?

Posted on July 29, 2014
neri

By neri

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.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.