Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5950793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:26:39+00:00 2026-05-22T17:26:39+00:00

I am trying to set up Rails on a Ubuntu instance by following along

  • 0

I am trying to set up Rails on a Ubuntu instance by following along with documentation such as https://help.ubuntu.com/community/RubyOnRails. I am trying to set up the app from the Rails Getting Started page here: http://guides.rubyonrails.org/getting_started.html.

What I have done so far:

  • Installation of Ruby/RubyGems/Rails through RVM and GEM (this installed Ruby 1.9.2 and Rails 3.0.7)
  • Installation of the mysql and mysql2 module (latter which didn’t work)
  • Creation of rails app (blog app as tutorial is instructing)
  • Sym linking of /home/me/www/blog/public/ from /var/www/blog/
  • Creation of DB through rake
  • Installation of passenger module for Rails execution in Apache
  • Running of passenger-install-apache2-module to configure Apache
  • Deletion of public.html file from public/ rails app folder so that my controller/view can fire
  • Configuration of sites-available files for virtual hosts
  • Configuration of Rails routing

I believe it is the last two steps that are tripping me up, partly due to lack of familiarity with Apache and Rails (I am new to both).

In my virtual host file I am trying to point to the blog public dir in /var/www/blog. For my Rails route I have root :to => "home#index" as instructed.

When I browse to the http:// url I should normally be seeing my “Hello, Rails!” page per section 4.3 of the Getting Started guide, however all I see is the directory listing from Apache. Static pages work but not Rails processing.

At this point I am unclear if the passenger module is even doing anything or where to look for any evidence of what is happening. I tried various things like running the Rails app off a different virtual host called “blog” at http:///blog and the routing worked (static pages and all) but no Rails as above.

Update: after playing around some more, I now get a new error message (404):

Not Found

The requested URL /dispatch.cgi was
not found on this server.

I have since determined that this cgi 404 was caused by a rewrite rule I had added to .htaccess from guidance from the help.ubuntu.com page I pointed out above. Looks like it wasn’t necessary or applied to an older version of Rails. The inconsistencies in instructions when looking up help online is disorienting! Removing the file leaves me with the previous problem though.

Here’s the entry in the Apache log that I believe correlates with the first error. Although I am no longer getting this error it seems, may be related to something else I was trying before…

[Fri May 27 22:49:41 2011] [notice] Apache/2.2.16 (Ubuntu) PHP/5.3.3-1ubuntu9 with Suhosin-Patch Phusion_Passenger/3.0.7 configured -- resuming normal operations
[Fri May 27 22:51:18 2011] [error] [client 192.168.1.141] File does not exist: /var/www/blog/rails, referer: http://192.168.1.138/blog/

Here’s the most recent entry with the 404 on the cgi thing:

[Sat May 28 08:01:18 2011] [error] [client 192.168.1.141] File does not exist: /var/www/blog/dispatch.cgi

What could I be missing? Thanks!


Additional details as requested. Apache sites file:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/blog/
    RailsEnv development

        # <Directory />
        #       Options FollowSymLinks
        #       AllowOverride None
        # </Directory>

        <Directory "/var/www/blog/">
        Options Indexes FollowSymLinks -MultiViews +ExecCGI
                AllowOverride All
                Order allow,deny
                allow from all
        # AddHandler cgi-script .cgi
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
    AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

Another update: I was able to get it working, finally, by using a top level DocumentRoot (/var/www) and basing my Rails app off that using RailsBaseURI. This maps to the “Deploying to a sub URI” section of the Phusion Passenger instructions. It is used as http:///blog which is not really what I wanted to get, but it’s kind of irrelevant as I am using this just to learn Rails in a virtual. I will need to go and work on getting it working as a top level app again sometime later. Here’s my current (final) VirtualHost file for reference:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/
        RailsEnv development

        <Directory /var/www/>
          Options FollowSymLinks
          AllowOverride None
        </Directory>

    RailsBaseURI /blog
        <Directory /var/www/blog/>
                Options Indexes FollowSymLinks -MultiViews +ExecCGI
                AllowOverride All
                Order allow,deny
                allow from all
                # AddHandler cgi-script .cgi
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:26:40+00:00Added an answer on May 22, 2026 at 5:26 pm

    Deploying a Ruby on Rails application

    Suppose you have a Ruby on Rails
    application in /webapps/mycook, and
    you own the domain http://www.mycook.com. You
    can either deploy your application to
    the virtual host’s root (i.e. the
    application will be accessible from
    the root URL, http://www.mycook.com/),
    or in a sub URI (i.e. the application
    will be accessible from a sub URL,
    such as
    http://www.mycook.com/railsapplication).

    Deploying to a virtual host’s root

    Add a virtual host entry to your
    Apache configuration file. Make sure
    that the following conditions are met:

    • The virtual host’s document root must
      point to your Ruby on Rails
      application’s public folder.
    • The Apache per-directory permissions
      must allow access to this folder.
    • MultiViews must be disabled for this
      folder.

    For example:

    <VirtualHost *:80>
        ServerName www.mycook.com
        DocumentRoot /webapps/mycook/public
        <Directory /webapps/mycook/public>
            Allow from all
            Options -MultiViews
        </Directory>
    </VirtualHost>
    

    You may also need to tweak your
    file/folder permissions. Make sure
    that the following folders are
    readable and executable by Apache:

    • this public folder.
    • the application’s config folder.
    • all parent folders. That is, /webapps/mycook and /webapps must also
      be readable and executable by Apache.

    Then restart Apache. The application
    has now been deployed.

    Read the whole docs here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please help, I am trying to set up a rails app on Ubuntu 12.04,
I'm trying to set up a date of birth helper in my Rails app
In my ruby(1.9.3) on rails (3.1) app I'm trying to set some conditional behavior
I'm trying to set up some semistatic page in a rails 3 app I've
I am trying to set up some semistatic page in a rails 3 app,
I'm trying to set up a rails 3.2 app with the new compass-rails gem
I'm trying to set up a Rails server to run an app that I
I am trying to set up a Ruby on Rails project by following the
I am trying to set up my rails app to upload its assets to
I was recently trying to set up an Amazon EC2 instance to run Rails

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.