git clone https://github.com/TobiMayr/ZUCK-Server.git
server.js
-> der Server (nodeJS)
views/
-> die Webseite (HTML/EJS)
public/
-> die Webseite (CSS, Bilder)
unter: /etc/systemd/system/nodeserver.service
[Unit]
Description=NodeJS server on startup
#Requires=After=mysql.service # Requires the mysql service to run first
[Service]
ExecStart=/usr/bin/nodejs /root/NodeServer/server.js
# Required on some systems
#WorkingDirectory=/root/NodeServer
Restart=always
# Restart service after 10 seconds if node service crashes
RestartSec=10
# Output to syslog
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=nodejs-example
#User=<alternate user>
#Group=<alternate group>
Environment=NODE_ENV=production PORT=1337
[Install]
WantedBy=multi-user.target
systemctl enable nodeserver.service
systemctl start nodeserver.service
systemctl status nodeserver.service
Mehr infos unter folgendem link