After setting up your Whisp project on your server you can make sure it always runs using systemd.
The config we use is below.
[Unit]
Description=Whisp SSH Server
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=5
[Service]
Type=simple
User=whisp
Group=whisp
WorkingDirectory=/home/whisp
RuntimeDirectory=whisp
RuntimeDirectoryMode=0755
PIDFile=/run/whisp/whisp.pid
# Kill the entire process group to ensure no children remain
KillMode=mixed
TimeoutStopSec=5
KillSignal=SIGTERM
ExecStart=/usr/bin/php8.4 whisp-server.php 22
Restart=always
RestartSec=3
StandardOutput=append:/var/log/whisp.log
StandardError=append:/var/log/whisp.error.log
# Prevent multiple instances
LockPersonality=yes
RemainAfterExit=no
# Restart daily and on file changes
RuntimeMaxSec=86400
# Security settings
NoNewPrivileges=yes
PrivateTmp=yes
ReadWritePaths=/home/whisp
ReadWritePaths=/run
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target