简体   繁体   English

如何在centOS 7中启动Apache

[英]How start apache in centOS 7

I was starting Apache using this command : service httpd start in centOS6 我正在使用以下命令启动Apache:在centOS6 service httpd start


Today I did download centOS7-64bit-minimal and wanted to start Apache after installing this. 今天,我确实下载了centOS7-64bit-minimal并希望在安装之后启动Apache。
When I use service httpd start , os will show me a message says: 当我使用service httpd start ,os会显示一条消息:

Redirecting to /bin/systemctl start httpd.service 重定向到/ bin / systemctl启动httpd.service


Should I use [root@localhost#] /bin/systemctl start httpd.service ?? 我应该使用[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... 我试过[root@localhost#] systemctl start httpd.service ,似乎还可以,但是在centOS6 ,启动httpd或类似的东西后,启动状态像[OK][FAILED]一样,但是在此版本中,没有报告...
Am I in right way? 我做对了吗?
Is httpd started correctly after this command : 在此命令后httpd是否正确启动:
[root@localhost#] systemctl start httpd.service ? [root@localhost#] systemctl start httpd.service吗?

Thanks in advance... 提前致谢...

you are doing it right. 你做对了。 It sends your command to httpd service. 它将您的命令发送到httpd服务。 You can use this command to see status of last command sent: 您可以使用以下命令查看上次发送的命令的状态:

service httpd status

Welcome to Systemd! 欢迎来到Systemd! This has replaced service in recent Red Hat ilk, such as CentOS 7. You are on the right track with systemctl . 这已经更换service在最近的Red Hat之流,如CentOS的7.你在正确的轨道上systemctl Now, instead of checking logs in /var/log/messages/ , you use journalctl to view logs. 现在,您无需使用/var/log/messages/ ,而使用journalctl来查看日志。 To look at logs specific to “httpd”, you can look at the “unit” with: 要查看特定于“ httpd”的日志,可以使用以下内容查看“单位”:

journalctl -u httpd

Other useful things to do with journalctl : journalctl相关的其他有用的事情:

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

Triggering the httpd service start must be changed.. Suggested way: 必须更改触发httpd服务启动的方法。建议的方法:

systemctl start httpd.service systemctl启动httpd.service

This would help in Linux EC2 instances.. Helped me though 这将在Linux EC2实例中有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM