<-
Apache > HTTP Server > Documentation > Version 2.4

Configuration Files 4f1j23

Available Languages:  tr 

This document describes the files used to configure Apache HTTP Server.

 Apache!

See also 27136x

top

Main Configuration Files m3v1o

Apache HTTP Server is configured by placing Include directive, and wildcards can be used to include many configuration files. Any directive may be placed in any of these configuration files. Changes to the main configuration files are only recognized by httpd when it is started or restarted.

The server also reads a file containing mime document types; the filename is set by the TypesConfig directive, and is mime.types by default.

top

Syntax of the Configuration Files 332p8

httpd configuration files contain one directive per line. The backslash "\" may be used as the last character on a line to indicate that the directive continues onto the next line. There must be no other characters or white space between the backslash and the end of the line.

Arguments to directives are separated by whitespace. If an argument contains spaces, you must enclose that argument in quotes.

Directives in the configuration files are case-insensitive, but arguments to directives are often case sensitive. Lines that begin with the hash character "#" are considered comments, and are ignored. Comments may not be included on the same line as a configuration directive. White space occurring before a directive is ignored, so you may indent directives for clarity. Blank lines are also ignored.

The values of variables defined with the RewriteMap's syntax.

Only shell environment variables defined before the server is started can be used in expansions. Environment variables defined in the configuration file itself, for example with SetEnv, take effect too late to be used for expansions in the configuration file.

The maximum length of a line in normal configuration files, after variable substitution and ing any continued lines, is approximately 16 MiB. In .htaccess files, the maximum length is 8190 characters.

You can check your configuration files for syntax errors without starting the server by using apache2ctl configtest or the -t command line option.

You can use <IfModule> sections removed. However, the output does not reflect the merging or overriding that may happen for repeated directives.

top

Modules q624d

httpd is a modular server. This implies that only the most basic functionality is included in the core server. Extended features are available through <IfModule> block. However, <IfModule> blocks are not required, and in some cases may mask the fact that you're missing an important module.

To see which modules are currently compiled into the server, you can use the -l command line option. You can also see what modules are loaded dynamically using the -M command line option.

top

Scope of Directives 2h2u10

Directives placed in the main configuration files apply to the entire server. If you wish to change the configuration for only a part of the server, you can scope your directives by placing them in <LocationMatch> sections. These sections limit the application of the directives which they enclose to particular filesystem locations or URLs. They can also be nested, allowing for very fine grained configuration.

httpd has the capability to serve many different websites simultaneously. This is called <VirtualHost> sections, so that they will only apply to requests for a particular website.

Although most directives can be placed in any of these sections, some directives do not make sense in some contexts. For example, directives controlling process creation can only be placed in the main server context. To find which directives can be placed in which sections, check the How Directory, Location and Files sections work.

top

.htaccess Files 1w2g1o

httpd allows for decentralized management of configuration via special files placed inside the web tree. The special files are usually called .htaccess, but any name can be specified in the AccessFileName directive. Directives placed in .htaccess files apply to the directory where you place the file, and all sub-directories. The .htaccess files follow the same syntax as the main configuration files. Since .htaccess files are read on every request, changes made in these files take immediate effect.

To find which directives can be placed in .htaccess files, check the AllowOverride directive in the main configuration files.

For more information on .htaccess files, see the .htaccess tutorial.

Available Languages:  tr 

top

Comments 2p1l6j

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our s if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our mailing lists.