| Woo. Have been using the RHEL 7 Amazon AMI images, and it's nice not to worry about shell scripts / custom supervisord stuff for your web services anymore. My node app is deployed with a single `myapp.service` file thanks to systemd: [Service]
ExecStart=/usr/local/bin/node --harmony /var/www/myapp/server.js
Restart=always
User=nobody
Group=nobody
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target
Then: iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000
(since I run my app on a low port so it can run as nobody, and 3000 isn't visible to the outside) cp myapp.service /etc/systemd/system
systemctl enable myapp.service
systemctl start myapp.service
This has all the stuff you expect:- Not restarting repeatedly if the app is bouncing up and down. - I can see how it goes with `journalctl` which reads journald messages, and those messages come from a source called `myapp` rather than the old ancient syslog facilities (local0, uucp, lpd) which everyone just ignored in favour of grepping. |
That said I'm somewhat on the fence about firewalld in a server context - the zones are really designed around mobile computing use-cases, and I'm not a fan of xml as a configuration language.