How configure the upstart in ubuntu in my ec2 [node.js]
I am using an amazon ec2 instance with ubuntu to host my node.js application, i already made all the configurations, and is working good when i type:
nodemon ./bin/www./bin/www is the file that creates the server.
Now, i am trying to setup the upstart, and i follow a tutorial, this is my configuration file:
path:
/etc/init/photogrid.conf:inside:
description "Photogrid"
start on started mountall
stop on shutdown
respawn
respawn limit 99 5
env NODE_ENV=production
exec node /home/ubuntu/photogrid/bin/www >> /var/log/photogrid.log 2>&1But when i try to access the site, is showing:
Cannot GET /I follow a tutorial, and the only difference between my configuration file is this part:
Original:
exec node /home/ubuntu/photogrid/app.js >> /var/log/photogrid.log 2>&1My one:
exec node /home/ubuntu/photogrid/bin/www >> /var/log/photogrid.log 2>&1Start with upstart:
Start with nodemon bin/www:
In my logs i see the following when i try access the '/' (just an example, in every route is the same problem):
^[[0mGET / ^[[33m404 ^[[0m12.036 ms - 13^[[0mThanks very much!
1 Answer
It could be problem with the working directory. Try using chdir:
description "Photogrid"
...
chdir /home/ubuntu/photogrid
exec node /home/ubuntu/photogrid/bin/wwwOn a side note: The redirection isn't needed. The log is saved to files in /var/log/upstart/.