(Answer) (Category) NetMAXFAQ : (Category) WebServer :
How do I use CGI on my website?

CGI (Common Gateway Interface) is a great technology for making websites more interactive. A CGI script is a program which is used to generate and customize HTML output or for processing of forms and user data. An example CGI script is included at the bottom of this article.

To enable CGI execution on your website, follow these steps:

  1. Log into the NetMAX interface as an administrative user
  2. Access HOME|Services|WWW
  3. Click Create to make a new website, or the pencil icon to edit an existing website
  4. Supply the proper path and hostname information on the Aliases Tab
  5. Click the OPTIONS tab
  6. Ensure that Enable CGI Execution is checked.
  7. You may also wish to change the Default File to the name of your CGI app, i.e. index.cgi
  8. Store and Commit the changes

This will cause your NetMAX server to treat any file whose name ends in ".cgi" and is marked as executable to be run from anywhere within the path specified in step 4 (including subdirectories) as CGI applications.

Please note that CGI scripts are programs that run on your server. This means that you should be sure that any CGI applications you choose to implement are secure and do not have any undesired side effects. CGI applications will be run as the user "nobody" by default, so they won't likely be able to damage the system, but any directories and or files accessible to the "nobody" user are accessible by CGI programs as well.

For this reason, it is common practice to put all cgi applications under a common directory which is separate from your usual web content. This directory is typically called "cgi-bin." To achieve maximum security, administrators should put the cgi-bin directory in a completely separate directory space. To accomplish this, disable CGI execution on the main site, create the cgi-bin directory in a separate directory space and add a new site by following the instructions above with one key exception: in the box labelled "URL Path" specify /cgi-bin. This means that the URL to the example CGI would become http://www.mynetmax.net/cgi-bin/index.cgi instead of http://www.mynetmax.net/index.cgi.

--- Example CGI script below ---
#!/usr/bin/perl -w
use CGI;
my $query = new CGI;
print $query->header,
  $query->start_html('A Simple Example'),
  $query->h1('A Simple Example');

address-suppressed
Previous: (Answer) UID of user "nobody" changes when upgrading to L2.4Pv4.0x
This document is: http://www.netmax.org/cgi-bin/fom.cgi?file=558
[Search] [Appearance]
This is a Faq-O-Matic 2.721.
This FAQ administered by ...Cybernet Systems Corp.