[英]How start apache in centOS 7
我正在使用以下命令启动Apache:在centOS6
service httpd start
今天,我确实下载了centOS7-64bit-minimal
并希望在安装之后启动Apache。
当我使用service httpd start
,os会显示一条消息:
重定向到/ bin / systemctl启动httpd.service
我应该使用[root@localhost#] /bin/systemctl start httpd.service
吗?
我试过[root@localhost#] systemctl start httpd.service
,似乎还可以,但是在centOS6
,启动httpd
或类似的东西后,启动状态像[OK]
或[FAILED]
一样,但是在此版本中,没有报告...
我做对了吗?
在此命令后httpd是否正确启动:
[root@localhost#] systemctl start httpd.service
吗?
提前致谢...
你做对了。 它将您的命令发送到httpd服务。 您可以使用以下命令查看上次发送的命令的状态:
service httpd status
欢迎来到Systemd! 这已经更换service
在最近的Red Hat之流,如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
必须更改触发httpd服务启动的方法。建议的方法:
systemctl启动httpd.service
这将在Linux EC2实例中有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.