Created
November 12, 2016 14:39
-
-
Save blacksaildivision/199f9806dc68b2e7cf78713ae4631dfe to your computer and use it in GitHub Desktop.
SystemD (systemctl) script for managing Apache httpd compiled from source
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=The Apache HTTP Server | |
After=network.target | |
[Service] | |
Type=forking | |
ExecStart=/usr/local/apache2/bin/apachectl -k start | |
ExecReload=/usr/local/apache2/bin/apachectl -k graceful | |
ExecStop=/usr/local/apache2/bin/apachectl -k graceful-stop | |
PIDFile=/usr/local/apache2/logs/httpd.pid | |
PrivateTmp=true | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since 2.4.42, httpd has native support for systemd. Compile mod_systemd with the flag:
The docs provide the following unit file:
# Example of systemd service unit (more settings are probably needed for production systems) [Unit] Description=The Apache HTTP Server After=network.target [Service] Type=notify ExecStart=/usr/local/apache2/bin/httpd -D FOREGROUND -k start ExecReload=/usr/local/apache2/bin/httpd -k graceful KillMode=mixed [Install] WantedBy=multi-user.target
See the note there on
ExecStop
.