]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/cgi.html
Merge changes from CUPS 1.4svn-r7614.
[thirdparty/cups.git] / doc / help / cgi.html
CommitLineData
757d2cad 1<HTML>
2<!-- SECTION: Getting Started -->
3<HEAD>
4 <TITLE>Using CGI Programs</TITLE>
5</HEAD>
6<BODY>
7
8<P>CUPS has traditionally provided a dynamic web interface
9through dedicated CGI programs that are executed when users open
10special directories on the CUPS server. Each CGI performs
11administration, class, help, job, and printer functions as
12directed by the user, but the actual programs that are run and
13functions that are available are limited to those that were
14originally designed into the scheduler.</P>
15
16<P>Support is now available for CGI programs and specific
17scripting languages, currently Java, Perl, PHP, and Python. The
18interpreters for these languages are currently configured at
19compile time. Future versions may expand the interface to allow
20for generic support of scripting languages similar to the Apache
21"AddHandler" directive, but with external programs instead of
22modules.</P>
23
24<P>Table 1 shows the MIME media types that are reserved for the
25CGI support in CUPS. The names have been chosen to mirror those
26used by Apache:</P>
27
28<DIV CLASS="table"><TABLE SUMMARY="CGI MIME Media Types">
29<CAPTION>Table 1: CGI MIME Media Types</CAPTION>
30<TR>
31 <TH>MIME Media Type</TH>
32 <TH>Description</TH>
33</TR>
34<TR>
35 <TD>application/x-httpd-cgi</TD>
36 <TD>CGI script/program</TD>
37</TR>
38<TR>
39 <TD>application/x-httpd-java</TD>
40 <TD>Java program</TD>
41</TR>
42<TR>
43 <TD>application/x-httpd-perl</TD>
44 <TD>Perl script</TD>
45</TR>
46<TR>
47 <TD>application/x-httpd-php</TD>
48 <TD>PHP script</TD>
49</TR>
50<TR>
51 <TD>application/x-httpd-python</TD>
52 <TD>Python script</TD>
53</TR>
54</TABLE></DIV>
55
56<H2><A NAME="CONFIG">Configuring the Server</A></H2>
57
58<P>In order to enable the corresponding type, you must create a
59new <VAR>/etc/cups/cgi.types</VAR> file which maps the filename
60extensions to the appropriate MIME type, for example:</P>
61
62<PRE CLASS="command">
63application/x-httpd-cgi cgi
64application/x-httpd-java class
65application/x-httpd-perl pl
66application/x-httpd-php php
67application/x-httpd-python py
68</PRE>
69
70<P>CGI scripts/programs (application/x-httpd-cgi) also must have
71execution permissions to be treated as a CGI script or
72program.</P>
73
74<H2><A NAME="LIMITS">Limitations</A></H2>
75
76<P>CUPS implements most of the CGI/1.1 specification, with the
77following exceptions:</P>
78
79<UL>
80
81 <LI>No PATH_INFO or PATH_TRANSLATED support</LI>
82
83 <LI>Limited HTTP field support; only the Content-Length
84 (CONTENT_LENGTH), Cookie (HTTP_COOKIE), and User-Agent
85 (HTTP_USER_AGENT) fields are placed in environment
86 variables at this time</LI>
87
88</UL>
89
90</BODY>
91</HTML>