This page explains how to use CGI scripts with vqServer and provides
a simple example.
There is a more formal overview of vqServer's CGI script support
on the main CGI page.
There are three main requirements for using CGI scripts with vqServer:
-
An appropriate CGI script interpreter must be installed on the server computer.
For example, to run PERL scripts a PERL interpreter must be installed on
the server computer. The exception are native executables or batch or script
files which can be interpreted directly by the server computer operating
system, for example .exe files or .bat files on a Windows system.
vqServer does not include any CGI script interpreters. Some operating
systems (for example Linux) come with a number of CGI script interpreters.
Others (for example Windows) do not and appropriate interpreters must be
obtained from third parties.
-
The action of a vqServer alias corresponding to a CGI script
must be set to Run CGI script. In the default configuration that comes
with vqServer this is most easily achieved by copying CGI scripts
to the website/cgi/ directory (where website/ is the directory
you originally extracted vqserver.zip to). For information on aliases
and actions see the files and aliases page
of the vqServer documentation.
-
There must be a vqServer file type corresponding to the type of CGI
script you want to run whose Interpeter setting is set to the location
and name of the appropriate CGI script interpreter. For example to run PERL
scripts whose extension is .pl there must be a vqServer file
type pl whose interpreter setting points to the PERL interpreter on
the server computer. The exceptions are native executables or batch or script
files which can be interpreted directly by the server computer operating
system, for example .exe files or .bat files on a Windows system,
or CGI scripts on UNIX-like operating systems in which the appropriate
interpreter is specified in the first line of the script. For information
on file type see the file types page
of the vqServer documentation.
Example
This example illustrates creation of a simple CGI script, the necessary
vqServer configuration and invoking the script.
-
Install vqServer and check that it is operating correctly. This example
assumes that you have installed vqServer to a directory named
website/.
-
Obtain a PERL interpreter and install it on the server computer. This example
assumes that you have installed a PERL package to a directory name
c:\apps\perl\ and that the PERL interpreter is therefore
c:\apps\perl\bin\perl.exe.
-
Start the vqServer control centre Click on File types in the
menu on the right of the page. Look for pl in the File extension
column and click on the icon in the Edit column. If the pl
file type isn't there
-
click on New file type in the menu on the right of the page.
-
type pl in the box next to File extension.
Type c:/apps/perl/bin/perl.exe in the box next to Interpreter.
Click the Ok button.
-
Create a simple PERL script using a text editor, for example Windows Notepad.
vqSoft suggests the following contents:
print
"Content-type: text/html
Pragma: no-cache
My first PERL CGI script!
";
The blank line in the middle of that lot is important. Save the file as
website/cgi/test.pl.
-
Invoke the script by typing http://localhost/cgi/test.pl in the address
box of your browser.
vqServer version 1.9. Copyright © 1997-2000
Steve Shering and
vqSoft. Last updated 3 November
1999. |
|
vqServer
FAQs
Register (free!)
Support
Contents
GNUJSP
JDBC |