2015-08-15 92 views
0

我使用这个命令启动Apache:service httpd startcentOS6如何在CentOS的启动Apache 7


今天我没有下载centOS7-64bit-minimal,想安装此之后启动Apache。
当我使用service httpd start,操作系统会告诉我一个消息说:

重定向为/ bin/systemctl启动httpd.service


我应该使用[[email protected]#] /bin/systemctl start httpd.service

我试图[[email protected]#] systemctl start httpd.service,似乎它是确定的,但在centOS6,有喜欢的东西[OK][FAILED]起始状态开始httpd或类似的东西之后,但在这个版本中,没有报告...
我正确吗?
是的httpd此命令后正确启动:
[[email protected]#] systemctl start httpd.service

在此先感谢...

回答

2

欢迎Systemd!这在最近的Red Hat之流更换service,如CentOS的7.你是正确的轨道上systemctl。现在,您不需要检查/var/log/messages/中的日志,而是使用journalctl来查看日志。要具体看,以“httpd”字样的日志,你可以看看“单位”与:

journalctl -u httpd 

其他有用的东西与journalctl

alias jc='journalctl -xa' # make a friendly alias for ease of typing 
jc -f # follow the current events 
0

你正在做的是正确的。 它将您的命令发送到httpd服务。您可以使用此命令查看最后发送的命令的状态:

service httpd status