|
|
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:
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 ---
address-suppressed |
| Previous: |
|
| ||||||||