Linux Example | Start, Stop or Restart Apache Server in Ubuntu

This linux example code will show us how to start, stop and restart apache server in ubuntu.

Ubuntu 18.04, 16.04, and Debian 9.x

Start

sudo systemctl start apache2

Stop

sudo systemctl stop apache2

Restart

sudo systemctl restart apache2

Ubuntu 14.10 or older Debian

start

sudo service apache2 start

stop

sudo service apache2 stop

Restart

sudo service apache2 restart