Rails, Phusion Passenger, Apache httpd Permission Denied error - Resolved one way.

Posted by Rajesh Shetty on February 25, 2009

This blog post is long due. Once again its a quick tip which can save lot of developers time in setting up rails with phusion passenger when they run into permission denied error.

After installing Passenger Phusion on a existing Apache HTTP web server when I started the Apache server and try to launch the app in browser I was getting following error.

[client ::1] (13)Permission denied: access to /favicon.ico denied, referer: http://localhost/

[client ::1] (13)Permission denied: access to / denied


After fixing obvious issues around permission like below, still no luck.
  • chmod on rails directory , so that Apache/Phusion would have all the permission to access the rails directory
  • Adjusting VirtualHost directory permission in Apache config (httpd.conf) file to allow all which would look something like this

<VirtualHost *:80>
ServerName localhost
DocumentRoot  <rails app directory>
<Directory  <rails app directory> >
Allow from all
</Directory>
RailsEnv development
RailsDefaultUser root
</VirtualHost>

As I was going thru httpd.conf in detail, I noticed that Apache kicking off the process under user  ”Daemon” every time I started the web server. This surely sounded like a issue to me and can lead to permission problems. So it was just a matter of changing this user to the my default user and bounce the server. This finally fixed it.
Look for following in your httpd.conf

User daemon


change this to

User <default machine user>


Here is one reference which talks about solution similar to what I explained above.

Following are some references for installing phusion passenger

Blogged with MessageDance using Gmail | Reply On Twitter

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

Comments