2026-03-12 21:01:38
This commit is contained in:
42
tiddlywiki/Apache httpd starting with systemd.tid
Executable file
42
tiddlywiki/Apache httpd starting with systemd.tid
Executable file
@@ -0,0 +1,42 @@
|
||||
created: 20190617091940764
|
||||
creator: vplesnila
|
||||
modified: 20200122095305456
|
||||
modifier: vplesnila
|
||||
tags: Linux [[Apache HTTPD]]
|
||||
title: Apache httpd starting with systemd
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Create `httpd.service` unit file in `/usr/lib/systemd/system`
|
||||
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=Apache Web Server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/app/apache_httpd/2.4.39/logs/httpd.pid
|
||||
ExecStart=/app/apache_httpd/2.4.39/bin/apachectl start
|
||||
ExecStop=/app/apache_httpd/2.4.39/bin/apachectl graceful-stop
|
||||
ExecReload=/app/apache_httpd/2.4.39/bin/apachectl graceful
|
||||
PrivateTmp=true
|
||||
LimitNOFILE=infinity
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
```
|
||||
systemctl daemon-reload
|
||||
systemctl enable httpd
|
||||
systemctl stop httpd
|
||||
systemctl start httpd
|
||||
systemctl status httpd
|
||||
```
|
||||
|
||||
//Note//: in 2.4.41 version, PIDFile in unit definition do not works.
|
||||
|
||||
Reference in New Issue
Block a user