【问题标题】:How start apache in centOS 7如何在 centOS 7 中启动 apache
【发布时间】:2015-08-15 04:19:13
【问题描述】:

我正在使用此命令启动 Apache:service httpd start in centOS6


今天我确实下载了centOS7-64bit-minimal 并想在安装后启动 Apache。
当我使用service httpd start 时,操作系统会向我显示一条消息:

重定向到 /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?

提前致谢...

【问题讨论】:

    标签: linux apache centos7


    【解决方案1】:

    你做得对。 它将您的命令发送到 httpd 服务。您可以使用此命令查看上次发送命令的状态:

    service httpd status
    

    【讨论】:

      【解决方案2】:

      欢迎来到 Systemd!这已在最近的 Red Hat 同类产品(例如 CentOS 7)中取代了 service。您在 systemctl 的正确轨道上。现在,您可以使用journalctl 查看日志,而不是查看/var/log/messages/ 中的日志。要查看特定于“httpd”的日志,您可以查看“单元”:

      journalctl -u httpd
      

      journalctl 相关的其他有用的事情:

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

      【讨论】:

        【解决方案3】:

        必须更改触发httpd服务启动.. 建议方式:

        systemctl 启动 httpd.service

        这将有助于 Linux EC2 实例.. 不过帮助了我

        【讨论】:

          猜你喜欢
          • 2016-11-12
          • 2018-02-12
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2023-04-06
          • 2020-07-09
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多