views:

31

answers:

1

I'm having a rough time with Apache and my Rails app on my production server. I have everything installed, libraries, gems, the whole get down. The issue is that I get a "Forbidden" error in my browser. I've even chmod'd my app directory with "777" but still no luck.

So my questions are:

  1. What is your ServerName Directive (in your virtual host configuration)?
  2. Where is your application located on your server?
  3. Who owns your application directory?
  4. What user should own your application directory?
A: 

Assuming your Apache has the Passenger (aka mod_rails) module installed and enabled, configuring a new Rails app is as simple as

<VirtualHost *:80>

  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin [email protected]
  ServerName  example.com
  ServerAlias www.example.com

  # Index file and Document Root (where the public files are located)
  # DirectoryIndex index.html
  DocumentRoot /path/to/app/public

  # Custom log file locations
  ErrorLog  /path/to/log/example.com/error.log
  CustomLog /path/to/log/example.com/access.log combined

</VirtualHost>

Some important notes:

  1. the default environment is "production"
  2. be sure your DocumentRoot points to the /public folder of your app, not to the app root
Simone Carletti