skip to Main Content

I am trying to host a rails2 application on a new Virtual Machine which is CentOS 6 with Parallels Plesk Panel 11 (64-bit).
I have installed RVM,ruby,rails, and passanger Succefully using the steps given here

I have followed all the steps correctly.
I have installed ruby 1.8.7 and rails 2.0.2

Now the thing is that, I am able to run the application using the Webrick server at 3000 port on the new server. Everything works fine there. But when I want to run it with apache, it doesn’t run. when I hit the url it returns the page

Not Found

The requested URL /account/login was not found on this server. Apache
Server at www.mem.com Port 80

Here is my passanger.conf file :

/etc/httpd/conf.d/passenger.conf

    LoadModule passenger_module /usr/local/rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.19/ext/apache2/mod_passenger.so
   PassengerRoot /usr/local/rvm/gems/ruby-1.8.7-p371/gems/passenger-3.0.19
   PassengerRuby /usr/local/rvm/wrappers/ruby-1.8.7-p371/ruby

Here is my virtual Host code :

/etc/httpd/sites-available/mem.conf

    <VirtualHost *:80>
 ServerAdmin [email protected]
 DocumentRoot /var/www/mem/public
 ServerName www.mem.com
 ErrorLog /var/log/httpd/mem/error.log
 CustomLog /var/log/httpd/mem/access.log common
</VirtualHost>

Any suggestions will be greatly appreciated.

6

Answers


  1. Chosen as BEST ANSWER

    The issue has been resolved. There already a Virtual Host had been created with different Document Root by the web hosting company. I moved my app directory to that path and application started. Thanks everyone for the suggestions.


  2. Try adding a this directory block inside your VirtualHost

    <Directory /var/www/mem/public>
        Allow from all
        Options -MultiViews
    </Directory>
    
    Login or Signup to reply.
  3. I’m running a CentOS 6 box with Apache & the Passenger module. My site configuration lives within the /etc/httpd/sites-enabled/ folder. Here’s my conf:

    # /etc/httpd/sites-enabled/hello-world.conf
    <VirtualHost *:80>
        ServerName hello-world.localhost
        DocumentRoot /var/www/hello/public
        <Directory /var/www/hello/public>
            Allow from all
            Options -MultiViews
        </Directory>
    </VirtualHost>
    

    Always remember to restart apache:

    $ sudo apachectl restart
    

    Hopefully this might help you. Good luck.

    Login or Signup to reply.
  4. I had the same problem myself, though with a rails3 app on rhel 6.2 (64bit) and ruby-1.8.7 with https. I fixed my problem by adding following line at the end (after “VirtualHost” section) in /etc/httpd/conf.d/myapp.conf:

        PassengerPreStart https://<url-to-my-rails-app>
    

    Once apache is restarted, my app shows up properly.

    You can find more information from passenger user guide for apache: http://www.modrails.com/documentation/Users%20guide%20Apache.html#User_switching

    Login or Signup to reply.
  5. Disable selinux.

    Answer must be at least 30 characters.

    Login or Signup to reply.
  6. You may also see this if you manage to set DocumentRoot to the wrong or non-existing directory. If you can’t figure this out, double check that it exists.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search