Você pode ler o código-fonte de /usr/sbin/apachectl
.
apachectl start/restart/stop
chamadas launchctl load -w $LAUNCHD_JOB
, e o trabalho é uma configuração do plist de inicialização /System/Library/LaunchDaemon/org.apache.httpd.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>EnvironmentVariables</key>
<dict>
<key>SERVER_INSTALL_PATH_PREFIX</key>
<string>/Applications/Server.app/Contents/ServerRoot</string>
<key>XPC_SERVICES_UNAVAILABLE</key>
<string>1</string>
</dict>
<key>Label</key>
<string>org.apache.httpd</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/httpd-wrapper</string>
<string>-D</string>
<string>FOREGROUND</string>
<string>-f</string>
<string>/Library/Server/Web/Config/apache2/httpd_server_app.conf</string>
<string>-D</string>
<string>WEBSERVICE_ON</string>
</array>
</dict>
</plist>
O trabalho chama httpd-wrapper
com o arquivo /Library/Server/Web/Config/apache2/httpd_server_app.conf
config.
sudo apachctl
sem nenhum parâmetro, que chamará httpd
com o arquivo de configuração padrão ( /etc/apache2/httpd.conf
).