Apache-ASP

 view release on metacpan or  search on metacpan

site/cgi.html  view on Meta::CPAN

		<td bgcolor=white><font size=-2 face="verdana" color=#993399><b><nobr>&nbsp;</nobr></b></font></td>

		<td bgcolor=white ><font face="verdana,helvetica" size=-1><b><nobr><a href="changes.html" style="text-decoration:none"><font color=#063678>CHANGES</font></a></nobr></b></font></td>		

		</tr>
		
		<tr>
		<td bgcolor=white><font size=-2 face="verdana" color=#993399><b><nobr>&nbsp;</nobr></b></font></td>

		<td bgcolor=white ><font face="verdana,helvetica" size=-1><b><nobr><a href="license.html" style="text-decoration:none"><font color=#063678>LICENSE</font></a></nobr></b></font></td>		

		</tr>
		<tr><td colspan=2><hr size=1></td></tr>
		<tr>
		<td bgcolor=white><font size=-2 face="verdana" color=#993399><b><nobr>&nbsp;</nobr></b></font></td>

		<td bgcolor=white ><font face="verdana,helvetica" size=-1><b><nobr><a href="eg/index.html" style="text-decoration:none"><font color=#063678>EXAMPLES</font></a></nobr></b></font></td>		

		</tr>
		
	</table>

	</td></tr>
	</table>

		<br>
		<center>
		<a href=http://www.apache-asp.org/><img src="powered_by_apache_asp.jpg" width="88" height="31" alt="Powered by Apache::ASP" border="0"></a>
		<br>
		<a href=http://perl.apache.org><img src="powered_by_modperl.gif" width="88" height="31" alt="Powered by ModPerl and Apache" border="0"></a>
		<br>
		<a href=http://www.perl.com><img src="rectangle_power_perl.gif" width="88" height="31" alt="Powered by Perl" border="0"></a>


</center>

</td>



<td valign=top bgcolor=white>
<font size=+0 face=verdana,arial>

<font face=verdana><font class=title size=+1 color=#555555><b>CGI</b></font>
<font face="courier new" size=3><pre>
</pre></font>CGI has been the standard way of deploying web applications long before
ASP came along.  In the CGI gateway world, CGI.pm has been a widely
used module in building CGI applications, and Apache::ASP is compatible
with scripts written with CGI.pm.  Also, as of version 2.19, Apache::ASP
can run in standalone CGI mode for the Apache web server without
<a href=http://perl.apache.org><font size=-1 face=verdana><b>mod_perl</b></font></a> being available.  See &quot;Standalone CGI Mode&quot; section below.
<font face="courier new" size=3><pre>
</pre></font>Following are some special notes with respect to compatibility with CGI
and CGI.pm.  Use of CGI.pm in any of these ways was made possible through 
a great amount of work, and is not guaranteed to be portable with other perl 
ASP implementations, as other ASP implementations will likely be more limited.</font>

	<hr size=1>
	<table width=100% border=0 cellpadding=1 cellspacing=3>
	<tr>
	<td valign=top><font face="lucida console" size=-1>
	
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#Standalone%20Cbddd74cc>Standalone CGI Mode, without mod_perl</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#CGI%20headers>CGI headers</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#CGI.pm>CGI.pm</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#print%28%29ing%20C99232b52>print()ing CGI</a>
			</font>
			</td>
							
		</tr>
		
		<tr>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#Query%20Object4fef5875>Query Object Initialization</a>
			</font>
			</td>
		
			<td valign=top >
			<font face="lucida console" size=-1>
			<a href=#File%20Upload>File Upload</a>
			</font>
			</td>
							
		</tr>
			
	</table>
	<hr size=1>
	<p>

	<p>
	<a name=Standalone%20Cbddd74cc></a>
	<font face=verdana><font class=title size=+0 color=#555555><b>Standalone CGI Mode, without mod_perl</b></font>
<font face="courier new" size=3><pre>
</pre></font>As of version 2.19, Apache::ASP scripts may be run as standalone
<a href=cgi.html><font size=-1 face=verdana><b>CGI</b></font></a> scripts without mod_perl being loaded into Apache.  Work
to date has only been done with mod_cgi scripts under Apache on a
Unix platform, and it is unlikely to work under other web servers 
or Win32 operating systems without further development.
<font face="courier new" size=3><pre>
</pre></font>To run the ./site/eg scripts as CGI scripts, you copy the 
./site directory to some location accessible by your web
server, in this example its /usr/local/apache/htdocs/aspcgi, 
then in your httpd.conf activate Apache::ASP cgi
scripts like so:
<font face="courier new" size=3><pre>
 Alias /aspcgi/ /usr/local/apache/htdocs/aspcgi/
 &lt;Directory /usr/local/apache/htdocs/aspcgi/eg/ &gt;
   AddType application/x-httpd-cgi .htm
   AddType application/x-httpd-cgi .html
   AddType application/x-httpd-cgi .asp
   AddType application/x-httpd-cgi .xml
   AddType application/x-httpd-cgi .ssi
   AllowOverride None
   Options +ExecCGI +Indexes
 &lt;/Directory&gt;
</pre></font>Then install the asp-perl script from the distribution 
into /usr/bin, or some other directory.  This is 
so the CGI execution line at the top of those scripts
will invoke the asp-perl wrapper like so:
<font face="courier new" size=3><pre>
 #!/usr/bin/perl /usr/bin/asp-perl
</pre></font>The asp-perl script is a cgi wrapper that sets up the 
Apache::ASP environment in lieu of the normal mod_perl
handler request.  Because there is no Apache-&gt;dir_config()
data available under mod_cgi, the asp-perl script will load
a asp.conf file that may define a hash %Config of
data for populating the dir_config() data.  An example
of a complex asp.conf file is at <a href=eg/asp.conf>./site/eg/asp.conf</a>
<font face="courier new" size=3><pre>
</pre></font>So, a trivial asp.conf file might look like:
<font face="courier new" size=3><pre>
 # asp.conf
 %Config = (
   &#39;Global&#39; =&gt; &#39;.&#39;,
   &#39;StateDir&#39; =&gt; &#39;/tmp/aspstate&#39;,
   &#39;NoState&#39; =&gt; 0,
   &#39;Debug&#39; =&gt; 3,
 );
</pre></font>The default for NoState is 1 in CGI mode, so one must



( run in 0.807 second using v1.01-cache-2.11-cpan-39bf76dae61 )