home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 November / CMCD1104.ISO / Software / Complet / Apache / apache_2.0.52-win32-x86-no_ssl.msi / Data.Cab / F277853_cgi.xml.ja < prev    next >
Extensible Markup Language  |  2004-09-04  |  25KB  |  553 lines

  1. <?xml version='1.0' encoding='iso-2022-jp' ?>
  2. <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
  3. <?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
  4. <!-- English Revision: 1.2.2.9 -->
  5.  
  6. <!--
  7.  Copyright 2002-2004 The Apache Software Foundation
  8.  
  9.  Licensed under the Apache License, Version 2.0 (the "License");
  10.  you may not use this file except in compliance with the License.
  11.  You may obtain a copy of the License at
  12.  
  13.      http://www.apache.org/licenses/LICENSE-2.0
  14.  
  15.  Unless required by applicable law or agreed to in writing, software
  16.  distributed under the License is distributed on an "AS IS" BASIS,
  17.  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18.  See the License for the specific language governing permissions and
  19.  limitations under the License.
  20. -->
  21.  
  22. <manualpage metafile="cgi.xml.meta">
  23.   <parentdocument href="./">How-To / $B%A%e!<%H%j%"%k(B</parentdocument>
  24.  
  25.   <title>Apache Tutorial: CGI $B$K$h$kF0E*%3%s%F%s%D(B</title>
  26.  
  27.   <section id="intro">
  28.     <title>$B$O$8$a$K(B</title>
  29.  
  30.     <related>
  31.       <modulelist>
  32.         <module>mod_alias</module>
  33.         <module>mod_cgi</module>
  34.       </modulelist>
  35.  
  36.       <directivelist>
  37.         <directive module="mod_mime">AddHandler</directive>
  38.         <directive module="core">Options</directive>
  39.         <directive module="mod_alias">ScriptAlias</directive>
  40.       </directivelist>
  41.     </related>
  42.  
  43.     <p>CGI (Common Gateway Interface) $B$O!"%&%'%V%5!<%P$,(B
  44.     $B%3%s%F%s%D@8@.$r$9$k30It%W%m%0%i%`$H6(D4$7$FF0:n$9$k$?$a$NJ}K!$r(B
  45.     $BDj5A$7$F$$$^$9!#$=$N%W%m%0%i%`$O$7$P$7$P(B CGI $B%W%m%0%i%`$d(B
  46.     CGI $B%9%/%j%W%H$H8F$P$l$^$9!#(BCGI $B$O!"%&%'%V%5%$%H$KF0E*$J(B
  47.     $B%3%s%F%s%D$rCV$/$?$a$N:G$b4JC1$G0lHLE*$JJ}K!$G$9!#$3$N%I%-%e%a%s%H$O!"(B
  48.     Apache $B%&%'%V%5!<%P$G(B CGI $B$r@_Dj$7!"(B
  49.     CGI $B%W%m%0%i%`$r=q$-;O$a$k$?$a$NF~Lg=q$H$J$k$G$7$g$&!#(B</p>
  50.   </section>
  51.  
  52.   <section id="configuring">
  53.     <title>CGI $B$r5v2D$9$k$h$&$K(B Apache $B$r@_Dj$9$k(B</title>
  54.  
  55.     <p>CGI $B%W%m%0%i%`$r@5$7$/F0:n$5$;$k$K$O!"(BCGI $B$r5v2D$9$k$h$&$K(B
  56.     Apache $B$N@_Dj$r9T$&I,MW$,$"$j$^$9!#(B
  57.     $B$3$l$r9T$J$&$?$a$NJ}K!$,$$$/$D$+$"$j$^$9!#(B</p>
  58.  
  59.     <section id="scriptalias">
  60.       <title>ScriptAlias</title>
  61.  
  62.       <p><directive module="mod_alias">ScriptAlias</directive>
  63.       $B%G%#%l%/%F%#%V$r;HMQ$7$F!"(B
  64.       CGI $B%W%m%0%i%`MQ$NFCJL$JJL%G%#%l%/%H%j$r(B Apache $B$K@_Dj$7$^$9!#(B
  65.       Apache $B$O!"$3$N%G%#%l%/%H%jCf$NA4$F$N%U%!%$%k$r(B CGI
  66.       $B%W%m%0%i%`$G$"$k$H2>Dj$7$^$9!#(B
  67.       $B$=$7$F!"$3$NFCJL$J%j%=!<%9$,%/%i%$%"%s%H$+$iMW5a$5$l$k$H!"(B
  68.       $B$=$N%W%m%0%i%`$N<B9T$r;n$_$^$9!#(B</p>
  69.  
  70.       <p><directive module="mod_alias">ScriptAlias</directive>
  71.       $B%G%#%l%/%F%#%V$O0J2<$N$h$&$K;HMQ$7$^$9(B:</p>
  72.  
  73.       <example>
  74.         ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/
  75.       </example>
  76.  
  77.       <p>$B%G%U%)%k%H0LCV$K(B Apache $B$r%$%s%9%H!<%k$7$?$J$i$P!"(B
  78.       $B$3$NNc$O%G%U%)%k%H>uBV$N(B <code>httpd.conf</code>
  79.       $B@_Dj%U%!%$%k$K4^$^$l$F$$$^$9!#(B
  80.       <directive module="mod_alias">ScriptAlias</directive>
  81.       $B%G%#%l%/%F%#%V$O!"(BURL $B$NA0$KIU2C$9$k%G%#%l%/%H%j$rDj5A$9$k(B
  82.       <directive module="mod_alias">Alias</directive>
  83.       $B%G%#%l%/%F%#%V$H$+$J$j;w$F$$$^$9!#(B
  84.       <directive>Alias</directive> $B$H(B <directive>ScriptAlias</directive>
  85.       $B$ODL>o!"(B<directive module="core">DocumentRoot</directive>
  86.       $B%G%#%l%/%H%j30$N%G%#%l%/%H%j$N$?$a$K;HMQ$5$l$^$9!#(B
  87.       <directive>Alias</directive> $B$H(B <directive>ScriptAlias</directive>
  88.       $B$H$N:9$O!"(B<directive>ScriptAlias</directive> $B$,@\F,<-$G;O$^$k$9$Y$F$N(B
  89.       URL $B$O(B CGI $B%W%m%0%i%`$H$_$J$5$l$k$H$$$&DI2C$N0UL#$r4^$s$G$$$k$3$H$G$9!#(B
  90.       $B=>$C$F!">e5-$NNc$G$O!"(B<code>/cgi-bin/</code>
  91.       $B$G;O$^$k%j%=!<%9$X$N$"$i$f$k%j%/%(%9%H$KBP$7$F!"%G%#%l%/%H%j(B
  92.       <code>/usr/local/apache2/cgi-bin/</code> $B$+$iDs6!$7!"$=$l$i$r(B
  93.       CGI $B%W%m%0%i%`$H$7$F07$&$h$&(B Apache $B$K<($7$^$9!#(B</p>
  94.  
  95.       <p>$BNc$($P!"(BURL <code>http://dev.rcbowen.com/cgi-bin/test.pl</code>
  96.       $B$,MW5a$5$l$?>l9g!"(BApache $B$O(B $B%U%!%$%k(B
  97.       <code>/usr/local/apache2/cgi-bin/test.pl</code>
  98.       $B$r<B9T$7!"$=$N=PNO$rJV$9$3$H$r;n$_$^$9!#(B
  99.       $B$b$A$m$s!"%U%!%$%k$,B8:_$7!"<B9T2DG=$G$"$j!"7h$a$i$l$?J}K!$G=PNO$rJV$7$^$9!#(B
  100.       $B$=$&$G$J$1$l$P!"(BApache $B$O%(%i!<%a%C%;!<%8$rJV$7$^$9!#(B</p>
  101.     </section>
  102.  
  103.     <section id="nonscriptalias">
  104.       <title>ScriptAlias $B%G%#%l%/%H%j30$N(B CGI</title>
  105.  
  106.       <p>CGI $B%W%m%0%i%`$O!"%;%-%e%j%F%#>e$NM}M3$+$i(B 
  107.       <directive module="mod_alias">ScriptAlias</directive>
  108.       $B$5$l$?%G%#%l%/%H%j$K@)8B$5$l$k$3$H$,$7$P$7$P$"$j$^$9!#$3$NJ}K!$K$h$j!"(B
  109.       CGI $B%W%m%0%i%`$r;HMQ$G$-$k%f!<%6$r4IM}<T$,87$7$/@)8f$9$k$3$H$,$G$-$^$9!#(B
  110.       $B$7$+$7$J$,$i!"E,@Z$J%;%-%e%j%F%#;vA0BP:v$,$H$i$l$k$J$i$P!"(BCGI
  111.       $B%W%m%0%i%`$rG$0U$N%G%#%l%/%H%j$G<B9T$G$-$J$$$h$&$K$9$kM}M3$O$"$j$^$;$s!#(B
  112.       $BNc$($P!"%f!<%6$K(B <directive module="mod_userdir">UserDir</directive>
  113.       $B%G%#%l%/%F%#%V$GH`$i$N%[!<%`%G%#%l%/%H%jG[2<$K%&%'%V%3%s%F%s%D$r;}$?$;$?$$$H$7$^$9!#(B
  114.       $B$b$7!"H`$i$,(B CGI $B%W%m%0%i%`$r;}$D$3$H$rK>$s$G$$$F$b!"%a%$%s$N(B
  115.       <code>cgi-bin</code> $B%G%#%l%/%H%j$X$N%"%/%;%9$,$G$-$J$$>l9g!"(B
  116.       CGI $B%W%m%0%i%`$r<B9T$9$k$3$H$,$G$-$kB>$N>l=j$,I,MW$K$J$j$^$9!#(B</p>
  117.  
  118.       <p>$BG$0U$N%G%#%l%/%H%j$G(B CGI $B$N<B9T$r5v2D$9$k$K$OFsCJ3,$N@_Dj$,I,MW$G$9!#(B
  119.       $B$^$:!"(B<directive
  120.       module="mod_mime">AddHandler</directive> $B$d(B <directive
  121.       module="core">SetHandler</directive> $B%G%#%l%/%F%#%V$K$h$C$F(B
  122.       <code>cgi-script</code> $B%O%s%I%i$,2DG=$K$J$C$F$$$kI,MW$,$"$j$^$9!#(B
  123.       $B<!$K!"(B<directive module="core">Options</directive> $B%G%#%l%/%F%#%V$G(B
  124.       <code>ExecCGI</code> $B$,;XDj$5$l$F$$$J$1$l$P$J$j$^$;$s!#(B</p>
  125.     </section>
  126.  
  127.     <section id="options">
  128.       <title>CGI $B$N<B9T$r2DG=$K$9$k$?$a$K(B Options $B$rL@<(E*$K;HMQ$9$k(B</title>
  129.  
  130.       <p>$B%5!<%P$N%a%$%s$N@_Dj%U%!%$%kCf$G(B <directive module="core">Options</directive>
  131.       $B%G%#%l%/%F%#%V$rL@<(E*$K;HMQ$9$k$3$H$G!"FCDj$N%G%#%l%/%H%jG[2<$G(B
  132.       CGI $B$N<B9T$r5v2D$9$k$h$&$K;XDj$9$k$3$H$,$G$-$^$9(B:</p>
  133.  
  134.       <example>
  135.         <Directory /usr/local/apache2/htdocs/somedir><br />
  136.         <indent>
  137.           Options +ExecCGI<br />
  138.         </indent>
  139.         </Directory>
  140.       </example>
  141.  
  142.       <p>$B>e5-%G%#%l%/%F%#%V$O!"(BCGI $B%U%!%$%k$N<B9T$r2DG=$K$9$k$h$&(B
  143.       Apache $B$KEA$($^$9!#$^$?!"$I$N%U%!%$%k$,(B CGI $B%U%!%$%k$+$r(B
  144.       $B%5!<%P$KEA$($kI,MW$,$"$j$^$9!#<!$N(B
  145.       <directive module="mod_mime">AddHandler</directive>
  146.       $B%G%#%l%/%F%#%V$NNc$G$O!"(B<code>cgi</code> $B$^$?$O(B <code>pl</code>
  147.       $B$r3HD%;R$K;}$D$9$Y$F$N%U%!%$%k$r(B CGI
  148.       $B%W%m%0%i%`$H$7$F$_$J$9$3$H$r%5!<%P$KEA$($^$9(B:</p>
  149.  
  150.       <example>
  151.         AddHandler cgi-script .cgi .pl
  152.       </example>
  153.     </section>
  154.  
  155.     <section id="htaccess">
  156.       <title>.htaccess files</title>
  157.  
  158.       <p><a href="htaccess.html"><code>.htaccess</code> $B%A%e!<%H%j%"%k(B</a>
  159.       $B$O(B <code>httpd.conf</code> $B$rJQ99$G$-$J$$>l9g$K$I$&$d$C$F(B CGI $B%W%m%0%i%`$r(B
  160.       $B;H$($k$h$&$K$9$k$+$r@bL@$7$F$$$^$9!#(B</p>
  161.     </section>
  162.  
  163.     <section id="userdir">
  164.       <title>User $B%G%#%l%/%H%j(B</title>
  165.  
  166.       <p><code>.cgi</code> $B$G=*$o$k$9$Y$F$N%U%!%$%k$KBP$7$F(B CGI $B%W%m%0%i%`$N(B
  167.       $B<B9T$r5v2D$9$k$K$O!"0J2<$N@_Dj$r;HMQ$G$-$^$9!#(B</p>
  168.  
  169.       <example>
  170.       <Directory /home/*/public_html><br/>
  171.       <indent>
  172.         Options +ExecCGI<br/>
  173.         AddHandler cgi-script .cgi<br/>
  174.       </indent>
  175.       </Directory>
  176.       </example>
  177.  
  178.       <p>$B%f!<%6%G%#%l%/%H%j$N(B <code>cgi-bin</code> $B%5%V%G%#%l%/%H%j$N(B
  179.       $B$9$Y$F$N%U%!%$%k$r(B CGI $B%W%m%0%i%`$H$7$F;XDj$7$?$$>l9g$K$O(B
  180.       $B0J2<$N$h$&$J$b$N$r;H$$$^$9!#(B</p>
  181.  
  182.       <example>
  183.       <Directory /home/*/public_html/cgi-bin><br/>
  184.       <indent>
  185.         Options ExecCGI<br/>
  186.         SetHandler cgi-script<br/>
  187.       </indent>
  188.       </Directory>
  189.       </example>
  190.  
  191.     </section>
  192.   </section>
  193.  
  194.   <section id="writing">
  195.     <title>CGI $B%W%m%0%i%`$r=q$/(B</title>
  196.  
  197.     <p>$B!VDL>o$N!W%W%m%0%i%_%s%0$H(B CGI
  198.     $B%W%m%0%i%_%s%0$N4V$K$O<g$KFs$D$N0c$$$,$"$j$^$9!#(B</p>
  199.  
  200.     <p>$B0l$D$O!"(BCGI $B%W%m%0%i%`$N$9$Y$F$N=PNO$K$O(B MIME-type
  201.     $B%X%C%@$rIU$1$J$1$l$P$J$j$^$;$s!#(B
  202.     $B$3$l$O$I$N$h$&$J<oN`$N%3%s%F%s%D$r<u$1<h$C$F$$$k$+$r%/%i%$%"%s%H$K<($9(B
  203.     HTTP $B%X%C%@$G$9!#$[$H$s$I$N>l9g$G$O!"<!$N$h$&$K=PNO$7$^$9(B:</p>
  204.  
  205.     <example>
  206.       Content-type: text/html
  207.     </example>
  208.  
  209.     <p>$B$b$&0l$D$O!"=PNO$r(B HTML
  210.     $B$+!"%V%i%&%6$,I=<($9$k$3$H$,$G$-$k2?$+B>$N7A<0$K$9$kI,MW$,$"$j$^$9!#(B
  211.     $BBgDq$N>l9g$O(B HTML $B$G$7$g$&$,!"(BGIF $B%$%a!<%8$dB>$NHs(B HTML
  212.     $B%3%s%F%s%D$r=PNO$9$k(B CGI $B%W%m%0%i%`$r=q$/$3$H$b$"$k$G$7$g$&!#(B</p>
  213.  
  214.     <p>$B$3$l$iFsE@0J30$G$O!"(BCGI $B%W%m%0%i%`$r=q$/$3$H$O!"(B
  215.     $B$"$J$?$,=q$$$F$$$kB>$N%W%m%0%i%`$H$h$/;w$F$$$k$G$7$g$&!#(B</p>
  216.  
  217.     <section id="firstcgi">
  218.       <title>$B:G=i$N(B CGI $B%W%m%0%i%`(B</title>
  219.  
  220.       <p>$B<!$K<($9$N$O!"%V%i%&%6$K(B 1 $B9T0u;z$9$k(B CGI
  221.       $B%W%m%0%i%`$NNc$G$9!#0J2<$rF~NO$7!"(B<code>first.pl</code>
  222.       $B$H$$$&%U%!%$%k$KJ]B8$7!"$=$l$r(B <code>cgi-bin</code>
  223.       $B%G%#%l%/%H%j$KCV$$$F$/$@$5$$!#(B</p>
  224.  
  225.       <example>
  226.         #!/usr/bin/perl<br />
  227.         print "Content-type: text/html\n\n";<br />
  228.         print "Hello, World.";
  229.       </example>
  230.  
  231.       <p>Perl $B$K@:DL$7$F$$$J$/$F$b!"(B
  232.       $B2?$,5/$3$k$+$rM}2r$9$k$3$H$O$G$-$k$G$7$g$&!#(B1 $B9TL\$O!"(B
  233.       <code>/usr/bin/perl</code> $B$G8+$D$1$i$l$k%$%s%?%W%j%?$K(B
  234.       $B$3$N%U%!%$%k$r6!5k$9$k$3$H$G$3$N%W%m%0%i%`$,<B9T$5$l$k$3$H$r(B
  235.       Apache $B$K(B ($B%7%'%k>e$G<B9T$7$h$&$H$7$F$$$k$J$i$P!"$=$N%7%'%k$K(B ) 
  236.       $B<($7$^$9!#(B2 $B9TL\$O!"A0=R$7$?$H$*$j(B content-type $B$NDj5A$r0u;z$7$^$9!#(B
  237.       $B$3$l$K$OI|5"2~9T$NFs$D$NAH$r8e$KIU2C$7$^$9!#(B
  238.       $B$3$l$K$h$j!"%X%C%@$N=*$j$K6u9T$,CV$+$l!"(BHTTP
  239.       $B%X%C%@$N=*$j$H%\%G%#$N;O$^$j$r<($7$^$9!#(B3 $B9TL\$O!"(B"Hello, World."
  240.       $B$H$$$&J8;zNs$r0u;z$7!"$3$l$G=*$j$H$J$j$^$9!#(B</p>
  241.  
  242.       <p>$B9%$_$N%V%i%&%6$r3+$-!"%"%I%l%9(B</p>
  243.  
  244.       <example>
  245.         http://www.example.com/cgi-bin/first.pl
  246.       </example>
  247.  
  248.       <p>$B$"$k$$$O%U%!%$%k$rCV$$$?%m%1!<%7%g%s$r;XDj$9$k$H!"(B
  249.       <code>Hello, World.</code>
  250.       $B$H$$$&(B 1 $B9T$,%V%i%&%6%&%#%s%I$K8=$l$k$G$7$g$&!#(B
  251.       $B$=$l$O$"$^$j%(%-%5%$%F%#%s%0$J$3$H$G$O$"$j$^$;$s!#(B
  252.       $B$7$+$7!"$3$l$,$&$^$/F0$1$P!"(B
  253.       $BB>$N$I$N$h$&$J$b$N$G$bF0$+$9$3$H$,$G$-$k$h$&$K$J$j$^$9!#(B</p>
  254.     </section>
  255.   </section>
  256.  
  257.   <section id="troubleshoot">
  258.     <title>$B$7$+$7!"$^$@F0$+$J$$(B !</title>
  259.  
  260.     <p>$B%&%'%V$+$i(B CGI $B%W%m%0%i%`$X$N%"%/%;%9$r9T$J$C$?$H$-!"(B
  261.     $B%V%i%&%6$G8+$k2DG=@-$,$"$k;M$D$N4pK\E*$J$3$H$,$"$j$^$9(B:</p>
  262.  
  263.     <dl>
  264.       <dt>CGI $B%W%m%0%i%`$N=PNO(B</dt>
  265.       <dd>$BAG@2$i$7$$(B ! $B$=$l$O$9$Y$F$,$&$^$/F0$$$?$3$H$r0UL#$7$^$9!#(B
  266.       $B=PNO$,@5>o$@$1$l$I$b!"%V%i%&%6$,@5>o$K=hM}$7$F$/$l$J$$>l9g$O!"(B
  267.       $B@5$7$$(B <code>Content-Type</code> $B$r(B CGI $B%W%m%0%i%`Fb$G(B
  268.       $B%;%C%H$7$?$+$r3NG'$7$F$/$@$5$$!#(B</dd>
  269.  
  270.       <dt>CGI $B%W%m%0%i%`$N%=!<%9%3!<%I!"$^$?$O(B "POST Method Not Allowed"
  271.       $B$H$$$&%a%C%;!<%8(B</dt> 
  272.       <dd>$B$3$l$O!"(BCGI $B%W%m%0%i%`$r=hM}$G$-$k$h$&(B Apache
  273.       $B$rE,@Z$K@_Dj$7$F$$$J$+$C$?$3$H$r0UL#$7$^$9!#(B<a
  274.       href="#configuring">$B!V(BCGI $B$r5v2D$9$k$h$&$K(B
  275.       Apache $B$r@_Dj$9$k!W(B</a>$B$N>O$rFI$_D>$7!"(B
  276.       $B$"$J$?$,2?$r4V0c$($?$+$rC5$7$F$_$F$/$@$5$$!#(B
  277.       </dd>
  278.  
  279.       <dt>$B%a%C%;!<%8$,(B "Forbidden" $B$G;O$^$C$F$$$k(B</dt>
  280.       <dd>$B$3$l$O%Q!<%_%C%7%g%s$NLdBj$H$$$&$3$H$r0UL#$7$^$9!#(B
  281.       <a href="#errorlogs">Apache $B$N%(%i!<%m%0(B</a>$B$H!"8e=R$N(B<a
  282.       href="#filepermissions">$B!V%U%!%$%k$N%Q!<%_%C%7%g%s!W(B</a>
  283.       $B$N>O$r%A%'%C%/$7$F$/$@$5$$!#(B
  284.       </dd>
  285.  
  286.       <dt>"Internal Server Error" $B$H$$$&%a%C%;!<%8(B</dt>
  287.       <dd><a href="#errorlogs">Apache
  288.       $B$N%(%i!<%m%0(B</a>$B$r%A%'%C%/$9$k$H!"(B"Premature end of script headers"
  289.       $B$H$$$&%m%0$,5-O?$5$l$F$$$k$H;W$$$^$9!#$=$7$F!"$*$=$i$/(B CGI
  290.       $B%W%m%0%i%`$K$h$C$F@8@.$5$l$?%(%i!<%a%C%;!<%8$b5-O?$5$l$F$$$k$G$7$g$&!#(B
  291.       $B$3$N>l9g!"(BCGI $B%W%m%0%i%`$,E,@Z$J(B
  292.       HTTP $B%X%C%@$r=PNO$G$-$J$$860x$rCN$k$?$a$K!"(B
  293.       $B0J2<$N3F>O$G%A%'%C%/$7$F$_$F$/$@$5$$!#(B</dd>
  294.     </dl>
  295.  
  296.     <section id="permissions">
  297.       <title>$B%U%!%$%k$N%Q!<%_%C%7%g%s(B</title>
  298.  
  299.       <p>$B%5!<%P$O$"$J$?$N8"8B$G<B9T$5$l$F$$$J$$$N$rK:$l$J$$$h$&$K!#(B
  300.       $B$D$^$j!"5/F0$9$k$H$-!"%5!<%P$OFC8"$r$b$?$J$$%f!<%6(B - $BDL>o(B <code>nobody</code>
  301.       $B$d(B <code>www</code> $B$N8"8B$G<B9T$5$l$^$9!#$7$?$,$C$F!"$"$J$?$,=jM-$9$k(B
  302.       $B%U%!%$%k$r<B9T$9$k$K$OJL$N%Q!<%_%C%7%g%s$,I,MW$H$J$j$^$9!#(B
  303.       $BDL>o!"(B<code>nobody</code> $B$,<B9T$9$k$N$K==J,$J%Q!<%_%C%7%g%s$rM?$($kJ}K!$O!"(B
  304.       $B%U%!%$%k$KC/$G$b<B9T2DG=$H$9$k%Q!<%_%C%7%g%s$rM?$($k$3$H$G$9(B:</p>
  305.  
  306.       <example>
  307.         chmod a+x first.pl
  308.       </example>
  309.  
  310.       <p>$B$^$?!"$b$7$"$J$?$N%W%m%0%i%`$,B>$N%U%!%$%k$rFI$_=q$-$9$k$J$i$P!"(B
  311.       $B$=$l$i$N%U%!%$%k$O!"$3$l$,2DG=$H$J$k@5$7$$%Q!<%_%C%7%g%s(B
  312.       $B$r;}$C$F$$$kI,MW$,$"$j$^$9!#(B</p>
  313.  
  314.     </section>
  315.  
  316.     <section id="pathinformation">
  317.       <title>$B%Q%9>pJs$H4D6-(B</title>
  318.  
  319.       <p>$B%3%^%s%I%i%$%s$+$i%W%m%0%i%`$r<B9T$9$k$H$-!"(B
  320.       $B0U<1$7$J$/$F$b%7%'%k$KEO$5$l$k>pJs$,$"$j$^$9!#(B
  321.       $BNc$($P!";2>H$9$k%U%!%$%k$N$?$a$K$I$3$r8!:w$7$?$i$h$$$+$r(B
  322.       $B%7%'%k$KEA$($k(B <code>PATH</code> $B$,$"$j$^$9!#(B</p>
  323.  
  324.       <p>$B%W%m%0%i%`$,(B CGI $B%W%m%0%i%`$H$7$F%&%'%V%5!<%P$K$h$C$F<B9T$5$l$k$H$-!"(B
  325.       $B$=$l$OF1$8(B <code>PATH</code> $B$G$O$J$$$+$b$7$l$^$;$s!#(B
  326.       CGI $B%W%m%0%i%`Fb$G8F$S=P$9$"$i$f$k%W%m%0%i%`(B
  327.       ($BNc$($P!"(B<code>sendmail</code> $B$N$h$&$J$b$N(B) $B$O!"(B
  328.       $B%U%k%Q%9$G;XDj$9$kI,MW$,$"$k$G$7$g$&!#$=$l$K$h$j!"(BCGI
  329.       $B%W%m%0%i%`$r<B9T$7$h$&$H$7$?$H$-!"(B
  330.       $B%7%'%k$O$=$N$h$&$J%W%m%0%i%`$r8+$D$1$k$3$H$,$G$-$^$9!#(B</p>
  331.  
  332.       <p>$BF1MM$J$3$H$O!"%9%/%j%W%H$N%$%s%?%W%j%?(B ($B$7$P$7$P(B <code>perl</code>)
  333.       $B$X$N%Q%9$G!"(BCGI $B%W%m%0%i%`$N(B 1 $B9TL\$K<!$N$h$&$K<($5$l$^$9(B:</p>
  334.  
  335.       <example>
  336.         #!/usr/bin/perl
  337.       </example>
  338.  
  339.       <p>$B$3$l$,%$%s%?!<%W%j%?$X$N<B:]$N%Q%9$G$"$k$3$H$r3N<B$K$7$F$*$-$^$9!#(B</p>
  340.     </section>
  341.  
  342.     <section id="syntaxerrors">
  343.       <title>$B%W%m%0%i%`%(%i!<(B</title>
  344.  
  345.       <p>CGI
  346.       $B%W%m%0%i%`$,<:GT$9$k$N$OBgDq!"%W%m%0%i%`<+?H$KLdBj$,$"$k>l9g$G$9!#(B
  347.       $B0lEY(B CGI $B$N;H$$J}$rM}2r$7!"A0=R$NFs$D$N8m$j$rHH$7$F$$$J$$$J$i$P!"(B
  348.       $B$^$:4V0c$$$J$/$=$&$G$7$g$&!#%V%i%&%6$r;H$C$F%F%9%H$9$kA0$K(B
  349.       $B$^$:3NG'$9$k$3$H$O!"%3%^%s%I%i%$%s$+$i%W%m%0%i%`$,<B9T$G$-$k$3$H$G$9!#(B
  350.       $BNc$($P!"0J2<$r<B9T$7$F$_$F$/$@$5$$(B:</p>
  351.  
  352.       <example>
  353.       cd /usr/local/apache2/cgi-bin<br/>
  354.       ./first.pl
  355.       </example>
  356.  
  357.       <p>(<code>perl</code> $B%$%s%?%W%j%?$O8F$P$J$$$G$/$@$5$$!#(B
  358.       $B%7%'%k$H(B Apache $B$,%9%/%j%W%H$N:G=i$N9T$N(B <a
  359.       href="#pathinformation">$B%Q%9>pJs(B</a> $B$r;H$C$F8+$D$1$^$9!#(B)</p>
  360.  
  361.       <p>$B:G=i$K%W%m%0%i%`$+$i=PNO$5$l$k$N$O(B <code>Content-Type</code> $B$r4^$_!"(B
  362.       $B8e$K6u9T$NB3$/(B HTTP $B%X%C%@$G$J$1$l$P$J$j$^$;$s!#B>$N$b$N$,=PNO$5$l$F$$$k(B
  363.       $B>l9g$O!"(BApache $B$O$3$N%W%m%0%i%`$r%5!<%P7PM3$G<B9T$7$h$&$H$7$?$H$-$K$O(B
  364.       <code>Premature end of script headers</code> $B%(%i!<$r=PNO$7$^$9!#>\:Y$O(B
  365.       $B>e5-$N(B <a
  366.       href="#writing">CGI $B%W%m%0%i%`$r=q$/(B</a> $B$rFI$s$G$/$@$5$$!#(B</p>
  367.     </section>
  368.  
  369.     <section id="errorlogs">
  370.       <title>$B%(%i!<%m%0(B</title>
  371.  
  372.       <p>$B%(%i!<%m%0$OM'C#$G$9!#(B
  373.       $BA4$F$N$&$^$/$$$+$J$$$3$H$O!"%(%i!<%m%0$K%a%C%;!<%8$r@8@.$7$^$9!#(B
  374.       $BI,$:$=$l$r:G=i$K8+$k$Y$-$G$9!#(B
  375.       $B$b$7!"$"$J$?$,%&%'%V%5%$%H$r<g:E$7$F$$$k>l=j$,(B
  376.       $B%(%i!<%m%0$N;2>H$r5v$7$F$$$J$$$J$i$P!"$-$C$HB>$N%5%$%H$G<g:E$9$k$Y$-$G$9!#(B
  377.       $B%(%i!<%m%0$NFI$_J}$r3X$V$3$H$G!"$[$H$s$IA4$F$NLdBj$,?WB.$K3NG'$5$l!"(B
  378.       $B?WB.$K2r7h$5$l$k$H$$$&$3$H$,J,$+$k$G$7$g$&!#(B</p>
  379.     </section>
  380.  
  381.     <section id="suexec">
  382.       <title>Suexec</title>
  383.  
  384.       <p><a href="../suexec.html">suexec</a> $B%5%]!<%H%W%m%0%i%`$O(B
  385.       $B%P!<%A%c%k%[%9%H$d%f!<%6$N%[!<%`%G%#%l%/%H%j$N>l=j$K0M$C$F(B
  386.       CGI $B%W%m%0%i%`$r0c$&%f!<%68"8B$N2<$GAv$i$;$k$3$H$r2DG=$K$7$^$9!#(B
  387.       Suexec $B$N8"8B$N%A%'%C%/$OHs>o$K87$7$/!"$=$l$rK~$?$5$J$$>l9g$O(B
  388.       CGI $B%W%m%0%i%`$,(B <code>Premature end of script headers</code> $B%(%i!<$G(B
  389.       $B<B9T$5$l$^$;$s!#(B</p>
  390.  
  391.       <p>suexec $B$r;H$C$F$$$k$+$I$&$+$rD4$Y$?$a$K$O(B <code>apachectl
  392.       -V</code> $B$r<B9T$7$F!"(B<code>SUEXEC_BIN</code> $B$N>l=j$rD4$Y$F$/$@$5$$!#(B
  393.       Apache $B$,$=$3$K(B suexec $B$N%P%$%J%j$rH/8+$7$?>l9g$O!"(Bsuexec $B$,(B
  394.       $B;HMQ$5$l$^$9!#(B</p>
  395.  
  396.       <p>suexec $B$r40A4$KM}2r$7$F$$$J$$8B$j!";H$&$Y$-$G$O$"$j$^$;$s!#(B
  397.       suexec $B$rL58z$K$9$k$K$O!"(B<code>SUEXEC_BIN</code> $B$+$i;X$5$l$F$$$k(B
  398.       <code>suexec</code> $B%P%$%J%j$r:o=|(B ($B$+L>A0$rJQ99(B) $B$9$k$@$1$G$9!#(B
  399.       <a href="../suexec.html">suexec</a> $B$rFI$s$@8e$G!"$^$@$=$l$r(B
  400.       $B;H$$$?$$$N$G$"$l$P!"(B<code>suexec -V</code> $B$r<B9T$7$F(B suexec $B$N(B
  401.       $B%m%0%U%!%$%k$N0LCV$rD4$Y!"$=$N%m%0%U%!%$%k$r;H$C$F%]%j%7!<0cH?$r(B
  402.       $B8+$D$1$F$/$@$5$$!#(B</p>
  403.     </section>
  404.   </section>
  405.  
  406.   <section id="behindscenes">
  407.     <title>$BN"$G2?$,5/$3$C$F$$$k$N$+(B?</title>
  408.  
  409.     <p>CGI $B%W%m%0%i%_%s%0$K=,=O$9$k$H!"(B
  410.     $BN"$G5/$3$C$F$$$k$3$H$K$D$$$F99$KM}2r$9$k$3$HLr$KN)$A$^$9!#(B
  411.     $B%V%i%&%6$H%5!<%P$,$I$N$h$&$KAj8_DL?.$9$k$+$K$D$$$F$OFC$K$=$&$G$9!#(B
  412.     $B$J$<$J$i!"(B"Hello, World."
  413.     $B$r0u;z$9$k%W%m%0%i%`$r=q$/$3$H$O$*$*$$$K7k9=$G$9$,!"(B
  414.     $B$=$l$OFC$KM-1W$G$O$"$j$^$;$s!#(B</p>
  415.  
  416.     <section id="env">
  417.       <title>$B4D6-JQ?t(B</title>
  418.  
  419.       <p>$B4D6-JQ?t$O!"(B
  420.       $B$"$J$?$,%3%s%T%e!<%?$r;H$&$H$-$KJU$j$KB8:_$7$F$$$kCM$G$9!#(B
  421.       $B$=$l$i$O!"%Q%9(B
  422.       ($B%3%^%s%I$r%?%$%W$7$?$H$-$K<B9T$9$k<B:]$N%U%!%$%k$rC5$7=P$9$H$3$m(B)$B!"(B
  423.       $B%f!<%6L>!"C<Kv7?$J$I$N$h$&$JJXMx$J$b$N$G$9!#(B
  424.       $BDL>o!"IaCJ;HMQ$7$F$$$k4D6-JQ?t$N40A4$J%j%9%H$rD4$Y$k$K$O!"(B
  425.       $B%3%^%s%I%W%m%s%W%H$G(B <code>env</code> $B$rF~NO$7$^$9!#(B</p>
  426.  
  427.       <p>CGI $B$N=hM}Cf!"%5!<%P$H%V%i%&%6$b4D6-JQ?t$r@_Dj$7!"(B
  428.       $B$=$l$K$h$jAj8_$KDL?.$9$k$3$H$,$G$-$k$h$&$K$J$j$^$9!#(B
  429.       $B$=$N4D6-JQ?t$O!"%V%i%&%6%?%$%W(B (Netscape, IE, Lynx)$B!"%5!<%P%?%$%W(B
  430.       (Apache, IIS, WebSite)$B!"<B9T$5$l$F$$$k(B CGI
  431.       $B%W%m%0%i%`$NL>A0$J$I$G$9!#(B</p>
  432.  
  433.       <p>$B$3$l$i$NJQ?t$O(B CGI $B%W%m%0%i%^$,;HMQ$G$-$^$9!#(B
  434.       $B$=$7$F!"$=$l$O%/%i%$%"%s%H$H%5!<%P$NDL?.$NOC$NH>J,$G$9!#(B
  435.       $BI,MW$JJQ?t$N40A4$J%j%9%H$O(B <a
  436.       href="http://hoohoo.ncsa.uiuc.edu/cgi/env.html"
  437.       >http://hoohoo.ncsa.uiuc.edu/cgi/env.html</a> $B$K$"$j$^$9!#(B</p>
  438.  
  439.       <p>$B0J2<$NC1=c$J(B Perl CGI
  440.       $B%W%m%0%i%`$O!"EO$5$l$kA4$F$N4D6-JQ?t$rI=<($7$^$9!#F1MM$N%W%m%0%i%`$O!"(B
  441.       Apache $B%G%#%9%H%j%S%e!<%7%g%s$N(B <code>cgi-bin</code>
  442.       $B%G%#%l%/%H%j$KFs$D4^$^$l$F$$$^$9!#(B
  443.       $B$$$/$D$+$NJQ?t$,I,?\$G$"$j!"$$$/$D$+$OG$0U$G$"$k$3$H$KCm0U$7$F$/$@$5$$!#(B
  444.       $B$=$7$F!"8x<0$N%j%9%H$K$O$J$$$$$/$D$+$NJQ?t$,I=<($5$l$F$$$k$+$b$7$l$^$;$s!#(B
  445.       $B$5$i$K!"(BApache $B$O%G%U%)%k%H$GMQ0U$5$l$F$$$k4pK\E*$J$b$N$K(B
  446.       <a href="../env.html">$B$"$J$?<+?H$N4D6-JQ?t$r2C$($k(B</a>$B$?$a$N!"(B
  447.       $BB?$/$N0[$J$kJ}K!$rMQ0U$7$F$7$^$9!#(B</p>
  448.  
  449.       <example>
  450.         #!/usr/bin/perl<br />
  451.         print "Content-type: text/html\n\n";<br />
  452.         foreach $key (keys %ENV) {<br />
  453.         <indent>
  454.           print "$key --> $ENV{$key}<br>";<br />
  455.         </indent>
  456.         }
  457.       </example>
  458.     </section>
  459.  
  460.     <section id="stdin">
  461.       <title>STDIN $B$H(B STDOUT</title>
  462.  
  463.       <p>$B%5!<%P$H%/%i%$%"%s%H4V$N$b$&0l$D$NDL?.$O!"I8=`F~NO(B
  464.       (<code>STDIN</code>)$B$HI8=`=PNO(B (<code>STDOUT</code>)
  465.       $B$rDL$8$F9T$J$o$l$^$9!#DL>o$NJ8L.$K$*$$$F!"(B<code>STDIN</code>
  466.       $B$O%-!<%\!<%I$d%W%m%0%i%`$,F0:n$9$k$?$a$KM?$($i$l$k%U%!%$%k$r0UL#$7!"(B
  467.       <code>STDOUT</code> $B$ODL>o%3%s%=!<%k$^$?$O%9%/%j!<%s$r0UL#$7$^$9!#(B</p>
  468.  
  469.       <p>$B%&%'%V%U%)!<%`$+$i(B CGI $B%W%m%0%i%`$X(B<code>POST</code>
  470.       $B$7$?$H$-!"%U%)!<%`$N%G!<%?$OFCJL$J%U%)!<%^%C%H$GB+$M$i$l!"(B
  471.       <code>STDIN</code> $B$rDL$7$F!"(BCGI $B%W%m%0%i%`$K0z$-EO$5$l$^$9!#(B
  472.       $B%W%m%0%i%`$O%G!<%?$,%-!<%\!<%I(B
  473.       $B$b$7$/$O%U%!%$%k$+$iMh$F$$$?$+$N$h$&$K=hM}$9$k$3$H$,$G$-$^$9!#(B</p>
  474.  
  475.       <p>$B!VFCJL$J%U%)!<%^%C%H!W$O$H$F$bC1=c$G$9!#%U%#!<%k%IL>$HCM$O%$%3!<%k(B
  476.       (=) $B$G7k$P$l$^$9!#$=$7$FCM$NAH$O%"%s%Q%5%s%I(B (&) $B$G7k$P$l$^$9!#(B
  477.       $B%9%Z!<%9!"%"%s%Q%5%s%I!"%$%3!<%k$N$h$&$JLLE]$JJ8;z$O!"(B
  478.       $B$=$l$i$,F0:n$rBLL\$K$7$J$$$h$&$K$=$NJ8;z$KAjEv$9$k(B 16 $B?J$KJQ49$5$l$^$9!#(B
  479.       $BA4%G!<%?J8;zNs$O!"0J2<$N$h$&$K$J$j$^$9(B:
  480.       </p>
  481.  
  482.       <example>
  483.         name=Rich%20Bowen&city=Lexington&state=KY&sidekick=Squirrel%20Monkey
  484.       </example>
  485.  
  486.       <p>$B;~!9!"$3$N$h$&$JJ8;zNs$,(B URL
  487.       $B$KIU2C$5$l$k$N$r8+$k$G$7$g$&!#$=$N>l9g!"%5!<%P$O(B
  488.       <code>QUERY_STRING</code> $B$H$$$&4D6-JQ?t$K$=$NJ8;zNs$rF~$l$^$9!#$=$l$O(B
  489.       <code>GET</code> $B%j%/%(%9%H$H8F$P$l$^$9!#(B
  490.       HTML $B%U%)!<%`$G$O!"%G!<%?$rEO$9$?$a$K(B <code>GET</code> $B$H(B
  491.       <code>POST</code> $B$N$I$A$i$r;HMQ$9$k$+$r!"(B<code>FORM</code> $B%?%0$N(B
  492.       <code>METHOD</code> $BB0@-$N@_Dj$G;XDj$7$^$9!#(B</p>
  493.  
  494.       <p>CGI $B%W%m%0%i%`$O!"$=$NJ8;zNs$rLr$KN)$D>pJs$KJ,3d$9$k@UG$$,$"$j$^$9!#(B
  495.       $B9,$$$K$b!"$=$N%G!<%?=hM}$r=u$1$k%i%$%V%i%j$d%b%8%e!<%k$,B8:_$7$^$9!#(B
  496.       $B$3$l$i$O!"(BCGI $B%W%m%0%i%`$NB>$NLL$G$bF1MM$KLr$KN)$A$^$9!#(B</p>
  497.     </section>
  498.   </section>
  499.  
  500.   <section id="libraries">
  501.     <title>CGI $B%b%8%e!<%k(B/$B%i%$%V%i%j(B</title>
  502.  
  503.     <p>CGI $B%W%m%0%i%`$r=q$/$H$-!"LLE]$J;E;v$NBgItJ,$r$7$F$/$l$k(B
  504.     $B%3!<%I%i%$%V%i%j$^$?$O%b%8%e!<%k$r;H$&$3$H$r8!F$$9$Y$-$G$9!#(B
  505.     $B$3$l$O%(%i!<$r8:$i$7!"Aa$$3+H/$K$D$J$,$j$^$9!#(B</p>
  506.  
  507.     <p>Perl $B$G(B CGI $B%W%m%0%i%`$r=q$$$F$$$k$J$i!"%b%8%e!<%k$O(B <a
  508.     href="http://www.cpan.org/">CPAN</a> $B$GDs6!$5$l$F$$$^$9!#(B
  509.     $B$3$NL\E*$N$?$a$N:G$bIa5Z$7$F$$$k%b%8%e!<%k$O(B <code>CGI.pm</code> $B$G$9!#(B
  510.     <code>CGI::Lite</code> $B$b8!F$$7$^$7$g$&!#$3$l$O!"$[$H$s$I$N%W%m%0%i%`(B
  511.     $B$K$*$$$FI,MW$H$9$k$9$Y$F$N5!G=$N:G>.%;%C%H$N<BAu$G$9!#(B</p>
  512.  
  513.     <p>C $B$G(B CGI $B%W%m%0%i%`$r=q$$$F$$$k$J$i!"$$$m$$$m$J(B
  514.     $B%*%W%7%g%s$,$"$j$^$9!#$3$l$i$NFb$N0l$D$O(B <a
  515.     href="http://www.boutell.com/cgic/">http://www.boutell.com/cgic/</a>
  516.     $B$GDs6!$5$l$F$$$k(B <code>CGIC</code> $B%i%$%V%i%j$G$9!#(B</p>
  517.   </section>
  518.  
  519.   <section id="moreinfo">
  520.     <title>$B99$J$k>pJs(B</title>
  521.  
  522.     <p>CGI $B$K4X$9$k>pJs$O%&%'%V$G?tB?$/Ds6!$5$l$F$$$^$9!#(BCGI
  523.     $B$NLdBj$K$D$$$F$O(B Usenet $B$N(B <a href="news:comp.infosystems.www.authoring.cgi"
  524.     >comp.infosystems.www.authoring.cgi</a> $B$G!"(B
  525.     $BB>$N%f!<%6$HO@5D$9$k$3$H$,$G$-$^$9!#(BHTML Writers Guide $B$N(B
  526.     -servers $B%a!<%j%s%0%j%9%H$O!"$"$J$?$N<ALd$K2sEz$7$F$/$l$k0NBg$J%j%=!<%9$G$9!#(B
  527.     <a href="http://www.hwg.org/lists/hwg-servers/"
  528.     >http://www.hwg.org/lists/hwg-servers/</a>
  529.     $B$G99$KB?$/$rC5$7=P$9$3$H$,$G$-$^$9!#(B</p>
  530.  
  531.     <p>$B$=$7$F$b$A$m$s!"$*$=$i$/(B CGI
  532.     $B%W%m%0%i%`$NF0:n$K4X$9$k>\:Y$NA4$F$,5-=R$5$l$F$$$k(B
  533.     CGI $B$N;EMM$rFI$`$Y$-$G$9!#%*%j%8%J%k%P!<%8%g%s$r(B
  534.     <a href="http://hoohoo.ncsa.uiuc.edu/cgi/interface.html">NCSA</a>
  535.     $B$G!"%"%C%W%G!<%H$5$l$?%I%i%U%H$r(B
  536.     <a href="http://web.golux.com/coar/cgi/">Common Gateway Interface RFC
  537.     $B%W%m%8%'%/%H(B</a>$B$G;2>H$9$k$3$H$,$G$-$^$9!#(B</p>
  538.  
  539.     <p>CGI $B$NLdBj$K$D$$$F!"2C$o$C$F$$$k%a!<%j%s%0%j%9%H$^$?$O%K%e!<%9(B
  540.     $B%0%k!<%W$K<ALd$rAw$k$H$-!"5/$3$C$?$b$N!"5/$3$C$F$[$7$$$3$H!"(B
  541.     $B<B:]$K5/$3$C$?$3$H$,$I$&0c$&$+!";HMQ$7$F$$$k%5!<%P!"(B
  542.     CGI $B%W%m%0%i%`$r5-=R$7$F$$$k8@8l$K4X$9$k==J,$J>pJs$H!"(B
  543.     $B2DG=$G$"$l$PLdBj$N%3!<%I$rDs6!$9$k$h$&$K$7$F$/$@$5$$!#(B
  544.     $B$=$&$9$k$3$H$G!"LdBj$,$h$j4VC1$K8+$D$+$k$h$&$K$J$j$^$9!#(B</p>
  545.  
  546.     <p>Apache $B$N%=!<%9%3!<%I$K$*$$$FLdBj$rH/8+$7$?$3$H$r3N?.$7$F$$$J$$8B$j!"(B
  547.     CGI $B$NLdBj$K4X$9$k<ALd$r(B Apache
  548.     $B%P%0%G!<%?%Y!<%9$K(B<strong>$BAw$k$Y$-$G$J$$(B</strong>
  549.     $B$3$H$KCmL\$7$F$/$@$5$$!#(B</p>
  550.   </section>
  551. </manualpage>
  552.  
  553.