Using sudo /etc/init.d/httpd start complains for log file rights

Posted by SCO on Server Fault See other posts from Server Fault or by SCO
Published on 2012-06-24T14:04:46Z Indexed on 2012/06/24 15:17 UTC
Read the original article Hit count: 223

Filed under:
|
|

I created a custom log directory with the root account, and chmoded it to 777 teporarily.

ls -la /var/mylogs/log/
total 16
drwxrwxrwx 2 root root 4096 Jun 24 06:27 .
drwxr-xr-x 5 root root 4096 Jun 24 06:25 ..

When I try to start the service from a user (lets say "myuser", which is in the sudoers files as myuser ALL=(ALL) ALL), it fails because of the permissions :

sudo /etc/init.d/httpd start

Starting httpd: (13)Permission denied: httpd: could not open error log file /var/mylogs/log/httpd_error.log.
Unable to open logs

However, the following is successfull :

sudo bash
/etc/init.d/http start

So I guess these two methods are not equivalent, although to me doing sudo was the same than logging into the root account and issuing the commands.

Any clue ?

Thank you !

© Server Fault or respective owner

Related posts about apache2

Related posts about httpd