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

GoDaddy cgiNodeInfo.jscript not working correctly #20

Open richm617 opened 8 years ago

richm617 commented 8 years ago

I right click on cgiNodeInfo.jscript from my CPanel and click View and all I see is the following: Could you help? 1 2 3 4 5 6

lanled commented 8 years ago

I have the same problem

Lan

lanled commented 8 years ago

I think that the problem is i the file cgi-node.js

Lan

lanled commented 8 years ago

BTW I use bluehost

jaszhix commented 8 years ago

If you are using the version from the website, it is not as up to date as the one from this repo. cgiNodeInfo() works on the repo version, where as CgiNodeInfo() works on the version on the website. I suggest cloning this repo instead.

richm617 commented 8 years ago

Thanks but can you help me a little more? I've found cgiNodeInfo() in this repo but all it says is 1 lines (1 sloc) 20 Bytes <? CgiNodeInfo(); ?>

What do I do with that? It's from oct 15 2014

jaszhix commented 8 years ago

It looks like node is not being executed and your files are being loaded as plain text. I took another look at the screenshots you posted. You need to point your cgi-node.js file directly to node. So it should look like:

#!/home/wmoralespr/bin/node

I'm assuming all of the libs node needs is in wmoralespr. Make sure your files are chmod 755. If you use the version from this repo in cgi-bin/, rename your extension JSS on files and in .htaccess, or change JSS to jscript in cgi-node.js.

richm617 commented 8 years ago

I changed the cgi-node.js to point to node. It still just showed as before I'm not sure how to change it stop loading from plain text? I've not changed to your repo yet.

Attached is what libs I have. capture

jaszhix commented 8 years ago

This is not my repo. :) I would be pointing your browser to the public address of the jscript file on port 80. It likely will not do anything from cpanel.

richm617 commented 8 years ago

Could I give you remote access?

jaszhix commented 8 years ago

SessionPath needs its own directory, create a dir like /home/wmoralespr/sessions, then point SessionPath to that. I am just helping because I like this project, and don't like seeing people get stuck, but I can't play a tech support role.

jaszhix commented 8 years ago

Paste your cgi-node.js file here: http://0bin.net/ and give me the long URL in the address bar. Did you try going to your site's public address? .htaccess only works there.

jaszhix commented 8 years ago

You gave me the link to your godaddy account. Paste/upload your cgi-node.js file to 0bin?

What are you trying to use cgi-node for? I wouldn't use cgi-node unless you absolutely have to. Its really just a jerry rigged version of node for CGI - not maintained, and probably not something to run in production if you're not familiar with linux.

jaszhix commented 8 years ago

http://23.229.176.101/cgiNodeInfo.jscript gives a 404. You didn't give me a 0bin link, so I can't look at what you pasted or uploaded.

jaszhix commented 8 years ago

Now paste the long link here it redirects to.

richm617 commented 8 years ago

http://0bin.net/paste/mUsH5mrLDDRv6lEi#nm-qlbju44ufYmPkHSa8NiOVUwYAwp0HR74IaiiJWyX

jaszhix commented 8 years ago

I formatted it and changed line 8. It was using JSS. Not really your fault, the documentation is completely wrong.

http://0bin.net/paste/NoKzctPiDhA0vEG6#vOPssEHewHnoG6SbZOeRRY0+zcAX+ao4LsORu7ZMu3N

jaszhix commented 8 years ago

I would really suggest not using screenshots. You should try to use FTP or SSH. Nothing you view in cpanel will work with node - cgi-node only works on port 80, because that's what htaccess is configuring.

richm617 commented 8 years ago

I thought it would open up in a browser the contents of the server it's running on.

jaszhix commented 8 years ago

https://p3plcpnl0462.prod.phx3.secureserver.net:2083/cpsess8901585666/frontend/gl_paper_lantern/filemanager/showfile.html?file=cgi-node.js&fileop=&dir=%2Fhome%2Fwmoralespr%2Fpublic_html%2Fcgi-bin&dirop=&charset=&file_charset=&baseurl=&basedir=

the :2083 at the end of the hostname (p3plcpnl0462.prod.phx3.secureserver.net) is the port. You gave me the server's IP, so anything in /home/wmoralespr should be available at http://23.229.176.101/ (port 80)

richm617 commented 8 years ago

correct. I thought going http://23.229.176.101/cgiNodeInfo.jscript would at least try to call up the script and make it run

jaszhix commented 8 years ago
<? CgiNodeInfo() ?>
richm617 commented 8 years ago

yes i thought it would run that and then display the contents of the machine. I tried to even put the /public_html/cginodeinfo.jscript

jaszhix commented 8 years ago

I'm sorry?

richm617 commented 8 years ago

lol Ya, I'm sorry to capture o this thing doesn't work as it should. It's supposed to show

jaszhix commented 8 years ago

That's on godaddy? That means its working.

richm617 commented 8 years ago

haha. not that's the tutorial on how to do this but it doesn't work. http://www.cgi-node.org/docs/cgi-node-on-godaddy-tutorial

jaszhix commented 8 years ago

I think it was disingenuous for the author to suggest cgi-node should be installed by anyone -- and configured over web admin. Node is linux software, and you need a terminal for this stuff.

richm617 commented 8 years ago

Ya, it seems like i wasted a lot of time on it. They make it look so easy. I mean I am entering the correct navigation link right? http://23.229.176.101/cginodeinfo.jscript

jaszhix commented 8 years ago

Yeah, except for the case sensitivity, cgiNodeInfo.jscript would make a difference in a nix environment.

richm617 commented 8 years ago

when I use the domainname/cgiNodeInfo.jscript I get: Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@XXXXXX.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

jaszhix commented 8 years ago

Did you install node? This is probably your only option on godaddy - https://github.com/niutech/node.php if you don't want to use SSH.

richm617 commented 8 years ago

this never ends! When I try to install it I get: Node.php

Node.js is not yet installed. Switch to Admin Mode and Install it.

Powered by node.php

jaszhix commented 8 years ago

Edit node.php https://github.com/niutech/node.php/blob/master/node.php#L13 - change it to true, then back to false after you install node.

richm617 commented 8 years ago

Thanks. Got it installed but for line two: When succeeded, install your node.js app by uploading its folder or using npm: http://example.org/node.php?npm=install jt-js-sample

I get

Node.php

Running: npm node/bin/npm install jt-js-sample Failed. Error: 127

jaszhix commented 8 years ago

https://github.com/niutech/node.php/issues/4

richm617 commented 8 years ago

I don't have the SSL credentials. i'll need to call GoDaddy and do it tomorrow. Thank you for your help!

jaszhix commented 8 years ago

Np, good luck!

richm617 commented 8 years ago

Can I used FTP for line 2? GoDaddy is telling me I don't have SSL

When succeeded, install your node.js app by uploading its folder or using npm: http://example.org/node.php?npm=install jt-js-sample.

jaszhix commented 8 years ago

SSH.

rokeegithub commented 8 years ago

i am having 404 error while following all the instruction given here if you want i can post cgi-node.js file to bin can you please help me

webtech0101 commented 7 years ago

After follow http://www.cgi-node.org/docs/cgi-node-on-godaddy-tutorial showing error

HOW CAN I SOLVE THAT

EXCEPTION: ENOENT: no such file or directory, open
'/home//bin/sessions/c3b705ce7c3920962bcec27021d8d3fb' Error: ENOENT: no such file or directory, open '/home//bin/sessions/c3b705ce7c3920962bcec27021d8d3fb' at Error (native) at Object.fs.openSync (fs.js:549:18) at Object.fs.writeFileSync (fs.js:1156:15) at CgiHttpSession.create (/home//public_html/cgi-bin/cgi-node.js:343:6) at CgiHttpSession.init (/home//public_html/cgi-bin/cgi-node.js:294:44) at new CgiHttpSession (/home//public_html/cgi-bin/cgi-node.js:378:7) at new CgiHttpContext (/home//public_html/cgi-bin/cgi-node.js:118:17) at Object. (/home//public_html/cgi-bin/cgi-node.js:948:18) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10)

Content-type: text/html; charset=iso-8859-1 EXCEPTION: Cannot read property 'session' of null TypeError: Cannot read property 'session' of null at process. (/home//public_html/cgi-bin/cgi-node.js:941:16) at emitOne (events.js:77:13) at process.emit (events.js:169:7)

dotme commented 7 years ago

@webtech0101 I am not a great specialist but I want to give you a little help with your problem. It all looks like you should edit the cgi-node.js file to have the working server. Check path to sessions and replace it with yours. Look here it is short instructions to solve your problem. Sessions folder must be separated from other folders and needs to 755 permissions. Have a nice day.