Risposte:
OS X fornisce launchctlper controllare quali demoni vengono avviati al momento dell'avvio.
Per interrompere e disabilitare Apache:
Digitare il comando seguente (digitare la password di accesso quando sudorichiesto):
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
Qualche parola sulla launchctl's -wopzione
L' -wopzione è il proiettile d'argento per arrestare / disabilitare Apache. Indica launchctldi svolgere il proprio lavoro indipendentemente dalle impostazioni di configurazione che altrimenti impedirebbero di scaricare il servizio, come spiegato in 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.
(Si scopre che, in OS X Mavericks (10.9), "altrove su disco" è /private/var/db/launchd.db/com.apple.launchd/overrides.plist.)
L' -wopzione è indispensabile se hai avviato Apache con apachectl start: come spiegato in questa risposta del Superutente . apachectlnon solo avvia Apache ma si modifica anche in /private/var/db/launchd.db/com.apple.launchd/overrides.plistquesto modo:
<key>org.apache.httpd</key>
<dict>
<key>Disabled</key>
<false/>
</dict>
In questo caso particolare puoi anche usare apachectl:
sudo apachectl stop
per interrompere Apache e impostare Disabledsu true.
-w: sudo launchctl -w unload .... Se non aiuta, potresti pubblicare l'output di ps -ef|grep httpd|grep -v grep?
-wprima, stesso risultato. Ecco l'output: pastebin.com/h14t8fEv
sudo launchctl1 ...restituisce un messaggio di errore? Potresti pubblicare l'output di grep apache /var/log/com.apple.launchd/launchd-shutdown.system.loge sudo grep apache /var/log/system.log?
sudo: launchctl1: command not founded ecco l'output: pastebin.com/raw.php?i=zxKvYV4i
sudo apachectl startil demone di avvio sembra essere riattivato dopo il riavvio.