基本上我正在尝试从 php 网页重新启动服务。
这是代码:
<?php
exec ('/usr/bin/sudo /etc/init.d/portmap restart');
?>
但是,在 中/var/log/httpd/error_log
,我得到
无法更改为 sudoers gid:不允许操作
在 /var/log/messages 中,我得到
9 月 22 日 15:01:56 ri 内核:审计(1222063316.536:777):avc:拒绝 { getattr } for pid=4851 comm="sh" name="var" dev=dm-0 ino=114241 scontext=root:system_r :httpd_sys_script_t tcontext=system_u:object_r:var_t tclass=dir
Sep 22 15:01:56 ri kernel: audit(1222063316.549:778): avc: denied { setrlimit } for pid=4851 comm="sudo" scontext=root:system_r: httpd_sys_script_t tcontext=root:system_r:httpd_sys_script_t tclass=process
Sep 22 15:01:56 ri kernel: audit(1222063316.565:779): avc: denied { read } for pid=4851 comm="sudo" name="shadow" dev= dm-0 ino=379669 scontext=root:system_r:httpd_sys_script_t tcontext=system_u:object_r:shadow_t tclass=file
9 月 22 日 15:01:56 ri kernel: audit(1222063316.568:780):avc: denied { read } for pid=4851 comm="sudo" name="shadow" dev=dm-0 ino=379669 scontext=root:system_r :httpd_sys_script_t tcontext=system_u:object_r:shadow_t tclass=file
Sep 22 15:01:56 ri kernel: audit(1222063316.571:781):avc: denied { setgid } for pid=4851 comm="sudo" capability=6 scontext=root :system_r:httpd_sys_script_t tcontext=root:system_r:httpd_sys_script_t tclass=capability
Sep 22 15:01:56 ri kernel: audit(1222063316.574:782):avc: denied { setuid } for pid=4851 comm="sudo" capability=7 scontext =root:system_r:httpd_sys_script_t tcontext=root:system_r:httpd_sys_script_t tclass=能力
9 月 22 日 15:01:56 ri kernel: audit(1222063316.577:783):avc: denied { setgid } for pid=4851 comm="sudo" capability=6 scontext=root:system_r:httpd_sys_script_t tcontext=root:system_r:httpd_sys_script_t tclass =能力
在我的 visudo 中,我添加了这些行
用户别名 WWW=apache
WWW ALL=(ALL) NOPASSWD:ALL
你能帮我么 ?难道我做错了什么 ?
谢谢你的帮助,
蒂邦