samedi 7 mars 2015

Unable to run keystone node.js application on Openshift

I am trying to build my first Keystone.js, got it running fine locally on my machine.


Now, i am trying to push my site to Openshift and failing miserably.


I have gotten mongo to connect by adding this to keystone.js:



var mongoDbConnectionString = process.env.OPENSHIFT_MONGODB_DB_URL || 'mongodb://localhost/my-project';


However i cannot get the thing to run correctly as it seems to be having issues binding to the ip and port i am feeding it on Openshift, i am using the following code:



var host = process.env.OPENSHIFT_NODEJS_IP || process.env.OPENSHIFT_INTERNAL_IP || "127.0.0.1";

var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.OPENSHIFT_INTERNAL_PORT || 3000;


Combined with:



'mongo': mongoDbConnectionString,
'host': host,
'port': port,


But i keep getting:



==> app-root/logs/nodejs.log <==
Error: listen EACCES
at errnoException (net.js:901:11)
at Server._listen2 (net.js:1020:19)
at listen (net.js:1061:10)
at Server.listen (net.js:1135:5)
....

with 'node keystone.js'
DEBUG: Sending SIGTERM to child...


Now i have checked the env via SSH and they seems to be correct, i am getting poot 8080 and what seems like a correct IP address.


I've event tried hard coding the port and address parts but it seems to make no difference.


I'm obviously missing something simple here, so help greatly appreciated!


Thanks


Aucun commentaire:

Enregistrer un commentaire