Spread the love

Before start i hope you know well about the apache, if not then you can read this article what is apache and install on ubuntu.

Commands to start, stop, status and restart the apache are as follow:

Start Apache in ubuntu command line

sudo service apache2 start

Restart Apache in ubuntu command line

sudo service apache2 restart

Stop Apache in ubuntu command line

sudo service apache2 stop

Check status of apache in ubuntu command line

sudo service apache2 statsu

Output:

apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor prese>
     Active: active (running) since Fri 2021-08-27 02:48:18 UTC; 1 day 7h ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 17783 ExecReload=/usr/sbin/apachectl graceful (code=exited, status>
   Main PID: 580 (apache2)
      Tasks: 8 (limit: 1159)
     Memory: 104.1M
     CGroup: /system.slice/apache2.service
             ├─  580 /usr/sbin/apache2 -k start
             ├─17791 /usr/sbin/apache2 -k start
             ├─17792 /usr/sbin/apache2 -k start
             ├─17793 /usr/sbin/apache2 -k start
             ├─17794 /usr/sbin/apache2 -k start
             ├─17795 /usr/sbin/apache2 -k start
             ├─17814 /usr/sbin/apache2 -k start
             └─18382 /usr/sbin/apache2 -k start

Aug 27 02:48:18 ip-xx-xx-xx-xxx systemd[1]: Starting The Apache HTTP Server...
Aug 27 02:48:18 ip-xx-xx-xx-xxx systemd[1]: Started The Apache HTTP Server.
Aug 28 00:00:54 ip-xx-xx-xx-xxx systemd[1]: Reloading The Apache HTTP Server.
Aug 28 00:00:54 xx-xx-xx-xxx systemd[1]: Reloaded The Apache HTTP Server.

One thought on “How to start, stop and restart apache linux ?

Leave a Reply