views:

33

answers:

1

I can run apachectl fine as a regular user, but when I sudo apachectl, I get sudo: apachectl: command not found. Any thoughts? I have the apache /bin directory in my path.

A: 

From the fine manual:

By default, the env_reset sudoers option is enabled. This causes commands to be executed with a minimal environment containing TERM, PATH, HOME, SHELL, LOGNAME, USER and USERNAME in addition to variables from the invoking process permitted by the env_check and env_keep sudoers options. There is effectively a whitelist for environment variables.

You could configure sudo so that the environment is not reset, or so the apachectl command is looked up in the correct path, or you could create a symlink to it in the standard path.

jleedev