]> git.ipfire.org Git - thirdparty/cups.git/blame_incremental - doc/help/cgi.html
Merge changes from CUPS 1.4svn-r7874.
[thirdparty/cups.git] / doc / help / cgi.html
... / ...
CommitLineData
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
9are executed when users open special directories on the CUPS server. Each CGI
10performs administration, class, help, job, and printer functions as directed by
11the user, but the actual programs that are run and functions that are available
12are 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,
15PHP, and Python) for pages you want to provide. The interpreters for these
16languages are currently configured at compile time and are associated with
17MIME media types. <a href="#TABLE1">Table 1</a> shows the MIME media types that
18are reserved for each type of page and are the same as those used by the Apache
19web 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
52new <VAR>/etc/cups/cgi.types</VAR> file which maps the filename
53extensions to the appropriate MIME types, for example:</P>
54
55<PRE CLASS="command">
56application/x-httpd-cgi cgi
57application/x-httpd-java class
58application/x-httpd-perl pl
59application/x-httpd-php php
60application/x-httpd-python py
61</PRE>
62
63<P>CGI scripts/programs (application/x-httpd-cgi) also must have execution
64permissions 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
69following 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>