Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Running C programs from within a web server
Ref. No. QNX.000002385
Category(ies) Utilities, Development
Issue Is it possible to run a C program from within a web server (like CGI) or otherwise incorporate the execution of outside C code into the web browser?




Solution Following is an excerpt from our Slinger web-server help files:

HTTPD_SCRIPTALIAS
Configure CGI scripts. It contains the directory name where Slinger looks for the CGI
executables. Note that if you define HTTPD_SCRIPTALIAS, anybody can run scripts or
processes that reside in this directory on your machine. Not defining
HTTPD_SCRIPTALIAS turns CGI off, causing all CGI requests to fail.

We recommend that you put your documents and scripts in separate directories. In this
example, the documents are in the /usr/webdoc directory, the root document is foo.html,
and the CGI scripts are in /usr/web/cgi.
export HTTPD_ROOT_DIR=/usr/webdoc