How did I install Apache onto my MacBook?
Apache is already pre-installed on my MacBook. I tried using the below commands to install Apache before I realized that it was pre-installed.
- brew install homebrew/apache/httpd24
- mkdir -p ~/Library/LaunchAgents
- ln -sfv /usr/local/opt/httpd24/*.plist ~/Library/LaunchAgents
- launchctl load ~/Library/LaunchAgents/homebrew.mxcl.httpd24.plist
- Edit the /usr/local/etc/apache2/2.4/httpd.conf
How can we configure the pre-installed Apache to start automatically?
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist
How can we prevent the pre-installed Apache from starting automatically?
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
Where is the configuration file for the pre-installed Apache?
Where are the log files generated by the pre-installed Apache?
What is the default DocumentRoot used by the pre-installed Apache?
How can we check the syntax of the configuration file?
/usr/sbin/httpd -S apachectl configtest
How can we stop Apache?
How can we start Apache?