diff options
Diffstat (limited to 'docs/manual/howto/cgi.html.en')
-rw-r--r-- | docs/manual/howto/cgi.html.en | 50 |
1 files changed, 16 insertions, 34 deletions
diff --git a/docs/manual/howto/cgi.html.en b/docs/manual/howto/cgi.html.en index ff227f79..46a34735 100644 --- a/docs/manual/howto/cgi.html.en +++ b/docs/manual/howto/cgi.html.en @@ -9,7 +9,7 @@ <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.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -65,9 +65,7 @@ directive has not been commented out. A correctly configured directive may look like this: - <pre class="prettyprint lang-config"> - LoadModule cgi_module modules/mod_cgi.so - </pre> + <pre class="prettyprint lang-config">LoadModule cgi_module modules/mod_cgi.so</pre> </div> <h3><a name="scriptalias" id="scriptalias">ScriptAlias</a></h3> @@ -85,9 +83,7 @@ <p>The <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code> directive looks like:</p> - <pre class="prettyprint lang-config"> - ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/ - </pre> + <pre class="prettyprint lang-config">ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/</pre> <p>The example shown is from your default <code>httpd.conf</code> @@ -141,11 +137,9 @@ file, to specify that CGI execution was permitted in a particular directory:</p> - <pre class="prettyprint lang-config"> -<Directory /usr/local/apache2/htdocs/somedir> + <pre class="prettyprint lang-config"><Directory /usr/local/apache2/htdocs/somedir> Options +ExecCGI -</Directory> - </pre> +</Directory></pre> <p>The above directive tells Apache to permit the execution @@ -154,9 +148,7 @@ files with the <code>cgi</code> or <code>pl</code> extension as CGI programs:</p> - <pre class="prettyprint lang-config"> - AddHandler cgi-script .cgi .pl - </pre> + <pre class="prettyprint lang-config">AddHandler cgi-script .cgi .pl</pre> @@ -175,24 +167,20 @@ <code>.cgi</code> in users' directories, you can use the following configuration.</p> - <pre class="prettyprint lang-config"> -<Directory /home/*/public_html> + <pre class="prettyprint lang-config"><Directory /home/*/public_html> Options +ExecCGI AddHandler cgi-script .cgi -</Directory> - </pre> +</Directory></pre> <p>If you wish designate a <code>cgi-bin</code> subdirectory of a user's directory where everything will be treated as a CGI program, you can use the following.</p> - <pre class="prettyprint lang-config"> -<Directory /home/*/public_html/cgi-bin> + <pre class="prettyprint lang-config"><Directory /home/*/public_html/cgi-bin> Options ExecCGI SetHandler cgi-script -</Directory> - </pre> +</Directory></pre> @@ -231,11 +219,9 @@ file called <code>first.pl</code>, and put it in your <code>cgi-bin</code> directory.</p> - <pre class="prettyprint lang-perl"> -#!/usr/bin/perl + <pre class="prettyprint lang-perl">#!/usr/bin/perl print "Content-type: text/html\n\n"; -print "Hello, World."; - </pre> +print "Hello, World.";</pre> <p>Even if you are not familiar with Perl, you should be able @@ -340,9 +326,7 @@ print "Hello, World."; interpreter (often <code>perl</code>) indicated in the first line of your CGI program, which will look something like:</p> - <pre class="prettyprint lang-perl"> - #!/usr/bin/perl - </pre> + <pre class="prettyprint lang-perl">#!/usr/bin/perl</pre> <p>Make sure that this is in fact the path to the @@ -481,16 +465,14 @@ print "Hello, World."; <a href="../env.html">add your own environment variables</a> to the basic ones provided by default.</p> - <pre class="prettyprint lang-perl"> -#!/usr/bin/perl + <pre class="prettyprint lang-perl">#!/usr/bin/perl use strict; use warnings; print "Content-type: text/html\n\n"; foreach my $key (keys %ENV) { print "$key --> $ENV{$key}<br>"; -} - </pre> +}</pre> @@ -597,7 +579,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/howto/cgi.html'; } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 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="apache">Copyright 2014 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/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); |