From Lyceum
Jump to: navigation, search

Add to /etc/sudoers the commands you wish apache to run, for example:

apache ALL=(ALL) NOPASSWD: /usr/bin/sudo, /usr/bin/pkill, /usr/sbin/dhcpd

Also ensure there is no line containing:

Defaults    requiretty

If requiretty is enabled, you will likely see the following errors logged by sudo:

#tail /var/log/secure
Mar 26 09:58:16 install-gw /usr/bin/sudo:   apache : sorry, you must
have a tty to run sudo ; TTY=unknown ; PWD=/var/www/pxe ; USER=root ;
COMMAND=/usr/bin/pkill dhcpd

Also, ensure the binaries being called have permissions allowing others to execute them:

[[email protected] pxe]# ls -lha /usr/sbin/dhcpd
-rwxr-xr-x  1 root root 552K Mar 12 09:33 /usr/sbin/dhcpd