How to start / stop / restart Apache server on Ubuntu / Linux

by cybersal

Following post show how to you start / stop / restart Apache server from linux command line.

There are various command set to start / stop / restart your Apache server from command line.

  • systemctl command (works with Ubuntu 16.04LTS and above)
  • /etc/init.d/apache2 (script to restart under Debian or Ubuntu Linux)
  • service command (works with most of the Debian and Ubuntu distribution)
  • apache2ctl command (works with all Linux & Unix based systems)
systemctl 

$ sudo systemctl start apache2.service

$ sudo systemctl stop apache2.service

$ sudo systemctl restart apache2.service

$ sudo systemctl status apache2.service
/etc/init.d/apache2

$ sudo /etc/init.d/apache2 start

$ sudo /etc/init.d/apache2 restart

$ sudo /etc/init.d/apache2 stop
service 

$ sudo service apache2 restart 

$ sudo service apache2 stop 

$ sudo service apache2 start 

$ sudo service apache2 reload (Reloads Apache Server gracefully)
apache2ctl 

$ sudo apache2ctl start 

$ sudo apache2ctl stop 

$ sudo apache2ctl restart 

$ sudo apache2ctl graceful (Reloads Apache Server gracefully)

Start / Stop/ Restart Apache server

Related Articles

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy