ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaie_5.4.0.1/rzag3ch2enablesrvrcgipms.htm

76 lines
5.1 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="topic" />
<meta name="DC.Title" content="How to enable the server to run CGI programs" />
<meta name="abstract" content="The iSeries server stores some CGI programs in QSYS.LIB. You can write the programs in C++, REXX, ILE C, ILE RPG, or ILE COBOL. If the UserID directive is not active, the server profile QTMHHTP1 needs access to the *PGM object and all objects the program accesses. If the UserID directive is active, the UserID profile needs access to the *PGM object and all objects the program accesses. The ScriptAlias directive is required in HTTP Server (powered by Apache) configuration to run a CGI program on the server." />
<meta name="description" content="The iSeries server stores some CGI programs in QSYS.LIB. You can write the programs in C++, REXX, ILE C, ILE RPG, or ILE COBOL. If the UserID directive is not active, the server profile QTMHHTP1 needs access to the *PGM object and all objects the program accesses. If the UserID directive is active, the UserID profile needs access to the *PGM object and all objects the program accesses. The ScriptAlias directive is required in HTTP Server (powered by Apache) configuration to run a CGI program on the server." />
<meta name="DC.Relation" scheme="URI" content="rzaieparcgi.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2002,2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2002,2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzag3ch2enablesrvrcgipms" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>How to enable the server to run CGI programs</title>
</head>
<body id="rzag3ch2enablesrvrcgipms"><a name="rzag3ch2enablesrvrcgipms"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">How to enable the server to run CGI programs</h1>
<div><p>The iSeries™ server
stores some CGI programs in QSYS.LIB. You can write the programs in C++, REXX,
ILE C, ILE RPG, or ILE COBOL. If the UserID directive is not active, the server
profile QTMHHTP1 needs access to the *PGM object and all objects the program
accesses. If the UserID directive is active, the UserID profile needs access
to the *PGM object and all objects the program accesses. The ScriptAlias directive
is required in HTTP Server (powered by Apache) configuration to run a CGI
program on the server.</p>
<p>Here is a summary of the steps you need to take to enable your server to
run CGI programs:</p>
<ol><li>Decide for which CGI mode you will write your program.</li>
<li>Write the C++, REXX, ILE C, ILE RPG, or ILE COBOL program.</li>
<li>Compile your program, if required.</li>
<li>Create a directory structure for your program using MKDIR.</li>
<li>Transfer your program to the new directory.</li>
<li>If you are using HTML, set the source type using CHGPFM.</li>
<li>Create the program object using CRTCMOD and CRTPGM.</li>
<li>Ensure that your program has the correct authority using *PUBLIC, QTMHHTTP
or QTMHHTP1.</li>
<li>Create a new server instance to associate with your program.</li>
<li>Make any changes to your server configuration file that are needed. For
example, you need to add the Exec or ScriptAlias directive at a minimum.</li>
<li>Start or restart the server.</li>
<li>Point your web browser to the URL for the HTML document on the server
where hostname is the fully qualified host domain name of your server.<pre>http://hostname/sample</pre>
<div class="note"><span class="notetitle">Note:</span> For
REXX programs, you only need to indicate the path and the file name in the
EXEC or ScriptAlias directive. REXX CGI execs must reside in database files
named REXX or QREXSRC. For example:<pre>EXEC /REXX/* /QSYS.LIB/AS400CGI.LIB/QREXSRC.FILE/*</pre>
<p>Or
in HTTP Server (powered by Apache):</p>
<pre>ScriptAlias /REXX /QSYS.LIB/AS400CGI.LIB/QREXSRC.FILE/*</pre>
<p>The
URL is :</p>
<pre>http://hostname/REXX/samplecgi.REXX</pre>
</div>
</li>
</ol>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzaieparcgi.htm" title="This topic provides information about Common Gateway Interfaces (CGI).">Common Gateway Interface</a></div>
</div>
</div>
</body>
</html>