deda-ca / cgi-node

CGI Node.js complete module to replace PHP on shared hosting such as GoDaddy
http://www.cgi-node.org/
MIT License
172 stars 21 forks source link

another 404 error #16

Open steffiland opened 8 years ago

steffiland commented 8 years ago

Hello,

i am trying to get node.js running on shared hosting with the help of cgi-node. I extracted the current node.js Distri to /www/htdocs/myuser/node, so the Binary is /www/htdocs/myuser/node/bin/node. The document root is /www/htdocs/myuser/sub, inside there is my info.jss containing the line <? cgiNodeInfo() ?> and an .htaccess file with:

Action cgi-node /www/htdocs/myuser/sub/cgi-bin/cgi-node.js
AddHandler cgi-node .jss

The file /www/htdocs/myuser/sub/cgi-bin/cgi-node.js is executable and the header looks like

!/www/htdocs/w010cd6b/node/bin/node

/\* ... */
var CgiNodeConfig = 
{
    Version: '0.2',
    StartTag: '<?',
    EndTag: '<?',

    ScriptExtensions: ['.js'],

    EmbededScriptExtensions: ['.jss'],
SessionCookie: 'CGI-NODE-SESSIONID',
    SessionTimeOut: 15*60, // 15 minutes
    SessionPath: '/www/htdocs/myuser/node/sessions/'
};

So, i corrected the path to the binary according to the instructions, and also the session path. The session directory is existing and writeable.

When I call the sub.example.com/info.jss from Browser, i get the following 404 error: Not Found

The requested URL /www/htdocs/myuser/sub/cgi-bin/cgi-node.js/info.jss was not found on this server.

I also tested to change the Action-Handler in the .htaccess to another dummy-Hello-World-cgi-Script, which just executes fine. So I think, there could be an error in detecting the path to the info.jss in the cgi-node.js, or do you have an idea what I am doing wrong or missing?

Thank you for your help and for thais great project!

Rhiannon

steffiland commented 8 years ago

I just saw that I used an old version from http://www.cgi-node.org, but with the current version from your repository I have the same issues.

jaszhix commented 8 years ago

Your 404 error hits at /www/htdocs/myuser/sub/cgi-bin/cgi-node.js/info.jss and your cgi-node.js file is in [edited for privacy] - is your server symlinking those directories? If so, it might chmod your file to 777, which a lot of environments won't let cgi run with.

Edit: Edited out the path.

steffiland commented 8 years ago

That was an copy&paste error when writing this issue. I did not not want to publish the path to my root wwwdir, but I forgot it here. Now I updated my comment. There are no symlinks. Could you pls update your comment too? :)