문제

Has anyone been able to get docpad up and running on openshift paas? If so, how do you do it? I've configured the port in the environments section of the docpad.coffee file to "process.env.OPENSHIFT_NODEJS_PORT" and set the env to "production" - but to no avail. Trying to launch docpad from the server.js file just seems to get the application stuck in a loop of trying to start up and then closing down with an "EACCES" error.

Edit: Here's the error message

Error: listen EACCES
at errnoException (net.js:884:11)
at Server._listen2 (net.js:1003:19)
at listen (net.js:1044:10)
at Server.listen (net.js:1110:5)
at startServer (/var/lib/openshift/52deb1644382ec26f9000098/app-root/runtime/repo/node_modules/docpad/out/lib/docpad.js:4134:25)
at /var/lib/openshift/52deb1644382ec26f9000098/app-root/runtime/repo/node_modules/docpad/out/lib/docpad.js:4204:16
at TaskGroup.<anonymous> (/var/lib/openshift/52deb1644382ec26f9000098/app-root/runtime/repo/node_modules/docpad/out/lib/docpad.js:1109:14)
at TaskGroup.g (events.js:175:14)
at TaskGroup.EventEmitter.emit (events.js:98:17)
at TaskGroup.complete (/var/lib/openshift/52deb1644382ec26f9000098/app-root/runtime/repo/node_modules/docpad/node_modules/event-emitter-grouped/node_modules/taskgroup/out/lib/taskgroup.js:556:14)
at TaskGroup.itemCompletionCallback (/var/lib/openshift/52deb1644382ec26f9000098/app-root/runtime/repo/node_modules/docpad/node_modules/event-emitter-grouped/node_modules/taskgroup/out/lib/taskgroup.js:347:17)
at TaskGroup.EventEmitter.emit (events.js:95:17)
at Task.<anonymous> (/var/lib/openshift/52deb1644382ec26f9000098/app-root/runtime/repo/node_modules/docpad/node_modules/event-emitter-grouped/node_modules/taskgroup/out/lib/taskgroup.js:405:26)
at Task.EventEmitter.emit (events.js:117:20)
at Task.completionCallback (/var/lib/openshift/52deb1644382ec26f9000098/app-root/runtime/repo/node_modules/docpad/node_modules/event-emitter-grouped/node_modules/taskgroup/out/lib/taskgroup.js:128:19)
at DocPad.<anonymous> (/var/lib/openshift/52deb1644382ec26f9000098/app-root/runtime/repo/node_modules/docpad/out/lib/docpad.js:922:18)
at ambi (/var/lib/openshift/52deb1644382ec26f9000098/app-root/runtime/repo/node_modules/docpad/node_modules/ambi/out/lib/ambi.js:23:18)
at Task.<anonymous> (/var/lib/openshift/52deb1644382ec26f9000098/app-root/runtime/repo/node_modules/docpad/node_modules/event-emitter-grouped/out/lib/event-emitter-grouped.js:38:23)
at ambi (/var/lib/openshift/52deb1644382ec26f9000098/app-root/runtime/repo/node_modules/docpad/node_modules/ambi/out/lib/ambi.js:23:18)
at fire (/var/lib/openshift/52deb1644382ec26f9000098/app-root/runtime/repo/node_modules/docpad/node_modules/event-emitter-grouped/node_modules/taskgroup/out/lib/taskgroup.js:159:23)
at b (domain.js:183:18)
at Domain.run (domain.js:123:23)
at Task.fire (/var/lib/openshift/52deb1644382ec26f9000098/app-root/runtime/repo/node_modules/docpad/node_modules/event-emitter-grouped/node_modules/taskgroup/out/lib/taskgroup.js:166:25)
at processImmediate [as _immediateCallback] (timers.js:317:15)
도움이 되었습니까?

해결책 2

As niharvey pointed out, we need to tell docpad to listen on a specific address. In version 6.58 of docpad the "host" option was added to the environments section of the docpad.coffee file. So it needs to have the following section:

environments:
    development: 
        # //Always refresh from server
        maxAge: false  # default

        # //Listen to port 9778 on the development environment
        port: 9778
    production: # //this is the important part for openshift

        # //this is the part that open shift needs - 
        # //but its only available in docapd 6.58+
        hostname: process.env.OPENSHIFT_NODEJS_IP

        port: process.env.OPENSHIFT_NODEJS_PORT

다른 팁

I was able to reproduce this and it boils down to not being able to specify a listening address in the docpad.coffee. I've messaged the maintainers to see what can be done to change that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top