Apache server debug commands cheat sheet for mac

Find where are the commands for apachectl and httpd

which apachectl
which httpd

Start, stop and restart the apache server with apachectl

apachectl start
apachectl stop
apachectl restart

Find out the config file locations and more details about the apache server using httpd

httpd -V

Check the configuration in httpd.conf for the apache server. This should show information for any syntax errors httpd.conf may have after it’s been edited.

apachectl configtest

Apache error log location

cat /var/log/apache2/error_log

On mac, you may find the following 2 config files for apache, however they have the same content, mac somehow copies the content from /etc/apache2/httpd.conf to /private/etc/apache2/httpd.conf, when /etc/apache2/httpd.conf is edited, the edits will automatically copied to /private/etc/apache2/httpd.conf

/etc/apache2/httpd.conf
/private/etc/apache2/httpd.conf

Search within Codexpedia

Custom Search

Search the entire web

Custom Search