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