How do I restart Apache?

How do I restart Apache?

Author: stanislav, 2010-10-12

5 answers

You need to run the /etc/init.d/apache2 restart command.

 17
Author: Nicolas Chabanovsky, 2010-10-12 16:57:31

This is a "hard" restart:

sudo /etc/init.d/apache2 restart

Restart without killing the process, but simply applying the new configuration:

sudo /etc/init.d/apache2 reload
 8
Author: alexeych, 2016-11-25 22:27:53

To restart, use:

sudo apache2ctl restart

To learn more about the command, call help:

man apache2ctl
 6
Author: simpson, 2016-11-25 22:27:32
sudo service apache2 restart

More details here: https://askubuntu.com/questions/6358/how-do-you-restart-apache

 3
Author: Vladimir Ch, 2017-04-13 12:23:04

If installed systemd, then you can restart using it:

sudo systemctl restart apache2.service
 2
Author: Yehor Smoliakov, 2016-11-25 22:23:26