CGI-Node - cgi.bin/cgi-node.js not called

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
teedjee
New here
Posts: 5
Joined: Wed May 17, 2017 2:07 pm

CGI-Node - cgi.bin/cgi-node.js not called

Post by teedjee »

Hello everybody,

I installed Node v4.5.0 on my QNAP TS231+. It is located in /usr/local/bin and seemingly works fine.

Now I need CGI-Node to run Node modules through the Apache cgi.

I did what is advised on http://www.cgi-node.org:

- copy cgi-node.js in /share/Web/cgi.bin, give it full execution rights, and set its shebang as #!/usr/local/bin/node

- copy the following lines in .htaccess (under /share/Web):

Code: Select all

Action cgi-node /cgi-bin/cgi-node.js 
AddHandler cgi-node .jss
I created the following classical cgiNodeInfo.jss file under /share/Web:

Code: Select all

<? cgiNodeInfo() ?>
Seems everything is in place: html files served right, info.php is okay, ./cgi.bin/cgi-node.js runs, .htaccess makes .jss files treated a special way but something is wrong still and I couldn't correct it. When I request cgiNodeInfo.jss from a browser I always get this strange error:

Code: Select all

Not Found
The requested URL /cgi-bin/cgi-node.js/cgiNodeInfo.jss was not found on this server.
Apache Server at xyz.myqnapcloud.com Port 8081
Why are the path to cgi-node.js and cgiNodeInfo.jss concatenated like that? I got the same behavior with different .jss files in different locations.

Thank your for your suggestions.

Note: I haven't changed Apache configuration file and it seems not necessary to do so.
Thanks, Gerard
QNAP TS231+
ARM Cortex AL212 - A15 dual-core processor @1.7GHz and 1GiB RAM
2 x Seagate ST3000DM008-2DM166 CC26 2794.52 GiB in RAID 1
User avatar
Toxic17
Ask me anything
Posts: 6477
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

Re: CGI-Node - cgi.bin/cgi-node.js not called

Post by Toxic17 »

maybe you need to use absolute paths perhaps? /share/Web/cgi-bin/cgi-node.js or even like so: /share/CACHEDEV1_DATA/Web/cgi-bin/cgi-node.js or wherever your absolute path points to the Web folder
Regards Simon

Qnap Downloads
MyQNap.Org Repository
Submit a ticket • QNAP Helpdesk
QNAP Tutorials, User Manuals, FAQs, Downloads, Wiki
When you ask a question, please include the following


NAS: TS-673A QuTS hero h5.1.2.2534 • TS-121 4.3.3.2420 • APC Back-UPS ES 700G
Network: VM Hub3: 500/50 • UniFi UDM Pro: 3.2.9 • UniFi Network Controller: 8.0.28
USW-Aggregation: 6.6.61 • US-16-150W: 6.6.61 • 2x USW Mini Flex 2.0.0 • UniFi AC Pro 6.6.62 • UniFi U6-LR 6.6.62
UniFi Protect: 2.11.21/8TB Skyhawk AI • 3x G3 Instants: 4.69.55 • UniFi G3 Flex: 4.69.55 • UniFi G5 Flex: 4.69.55
teedjee
New here
Posts: 5
Joined: Wed May 17, 2017 2:07 pm

Re: CGI-Node - cgi.bin/cgi-node.js not called

Post by teedjee »

Thanks Simon.

I already tried /share/Web/cgi-bin/cgi-node.js (absolute/relative paths are always a nightmare :D) and it does not work any better. Error message extends path to /share/Web/cgi-bin/cgi-node.js which by the way gave me some proof what's in .htaccess is well understood. I don't think /share/CACHEDEV1_DATA/Web/cgi-bin/cgi-node.js will do anything different as the former is just a symbolic link to the later.

Thanks again, anyway.
Thanks, Gerard
QNAP TS231+
ARM Cortex AL212 - A15 dual-core processor @1.7GHz and 1GiB RAM
2 x Seagate ST3000DM008-2DM166 CC26 2794.52 GiB in RAID 1
Post Reply

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”