systemd service file for openlitespeed

To start/stop OpenLiteSpeed web server, you can use the following systemd service file

vi /usr/lib/systemd/system/lshttpd.service

Add following content

[Unit]
Description=OpenLiteSpeed HTTP Server
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/var/run/openlitespeed.pid
ExecStart=/usr/local/lsws/bin/lswsctrl start
ExecReload=/usr/local/lsws/bin/lswsctrl restart
ExecStop=/usr/local/lsws/bin/lswsctrl delay-stop

KillMode=none
PrivateTmp=false
Restart=on-failure
RestartSec=5

# do not want to be limited in anyway
CPUAccounting=false
TasksAccounting=false
MemoryAccounting=false

[Install]
WantedBy=multi-user.target
Alias=lsws.service
Alias=openlitespeed.service

To start openlitespeed on boot,

Advertisement

systemctl enable lsws

To start OpenLiteSpeed

systemctl start lsws

To stop OpenLiteSpeed

systemctl stop lsws
Add a comment

Leave a Reply

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

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement