From 2a463b3cd73c32ee9dcd508248d0194923f435f4 Mon Sep 17 00:00:00 2001
From: Stefan Fritsch The The example shown is from your default The above directive tells Apache to permit the execution
@@ -154,9 +148,7 @@
files with the
- LoadModule cgi_module modules/mod_cgi.so
-
+ LoadModule cgi_module modules/mod_cgi.so
ScriptAlias
@@ -85,9 +83,7 @@
ScriptAlias
directive looks like:
- ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/
-
+ ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/
httpd.conf
@@ -141,11 +137,9 @@
file, to specify that CGI execution was permitted in a particular
directory:
-<Directory /usr/local/apache2/htdocs/somedir>
+
<Directory /usr/local/apache2/htdocs/somedir>
Options +ExecCGI
-</Directory>
-
+</Directory>cgi
or pl
extension as CGI
programs:
- AddHandler cgi-script .cgi .pl
-
+ AddHandler cgi-script .cgi .pl
@@ -175,24 +167,20 @@
.cgi
in users' directories, you can use the
following configuration.
-<Directory /home/*/public_html> +<Directory /home/*/public_html> Options +ExecCGI AddHandler cgi-script .cgi -</Directory> -+</Directory>
If you wish designate a cgi-bin
subdirectory of
a user's directory where everything will be treated as a CGI
program, you can use the following.
-<Directory /home/*/public_html/cgi-bin> +@@ -231,11 +219,9 @@ file called<Directory /home/*/public_html/cgi-bin> Options ExecCGI SetHandler cgi-script -</Directory> -+</Directory>
first.pl
, and put it in your
cgi-bin
directory.
- -#!/usr/bin/perl +#!/usr/bin/perl print "Content-type: text/html\n\n"; -print "Hello, World."; -+print "Hello, World.";
Even if you are not familiar with Perl, you should be able
@@ -340,9 +326,7 @@ print "Hello, World.";
interpreter (often perl
) indicated in the first
line of your CGI program, which will look something like:
- #!/usr/bin/perl -+
#!/usr/bin/perl
Make sure that this is in fact the path to the @@ -481,16 +465,14 @@ print "Hello, World."; add your own environment variables to the basic ones provided by default.
--#!/usr/bin/perl +@@ -597,7 +579,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/howto/cgi.html'; } })(window, document); //-->#!/usr/bin/perl use strict; use warnings; print "Content-type: text/html\n\n"; foreach my $key (keys %ENV) { print "$key --> $ENV{$key}<br>"; -} -+}