Basic Apache Commands


Get a Linode SliceI can highly recommend Linode installations. Easy, fully functional, optimized, ready to go, LAMP stack.


Basic Apache Commands

Starting Apache

> In console (either or)

  • sudo /etc/init.d/apache2 start
  • sudo service apache2 start

Restarting Apache

> In console

  • sudo /etc/init.d/apache2 restart
  • sudo service apache2 restart
  • sudo apachectl -k restart

Gracefully Kill Apache Children

(does not kill or stop Apache)
> In console

  • sudo apachectl -k graceful

Stopping Apache

> In console

  • sudo /etc/init.d/apache2 stop
  • sudo service apache2 stop
  • sudo apachectl -k stop

View Apache Logs

> In console

  • sudo tail -f /var/log/apache2/error.log
  • sudo tail -f /var/log/apache2/access.log
  • sudo tail -f /var/log/apache2/other_vhosts_access.log

Check access.log for attacks

> In console

  • grep “client denied” /var/log/apache2/error.log | tail -n 10

Removes sym-links that startup apache on boot

> In console

  • sudo update-rc.d -f apache2 remove