Information Technology Grimoire

Version .0.0.1

IT Notes from various projects because I forget, and hopefully they help you too.

Apache Services

Apache Services

Service Running?

ps axf 
ps aux | egrep "apache|http"

Service Status

systemctl status apache2

Example:

systemctl status apache2
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Mon 2023-08-14 08:09:09 CDT; 2h 29min ago
  Process: 23025 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
  Process: 18637 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
  Process: 23031 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 23057 (apache2)
    Tasks: 11 (limit: 4915)
   CGroup: /system.slice/apache2.service
           ├─23057 /usr/sbin/apache2 -k start
           ├─23076 /usr/sbin/apache2 -k start
           ├─25302 /usr/sbin/apache2 -k start
           ├─25304 /usr/sbin/apache2 -k start
           ├─26895 /usr/sbin/apache2 -k start
           ├─26901 /usr/sbin/apache2 -k start
           ├─26902 /usr/sbin/apache2 -k start
           ├─27393 /usr/sbin/apache2 -k start
           ├─27609 /usr/sbin/apache2 -k start
           ├─27816 /usr/sbin/apache2 -k start
           └─28747 /usr/sbin/apache2 -k start

Aug 14 08:09:09 vhosts systemd[1]: Starting The Apache HTTP Server...
Aug 14 08:09:09 vhosts systemd[1]: Started The Apache HTTP Server.

Restart Service

Restarting the service will disrupt all connections and force them to restablish.

sudo systemctl restart apache2

Reload Configs

This does not break active connections and is preferred if a complete restart is not needed.

sudo systemctl reload apache2