Error Message in Browser

Support and queries relating to all previous versions of ZoneMinder
Locked
aburgett
Posts: 1
Joined: Thu Sep 15, 2005 11:19 pm

Error Message in Browser

Post by aburgett »

Everything installed OK, permissions look fine--must be something minor.

Warning: fopen(/usr/local/etc/zm.conf): failed to open stream: Permission denied in /usr/local/apache2/htdocs/zm_config.php on line 29
Could not open config file.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

i know this much its a permission thing, what user are you using to run httpd?

James

well i think i know
Ruler
Posts: 235
Joined: Mon Nov 08, 2004 9:02 pm
Location: Bay City, MI

Post by Ruler »

Did you ever figure this one out? I'm getting the same identical thing on a brand new system (Slackware 10.1) - I get 'Could not open config file' in my browser when I try to open the URL and the following is in the /var/log/apache/error_log There are no errors shown in any of the ZM log files.

Code: Select all

[error] PHP Warning:  fopen(/usr/local/etc/zm.conf): failed to open stream: Permission denied in /video/html-root/zmconfig.php on line 29
(Note: I've got a RAID set up under /video and that's where I've got apache and zoneminder pointed for the web root directory, which is why /video/html-root is listed as the location of zmconfig.php)

I'm running Apache 1.3.33 and PHP 4.3.10 as shipped with slack 10.1, although I'm fairly certain these aren't the culprits as I have another ZM box runinng the same combination that never had this problem. That machine is running 1.21.0 though - I put 1.21.3 on this new one.

I've even su-ed to apache and cat-ed the file to verify that it's not a file system-level permission problem. I'm going to continue investigating, but I'm not real sure where to go from here and could use some help to at least point me in the right direction if not solve the problem. This is the only post that came up in a search for this problem.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Who owns /usr/local/etc/zm.conf ? Should the same permisions as the web-user has read access.
Regards,
Cordel
Ruler
Posts: 235
Joined: Mon Nov 08, 2004 9:02 pm
Location: Bay City, MI

Post by Ruler »

apache:apache owns it and it's set to rw-------
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

If you check the running process for apache what user is is running as?

I can't thing of anything thing else other than the process has no access to the config file due to missmatched permisions. If I think of anything else I'll let ya know but thats all I got on this one.
Regards,
Cordel
Ruler
Posts: 235
Joined: Mon Nov 08, 2004 9:02 pm
Location: Bay City, MI

Post by Ruler »

*THAT*'s interesting... I have apache set to start at boot time; I never changed this from the default behavior. The first one is firing as root and the child processes are starting up as 'nobody'. I would be willing to bet that you hit the nail right on the head with that one cordel.

Now how do I go about changing what user a startup process runs as??? (It's not something that I've ever had need to do before.)
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

couple things, If this has been running a while something must have changed. check the config dir for apache ( /etc/httpd/conf or maybe /etc/apache/conf ) and see if there is a backed up version of httpd.conf
There are two possible settings in the file:
Both in /etc/httpd/conf/httpd.conf

First is the user and group settings, that tell apache what to run as.

Second is a new directives that is not fully functioning yet that you want to make sure your not makeing use of is AssignUserID and ChildPerUserID ( I really wish these worked )

Before changing anything, make sure you backup this file.
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.backup

Regards,
Cordel
Ruler
Posts: 235
Joined: Mon Nov 08, 2004 9:02 pm
Location: Bay City, MI

Post by Ruler »

Nevermind - found it.

/etc/apache/httpd.conf has a User and Group option in it that you can set to what user to run apache as. :)

Changed these, restarted the daemons, and voila! No more problem and the zoneminder console pops right up. :D

Thanks for your help Cordel.



*edit - DOH! I was too slow to save you the work of typing. Thanks again though.*
Locked