Starting and Stopping Apache with sudo
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.
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.
精彩评论