Apache 2 Basic Terminal Commands

Published: August 18, 2014 | Last Modified: August 18, 2014

Debian & Apache 2

Start/Stop/Status

sudo service apache2 start
sudo service apache2 stop
sudo service apache2 status

New vhost sites

sudo a2ensite local.newsite.com

or

sudo a2ensite local.newsite.com.conf

add a new local site - afterwards run sudo service apache2 reload

sudo service apache2 reload

reload apache

CentOS

Start/Stop/Status

sudo /etc/init.d/httpd start
sudo /etc/init.d/httpd stop
sudo /etc/init.d/httpd restart
sudo /etc/init.d/httpd status