0

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> 
5
  • You're not really clear on what is being asked. You might want to clear up exactly what problem you're having and how we can help. Commented Aug 27, 2013 at 14:23
  • In which file I need to add: <VirtualHost *:80> ... </VirtualHost>? In apache2.conf? And In which file add passenger routes? Commented Aug 27, 2013 at 14:34
  • Can I write: "ServerName localhost"? Commented Aug 27, 2013 at 14:36
  • You are way out of your depth here @AlexKurmaev - You need to spend some quality time with an Apache tutorial, or alternatively the Apache documentation and understand the configuration files before you start mucking about with Passenger. You're trying to build a skyscraper, but you haven't learned how to use a hammer yet... Commented Aug 27, 2013 at 16:01
  • I dont think so voretaq7 Commented Aug 30, 2013 at 18:14

1 Answer 1

1

Your DocumentRoot must be set to the public directory of your Rails app.

For instance (it seems you're trying out the demo from the Rails book):

 DocumentRoot /home/alexkd/WebDev/rails/depot/public 
1
  • Yes it is. I decided my problem with creating new file in /etc/apache2/sites-available' with <VirtualHost *:80>...</VirtualHost *:80> and using 'RailsEnv development' there. Commented Aug 30, 2013 at 18:12

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.