http://hi.baidu.com/maclinuxp/item/28d8b62828ee1d88af48f585
https://bugzilla.redhat.com/show_bug.cgi?id=730832
http://forums.fedoraforum.org/showthread.php?t=272154
[root@localhost ~]# service httpd start
Starting httpd (via systemctl): Job failed. See system logs and 'systemctl status' for details.
[FAILED]
[root@localhost ~]# systemctl --failed
UNIT LOAD ACTIVE SUB JOB DESCRIPTION
httpd.service loaded failed failed The Apache HTTP Server (prefork MPM)
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
JOB = Pending job for the unit.
1 units listed. Pass --all to see inactive units, too.
[root@localhost ~]# systemctl status httpd.service
问题描诉:
service httpd start
Starting httpd (via systemctl): Job failed. See system logs and 'systemctl status' for details.
这里有两个文件可以查看
1./var/log/httpd/error-log
基本没收获,这个问题根本没有写这个文件
2./var/log/messages
这个文件基本所有程序都会向里面写东西,我先清空该文件,方便我们观察错误
echo "" >/var/log/messages
然后执行 service httpd start
当然肯定错误还是有,这个时候我们在查看message文件
[root@localhost log]# more messages
Feb 18 21:06:31 localhost kernel: [13315.945323] intel ips 0000:00:1f.6: MCP lim
it exceeded: Avg temp 9279, limit 9000
Feb 18 21:06:34 localhost httpd[15298]: httpd: Could not reliably determine the
server's fully qualified domain name, using localhost.localdomain for ServerName
Feb 18 21:06:34 localhost httpd[15298]: (98)Address already in use: make_sock: c
ould not bind to address [::]:443
Feb 18 21:06:34 localhost httpd[15298]: (98)Address already in use: make_sock: c
ould not bind to address 0.0.0.0:443
Feb 18 21:06:34 localhost httpd[15298]: no listening sockets available, shutting
down
==============
可以看出 我们电脑的443端口被其他程序占用了
我们来查看该端口到底运行的什么程序----------
[root@localhost log]# lsof -i:443
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
hostd-wor 1722 root 28u IPv4 23805 0t0 TCP *:https (LISTEN)
hostd-wor 1722 root 29u IPv6 23806 0t0 TCP *:https (LISTEN)
好了,看得出 是 hostd-wor 命令 占用了改端口。果断杀之
[root@localhost log]# kill 1722
然后在启动试试
[root@localhost log]# service httpd start
Starting httpd (via systemctl): [确定]
=============
看样子是成功了。。。。。。。。。。。。
然后我们改变一下端口试试,httpd 默认的监听端口是 80,我改为 9999
这是因为 9999端口被selinx 禁止了
我们添加上
semanage port -a -t http_port_t -p tcp 9999
然后在启动就行了