views:

41

answers:

3

A friends of mine have a shared hosting with many sites hosted. There is ruby on rails, php, xslt/xml sites using mysql or postgress. Today one of the xslt sites displays this error:

Passenger error #2
An error occurred while trying to access '..../config/environment.rb': Cannot stat '..../config/environment.rb': Permission denied (13)
Apache doesn't have read permissions to that file. Please fix the relevant file permissions.

This is, as I Know, a ruby error (*.rb), but there is no ruby app here! And no any config/ catalogue. The error log says:

(13)Permission denied: /home/..../.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

The .htaccess file in the htdocs directory is present and have 777 permission for now. I haven't any idea what does it mean.

A: 

I think the configuration of either your apache or nginx state that passenger is enabled. Check for a "passenger_enabled on" on nginx or "PassengerEnabled on" on apache in your webserver configuration file. Then disable it on top level or in the virtual host that runs a php website.

hellvinz
There is no nginx here. In config file for this site's virtual host there is now such option.
elisium
A: 

You could instead try to put "PassengerEnabled on" in a .htaccess file in the public_html folder (or equivalent, e.g. httpdocs). Also, make sure the .htaccess file is readable (e.g. 644 permissions in Linux), as that's what the error in your error log is saying.

Jaap Haagmans
I've set 777 on .htaccess in htdocs, to ensure any user can read-write it for now. Added PassengerEnabled to it, but no luck. Also restarted apache on server after adding. The Passenger error and error in the log did not changed any time during this day. I've played a lot with permissions today.
elisium
Of course I meant "PassengerEnabled off" in this case. Sorry about that.
Jaap Haagmans
A: 

Looks like there are some leaks in the web host's configuration. Passenger (which is like a mod_rails apache extension) is looking to load a particular Rails app's configuration, presumably not yours. If you're doing something important (like an e-commerce site) I'd run far away from the hosting company. Otherwise you'll have to get this resolved through them.

Mark Thomas