php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay
files >> /var/www/html/sub/images/Rm19_symconf/root/opt/lampp/manual/howto/ |
files >> /var/www/html/sub/images/Rm19_symconf/root/opt/lampp/manual/howto/cgi.html.ko.euc-kr |
<?xml version="1.0" encoding="EUC-KR"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko"><head> <meta content="text/html; charset=EUC-KR" http-equiv="Content-Type" /> <!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX This file is generated from xml source: DO NOT EDIT XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --> <title>ġ 丮: CGI - Apache HTTP Server Version 2.4</title> <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> <script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> <body id="manual-page"><div id="page-header"> <p class="menu"><a href="../mod/"></a> | <a href="../mod/directives.html">þ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html"></a> | <a href="../sitemap.html">Ʈ</a></p> <p class="apache">Apache HTTP Server Version 2.4</p> <img alt="" src="../images/feather.gif" /></div> <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> <div id="path"> <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.4</a> > <a href="./">How-To / Tutorials</a></div><div id="page-content"><div id="preamble"><h1>ġ 丮: CGI </h1> <div class="toplang"> <p><span> : </span><a href="../en/howto/cgi.html" hreflang="en" rel="alternate" title="English"> en </a> | <a href="../fr/howto/cgi.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | <a href="../ja/howto/cgi.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | <a href="../ko/howto/cgi.html" title="Korean"> ko </a></p> </div> <div class="outofdate"> ֽ ƴմϴ. ֱٿ ϼ.</div> </div> <div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#intro">Ұ</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#configuring">CGI ϵ ġ ϱ</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#writing">CGI α ۼϱ</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#troubleshoot"> ʾƿ!</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#behindscenes">ڿ °?</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#libraries">CGI /̺귯</a></li> <li><img alt="" src="../images/down.gif" /> <a href="#moreinfo"> ...</a></li> </ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> <h2><a name="intro" id="intro">Ұ</a></h2> <table class="related"><tr><th>õ </th><th>õ þ</th></tr><tr><td><ul><li><code class="module"><a href="../mod/mod_alias.html">mod_alias</a></code></li><li><code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code></li></ul></td><td><ul><li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li><li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li><li><code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code></li></ul></td></tr></table> <p>CGI (Common Gateway Interface) CGI α Ȥ CGI ũƮ θ, ( ) ܺ α ϴ Ѵ. Ʈ ϰ ̴. ġ CGI ϴ Ұϰ, CGI α ۼغ.</p> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> <h2><a name="configuring" id="configuring">CGI ϵ ġ ϱ</a></h2> <p>CGI α ùٷ Ϸ CGI ϵ ġ ؾ Ѵ. ϴ .</p> <h3><a name="scriptalias" id="scriptalias">ScriptAlias</a></h3> <p><code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code> þ ϸ ġ Ư 丮 CGI α д. ġ 丮 ִ CGI α̶ Ͽ Ŭ̾Ʈ ڿ ûϸ ڿ Ϸ õѴ.</p> <p><code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code> þ Ѵ.</p> <div class="example"><p><code> ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/ </code></p></div> <p> ġ ⺻ ҿ ġ <code>httpd.conf</code> Ͽ ִ ̴. <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code> þ <code class="directive"><a href="../mod/mod_alias.html#alias">Alias</a></code> þ URL պκ Ư 丮 Ѵ. <code class="directive">Alias</code> <code class="directive">ScriptAlias</code> <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code> 丮 ۿ ִ 丮 Ѵ. <code class="directive">Alias</code> <code class="directive">ScriptAlias</code> <code class="directive">ScriptAlias</code> ߰ URL պκ ϴ CGI α ϴ ̴. ġ <code>/cgi-bin/</code> ϴ ڿ ûϸ <code>/usr/local/apache2/cgi-bin/</code> 丮 ãƼ CGI α ó϶ ˸.</p> <p> , URL <code>http://www.example.com/cgi-bin/test.pl</code> ûϸ ġ <code>/usr/local/apache2/cgi-bin/test.pl</code> Ͽ ȯѴ. ϰ డϸ ε ؾ Ѵ. ġ .</p> <h3><a name="nonscriptalias" id="nonscriptalias">ScriptAlias 丮 ۿ ִ CGI</a></h3> <p> Ȼ CGI α <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code> 丮 Ѵ. ڴ CGI α ִ ִ. ġ ߴٸ ƹ 丮 CGI α . , <code class="directive"><a href="../mod/mod_userdir.html#userdir">UserDir</a></code> þ Ͽ ڰ ڽ Ȩ丮 츦 . ڰ ڽ CGI α ϰ <code>cgi-bin</code> 丮 ٱ ٸ, ٸ CGI α ϰ ̴.</p> <p>ƹ 丮 CGI Ϸ ʿϴ. , <code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code> <code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code> þ Ͽ <code>cgi-script</code> ڵ鷯 ۵ؾ Ѵ. ι°, <code class="directive"><a href="../mod/core.html#options">Options</a></code> þ <code>ExecCGI</code> ؾ Ѵ.</p> <h3><a name="options" id="options">Options Ͽ CGI ϱ</a></h3> <p> ּϿ <code class="directive"><a href="../mod/core.html#options">Options</a></code> þ Ͽ Ư 丮 CGI ִ.</p> <div class="example"><p><code> <Directory /usr/local/apache2/htdocs/somedir><br /> <span class="indent"> Options +ExecCGI<br /> </span> </Directory> </code></p></div> <p> þ ġ CGI Ѵ. CGI ˷ Ѵ. <code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code> þ Ȯڰ <code>cgi</code> <code>pl</code> CGI α̶ ˸.</p> <div class="example"><p><code> AddHandler cgi-script .cgi .pl </code></p></div> <h3><a name="htaccess" id="htaccess">.htaccess </a></h3> <p><a href="htaccess.html"><code>.htaccess</code> 丮</a> <code>httpd.conf</code> ٱ 쿡 CGI α ִ ˷ش.</p> <h3><a name="userdir" id="userdir"> 丮</a></h3> <p>Ʒ ϸ 丮 <code>.cgi</code> CGI α Ѵ.</p> <div class="example"><p><code> <Directory /home/*/public_html><br /> <span class="indent"> Options +ExecCGI<br /> AddHandler cgi-script .cgi<br /> </span> </Directory> </code></p></div> <p> ϸ 丮 <code>cgi-bin</code> 丮 ִ CGI α νѴ.</p> <div class="example"><p><code> <Directory /home/*/public_html/cgi-bin><br /> <span class="indent"> Options ExecCGI<br /> SetHandler cgi-script<br /> </span> </Directory> </code></p></div> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> <h2><a name="writing" id="writing">CGI α ۼϱ</a></h2> <p>``Ϲ'' αְ CGI α ̿ ΰ ֵ ִ.</p> <p>ù° ̴ CGI α ٸ ϱ MIME-type ؾ Ѵٴ ̴. HTTP Ŭ̾Ʈ Ŭ̾Ʈ ްԵ ̸ ˸. .</p> <div class="example"><p><code> Content-type: text/html </code></p></div> <p>ι° ̴ HTML Ȥ ִ ؾ Ѵٴ ̴. κ HTML , gif HTML ƴ ϴ CGI α ۼϴ 쵵 ִ.</p> <p>ΰ ϰ CGI α ۼ ̹ ٸ α ſ ϴ.</p> <h3><a name="firstcgi" id="firstcgi">ó CGI α</a></h3> <p> CGI α . ״ <code>first.pl</code>̶ Ͽ ϰ, <code>cgi-bin</code> 丮 Ѵ.</p> <div class="example"><p><code> #!/usr/bin/perl<br /> print "Content-type: text/html\n\n";<br /> print "Hello, World."; </code></p></div> <p>Perl ͼ ʴ Ͼ ִ. ù° ġ(Ȥ ϴ ) <code>/usr/bin/perl</code> ġ ִ Ͽ α ϶ ˸. ι° content-type ϰ carriage-return ٹٲ ι Ѵ. ڿ HTTP ϴ , Ѵ. ° "Hello, World." ڿ Ѵ. ̰ ̴.</p> <p> ϰ ּҸ ԷѴ</p> <div class="example"><p><code> http://www.example.com/cgi-bin/first.pl </code></p></div> <p> Ҹ Էϸ, â <code>Hello, World.</code> δ. е , ѹ ϴ ٸ õ ִ.</p> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> <h2><a name="troubleshoot" id="troubleshoot"> ʾƿ!</a></h2> <p> CGI α Ҷ ִ ⺻ װ.</p> <dl> <dt>CGI α </dt> <dd>! Ѵٴ ̴. Ȯ ùٷ ó Ѵٸ, CGI α ùٸ <code>Content-Type</code> Ͽ ȮѴ.</dd> <dt>CGI α ҽڵ Ȥ "POST Method Not Allowed" </dt> <dd>CGI α ϵ ġ ʾҴٴ ̴. <a href="#configuring">ġ ϱ</a> ٽ а κ ִ ãƺ.</dd> <dt>"Forbidden" ϴ </dt> <dd> ִٴ ̴. <a href="#errorlogs">ġ α</a> Ʒ <a href="#permissions">ϱ</a> Ȯ϶.</dd> <dt>"Internal Server Error" </dt> <dd><a href="#errorlogs">ġ α</a> Ƹ CGI α Բ "Premature end of script headers" ̴. Ʒ ϳ ȮϿ CGI α HTTP ߴ ˾ƺ.</dd> </dl> <h3><a name="permissions" id="permissions">ϱ</a></h3> <p> Ű ϶. , ϸ Ư ( <code>nobody</code> <code>www</code>) Ѵ. Ϸ ʿϴ. Ͽ <code>nobody</code> ϱ ֱ ο ش.</p> <div class="example"><p><code> chmod a+x first.pl </code></p></div> <p>, α ٸ аų ٸ Ͽ ʿϴ.</p> <h3><a name="pathinformation" id="pathinformation"> ȯ</a></h3> <p> α ϸ ڵ ȴ. , <code>PATH</code> ã Ҹ ˷ش.</p> <p> α CGI α Ҷ <code>PATH</code> ٸ ִ. ( , <code>sendmail</code> ) CGI α ȿ ϴ ɾ η ؾ ɾ ã ִ.</p> <p> CGI α ù° ٿ ũƮ ( <code>perl</code>) ο Ѵ.</p> <div class="example"><p><code> #!/usr/bin/perl </code></p></div> <p> ȮѴ.</p> <p>, CGI α ٸ <a href="#env">ȯ溯</a> Ѵٸ ġ α ؾ Ѵ.</p> <h3><a name="syntaxerrors" id="syntaxerrors">α </a></h3> <p>CGI α ϴ κ α ü ̴. Ư ΰ Ǽ ʾҰ ִٸ . ϱ α غ. , Ѵ.</p> <div class="example"><p><code> cd /usr/local/apache2/cgi-bin<br /> ./first.pl </code></p></div> <p>(<code>perl</code> . ġ ũƮ ù° ٿ ִ <a href="#pathinformation"> </a> Ͽ ãƾ Ѵ.)</p> <p>α <code>Content-Type</code> HTTP ϰ ؾ Ѵ. ٸ Ѵٸ ġ <code>Premature end of script headers</code> ȯѴ. ڼ <a href="#writing">CGI α ۼϱ</a> ϶.</p> <h3><a name="errorlogs" id="errorlogs"> α</a></h3> <p> α״ ̴. ߸Ǹ α . α Ѵ. Ʈ ȣϴ α ϰ Ѵٸ, Ƹ ٸ ü ˾ƺ Ѵ. α , κ ľϿ ذ ִ.</p> <h3><a name="suexec" id="suexec">Suexec</a></h3> <p><a href="../suexec.html">suexec</a> α ϸ ȣƮ Ȥ 丮 ִ CGI α ٸ ִ. Suexec ſ ϰ ˻ϸ, ˻縦 ϳ ϸ CGI α ʰ <code>Premature end of script headers</code> ȯѴ.</p> <p>suexec ϰ ִ ˷ <code>apachectl -V</code> Ͽ <code>SUEXEC_BIN</code> ġ ȮѴ. ġ Ҷ ҿ suexec ߰ϸ, suexec ִ.</p> <p>suexec ߴٸ ؼ ȵȴ. suexec <code>SUEXEC_BIN</code> ġ ִ <code>suexec</code> (Ȥ ϸ ٲٰ) ϸ ȴ. <a href="../suexec.html">suexec</a> ϰ ʹٸ, <code>suexec -V</code> Ͽ suexec α ġ ˾Ƴ αϿ Ģ ִ ã´.</p> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> <h2><a name="behindscenes" id="behindscenes">ڿ °?</a></h2> <p>CGI αֿ ͼ ڿ ϸ ȴ. ü ϴ ϴ ̴. "Hello, World." ϴ α ۼ ̷ α ̴.</p> <h3><a name="env" id="env">ȯ溯</a></h3> <p>ȯ溯 ǻ ϴ ٴϴ ̴. ȯ溯 path (ǻͰ Է ɾ شϴ ã ), ڸ, ̳ . Ϲ ȯ溯 Ʈ <code>env</code> ԷѴ.</p> <p>CGI Ҷ ȯ溯 ȯѴ. (Netscape, IE, Lynx), (ġ, IIS, WebSite), ϴ CGI α ִ.</p> <p>CGI αӴ ̷ ְ, ȯ溯 Ŭ̾Ʈ- ſ Ϻκ Ѵ. ü ʼ <a href="http://hoohoo.ncsa.uiuc.edu/cgi/env.html">http://hoohoo.ncsa.uiuc.edu/cgi/env.html</a> ִ.</p> <p>Ʒ Perl CGI α ڽſ ȯ溯 ش. ġ <code>cgi-bin</code> 丮 ̿ α ΰ ִ. ʼ̰ ̴. Ͽ δ. , ġ ⺻ ϴ ȯ溯 ܿ <a href="../env.html"> ȯ溯 ߰ ִ</a>.</p> <div class="example"><p><code> #!/usr/bin/perl<br /> print "Content-type: text/html\n\n";<br /> foreach $key (keys %ENV) {<br /> <span class="indent"> print "$key --> $ENV{$key}<br>";<br /> </span> } </code></p></div> <h3><a name="stdin" id="stdin">STDIN STDOUT</a></h3> <p>, Ŭ̾Ʈ ǥԷ(<code>STDIN</code>) ǥ(<code>STDOUT</code>) Ѵ. ϻ <code>STDIN</code> Ű峪 α óϴ Ÿ, <code>STDOUT</code> ܼ̳ ȭ Ѵ.</p> <p>CGI α (form) <code>POST</code>ϸ Ŀ Է ڷḦ Ư CGI α <code>STDIN</code> Ѵ. α Ű峪 Ͽ ڷḦ óϵ ڷḦ ó ִ.</p> <p>"Ư " ſ ϴ. ̸ ȣ(=) ϰ, ̸ ֵ ۻ(&) Ѵ. , ۻ, ȣ ڿ ڴ ȥ ʵ 16 ȯѴ. ڷ ڿ .</p> <div class="example"><p><code> name=Rich%20Bowen&city=Lexington&state=KY&sidekick=Squirrel%20Monkey </code></p></div> <p> URL ڿ ̷ ڿ ȴ. ڿ <code>QUERY_STRING</code>̶ ȯ溯 Ѵ. ̸ <code>GET</code> û̶ Ѵ. <code>FORM</code> ± <code>METHOD</code> Ӽ Ͽ HTML (form) ڷḦ <code>GET</code> <code>POST</code> Ѵ.</p> <p> α ̷ ڿ ɰ Ѵ. ̷ ڷ ó CGI α ٸ Ǵ ̺귯 ִ.</p> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> <h2><a name="libraries" id="libraries">CGI /̺귯</a></h2> <p>CGI α ۼҶ ۾ ִ ڵ ̺귯 Ȥ غ Ѵ. ̷ ϸ װ ٰ α ִ.</p> <p>Perl CGI α ۼѴٸ <a href="http://www.cpan.org/">CPAN</a> ã ִ. CGI ߿ θ Ǵ <code>CGI.pm</code>̴. κ α ּ <code>CGI::Lite</code> ִ.</p> <p>C CGI α ۼѴٸ . ϳ <a href="http://www.boutell.com/cgic/">http://www.boutell.com/cgic/</a> ִ <code>CGIC</code> ̺귯.</p> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> <div class="section"> <h2><a name="moreinfo" id="moreinfo"> ...</a></h2> <p> ſ CGI ִ. <a href="news:comp.infosystems.www.authoring.cgi">comp.infosystems.www.authoring.cgi</a> CGI ִ. HTML Writers Guild -servers ϸƮ ã Ǹ Ҵ. <a href="http://www.hwg.org/lists/hwg-servers/">http://www.hwg.org/lists/hwg-servers/</a> ִ.</p> <p> CGI α ۿ CGI Ծ о . <a href="http://hoohoo.ncsa.uiuc.edu/cgi/interface.html">NCSA</a> ְ, ʾ <a href="http://web.golux.com/coar/cgi/">Common Gateway Interface RFC Ʈ</a> ִ.</p> <p>ϸƮ 쿡 ݰ ִ CGI Ҷ , ٸ, ϴ , CGI α ۼ , ϸ ش ڵ带 ڼ . ذå ã .</p> <p>ġ ҽڵ尡 ߸Ǿٰ Ȯ ʴ CGI ġ ͺ̽ ø <strong></strong> ȵȴ.</p> </div></div> <div class="bottomlang"> <p><span> : </span><a href="../en/howto/cgi.html" hreflang="en" rel="alternate" title="English"> en </a> | <a href="../fr/howto/cgi.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | <a href="../ja/howto/cgi.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | <a href="../ko/howto/cgi.html" title="Korean"> ko </a></p> </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> <script type="text/javascript"><!--//--><![CDATA[//><!-- var comments_shortname = 'httpd'; var comments_identifier = 'http://httpd.apache.org/docs/2.4/howto/cgi.html'; (function(w, d) { if (w.location.hostname.toLowerCase() == "httpd.apache.org") { d.write('<div id="comments_thread"><\/div>'); var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); } else { d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); } })(window, document); //--><!]]></script></div><div id="footer"> <p class="apache">Copyright 2015 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/"></a> | <a href="../mod/directives.html">þ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html"></a> | <a href="../sitemap.html">Ʈ</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); } //--><!]]></script> </body></html>y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`