[英]Fresh install: httpd.service: Unit not found
目前我正在嘗試遵循本指南: 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]$
任何人都可以讓我知道可能導致這種情況的原因嗎?
提前致謝!
我也遇到了同樣的錯誤,這就是我解決問題的方式。
登錄到計算機后:
這應該可以解決您的問題。 祝好運
您是否要使用CentOS 7為Compute Engine VM實例安裝WordPress?
如果是這種情況,您可以按照此處[1]的說明為VM設置LAMP,然后下載您選擇的WordPress版本[2]並將其安裝在VM上。
我了解您已經使用Centos 7成功設置了VM實例,對嗎? 假設您可以從[1]中看到,對於CentOS 7,這些將是執行此安裝的命令:
1)更新並安裝Apache和PHP:
sudo yum check-update
sudo yum -y install httpd php
2)啟動Apache服務:
sudo service httpd start
sudo chkconfig httpd on
3)安裝,配置和啟動數據庫:
sudo yum -y install httpd mariadb-server php php-mysql
sudo systemctl start mariadb
4)配置MySQL(如果需要,請為root用戶設置密碼):
sudo mysql_secure_installation
5)重啟Apache sudo服務httpd重啟
設置完MySQL之后,您將必須為WordPress安裝創建一個數據庫。
按照此步驟,您將在Compute Engine VM實例上安裝並運行Apache,MySQL和PHP。
然后,您可以下載您選擇的WordPress版本[2],解壓縮文件並通過訪問您的IP地址和WordPress的下載文件夾來安裝WordPress。 例如, http:// YOUR_PUBLIC_VM_IP_ADDRESS / wordpress 。
系統將要求您輸入數據庫名稱,用戶名和密碼。 這將允許WordPress代表您創建wp-config.php文件並繼續安裝。
此時,您應該已經使用CentOS 7在您的Compute Engine VM實例上安裝了WordPress。
在Compute Engine VM實例上安裝WordPress的更簡單方法是使用Cloud Platform Console中的Marketpace。 轉到“產品和服務”菜單>“市場”,然后搜索“ Wordpress”。 您將看到許多不同的選項,以在Compute Engine VM實例中啟動WordPress。 但是,似乎Debian是用於這些選項的默認操作系統。
鏈接:
[1] https://cloud.google.com/community/tutorials/setting-up-lamp
Fabian Garcia 的解決方案仍然有效。 我只是偶然發現了這一點,記得有這些錯誤。 chkconfig on resolves failed to start http.service: unit not found
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.