From: Daniel Gruno The The example shown is from your default The above directive tells Apache to permit the execution
of CGI files. You will also need to tell the server what
@@ -153,9 +154,10 @@
files with the
+
LoadModule cgi_module modules/mod_cgi.so
-
ScriptAlias
@@ -84,9 +85,10 @@
ScriptAlias
directive looks like:
+
ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/
-
httpd.conf
configuration file, if you installed Apache in the default
@@ -139,13 +141,12 @@
file, to specify that CGI execution was permitted in a particular
directory:
- <Directory /usr/local/apache2/htdocs/somedir>
-
- Options +ExecCGI
-
- </Directory>
-
+<Directory /usr/local/apache2/htdocs/somedir>
+ Options +ExecCGI
+</Directory>
+
+
cgi
or pl
extension as CGI
programs:
+
AddHandler cgi-script .cgi .pl
-
.htaccess files
@@ -173,27 +175,25 @@
.cgi
in users' directories, you can use the
following configuration.
- <Directory /home/*/public_html>
-
- Options +ExecCGI
- AddHandler cgi-script .cgi
-
- </Directory>
-
+<Directory /home/*/public_html> + Options +ExecCGI + AddHandler cgi-script .cgi +</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>
-
- Options ExecCGI
- SetHandler cgi-script
-
- </Directory>
-
+<Directory /home/*/public_html/cgi-bin> + Options ExecCGI + SetHandler cgi-script +</Directory> ++ @@ -340,9 +340,10 @@ print "Hello, World."; interpreter (often
perl
) indicated in the first
line of your CGI program, which will look something like:
-
+
#!/usr/bin/perl
-
Make sure that this is in fact the path to the interpreter.
diff --git a/docs/manual/howto/cgi.xml b/docs/manual/howto/cgi.xml index a2e0840f4a4..fcd70e6c5dd 100644 --- a/docs/manual/howto/cgi.xml +++ b/docs/manual/howto/cgi.xml @@ -64,9 +64,9 @@ directive has not been commented out. A correctly configured directive may look like this: -The
The example shown is from your default httpd.conf
configuration file, if you installed Apache in the default
@@ -145,13 +145,11 @@
file, to specify that CGI execution was permitted in a particular
directory:
The above directive tells Apache to permit the execution
of CGI files. You will also need to tell the server what
@@ -160,9 +158,9 @@
files with the cgi
or pl
extension as CGI
programs:
.cgi
in users' directories, you can use the
following configuration.
- 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.
perl
) indicated in the first
line of your CGI program, which will look something like:
- Make sure that this is in fact the path to the interpreter.