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