How To Start, Stop, Restart and Manage Apache Web Server In Linux? – POFTUT

How To Start, Stop, Restart and Manage Apache Web Server In Linux?

Apache or Apache 2 is most popular web server in the internet. We have setup our Apache server and made some configuration change we want to active the changes. To active the changes Apache server must be restart. In this post we will look how to restart Apache in different ways in Ubuntu and CentOS.

Using Systemctl

Systemctl is tool for managing Linux services, operating system state, run levels etc. Systemctl became very popular and currently supported CentOS, Fedora, Ubuntu as default service manager.


Using Systemctl

Using Systemctl

CentOS, Fedora:

If we look status line starts with  Active we can see that Apache2 service is start 5 second ago.

Another way perhaps more complicated way to restart Apache2 with systemctl is first stopping the service and then starting it.

Ubuntu, Debian:

CentOS, Fedora:


Alternative way to restart Apache 2 service is using native tool apachectl . Syntax of apachectl is like below.

We can use restart command with apachectl

As we see apachectl provides restart operation logs too.


Apache provides init.rc related daemon control script under /etc/init.d . This scripts can be used to restart Apache too.

Ubuntu, Debian:


We need root privileges too to use this init.rc script. After restart script provides information about restart operation. In this example it seems everything done without problem.

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)