@TechDoctor,
pm2
is a tool for running nodejs services in the background. Running yarn server
runs Firestorm in your terminal but pm2 is already running it for you in the background.
You do not need to run yarn server
anymore. Once pm2 is set up to run Firestorm on startup (and this appears to be the case now), you wont be able to run another copy on the same port and you will see errors like above. If you reboot your Pi, you should be able to get to Firestorm via browser by pointing it at your Pi’s IP address.
It is possible to get pm2 to run Firestorm without permission to use port 80, which is what all of the alias
and authbind
stuff is about in the instructions. On most Linux/unix systems port 80 (and all ports below 1024) are restricted to authorized users on the system. The authbind stuff is what allows the pi
user to run Firestorm on port 80.
You can see the console output (and more) of Firestorm when it is running via pm2
by running this:
pm2 logs server --lines 1000 --nostream
This will show the last 1000 lines of both the error and stdout streams.
If you see something like “Error: listen EACCES: permission denied 0.0.0.0:80” in the pm2 log, then permissions aren’t set up properly to allow pm2 to use port 80. It is critical that pm2 be run via authbind, like so:
authbind --deep pm2
Which is what the alias
command in the instructions is all about. I make note if this in the instructions here:
alias pm2='authbind --deep pm2'
#...
#I believe the pm2 alias with authbind is critical here
#alternatively `authbind --deep pm2 start server.js` might work
pm2 start server.js
pm2 save
Try rebooting fresh, once online, can you access Firestorm at the Pi’s IP on port 80? If not, try running these 3 commands above (in the Firestorm directory) again.
You can also verify that the authbind config for port 80 exists, and is owned by pi
by running
ls -l /etc/authbind/byport/80