1

I am only beginner and try to understand how to configure apach web-server for my RubyOnRails app. I have linux, installed apache2, passenger and apache2-module for passenger. While installing i got text like this

LoadModule passenger_module /home/rubys/.rvm/.../ext/apache2/mod_passenger.so
PassengerRoot /home/rubys/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8
PassengerRuby /home/rubys/.rvm/wrappers/ruby-1.9.2-p290/ruby

I need add this to my apache config file, so, i use

$ apachectl -V | grep HTTPD_ROOT
$ apachectl -V | grep SERVER_CONFIG_FILE

file, which i need is here

/etc/apache2/apache2.conf

my rails app is here

/home/alexkd/WebDev/rails/depot

Also i have file in /etc/apache2/ports.conf with text like this

NameVirtualHost *:80
Listen80

What I have to copy to my apache2.conf? and where i have to add this:

<VirtualHost *:80>
   ServerName depot.yourhost.com
   DocumentRoot /home/alexkd/WebDev/rails/depot
   <Directory /home/alexkd/WebDev/rails/depot>
     AllowOverride all
     Options -MultiViews
   </Directory>
</VirtualHost>
1

You never asked a question, but looking at your data I will try to fix your potential problems, so please update the question with a real question so it better serves anyone else who may have similar issues in the future and stumbles across this question.

Try putting a space in here: Listen80 like Listen 80.

Then try putting this:

<VirtualHost *:80>
   ServerName depot.yourhost.com
   DocumentRoot /home/alexkd/WebDev/rails/depot
   <Directory /home/alexkd/WebDev/rails/depot>
     AllowOverride all
     Options -MultiViews
   </Directory>
</VirtualHost>

into /etc/apache2/apache2.conf, add a slash / into this at the end:

<Directory /home/alexkd/WebDev/rails/depot/>

and then restart Apache.

1
  • Thanks. It seems to be working. But I solved my problem in another way by creating new file in /etc/apache2/sites-available' with <VirtualHost *:80>...</VirtualHost *:80> and using 'RailsEnv development' there. And also changed DocumentRoot to: /home/alexkd/WebDev/rails/depot/public – Alex Kurmaev Aug 30 '13 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.