Access
- Open your browser:
https://<SERVER-IP> - Static Web Server uses HTTPS on port
443. - The TLS certificate is self-signed, so the browser will show a warning on the first visit.
Publish Website Files
Place your static website files in: /var/www/html
Example:
cp -r mysite/* /var/www/html/
chmod -R a+rX /var/www/html
Changes are served immediately. No restart is required after updating files.
Important Files & Directories
- Binary:
/usr/local/bin/static-web-server - Web Root:
/var/www/html - Environment File:
/etc/default/static-web-server - TLS Certificate:
/etc/static-web-server/cert.pem - TLS Private Key:
/etc/static-web-server/key.pem - Socket Unit:
/etc/systemd/system/static-web-server.socket - Service Unit:
/etc/systemd/system/static-web-server.service
Service Management
Check socket status:
systemctl status static-web-server.socket
Check service status:
systemctl status static-web-server.service
Restart Static Web Server:
systemctl restart static-web-server.service
View logs:
journalctl -u static-web-server.service -f
Enable socket activation:
systemctl enable static-web-server.socket
Configuration
Environment configuration:
/etc/default/static-web-server
After changing configuration or TLS certificates:
systemctl restart static-web-server.service
Notes
- Static Web Server runs using systemd socket activation.
- Systemd owns port
443and passes connections to SWS. - Website files are served publicly without authentication.