Forums.ATC.no

Teknisk => Generelt teknisk => Emne startet av: ATC på 27. ſeptember 2008, 18:24 pm

Tittel: Apache no longer has access to script files etc.
Skrevet av: ATC27. ſeptember 2008, 18:24 pm
After upgrading Apache, certain CGI scripts no longer seem to work while others work just fine. The log file "/var/log/httpd/error_log" contains messages like this:

"file permissions deny server execution: /path/to/myscript.cgi"

Other scripts will execute but can't access its data files. Some of them just fail in various weird ways, others complain about lack of file permissions.
Tittel: [Solved] Apache no longer has access to script files etc.
Skrevet av: ATC27. ſeptember 2008, 18:24 pm
Recent rpm versions of Apache run as apache/apache instead of nobody/nobody. The UID and GID are different, which effectively means Apache no longer has ownership of the relevant scripts and/or data files.

There are two ways to solve this problem:

* The quick and dirty one: change the UID of the "apache" user from the default 48 to 99 to match the "nobody" user.

* The proper one: change ownership of all files currently belonging to "nobody" to "apache". This MAY break other user-made services on the server so be careful.

Also, make sure to set the home directory in /etc/passwd to a directory where the apache/nobody user has write permissions, like /tmp (not recommended unless ALL users are trusted) or a directory created for that purpose (much safer)