Linux

如果 Apache IS 已安裝並正在執行,“apache2ctl:: command not found”是什麼意思?

  • October 15, 2010

嘗試執行命令“apache2ctl restart”並收到此消息“apache2ctl:: command not found”——事情是,Apache IS 已安裝,正在執行,我現在正在伺服器上積極進行開發……任何想法?

上下文: VM 上 CentOS-5.5 上的 sudo 訪問


**更新:**好消息,重新啟動 Apache,壞消息 500 錯誤,仍然在進步…… :-)

[username@VMname /]$ sudo /etc/init.d/httpd restart
[username@VMname /]$ sudo /etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

看起來apache2ctl不在你的路徑中。試試這個:

$ sudo /usr/sbin/apache2ctl restart

上面的位置反映了apache2ctl在 Ubuntu 中的位置。我不確定 CentOS 上的預設位置在哪裡。如果上述命令不起作用,您可以通過以 root 身份執行以下命令來找到該位置:

$ which apache2ctl

引用自:https://serverfault.com/questions/191180