From 229a2d3142d231d41f4928dde41c5b4a70faf3f3 Mon Sep 17 00:00:00 2001 From: Erik Abele Date: Thu, 5 Sep 2002 23:12:58 +0000 Subject: Updated XML plus transformations git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96653 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/howto/htaccess.html.en | 125 +++++++++++++++++----------------- docs/manual/howto/htaccess.xml | 1 - docs/manual/howto/public_html.html.en | 68 +++++++++--------- 3 files changed, 97 insertions(+), 97 deletions(-) diff --git a/docs/manual/howto/htaccess.html.en b/docs/manual/howto/htaccess.html.en index d3eed50c0e..ce05e59ed8 100644 --- a/docs/manual/howto/htaccess.html.en +++ b/docs/manual/howto/htaccess.html.en @@ -1,13 +1,15 @@ -Apache Tutorial: .htaccess files - Apache HTTP Server
[APACHE DOCUMENTATION]

Apache HTTP Server Version 2.0

Apache Tutorial: .htaccess files

+ -->Apache Tutorial: .htaccess files - Apache HTTP Server
<-
top
top

What they are/How to use them

.htaccess files (or "distributed configuration files") @@ -16,36 +18,34 @@ changes on a per-directory basis.

particular document directory, and the directives apply to that directory, and all subdirectories thereof.

-
+

Note: If you want to call your .htaccess file something else, you can change the name of the file using the AccessFileName directive. For example, if you would rather call the file .config then you can put the following in your server configuration file:

-
+

AccessFileName .config -

-
+

+
-

What you can put in these files is determined by the AllowOverride +

What you can put in these files is determined by the AllowOverride directive. This directive specifies, in categories, what directives will be honored if they are found in a .htaccess file. If a directive is permitted in a .htaccess file, the documentation for that directive will contain an Override section, - specifying what value must be in AllowOverride in order + specifying what value must be in AllowOverride in order for that directive to be permitted.

-

For example, if you look at the documentation for the AddDefaultCharset +

For example, if you look at the documentation for the AddDefaultCharset directive, you will find that it is permitted in .htaccess files. (See the Context line in the directive summary.) The Override line reads "FileInfo". Thus, you must have at least "AllowOverride FileInfo" in order for this directive to be honored in .htaccess files.

-

Example:

- - +

Example:

@@ -57,14 +57,13 @@ changes on a per-directory basis.

-
Context: FileInfo
-
+

If you are unsure whether a particular directive is permitted in a .htaccess file, look at the documentation for that directive, and check the Context line for ".htaccess."

-

When (not) to use .htaccess files

+
top

When (not) to use .htaccess files

In general, you should never use .htaccess files unless @@ -88,13 +87,13 @@ changes on a per-directory basis.

However, in general, use of .htaccess files should be avoided when possible. Any configuration that you would consider putting in a .htaccess file, can just as effectively be - made in a <Directory> section in your main server + made in a <Directory> section in your main server configuration file.

There are two main reasons to avoid the use of .htaccess files.

-

The first of these is performance. When AllowOverride +

The first of these is performance. When AllowOverride is set to allow the use of .htaccess files, Apache will look in every directory for .htaccess files. Thus, permitting .htaccess files causes a performance hit, @@ -109,12 +108,12 @@ changes on a per-directory basis.

directory /www/htdocs/example, Apache must look for the following files:

-
- /.htaccess
- /www/.htaccess
- /www/htdocs/.htaccess
+

+ /.htaccess
+ /www/.htaccess
+ /www/htdocs/.htaccess
/www/htdocs/example/.htaccess -

+

And so, for each file access out of that directory, there are 4 additional file-system accesses, even if none of those files are @@ -138,17 +137,17 @@ changes on a per-directory basis.

.htaccess file in /www/htdocs/example:

-

Contents of .htaccess file in - /www/htdocs/example

+

Contents of .htaccess file in + /www/htdocs/example

AddType text/example .exm -

+

-

Section from your httpd.conf - file

- <Directory /www/htdocs/example>
- AddType text/example .exm
+

Section from your httpd.conf + file

+ <Directory /www/htdocs/example>
+ AddType text/example .exm
</Directory> -

+

However, putting this configuration in your server configuration file will result in less of a performance hit, as the configuration is @@ -158,10 +157,10 @@ changes on a per-directory basis.

The use of .htaccess files can be disabled completely by setting the AllowOverride directive to "none"

-
+

AllowOverride None -

-

How directives are applied

+

+
top

How directives are applied

The configuration directives found in a .htaccess file are applied to the directory in which the .htaccess file @@ -179,27 +178,27 @@ changes on a per-directory basis.

In the directory /www/htdocs/example1 we have a .htaccess file containing the following:

-
+

Options +ExecCGI -

+

(Note: you must have "AllowOverride Options" in effect - to permit the use of the "Options" directive in + to permit the use of the "Options" directive in .htaccess files.)

In the directory /www/htdocs/example1/example2 we have a .htaccess file containing:

-
+

Options Includes -

+

Because of this second .htaccess file, in the directory /www/htdocs/example1/example2, CGI execution is not permitted, as only Options Includes is in effect, which completely overrides any earlier setting that may have been in place.

-

Authentication example

+
top

Authentication example

If you jumped directly to this part of the document to find out how to do authentication, it is important to note one thing. There is a @@ -221,31 +220,31 @@ changes on a per-directory basis.

.htaccess file contents:

-
- AuthType Basic
- AuthName "Password Required"
- AuthUserFile /www/passwords/password.file
- AuthGroupFile /www/passwords/group.file
+

+ AuthType Basic
+ AuthName "Password Required"
+ AuthUserFile /www/passwords/password.file
+ AuthGroupFile /www/passwords/group.file
Require Group admins -

+

Note that AllowOverride AuthConfig must be in effect for these directives to have any effect.

Please see the authentication tutorial for a more complete discussion of authentication and authorization.

-

Server side includes example

+
top

Server side includes example

Another common use of .htaccess files is to enable Server Side Includes for a particular directory. This may be done with the following configuration directives, placed in a .htaccess file in the desired directory:

-
- Options +Includes
- AddType text/html shtml
+

+ Options +Includes
+ AddType text/html shtml
AddHandler server-parsed shtml -

+

Note that AllowOverride Options and AllowOverride FileInfo must both be in effect for these directives to have any @@ -253,25 +252,25 @@ changes on a per-directory basis.

Please see the SSI tutorial for a more complete discussion of server-side includes.

-

CGI example

+
top

CGI example

Finally, you may wish to use a .htaccess file to permit the execution of CGI programs in a particular directory. This may be implemented with the following configuration:

-
- Options +ExecCGI
+

+ Options +ExecCGI
AddHandler cgi-script cgi pl -

+

Alternately, if you wish to have all files in the given directory be considered to be CGI programs, this may be done with the following configuration:

-
- Options +ExecCGI
+

+ Options +ExecCGI
SetHandler cgi-script -

+

Note that AllowOverride Options must be in effect for these directives to have any effect.

@@ -279,13 +278,13 @@ changes on a per-directory basis.

Please see the CGI tutorial for a more complete discussion of CGI programming and configuration.

-

Troubleshooting

+
top

Troubleshooting

When you put configuration directives in a .htaccess file, and you don't get the desired effect, there are a number of things that may be going wrong.

-

Most commonly, the problem is that AllowOverride is not +

Most commonly, the problem is that AllowOverride is not set such that your configuration directives are being honored. Make sure that you don't have a AllowOverride None in effect for the file scope in question. A good test for this is to put garbage @@ -299,4 +298,4 @@ changes on a per-directory basis.

Alternately, it may tell you that you had a syntax error, which you will then need to fix.

-

Apache HTTP Server Version 2.0

IndexHome \ No newline at end of file + \ No newline at end of file diff --git a/docs/manual/howto/htaccess.xml b/docs/manual/howto/htaccess.xml index 02f6fbc9a9..9b86100e3e 100755 --- a/docs/manual/howto/htaccess.xml +++ b/docs/manual/howto/htaccess.xml @@ -79,7 +79,6 @@ changes on a per-directory basis.

honored in .htaccess files.

Example: -
Per-user web directories - Apache HTTP Server
[APACHE DOCUMENTATION]

Apache HTTP Server Version 2.0

Per-user web directories

+ -->Per-user web directories - Apache HTTP Server
<-

Per-user web directories

On systems with multiple users, each user can be permitted to have a - web site in their home directory using the UserDir directive. Visitors + web site in their home directory using the UserDir directive. Visitors to a URL http://example.com/~username/ will get content out of the home directory of the user "username", out of - the subdirectory specified by the UserDir directive.

+ the subdirectory specified by the UserDir directive.

-

Per-user web directories

+
top
top

Setting the file path with UserDir

-

The UserDir +

The UserDir directive specifies a directory out of which per-user content is loaded. This directive may take several different forms.

@@ -24,9 +26,9 @@ assumed to be a directory path relative to the home directory of the specified user. Given this configuration:

-
+

UserDir public_html -

+

the URL http://example.com/~rbowen/file.html will be translated to the file path @@ -36,9 +38,9 @@ constructed using that path, plus the username specified. Given this configuration:

-
+

UserDir /var/html -

+

the URL http://example.com/~rbowen/file.html will be translated to the file path /var/html/rbowen/file.html

@@ -47,62 +49,62 @@ in which the asterisk is replaced with the username. Given this configuration:

-
+

UserDir /var/www/*/docs -

+

the URL http://example.com/~rbowen/file.html will be translated to the file path /var/www/rbowen/docs/file.html

-

Restricting what users are permitted to use this +
top

Restricting what users are permitted to use this feature

Using the syntax show in the UserDir documentation, you can restrict what users are permitted to use this functionality:

-
- UserDir enabled
+

+ UserDir enabled
UserDir disabled root jro fish -

+

The configuration above will enable the feature for all users except for those listed in the disabled statement. You can, likewise, disable the feature for all but a few users by using a configuration like the following:

-
- UserDir disabled
+

+ UserDir disabled
UserDir enabled rbowen krietz -

+

-

See UserDir +

See UserDir documentation for additional examples.

-

Enabling a cgi directory for each user

+
top

Enabling a cgi directory for each user

In order to give each user their own cgi-bin directory, you can use - a DirectoryMatch + a DirectoryMatch directive to make a particular subdirectory of a user's home directory cgi-enabled.

-
- <DirectoryMatch /home/*/cgi-bin/>
- Options +ExecCGI
- SetHandler cgi-script
+

+ <DirectoryMatch /home/*/cgi-bin/>
+ Options +ExecCGI
+ SetHandler cgi-script
</DirectoryMatch> -

+

-

Allowing users to alter configuration

+
top

Allowing users to alter configuration

If you want to allows users to modify the server configuration in their web space, they will need to use .htaccess files to - make these changed. Ensure that you have set AllowOverride to a + make these changed. Ensure that you have set AllowOverride to a value sufficient for the directives that you want to permit the users to modify. See the .htaccess tutorial for additional details on how this works.

-

Apache HTTP Server Version 2.0

IndexHome \ No newline at end of file + \ No newline at end of file -- cgit v1.2.3