【发布时间】:2018-12-09 01:08:52
【问题描述】:
目前我正在尝试遵循本指南: https://marxtudor.com/how-to-install-wordpress-using-ssh-on-centos-vps/
我正在使用 Google Cloud Platform(免费版进行测试)并且创建了一个全新的 CentOS 7 虚拟机。上面的指南是我填写的第一个命令,我不断收到此错误:
我已经学习了很多教程,创建了一个新的 VM,但我一直遇到这个错误,它不知道 httpd 命令。我什至删除了项目并重新开始,但仍然没有运气。
[rsa-key-XXXXXX]$ sudo service httpd restart
Redirecting to /bin/systemctl restart httpd.service
Failed to restart httpd.service: Unit not found.
[rsa-key-XXXXXX]$ httpd -t
-bash: httpd: command not found
[rsa-key-XXXXXX]$
谁能告诉我这是什么原因造成的?
提前致谢!
【问题讨论】:
-
它正在寻找一个
httpd.service文件。 systemd 已在 CentOS 7 中替换了 init。带有 CentOS 7 的 httpd 库存版本应该可以正常工作。您必须先使用systemctl enable httpd启用它。另请查看 rpmnet-tools,它将为 CentOS 7 提供一些初始化功能。如果您使用自定义 httpd 构建,则需要 httpd.service 文件供 systemd 启动它。
标签: wordpress apache centos google-cloud-platform centos7