Apache Cheat sheet

  • by

Useful list for setup and maintenace

sudo systemctl start/restart/stop/status httpd.service
sudo systemctl start httpd

auto restart on server reboot:
sudo systemctl enable httpd

check Apache status:
ps -eo comm,etime,user | grep httpd
systemctl status httpd | grep -i active
apachectl status

Check on the setup files:
httpd -t
httpd -S

– all files available
sudo ls -lh /var/log/httpd*
– read the logs
tail -f /var/log/httpd/access_log
tail -f /var/log/httpd/error_log

kill a service:
– This is a generic command but can be useful if Apache is jammed – recently happened during an update
sudo kill [service pid id]