{"action":"created","issue":{"url":"https://api.github.com/repos/keystonejs/keystone/issues/1184","labels_url":"https://api.github.com/repos/keystonejs/keystone/issues/1184/labels{/name}","comments_url":"https://api.github.com/repos/keystonejs/keystone/issues/1184/comments","events_url":"https://api.github.com/repos/keystonejs/keystone/issues/1184/events","html_url":"https://github.com/keystonejs/keystone/issues/1184","id":60393023,"number":1184,"title":"Unable to run keystone application on Openshift, port error.","user":{"login":"gazzer82","id":1923535,"avatar_url":"https://avatars.githubusercontent.com/u/1923535?v=3","gravatar_id":"","url":"https://api.github.com/users/gazzer82","html_url":"https://github.com/gazzer82","followers_url":"https://api.github.com/users/gazzer82/followers","following_url":"https://api.github.com/users/gazzer82/following{/other_user}","gists_url":"https://api.github.com/users/gazzer82/gists{/gist_id}","starred_url":"https://api.github.com/users/gazzer82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gazzer82/subscriptions","organizations_url":"https://api.github.com/users/gazzer82/orgs","repos_url":"https://api.github.com/users/gazzer82/repos","events_url":"https://api.github.com/users/gazzer82/events{/privacy}","received_events_url":"https://api.github.com/users/gazzer82/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/keystonejs/keystone/labels/(status)%20invalid%20/%20duplicate","name":"(status) invalid / duplicate","color":"ffffff"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-09T19:02:51Z","updated_at":"2015-03-10T22:08:47Z","closed_at":"2015-03-09T21:58:22Z","body":"I am trying to build my first Keystone.js site, got it running fine locally on my machine. \r\n\r\nNow, i am trying to push my site to Openshift and failing miserably.\r\n\r\nI have gotten mongo to connect by adding this to keystone.js:\r\n\r\n    var mongoDbConnectionString =  process.env.OPENSHIFT_MONGODB_DB_URL || 'mongodb://localhost/*********';\r\n\r\nHowever 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:\r\n\r\n    var host = process.env.OPENSHIFT_NODEJS_IP || process.env.OPENSHIFT_INTERNAL_IP || \"127.0.0.1\";\r\n\r\n    var port = process.env.OPENSHIFT_NODEJS_PORT  || process.env.OPENSHIFT_INTERNAL_PORT || 3000;\r\n\r\nCombined with:\r\n\r\n\tkeystone.init({\r\n\r\n\t'name': '*********',\r\n\t'brand': '*********',\r\n\t\r\n\t'less': 'public',\r\n\t'static': 'public',\r\n\t'favicon': 'public/favicon.ico',\r\n\t'views': 'templates/views',\r\n\t'view engine': 'jade',\r\n\t\r\n\t'emails': 'templates/emails',\r\n\t'mongo': mongoDbConnectionString,\r\n  \t'host': host,\r\n  \t'port':  port,\r\n\t'auto update': true,\r\n\t'session': true,\r\n\t'auth': true,\r\n\t'user model': 'User',\r\n\t'cookie secret': '*********'\r\n\t\r\n\r\n    });\r\n\r\nBut i keep getting:\r\n\r\n    ==> app-root/logs/nodejs.log <==\r\n    Error: listen EACCES\r\n    at errnoException (net.js:901:11)\r\n    at Server._listen2 (net.js:1020:19)\r\n    at listen (net.js:1061:10)\r\n    at Server.listen (net.js:1135:5)\r\n    ....\r\n\r\n    with 'node keystone.js'\r\n    DEBUG: Sending SIGTERM to child...\r\n\r\n\r\n\r\nNow i have checked the env on the Openshift instance and they seem to be correct variable, i am getting port 8080 and what seems like a correct IP address.\r\n\r\nI've also tried hard coding the port and address parts but it seems to make no difference, and also not really workable for local testing.\r\n\r\nI'm obviously missing something simple here, so help greatly appreciated!\r\n\r\nThanks\r\n\r\nHere is my full keystone.js\r\n\r\n*keystone.js*\r\n\r\n    // Simulate config options from your production environment by\r\n    // customising the .env file in your project's root folder.\r\n    require('dotenv').load();\r\n    \r\n    // Require keystone\r\n    var keystone = require('keystone');\r\n    \r\n    var mongoDbConnectionString =  process.env.OPENSHIFT_MONGODB_DB_URL || 'mongodb://localhost/********';\r\n    \r\n    var host = process.env.OPENSHIFT_NODEJS_IP || \"127.0.0.1\";\r\n    \r\n    var port = process.env.OPENSHIFT_NODEJS_PORT  || process.env.OPENSHIFT_INTERNAL_PORT || 3000;\r\n    \r\n    // Initialise Keystone with your project's configuration.\r\n    // See http://keystonejs.com/guide/config for available options\r\n    // and documentation.\r\n    \r\n    keystone.init({\r\n    \r\n    \t'name': '********',\r\n    \t'brand': '********',\r\n    \t\r\n    \t'less': 'public',\r\n    \t'static': 'public',\r\n    \t'favicon': 'public/favicon.ico',\r\n    \t'views': 'templates/views',\r\n    \t'view engine': 'jade',\r\n    \t\r\n    \t'emails': 'templates/emails',\r\n    \t'mongo': mongoDbConnectionString,\r\n      \t'host': host,\r\n      \t'port':  port,\r\n    \t'auto update': true,\r\n    \t'session': true,\r\n    \t'auth': true,\r\n    \t'user model': 'User',\r\n    \t'cookie secret': '********'\r\n    \t\r\n    \r\n    });\r\n    \r\n    // Load your project's Models\r\n    \r\n    keystone.import('models');\r\n    \r\n    // Setup common locals for your templates. The following are required for the\r\n    // bundled templates and layouts. Any runtime locals (that should be set uniquely\r\n    // for each request) should be added to ./routes/middleware.js\r\n    \r\n    keystone.set('locals', {\r\n    \t_: require('underscore'),\r\n    \tenv: keystone.get('env'),\r\n    \tutils: keystone.utils,\r\n    \teditable: keystone.content.editable\r\n    });\r\n    \r\n    // Load your project's Routes\r\n    \r\n    keystone.set('routes', require('./routes'));\r\n    \r\n    // Setup common locals for your emails. The following are required by Keystone's\r\n    // default email templates, you may remove them if you're using your own.\r\n    \r\n    keystone.set('email locals', {\r\n    \tlogo_src: '/images/logo-email.gif',\r\n    \tlogo_width: 194,\r\n    \tlogo_height: 76,\r\n    \ttheme: {\r\n    \t\temail_bg: '#f9f9f9',\r\n    \t\tlink_color: '#2697de',\r\n    \t\tbuttons: {\r\n    \t\t\tcolor: '#fff',\r\n    \t\t\tbackground_color: '#2697de',\r\n    \t\t\tborder_color: '#1a7cb7'\r\n    \t\t}\r\n    \t}\r\n    });\r\n    \r\n    // Setup replacement rules for emails, to automate the handling of differences\r\n    // between development a production.\r\n    \r\n    // Be sure to update this rule to include your site's actual domain, and add\r\n    // other rules your email templates require.\r\n    \r\n    keystone.set('email rules', [{\r\n    \tfind: '/images/',\r\n    \treplace: (keystone.get('env') == 'production') ? 'http://www.your-server.com/images/' : 'http://localhost:3000/images/'\r\n    }, {\r\n    \tfind: '/keystone/',\r\n    \treplace: (keystone.get('env') == 'production') ? 'http://www.your-server.com/keystone/' : 'http://localhost:3000/keystone/'\r\n    }]);\r\n    \r\n    // Load your project's email test routes\r\n    \r\n    keystone.set('email tests', require('./routes/emails'));\r\n    \r\n    // Configure the navigation bar in Keystone's Admin UI\r\n    \r\n    keystone.set('nav', {\r\n    \t'posts': ['posts', 'post-categories'],\r\n    \t'creations': 'galleries',\r\n    \t'contact us': 'enquiries',\r\n    \t'users': 'users'\r\n    });\r\n    \r\n    // Start Keystone to connect to your database and initialise the web server\r\n    \r\n    \tconsole.log('%s: IP Set.', host);\r\n    \tconsole.log('%s: Port Set.', port);\r\n    \r\n    keystone.start();"},"comment":{"url":"https://api.github.com/repos/keystonejs/keystone/issues/comments/78159315","html_url":"https://github.com/keystonejs/keystone/issues/1184#issuecomment-78159315","issue_url":"https://api.github.com/repos/keystonejs/keystone/issues/1184","id":78159315,"user":{"login":"JohnnyEstilles","id":5514878,"avatar_url":"https://avatars.githubusercontent.com/u/5514878?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnnyEstilles","html_url":"https://github.com/JohnnyEstilles","followers_url":"https://api.github.com/users/JohnnyEstilles/followers","following_url":"https://api.github.com/users/JohnnyEstilles/following{/other_user}","gists_url":"https://api.github.com/users/JohnnyEstilles/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnnyEstilles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnnyEstilles/subscriptions","organizations_url":"https://api.github.com/users/JohnnyEstilles/orgs","repos_url":"https://api.github.com/users/JohnnyEstilles/repos","events_url":"https://api.github.com/users/JohnnyEstilles/events{/privacy}","received_events_url":"https://api.github.com/users/JohnnyEstilles/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T22:08:47Z","updated_at":"2015-03-10T22:08:47Z","body":"@gazzer82 ... that's strange, I've deployed a couple of Keystone apps on OpenShift recently, and it has been sufficient to set `OPENSHIFT_MONGODB_DB_URL` using:\r\n\r\n```\r\nrhc set-env OPENSHIFT_MONGODB_DB_URL=mongodb://...  -a myapp\r\n```"}}