How to use Supervisor to run Websocket server on AWS Lightsail instance

447 Views Asked by At

I'm using this library to add websockets to my codeigniter app. I got everything to work, but I need the websocket server to always run in the background, regardless of the CLI being open or not. To run the server in the CLI, I run this command:

php index.php welcome index

Which gives me:

Running server on host 0.0.0.0:8282
Authentication activated

Websockets works on my app, but if I close the CLI, the server closes as well. How do I keep this running? I have Supervisor (as suggested for Ratchet), but I have no idea where to go from here. I'm just running a simple PHP server (Ubuntu on AWS Lightsail), not a node one, bytheway.

0

There are 0 best solutions below