如何在centOS 7中启动Apache [英] How start apache in centOS 7
问题描述
我正在使用以下命令启动Apache:centOS6
I was starting Apache using this command : service httpd start
in centOS6
今天,我确实下载了centOS7-64bit-minimal
,并希望在安装此软件后启动Apache.
当我使用service httpd start
时,操作系统将向我显示一条消息:
Today I did download centOS7-64bit-minimal
and wanted to start Apache after installing this.
When I use service httpd start
, os will show me a message says:
重定向到/bin/systemctl开始httpd.service
Redirecting to /bin/systemctl start 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
吗?
Should I use [root@localhost#] /bin/systemctl start httpd.service
??
I tried [root@localhost#] systemctl start httpd.service
and it seems it's OK, but in the centOS6
, there was starting status with something like [OK]
or [FAILED]
after starting httpd
or something like that, but in this version, there is no report...
Am I in right way?
Is httpd started correctly after this command :
[root@localhost#] systemctl start httpd.service
?
谢谢...
Thanks in advance...
推荐答案
欢迎使用Systemd!这已取代了最近的Red Hat同类产品(例如CentOS 7)中的service
.现在,您可以使用journalctl
来查看日志,而不是检查/var/log/messages/
中的日志.要查看特定于"httpd"的日志,可以使用以下命令查看"unit":
Welcome to Systemd! This has replaced service
in recent Red Hat ilk, such as CentOS 7. You are on the right track with systemctl
. Now, instead of checking logs in /var/log/messages/
, you use journalctl
to view logs. To look at logs specific to "httpd", you can look at the "unit" with:
journalctl -u httpd
与journalctl
有关的其他有用的事情:
Other useful things to do with journalctl
:
alias jc='journalctl -xa' # make a friendly alias for ease of typing
jc -f # follow the current events
这篇关于如何在centOS 7中启动Apache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!