How to Restart, Stop, Start Apache 2 Web Server on Linux

I write a weekly newsletter, sharing my articles and thoughts on building and running websites. There’s no spam and it’s totally free.
Join 1500+ subscribers!

There are several methods to start, stop, and restart the Apache 2 web server on Linux. Choose the one that works for you, depending on your Linux distribution.


To restart Apache 2 web server on Linux, use one of these commands:

sudo service apache2 restart
sudo /etc/init.d/apache2 restart
sudo service httpd restart
sudo /etc/init.d/httpd restart
sudo systemctl restart httpd.service
sudo apachectl -k restart
sudo apachectl -k graceful
service apache2 restart
service apache2 restart

To stop Apache 2 web server on Linux, use one of these commands:

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

To start Apache 2 web server on Linux, use one of these commands:

sudo service apache2 start
sudo /etc/init.d/apache2 start
sudo service httpd start
sudo /etc/init.d/httpd start
sudo systemctl start httpd.service
sudo apachectl -f /usr/local/apache2/conf/httpd.conf
service apache2 start
service apache2 start

Bonus tip: To check Apache 2 status, use one of these commands:

sudo service apache2 status
sudo /etc/init.d/apache2 status
sudo service httpd status
sudo /etc/init.d/httpd status
sudo systemctl status httpd.service
service apache2 status
service apache2 status
I write a weekly newsletter, sharing my articles and thoughts on building and running websites. There’s no spam and it’s totally free. Join 1500+ subscribers!