Start Open Lite Speed automatically

#1
Good morning everyone, and thank you for your interest in my problem.
This is my first time trying to install Open Lite Speed. I installed Open Lite Speed on a Hyper-V virtual machine with Rocky Linux freshly installed and updated.
To install Open Lite Speed, I strictly followed the documentation on the website at this link: https://docs.openlitespeed.org/installation/repo/ quindi:
Bash:
sudo wget -O - https://repo.litespeed.sh | sudo bash

sudo dnf install openlitespeed -y

sudo dnf install lsphp84 lsphp84-common lsphp84-mysqlnd

Now I would like to start Open Lite Speed automatically as a service, but when I try to start it as described in my various searches, it doesn't work because it tells me that the lsws.service service does not exist
Bash:
[root@server /]# systemctl start lsws.service
Failed to start lsws.service: Unit lsws.service not found.

However, I can start the Open Lite Speed server with this command:
Bash:
 /usr/local/lsws/bin/lswsctrl start

Now I don't understand how to start Open Lite Speed automatically every time I restart the server.
Thank you for your letter and any replies.wever, every time the virtual machine restarts, I have to re-execute this command, and I haven't found a way to start Open Lite Speed automatically every time the server restarts.
 
#2
The real service name is lshttpd

So you can either use this
Code:
service lsws status
Redirecting to /bin/systemctl status lsws.service
● lshttpd.service - OpenLiteSpeed HTTP Server
     Loaded: loaded (/usr/lib/systemd/system/lshttpd.service; enabled; preset: disabled)
     Active: active (running) since xxxxxxxx
 Invocation: b6c14af988234477854fb135c214a5ea
    Process: 7638 ExecStart=/usr/local/lsws/bin/lswsctrl start (code=exited, status=0/SUCCESS)
or
Code:
systemctl status lshttpd
 
#3
Hello @Cold-Egg and thanks to answered me.
I read at the "Basic Command" documentation page of Open Lite Speed site,
that the commad was: systemctl start lsws

However it doesn't find me even lshttp service

Code:
[root@server ~]# systemctl status lshttpd
Unit lshttpd.service could not be found.
Code:
[root@server system]# ls
 auditd.service
 autovt@.service
 basic.target
 basic.target.wants
 blk-availability.service
 blockdev@.target
 bluetooth.target
 boot-complete.target
 capsule@.service
 capsule.slice
 chronyd-restricted.service
 chronyd.service
 chrony-wait.service
 console-getty.service
 container-getty@.service
 crond.service
 cryptsetup-pre.target
 cryptsetup.target
 ctrl-alt-del.target
 dbus-broker.service
 dbus-org.freedesktop.hostname1.service
 dbus-org.freedesktop.locale1.service
 dbus-org.freedesktop.login1.service
 dbus-org.freedesktop.timedate1.service
 dbus.socket
 dbus.target.wants
 debug-shell.service
 default.target
 default.target.wants
 dev-hugepages.mount
 dev-mqueue.mount
 dm-event.service
 dm-event.socket
 dnf-makecache.service
 dnf-makecache.timer
 dnf-system-upgrade-cleanup.service
 dnf-system-upgrade.service
 dracut-cmdline.service
 dracut-initqueue.service
 dracut-mount.service
 dracut-pre-mount.service
 dracut-pre-pivot.service
 dracut-pre-trigger.service
 dracut-pre-udev.service
 dracut-shutdown-onfailure.service
 dracut-shutdown.service
 emergency.service
 emergency.target
 exit.target
 factory-reset.target
 final.target
 fips-crypto-policy-overlay.service
 firewalld.service
 first-boot-complete.target
 fstrim.service
 fstrim.timer
 fwupd-offline-update.service
 fwupd-refresh.service
 fwupd-refresh.timer
 fwupd.service
 getty-pre.target
 getty@.service
 getty.target
 graphical.target
 graphical.target.wants
 grub2-systemd-integration.service
 grub-boot-indeterminate.service
 halt.target
 hibernate.target
 hybrid-sleep.target
 initrd-cleanup.service
 initrd-fs.target
 initrd-parse-etc.service
 initrd-root-device.target
 initrd-root-device.target.wants
 initrd-root-fs.target
 initrd-root-fs.target.wants
 initrd-switch-root.service
 initrd-switch-root.target
 initrd.target
 initrd.target.wants
 initrd-udevadm-cleanup-db.service
 initrd-usr-fs.target
 integritysetup-pre.target
 integritysetup.target
 irqbalance.service
 kdump.service
 kexec.target
 kmod-static-nodes.service
 kvm_stat.service
 ldconfig.service
 local-fs-pre.target
 local-fs.target
 logrotate.service
 logrotate.timer
 lvm2-lvmpolld.service
 lvm2-lvmpolld.socket
 lvm2-monitor.service
 lvm-devices-import.path
 lvm-devices-import.service
 man-db-cache-update.service
 man-db-restart-cache-update.service
 mariadb@bootstrap.service.d
 mariadb-extra.socket
 mariadb-extra@.socket
 mariadb.service
 mariadb@.service
 mariadb.socket
 mariadb@.socket
 microcode.service
 modprobe@.service
 multi-user.target
 multi-user.target.wants
 mysqld.service
 mysql.service
 NetworkManager-dispatcher.service
 NetworkManager.service
 NetworkManager-wait-online.service
 network-online.target
 network-pre.target
 network.target
 nftables.service
 nis-domainname.service
 nm-priv-helper.service
 nss-lookup.target
 nss-user-lookup.target
 pam_namespace.service
 paths.target
 pcscd.service
 pcscd.socket
 polkit.service
 poweroff.target
 printer.target
 proc-sys-fs-binfmt_misc.automount
 proc-sys-fs-binfmt_misc.mount
 quotaon-root.service
 quotaon@.service
 rc-local.service
 reboot.target
 reboot.target.wants
 remote-cryptsetup.target
 remote-fs-pre.target
 remote-fs.target
 remote-fs.target.wants
 remote-veritysetup.target
 rescue.service
 rescue.target
 rescue.target.wants
 rpcbind.target
 rpmdb-migrate.service
 rpmdb-rebuild.service
 rsyslog.service
 runlevel0.target
 runlevel1.target
 runlevel1.target.wants
 runlevel2.target
 runlevel2.target.wants
 runlevel3.target
 runlevel3.target.wants
 runlevel4.target
 runlevel4.target.wants
 runlevel5.target
 runlevel5.target.wants
 runlevel6.target
 selinux-autorelabel-mark.service
 selinux-autorelabel.service
 selinux-autorelabel.target
 selinux-check-proper-disable.service
 serial-getty@.service
 shutdown.target
 sigpwr.target
 sleep.target
 slices.target
 smartcard.target
 sockets.target
 sockets.target.wants
 soft-reboot.target
 sound.target
 ssh-access.target
 sshd-keygen@.service
 sshd-keygen.target
 sshd.service
 sshd@.service
 sshd.socket
 ssh-host-keys-migration.service
 sssd-autofs.service
 sssd-autofs.socket
 sssd-kcm.service
 sssd-kcm.socket
 sssd-nss.service
 sssd-nss.socket
 sssd-pac.service
 sssd-pac.socket
 sssd-pam.service
 sssd-pam.socket
 sssd.service
 sssd-ssh.service
 sssd-ssh.socket
 sssd-sudo.service
 sssd-sudo.socket
 suspend.target
 suspend-then-hibernate.target
 swap.target
 sys-fs-fuse-connections.mount
 sysinit.target
 sysinit.target.wants
 sys-kernel-config.mount
 sys-kernel-debug.mount
 sys-kernel-tracing.mount
 syslog.socket
 syslog.target.wants
 systemd-ask-password-console.path
 systemd-ask-password-console.service
 systemd-ask-password-wall.path
 systemd-ask-password-wall.service
 systemd-backlight@.service
 systemd-battery-check.service
 systemd-binfmt.service
 systemd-bless-boot.service
 systemd-boot-check-no-failures.service
 systemd-bootctl@.service
 systemd-bootctl.socket
 systemd-boot-random-seed.service
 systemd-boot-update.service
 systemd-confext.service
 systemd-coredump@.service
 systemd-coredump.socket
 systemd-creds@.service
 systemd-creds.socket
 systemd-exit.service
 systemd-firstboot.service
 systemd-fsck-root.service
 systemd-fsck@.service
 systemd-growfs-root.service
 systemd-growfs@.service
 systemd-halt.service
 systemd-hibernate-clear.service
 systemd-hibernate-resume.service
 systemd-hibernate.service
 systemd-hostnamed.service
 systemd-hostnamed.socket
 systemd-hwdb-update.service
 systemd-hybrid-sleep.service
 systemd-initctl.service
 systemd-initctl.socket
 systemd-journal-catalog-update.service
 systemd-journald-audit.socket
 systemd-journald-dev-log.socket
 systemd-journald.service
 systemd-journald@.service
 systemd-journald.socket
 systemd-journald@.socket
 systemd-journald-sync@.service
 systemd-journald-varlink@.socket
 systemd-journal-flush.service
 systemd-kexec.service
 systemd-localed.service
 systemd-logind.service
 systemd-logind.service.d
 systemd-machine-id-commit.service
 systemd-modules-load.service
 systemd-network-generator.service
 systemd-pcrextend@.service
 systemd-pcrextend.socket
 systemd-pcrfs-root.service
 systemd-pcrfs@.service
 systemd-pcrlock-file-system.service
 systemd-pcrlock-firmware-code.service
 systemd-pcrlock-firmware-config.service
 systemd-pcrlock-machine-id.service
 systemd-pcrlock-make-policy.service
 systemd-pcrlock-secureboot-authority.service
 systemd-pcrlock-secureboot-policy.service
 systemd-pcrlock@.service
 systemd-pcrlock.socket
 systemd-pcrmachine.service
 systemd-pcrphase-initrd.service
 systemd-pcrphase.service
 systemd-pcrphase-sysinit.service
 systemd-poweroff.service
 systemd-pstore.service
 systemd-quotacheck-root.service
 systemd-quotacheck@.service
 systemd-random-seed.service
 systemd-reboot.service
 systemd-remount-fs.service
 systemd-repart.service
 systemd-rfkill.service
 systemd-rfkill.socket
 systemd-soft-reboot.service
 systemd-suspend.service
 systemd-suspend-then-hibernate.service
 systemd-sysctl.service
 systemd-sysext.service
 systemd-sysext@.service
 systemd-sysext.socket
 systemd-sysupdate-reboot.service
 systemd-sysupdate-reboot.timer
 systemd-sysupdate.service
 systemd-sysupdate.timer
 systemd-sysusers.service
 systemd-timedated.service
 systemd-tmpfiles-clean.service
 systemd-tmpfiles-clean.timer
 systemd-tmpfiles-setup-dev-early.service
 systemd-tmpfiles-setup-dev.service
 systemd-tmpfiles-setup.service
 systemd-tpm2-setup-early.service
 systemd-tpm2-setup.service
 systemd-udevd-control.socket
 systemd-udevd-kernel.socket
 systemd-udevd.service
 systemd-udev-load-credentials.service
 systemd-udev-settle.service
 systemd-udev-trigger.service
 systemd-udev-trigger.service.d
 systemd-update-done.service
 systemd-update-utmp-runlevel.service
 systemd-update-utmp.service
 systemd-userdbd.service
 systemd-userdbd.socket
 systemd-user-sessions.service
 systemd-vconsole-setup.service
 systemd-volatile-root.service
 system.slice.d
'system-systemd\x2dcryptsetup.slice'
'system-systemd\x2dveritysetup.slice'
 system-update-cleanup.service
 system-update-pre.target
 system-update.target
 system-update.target.wants
 system-xfs_scrub.slice
 timers.target
 timers.target.wants
 time-set.target
 time-sync.target
 tmp.mount
 tpm2.target
 umount.target
 usb-gadget.target
 user@0.service.d
 user-runtime-dir@.service
 user@.service
 user@.service.d
 user.slice
 user-.slice.d
 veritysetup-pre.target
 veritysetup.target
 
Last edited:
#4
I just installed OLS on RoxyLinux 10 without any issues. Maybe you can back up lsws folder just in case, and then install the OLS again and see if there's any error in the middle. Or manually setup the service file

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

Code:
# should be added as /usr/lib/systemd/system/lshttpd.service
[Unit]
Description=OpenLiteSpeed HTTP Server
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
`cat /usr/lib/systemd/system/lshttpd.service`
[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
 
#5
Hello,

Thank you again for responding.

I did as you said. I deleted the Hyper-V virtual machine and reinstalled Rocky 10.1 and did the updates, nothing else.

Then I installed OLS as per the documentation:
Code:
wget -O - https://repo.litespeed.sh | sudo bash

yum install openlitespeed -y

I tried even to install manually:
Code:
wget https://openlitespeed.org/packages/openlitespeed-1.8.5.tgz
tar -zxf openlitespeed-*.tgz
cd openlitespeed
./install.sh

Nothing, in both methods the lshttp service is not created.

So I created it myself by entering what you wrote.

Now I can start the service and with systemctl enable lshhtp it starts automatically.
 
Last edited:
Top