Apache Commands when Using Ubuntu

If you use Ubuntu linux, you can use the commands below to control the apache webserver.

Stop apache:

sudo systemctl stop apache2

Start apache:

sudo systemctl start apache2

Restart apache:

sudo systemctl restart apache2

Reload configuration:

sudo systemctl reload apache2

Disable automatic start of apache:

sudo systemctl disable apache2

Enable automatic start of apache:

sudo systemctl enable apache2

Test apache configuration:

sudo apachectl configtest