From: Daniel Gruno Authentication is any process by which you verify that
someone is who they claim they are. Authorization is any
process by which someone is allowed to be where they want to
go, or to have information that they want to have. For general access control, see the Access
+ Control How-To.
You will also need to make sure that the modules
+
Let's examine each of those directives individually. The
The
The
Finally, the
Finally, the
AuthUserFile /usr/local/apache/passwd/passwords
AuthGroupFile /usr/local/apache/passwd/groups
- Require group GroupName
+Require group GroupName
Now, anyone that is listed in the group GroupName
,
@@ -394,7 +407,7 @@ person in
AuthBasicProvider dbm
AuthDBMUserFile /www/passwords/passwd.dbm
Require valid-user
- </Directory>
+</Directory>
Other options are available. Consult the diff --git a/docs/manual/howto/cgi.xml b/docs/manual/howto/cgi.xml index 32140322cba..60b58c3cbcb 100644 --- a/docs/manual/howto/cgi.xml +++ b/docs/manual/howto/cgi.xml @@ -57,10 +57,21 @@ need to have Apache configured to permit CGI execution. There are several ways to do this.
+httpd.conf
you need to make sure the
+ The +
The
For example, if the URL
http://www.example.com/cgi-bin/test.pl
- is requested, Apache will attempt to execute the file
+ is requested, Apache will attempt to execute the file
/usr/local/apache2/cgi-bin/test.pl
and return the output. Of course, the file will have to
exist, and be executable, and return output in a particular
@@ -111,7 +122,7 @@
use CGI programs. However, if the proper security precautions are
taken, there is no reason why CGI programs cannot be run from
arbitrary directories. For example, you may wish to let users
- have web content in their home directories with the
+ have web content in their home directories with the
cgi-bin
directory, they will need to be able to
@@ -123,7 +134,7 @@
module="mod_mime">AddHandler or ExecCGI
must be specified in the
The above directive tells Apache to permit the execution
@@ -175,7 +186,7 @@
Options +ExecCGI
AddHandler cgi-script .cgi
- </Directory>
+</Directory>
If you wish designate a cgi-bin
subdirectory of
@@ -188,7 +199,7 @@
Options ExecCGI
SetHandler cgi-script
- </Directory>
+</Directory>
The following is an example CGI program that prints one
line to your browser. Type in the following, save it to a
- file called first.pl
, and put it in your
+ file called first.pl
, and put it in your
cgi-bin
directory.
Even if you are not familiar with Perl, you should be able @@ -252,7 +263,7 @@ http://www.example.com/cgi-bin/first.pl -
or wherever you put your file, you will see the one line +
or wherever you put your file, you will see the one line
Hello, World.
appear in your browser window.
It's not very exciting, but once you get that working, you'll
have a good chance of getting just about anything working.
Make sure that this is in fact the path to the interpreter.
- -In addition, if your CGI program depends on other environment variables, you will need to - assure that those variables are passed by Apache.
-If your CGI program depends on non-standard environment variables, you will need to + assure that those variables are passed by Apache.
+ +When you miss HTTP headers from the environment, make + sure they are formatted according to + RFC 2616, + section 4.2: Header names must start with a letter, + followed only by letters, numbers or hyphen. Any header + violating this rule will be dropped silently.
env
at a command prompt.
During the CGI transaction, the server and the browser @@ -458,13 +479,13 @@
This simple Perl CGI program will display all of the
environment variables that are being passed around. Two
- similar programs are included in the
+ similar programs are included in the
cgi-bin
directory of the Apache distribution. Note that some
variables are required, while others are optional, so you may
see some variables listed that were not in the official list.
- In addition, Apache provides many different ways for you to
+ In addition, Apache provides many different ways for you to
add your own environment variables
to the basic ones provided by default.
Other communication between the server and the client
happens over standard input (STDIN
) and standard
- output (STDOUT
). In normal everyday context,
- STDIN
means the keyboard, or a file that a
+ output (STDOUT
). In normal everyday context,
+ STDIN
means the keyboard, or a file that a
program is given to act on, and STDOUT
- usually means the console or screen.
When you POST
a web form to a CGI program,
the data in that form is bundled up into a special format
@@ -509,10 +530,10 @@
You'll sometimes also see this type of string appended to
a URL. When that is done, the server puts that string
- into the environment variable called
+ into the environment variable called
QUERY_STRING
. That's called a GET
request. Your HTML form specifies whether a GET
- or a POST
is used to deliver the data, by setting the
+ or a POST
is used to deliver the data, by setting the
METHOD
attribute in the FORM
tag.
Your program is then responsible for splitting that string @@ -536,7 +557,7 @@ set of functionality, which is all you need in most programs.
If you're writing CGI programs in C, there are a variety of
- options. One of these is the CGIC
library, from
+ options. One of these is the CGIC
library, from
http://www.boutell.com/cgic/.