开发者

Starting and Stopping Apache with sudo

开发者 https://www.devze.com 2023-01-18 08:10 出处:网络
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 fin

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号