我认为这是一个非常简单的过程。我想基本上重新加载 apache(因为我会经常添加/删除虚拟主机),但如果没有提示我输入密码,我似乎无法让 Apache 重新加载。
这是我的/etc/sudoers
文件:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# Host alias specification
# User alias specification
subzero ALL=(ALL) NOPASSWD:/etc/init.d/apache2 reload
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
我已经注销并重新登录,但仍然没有成功。知道为什么这可能不起作用吗?
我还尝试将其移至底部以防万一它是优先事项,但仍然没有运气。
你在打字
sudo /etc/init.d/apache2 reload
吗?你必须。你检查过
/var/log/auth.log*
吗/var/log/syslog*
?–