Odpowiedzi:
OS X zapewnia launchctlkontrolę, które demony są uruchamiane podczas rozruchu.
Aby zatrzymać i wyłączyć Apache:
Wpisz następujące polecenie (wpisz hasło logowania, gdy sudoo to poprosi):
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
Kilka słów na temat launchctl„s -wopcji
-wOpcją jest srebrna kula na zatrzymanie / wyłączenie Apache. Mówi, launchctlaby wykonać swoje zadanie bez względu na ustawienia konfiguracji, które w przeciwnym razie uniemożliwiłyby mu zwolnienie usługi, jak wyjaśniono w man launchctl:
-w Overrides the Disabled key and sets it to false or true for the load and
unload subcommands respectively. In previous versions, this option would
modify the configuration file. Now the state of the Disabled key is stored
elsewhere on- disk in a location that may not be directly manipulated by any
process other than launchd.
(Okazuje się, że w OS X Mavericks (10.9) „gdzie indziej na dysku” to /private/var/db/launchd.db/com.apple.launchd/overrides.plist.)
Ta -wopcja jest niezbędna, jeśli uruchomiłeś Apache z apachectl start: jak wyjaśniono w odpowiedzi Superuser . apachectlnie tylko uruchamia Apache, ale także modyfikuje w /private/var/db/launchd.db/com.apple.launchd/overrides.plistnastępujący sposób:
<key>org.apache.httpd</key>
<dict>
<key>Disabled</key>
<false/>
</dict>
W tym konkretnym przypadku możesz również użyć apachectl:
sudo apachectl stop
zatrzymać Apache i ustawić Disabledna true.
-w: sudo launchctl -w unload .... Jeśli to nie pomoże, możesz opublikować wynik ps -ef|grep httpd|grep -v grep?
-wwcześniej, ten sam wynik. Oto wynik: pastebin.com/h14t8fEv
sudo launchctl1 ...zwraca komunikat o błędzie? Czy możesz opublikować dane wyjściowe grep apache /var/log/com.apple.launchd/launchd-shutdown.system.logi sudo grep apache /var/log/system.log?
sudo: launchctl1: command not foundi oto wynik: pastebin.com/raw.php?i=zxKvYV4i
sudo apachectl startgdy uruchamiam, demon uruchamiania wydaje się być ponownie aktywowany po ponownym uruchomieniu.