I have phantomjs
installed and I want to run a phantom server whenever the (Ubuntu) server starts.
I am currently working locally on Ubuntu 14.04, and the server this will be deployed to is also Ubuntu 14.04.
This is what I have so far:
upstart script:
# /etc/init/phantomjs.conf
start on startup
exec '/path/to/script/to/start/server.bash'
bash script to start the phantom server:
#/path/to/script/to/start/server.bash
#!/bin/bash
phantomjs /path/to/the/server.js -host 127.0.0.1 -port 1337
When I run the server normally from the command line, it works as expected.
When I run the upstart script, it ouputs OK, PhantomJS is ready
to the log file, but when I make post requests to it, nothing else happens. I would expect it to output something to the log each time I make a request, like it does when I run it from the command line, but it seems to just start the server and then nothing else.