httpd服务器启动不了问题解决

时间:2022-06-01 20:54:31
 [root@Discuz subsys]# ps -ef|grep httpd
root      9606  8956  0 09:29 pts/1    00:00:00 grep httpd
[root@Discuz subsys]# service httpd restart
停止 httpd:[失败]
正在启动 httpd:[确定]
[root@Discuz subsys]# service httpd status
httpd 已死,但是 subsys 被锁

[root@Discuz logs]# tail -f /etc/httpd/log/error_log
[Fri Mar 13 09:05:36 2015] [notice] Digest: done
[Fri Mar 13 09:05:36 2015] [apc-error] apc_mmap: mkstemp on /tmp/apc.JLuoa0 failed: 

Permission denied
[Fri Mar 13 09:06:06 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Mar 13 09:06:07 2015] [notice] Digest: generating secret for digest authentication ...
[Fri Mar 13 09:06:07 2015] [notice] Digest: done
[Fri Mar 13 09:06:07 2015] [apc-error] apc_mmap: mkstemp on /tmp/apc.l2kVzi failed: 

root用户无法删除tmp目录下文件

 [root@Discuz tmp]# rm -rf *
rm: 无法删除"gates.lod": 权限不够
rm: 无法删除"gpg-HrbORJ": 权限不够
rm: 无法删除"moni.lod": 权限不够
rm: 无法删除"pulse-CD05lEqvCfi5": 权限不够
[root@Discuz tmp]#  


原因:疑似被攻击了,然后修改tmp权限,导致httpd起不来

解决:从其他服务器的/usr/bin目录拷贝chattr 命令至本地/usr/bin目录下

运行:

[root@Discuz tmp]# lsattr -a ../tmp/
-------------e- ../tmp/.X11-unix
-------------e- ../tmp/.esd-0
-------------e- ../tmp/.X0-lock
-------------e- ../tmp/moni.lod
-------------e- ../tmp/gpg-HrbORJ
----i--------e- ../tmp/.
-------------e- ../tmp/pulse-CD05lEqvCfi5
-------------e- ../tmp/.ICE-unix
-------------e- ../tmp/gates.lod
--------------- ../tmp/..
[root@Discuz tmp]# chattr -i /tmp
再次查看
[root@Discuz tmp]# lsattr -a ../tmp
-------------e- ../tmp/.X11-unix
-------------e- ../tmp/.esd-0
-------------e- ../tmp/.X0-lock
-------------e- ../tmp/.
-------------e- ../tmp/.ICE-unix
--------------- ../tmp/..

再[root@Discuz tmp]# mkdir a成功,

再service httpd restart 成功 
[root@Discuz tmp]# service httpd status
httpd (pid  12181) 正在运行...
[root@Discuz tmp]#