Skip to main content

A few of my most commonly used Apache commands. Start, stop, restart and more...

sudo apachectl stop
sudo apachectl start

sudo apachectl restart
sudo apachectl graceful # (graceful restart)

# View Apache logs in real time using tail -f. 
# The command can be terminated using CTRL-C.
tail -f /private/var/log/apache2/access_log
tail -f /private/var/log/apache2/error_log
tail -f /Applications/MAMP/logs/php_error.log # php error log

# Clear Apache logs
cat /dev/null > /private/var/log/apache2/access_log
cat /dev/null > /private/var/log/apache2/error_log