Apache Core Features

xiaoxiao2021-03-06  21

Modules | Directives | FAQ | Glossary | SiteMap

Apache Http Server Version 2.0

Apache>

HTTP Server>

Documentation>

Version 2.0>

Modules

Apache Core Features

Available Languages: DE | EN | JA

Description: Core Apache Http Server Features That Are ALWAYS AVAILABLESTATUS: CORE

Directives

AcceptPathInfo AccessFileName AddDefaultCharset AddOutputFilterByType AllowEncodedSlashes AllowOverride AuthName AuthType CGIMapExtension ContentDigest DefaultType DocumentRoot EnableMMAP EnableSendfile ErrorDocument ErrorLog FileETag ForceType HostnameLookups IdentityCheck Include KeepAlive KeepAliveTimeout LimitInternalRecursion LimitRequestBody LimitRequestFields LimitRequestFieldSize LimitRequestLine LimitXMLRequestBody LogLevel MaxKeepAliveRequests NameVirtualHost Options Require RLimitCPU RLimitMEM RLimitNPROC Satisfy ScriptInterpreterSource ServerAdmin ServerAlias ​​ServerName ServerPath ServerRoot ServerSignature ServerTokens SetHandler SetInputFilter SetOutputFilter TimeOut UseCanonicalName

AcceptpathInfo Directive

Description: Resources accept trailing pathname informationSyntax: AcceptPathInfo On | Off | DefaultDefault: AcceptPathInfo DefaultContext: server config, virtual host, directory, .htaccessOverride: FileInfoStatus: CoreModule: coreCompatibility: Available in Apache 2.0.30 and later

This directive controls whether requests that contain trailing pathname information that follows an actual filename (or non-existent file in an existing directory) will be accepted or rejected. The trailing pathname information can be made available to scripts in the PATH_INFO environment variable.For example Assume the location / test / point a directory That Contains Only the Single File Here.html. The Requests for /Test/here.html/more and /test/nothere.html/more Both Collect / More As Path_info.

The Three Possible Arguments for the AcceptPathInfo Directive Are:

Off

A Request Will Only Be Accepted if IT Maps. Therefore a request with trailing pathname information after the true filename resch as

/ Test/here.html/more in the Above Example Will Return A 404 Not Found Error.

On

A Request Will Be Accepted IF A Leading Path Component Maps to a File That EXISTS. The Above Example

/TEST/here.html/more will be affilties

/ Test/here.html Maps to a Valid File.

DEFAULT

Tre atment of requests with trailing pathname information is determined by the

Handler responsible for the request. The core handler for Normal Files Defaults To Rejecting

Path_info Requests. Handlers That Serve Scripts, Such As

CGI-script and

Isapi-isa, generally accept

Path_INFO by Default.

The primary purpose of the AcceptPathInfo directive is to allow you to override the handler's choice of accepting or rejecting PATH_INFO. This override is required, for example, when you use a filter, such as INCLUDES, to generate content based on PATH_INFO. The core handler Would Usually Reject The Request, SO You CAN Use The Following Configuration To Enable Such A Script:

Options includeetoutputfilter incrudeesAcceptpathinfo on AccessFileName Directive

Description: Name of the Distributed Configuration FileSyntax: AccessFileName FileName [FileName] ... Default: AccessFileName .htaccessContext: Server Config, Virtual Hoststatus: Coremodule: Core

While processing a request the server looks for the first existing configuration file from this list of names in every directory of the path to the document, if distributed configuration files are enabled for that directory For example.:

AccessFileName .acl .acl

BEFORE RETURNING THE Document /usR /UCAL/web/index.html, The Server Will Read /.acl, /usr/.acl, /usr/local/.acl and /usr/local/web/.acl for Directives, Unless THEY HAVE BEEN DISABLED with

ALLOWOVERRIDE NONE

See Also

ALOWOVERRIDE Configuration Files .htaccess Files

AddDefaultCharset Directive

Description: Default character set to be added for a response without an explicit character setSyntax: AddDefaultCharset On | Off | charsetDefault: AddDefaultCharset OffContext: server config, virtual host, directory, .htaccessOverride: FileInfoStatus: CoreModule: core

This directive specifies the name of the character set that will be added to any response that does not have any parameter on the content type in the HTTP headers. This will override any character set specified in the body of the document via a META tag. A ... setting of AddDefaultCharset Off disables this functionality AddDefaultCharset On enables Apache's internal default charset of iso-8859-1 as required by the directive You can also specify an alternate charset to be used For example:

AddDefaultCharset UTF-8

AddOutputFilterbytype Directive

Description: assigns an output filter to a particular MIME-typeSyntax: AddOutputFilterByType filter [; filter ...] MIME-type [MIME-type] ... Context: server config, virtual host, directory, .htaccessOverride: FileInfoStatus: CoreModule: CoreCompatibility: Available in apache 2.0.33 and LaTerThis Directive Activates a Particular Output Filter for a Request Depending on the response mime-type.

The following example uses the DEFLATE filter, which is provided by mod_deflate. It will compress all output (either static or dynamic) which is labeled as text / html or text / plain before it is sent to the client.

AddOutputFilterbyType Deflate Text / Html Text / Plain

IF you want the content to be processed by more more than one filter, Their names. It's also picture. It's also possible to usepe directive for each of these filters.

.

Options includesaddoutputfilterBytype Includes; deflate text / html

Note

Enabling filters with AddOutputFilterByType may fail partially or completely in some cases. For example, no filters are applied if the MIME-type could not be determined and falls back to the DefaultType setting, even if the DefaultType is the same.

However, if you want to make sure, that the filters will be applied, assign the content type to a resource explicitly, for example with AddType or ForceType. Setting the content type within a (non-nph) CGI script is also safe.

The BY-TYPE OUTPUT FILTERS Are Never Applied On Proxy Requests.

See Also

AddOutputFilter SetOutputFilter Filters

ALLOWENCODEDSLASHES DIRECTIVE

Description: Determines whether encoded path separators in URLs are allowed to be passed throughSyntax: AllowEncodedSlashes On | OffDefault: AllowEncodedSlashes OffContext: server config, virtual hostStatus: CoreModule: coreCompatibility: Available in Apache 2.0.46 and laterThe AllowEncodedSlashes directive allows URLs which contain encoded path Separators (% 2f for / and additionally% 5c for / on aciding systems) to be used. Normally Such Urls Are Refused With A 404 (NOT Found) Error.

Turning allowencodedslashes on is motion useful by in conjunction with path_info.

Note

Allowing Encoded Slashes Does Not Imply Decoding. Occurrences OF% 2F OR% 5C (Only On According Systems) Will Be Left As Such in The OtherWise Decode URL String.

See Also

AcceptpathInfo

ALLOWOVERRIDE DIRECTIVE

Description: Types of directives that are allowed in .htaccess filesSyntax: AllowOverride All | None | directive-type [directive-type] ... Default: AllowOverride AllContext: directoryStatus: CoreModule: core

........................................ ...CRIPLILE, INFORMATION SCIENCE AND TECHNOLOGY.

Only Available in Sections

Allowoverride Is Valid Only in

Sections Specified without Regular Expressions, Not in

,

OR

sections.

................... ..,.

..

The Directive-Type Can Be One of the Following Groupings of Directives.Authconfig

Allow Use of the Authorization Directives

Authdbmgroupfile,

Authdbmuserfile,

Authgroupfile,

Authname,

Authtype,

Authiserfile,

REQUIRE,

ETC.).

FileInfo

Allow Use of the Directives Controlling Document Types

DefaultType,

ErrorDocument,

ForceType,

LanguagePriority,

SetHandler,

SetInputFilter,

SetOutputFilter, And

MOD_MIME Add * And Remove * Directives,

ETC.).

Indexes

Allow Use of the Directives Controlling Directory Indexing

AddDescription,

Addicon,

AddiconbyEncoding,

AddiconBytype,

DEFAULTICON,

DirectoryIndex,

FancyIndexing,

Headername,

INDEXIGNORE,

IndexOptions,

Readmename,

ETC.).

Limit

Allow Use of the Directives Controlling Host Access

ALLOW,

Deny and

ORDER).

Options

Allow Use of the Directives Controlling Specific Directory Features

Options and

Xbithack).

EXAMPLE:

ALLOWOVERRIDE Authconfig Indexes

In The Example Above All Directives That Are Neither In The Group Authconfig Nor Indexes Cause An Internal Server Error.

See Also

AccessFileName Configuration Files .htaccess Files

Authname Directive

Description: Authorization Realm for use in http automationsystemax: Authname Auth-domainContext: Directory, .htaccessoverride: AuthconfigStatus: Coremodule: CORE

. This directive sets the name of the authorization realm for a directory This realm is given to the client so that the user knows which username and password to send AuthName takes a single argument;. If the realm name contains spaces, it must be enclosed in Quotation Marks. It Must Be Accompanied by Authtype and Require Directives, And Directives Such as Authorfile And AuthgroupFile To Work.

For example:

Authname "Top Secret" The String Provided for the Authname Is What Will Appear in The Password Dialog Provided by MOST Browsers.

See Also

Authentication, Authorization, And Access Control

Authtype Directive

Description: Type of User AuthenticationSyntax: Authtype Basic | DigestContext: Directory, .htaccessoverride: AuthconfigStatus: Coremodule: Core

This directive selects the type of user authentication for a directory. Only Basic and Digest are currently implemented. It must be accompanied by AuthName and Require directives, and directives such as AuthUserFile and AuthGroupFile to work.

See Also

Authentication, Authorization, And Access Control

CGIMAPEXTENSION DIRECTIVE

Description: Technique for locating the interpreter for CGI scriptsSyntax: CGIMapExtension cgi-path .extensionContext: directory, .htaccessOverride: FileInfoStatus: CoreModule: coreCompatibility: NetWare only

This directive is used to control how Apache finds the interpreter used to run CGI scripts For example, setting CGIMapExtension sys:. /Foo.nlm .foo will cause all CGI script files with a .foo extension to be passed to the FOO interpreter.

ContentDigest Directive

Description: Enables the generation of Content-MD5 HTTP Response headersSyntax: ContentDigest On | OffDefault: ContentDigest OffContext: server config, virtual host, directory, .htaccessOverride: OptionsStatus: CoreModule: core

This Directive Enables The Generation of Content-MD5 Headers as defined in rfc1864 respectively RFC2068.

MD5 is an algorithm for computing a "message digest" (sometimes called "fingerprint") of arbitrary-length data, with a high degree of confidence that any alterations in the data will be reflected in alterations in the message digest.

The Content-MD5 header provides an end-to-end message integrity check (MIC) of the entity-body A proxy or client may check this header for detecting accidental modification of the entity-body in transit Example header:.. Content-MD5 : Aulb7dp1rqtxz2m9krpa ==

Note That This Cause Performance Problems On Your Server Since The Message Digest Is Computed On Every Request (The VALUES Are Not Cached).

Content-md5 is only sample for documents served by the core, and not by any module. For Example, SSI Documents, Output from CGI Scripts, and byte Range Responses Do Not Have this header.

DefaultType Directive

Description: MIME content-type that will be sent if the server can not determine a type in any other waySyntax: DefaultType MIME-typeDefault: DefaultType text / plainContext: server config, virtual host, directory, .htaccessOverride: FileInfoStatus: CoreModule: core

.............. ..

The Server Must Inform The Client Of The Content-Type of An Unknown Type It Uses The DefaultType. For example:

DefaultType Image / GIF

Would Be Appropriate for a Directory Which Contained MASING IMAGES with Filenames Missing The .gif Extension.

Note that unlike ForceType, this directive only provides the default mime-type. All other mime-type definitions, including filename extensions, that might identify the media type will override this default.

Directive

Description: Enclose a group of directives that apply only to the named file-system directory and sub-directoriesSyntax: ... Context: server config, virtual hostStatus: CoreModule: core and are used to enclose a group of directives that will apply only to the named directory and sub-directories of that directory. Any directive that is allowed in a directory context may be used. Directory-path is either the full path to a directory, or a wild-card string using Unix shell-style matching. In a wild-card string,? matches any single character, and * matches any sequences of characters. You may also use [] character ranges. None of the wildcards Match a `/ 'character, so will not match / home / user / public_html, but Will match. EXAMPLE:

Options Indexes Followsymlinks

Be careful with the directory-path arguments: They have to literally match the filesystem path which Apache uses to access the files Directives applied to a particular will not apply to files accessed from that same directory via a different path, such as. Via DiffERENT SYMBOLIC LINKS.

Extended Regular Expressions Can Also BE Used, with the addition of the ~ character. For example:

Would Match Director IN / WWW / THAT CONSISTED OF THREE NUMBERS.

If multiple (non-regular expression) sections match the directory (or one of its parents) containing a document, then the directives are applied in the order of shortest match first, interspersed with the directives from the .htaccess files. For Example, With allowoverride none allowoverride fileinfo

For access to the document /Home/web/dir/doc.html the steps are:

Apply directive AllowOverride None (disabling .htaccess files). Apply directive AllowOverride FileInfo (for directory / home). Apply any FileInfo directives in /home/.htaccess, /home/web/.htaccess and /home/web/dir/.htaccess IN That Order.

Regular expressions are not considered until after all of the normal sections have been applied. Then all of the regular expressions are tested in the order they appeared in the configuration file. For example, with

# ... Directives Here ...

the regular expression section will not be considered until after all normal s and .htaccess files have been applied. Then the regular expression will match on / home / abc / public_html / abc and the corresponding will be applied.

Note That The Default Apache Access For IS Allow from all. This means what apache will serve any file mapped from an url. It is recommented That You change this with a block such as

ORDER DENY, ALOWDENY from ALL

And Then Override this for directories you want accessible. See the security tips page for more details.

The Directory Sections Occur in The Httpd.conf File. Directives Cannot Nest, And Cannot Appear in a Or Section.see Also

How , and sections work for an expected of how these Different Sections Are Combined WHEN A Request Is Received

Directive

Description: Enclose directives that apply to file-system directories matching a regular expression and their subdirectoriesSyntax: ... Context: server config, virtual hostStatus: CoreModule: core

and are used to enclose a group of directives which will apply only to the named directory and sub-directories of that directory, the same as . However, it takes as an argument a regular expression. For example:

Would Match Director IN / WWW / THAT CONSISTED OF THREE NUMBERS.

See Also

for a description of how regular expressions are mixed in with normal s How , and sections work for an explanation of how these different sections are combined when a request is received

DocumentRoot Directive

Description: Directory that forms the main document tree visible from the webSyntax: DocumentRoot directory-pathDefault: DocumentRoot / usr / local / apache / htdocsContext: server config, virtual hostStatus: CoreModule: core

. This directive sets the directory from which httpd will serve files Unless matched by a directive like Alias, the server appends the path from the requested URL to the document root to make the path to the document Example:. DocumentRoot / usr / web

Then an access to http://www.my.host.com/index.html refers to /usr/web/index.html.

The Documentroot SHOULD BE Specified Without a trailing slash.

See Also

Mapping Urls to FileSystem Location

EnablemMap Directive

Description: Use memory-mapping to read files during deliverySyntax: EnableMMAP On | OffDefault: EnableMMAP OnContext: server config, virtual host, directory, .htaccessOverride: FileInfoStatus: CoreModule: core

This directive controls whether the httpd may use memory-mapping if it needs to read the contents of a file during delivery By default, when the handling of a request requires access to the data within a file -. For example, when delivering a server -PARSED File Using MOD_INCLUDE - APACHE MEMORY-MAPS The File if The OS Supports it.

This Memory-Mapping Sometimes Yields a Performance Improvement. But in Some Environments, IT IS Better to Disable The Memory-maping to Prevent Operational Problems:

On some multiprocessor systems, memory-mapping can reduce the performance of the httpd. With an NFS-mounted DocumentRoot, the httpd may crash due to a segmentation fault if a file is deleted or truncated while the httpd has it memory-mapped.

For Server Configurations That Are Vulnerable to these Problems, You Should Disable Memory-maping of Delivered Files By Specifying:

Enablemmap off

For NFS MOUNTED Files, this Feature May Be Disabled Explicitly for the Offering Files by Specifying:

EnablemMap off

EnableSendfile DirectiveDescription: Use the kernel sendfile support to deliver files to the clientSyntax: EnableSendfile On | OffDefault: EnableSendfile OnContext: server config, virtual host, directory, .htaccessOverride: FileInfoStatus: CoreModule: coreCompatibility: Available in version 2.0.44 and later

This directive controls whether httpd may use the sendfile support from the kernel to transmit file contents to the client By default, when the handling of a request requires no access to the data within a file -. For example, when delivering a static file - - Apache Uses Sendfile To Deliver The File Contents without Ever Reading The File if The OS Supports it.

This SendFile Mechanism Avoids Separate Read and Send Operations, And Buffer Allocations. But on Some Platforms or With FileSystems, IT IS Better To Disable this Feature To Avoid Operational Problems:

Some platforms may have broken sendfile support that the build system did not detect, especially if the binaries were built on another box and moved to such a machine with broken sendfile support. On Linux the use of sendfile triggers TCP-checksum offloading bugs on certain networking Cards WHEN Using IPv6. with a network-mounted Document (EG, NFS OR SMB), The Kernel May Be Unable to Serve The Network File Through Its Own Cache.

For Server Configurations That Are Vulnerable To these Problems, you Should Disable this feature by Specifying:

Enablesendfile off

For nfs or smb mounted files, this feature may be disabled explicitly for the offnding files by specifying:

Enablesendfile off

ErrorDocument Directive

Description: What the server will return to the client in case of an errorSyntax: ErrorDocument error-code documentContext: server config, virtual host, directory, .htaccessOverride: FileInfoStatus: CoreModule: coreCompatibility: Quoting syntax for text messages is different in Apache 2.0In The Event of a Problem or Error, Apache Can Be Configured to do one of four things,

Output a Simple Hardcoded Error Message Output a Customized Message Redirect to a local url-path to handle the problem URROR REDIRECT TO an EXTERNAL URROR To Handle To An External Url To Handle The Problem / Error

The first option is the default, while options 2-4 are configured using the ErrorDocument directive, which is followed by the HTTP response code and a URL or a message. Apache will sometimes offer additional information regarding the problem / error.

Urls Can Begin with a slash (/) for local urls, or be a full URL Which The Client Can Resolve. Alternative, A Message Can Be provided to be displayed by the browser. Examples:

ErrorDocument 500 http://foo.example.com/cgi-bin/testerErrorDocument 404 /cgi-bin/bad_urls.plErrorDocument 401 /subscription_info.htmlErrorDocument 403 "Sorry can not allow you access today"

Additionally, the special value default can be used to specify Apache's simple hardcoded message. While not required under normal circumstances, default will restore Apache's simple hardcoded message for configurations that would otherwise inherit an existing ErrorDocument.

Errordocument 404 /cgi-bin/bad_urls.pl ErrorDocument 404 Default

Note that when you specify an ErrorDocument that points to a remote URL (ie. Anything with a method such as http in front of it), Apache will send a redirect to the client to tell it where to find the document, even if the document ends up being on the same server. This has several implications, the most important being that the client will not receive the original error status code, but instead will receive a redirect status code. This in turn can confuse web robots and other clients which try to determine if a URL is valid using the status code. in addition, if you use a remote URL in an ErrorDocument 401, the client will not know to prompt the user for a password since it will not receive the 401 status code. Therefore, if you use an ErrorDocument 401 directive then it must refer to a local document.Microsoft Internet Explorer (MSIE) will by default ignore server-generated error messages when they are "too small" and substitute its own "friendly" error messages. The size Threshold V aries depending on the type of error, but in general, if you make your error document greater than 512 bytes, then MSIE will show the server-generated error rather than masking it. More information is available in Microsoft Knowledge Base article Q294807.

...................

See Also

Documentation of customize Responses

Errorlog Directive

Description: Location where the server will log errorsSyntax: ErrorLog file-path | syslog [: facility] Default: ErrorLog logs / error_log (Unix) ErrorLog logs / error.log (Windows and OS / 2) Context: server config, virtual hostStatus: Coremodule: CORE

The ErrorLog Directive Sets The Name of The File to Which The Server Will Log Any Errors It Encounters. If The File-path is not absolute kiln is assocmed to be relative to the serverroot.example

ErrorLog / Var / log / httpd / error_log

If the file-path begins with a pipe (|) Then it is assocmed to beetle the error log.

EXAMPLE

ERRORLOG "| / usr / local / bin / httpd_errors"

Using syslog instead of a filename enables logging via syslogd (8) if the system supports it The default is to use syslog facility local7, but you can override this by using the syslog:. Facility syntax where facility can be one of the names usually documented In syslog (1).

EXAMPLE

ErrorLog Syslog: User

Security: See The Security Tips Document for Details On Why Your Security WHERE LOG Files Are Stored Is Writable by Anyone Other Than The User That Starts The Server.

Note

When entering a file path on non-Unix platforms, care should be taken to make sure that only forward slashed are used even though the platform may allow the use of back slashes. In general it is a good idea to always use forward slashes throughout the Configuration FILES.

See Also

Loglevel Apache log file

FileEtAg Directive

Description: File attributes used to create the ETag HTTP response headerSyntax: FileETag component ... Default: FileETag INode MTime SizeContext: server config, virtual host, directory, .htaccessOverride: FileInfoStatus: CoreModule: core

The FileETag directive configures the file attributes that are used to create the ETag (entity tag) response header field when the document is based on a file. (The ETag value is used in cache management to save network bandwidth.) In Apache 1.3.22 and earlier, the ETag value was always formed from the file's inode, size, and last-modified time (mtime) The FileETag directive allows you to choose which of these - if any - should be used The recognized keywords are..: Inode

The File's I-Node Number Will Be Included in The Calculation

Mtime

The date and time the file was last modified will be incruded

Size

The number of bytes in the file will be incdaded

All

All Available Fields Will BE Used. This is equivalent to:

FileTag inode Mtime Size

None

IF a document is file-based, no

ETAG Field Will Be include in the response

The INode, MTime, and Size keywords may be prefixed with either or -, which allow changes to be made to the default setting inherited from a broader scope Any keyword appearing without such a prefix immediately and completely cancels the inherited setting..

If a directory's configuration includes FileETag INode MTime Size, and a subdirectory's includes FileETag -INode, the setting for that subdirectory (which will be inherited by any sub-subdirectories that do not override it) will be equivalent to FileETag MTime Size.

Directive

Description: Contains Directives That Apply to matched filenamessyntax: ... Context: Server Config, Virtual Host, Directory, .htaccessOverride: Allstatus: Coremodule: Core

The directive limits the scope of the enclosed directives by filename. It is comparable to the and directives. It should be matched with a directive. The directives given within this section will be applied to any object with a basename (last component of filename) matching the specified filename. sections are processed in the order they appear in the configuration file, after the sections and .htaccess files are read, but before sections. Note that can be nested inside sections to restrict the portion of the filesystem they apply to.The filename argument should include a filename, or a wild-card string, where? matches any single character, and * Matches Any Sequences of Characters. Extended Regular Expressions Can Also Be Used, with the addition of the ~ character. for example:

Would Match MOST Common Internet Graphics Formats. is preferred, however.

Note That Unlike and Sections, Sections Can Be Used Inside .htaccess Files. This Allows Users to Control Access To Their Own Files, At A file-by-file level.

See Also

How , and sections work for an expected of how these Different Sections Are Combined WHEN A Request Is Received

Directive

Description: Contains directives that apply to regular-expression matched filenamesSyntax: ... Context: server config, virtual host, directory, .htaccessOverride: AllStatus: CoreModule: core

The directive limits the scope of the enclosed directives by filename, just as the directive does However, it accepts a regular expression For example:..

Would Match Most Common Internet Graphics Formats.

See Also

How , and sections work for an expected of how these Different Sections Are Combined WHEN A Request Is Received

ForceType Directive

Description: Forces all matching files to be served with the specified MIME content-typeSyntax: ForceType MIME-type | NoneContext: directory, .htaccessOverride: FileInfoStatus: CoreModule: coreCompatibility: Moved to the core in Apache 2.0

When placed into an .htaccess file or a , or or section, this directive forces all matching files to be served with the content type identification given by MIME-type. For example, if you had a Directory Full of Gif Files, But Did Not Want To Label The All with .gif, You Might Want To Use:

ForceType image / gif

Note That Unlike DefaultType, this Directive Overrides All Mime-Type Associations, Including FileName Extensions, That Might Identify The Media Type.

You can override any forcetype setting by using the value of none:

# force all files to be image / gif: forcetype image / gif # But normal mime-type associations here: forcetype none

Hostnamelookups Directive

Description: Enables DNS Lookups on Client IP Addressessyntax: Hostnamelookups on | Off | Doubledefault: Hostnamelookups Offcontext: Server Config, Virtual Host, DirectoryStatus: Coremodule: Core

This directive enables DNS lookups so that host names can be logged (and passed to CGIs / SSIs in REMOTE_HOST). The value Double refers to doing double-reverse DNS lookup. That is, after a reverse lookup is performed, a forward lookup is then performed on that result. At least one of the IP addresses in the forward lookup must match the original address. (in "tcpwrappers" terminology this is called PARANOID.) Regardless of the setting, when mod_access is used for controlling access by hostname, a double reverse lookup will be performed. This is necessary for security. Note that the result of this double-reverse is not generally available unless you set HostnameLookups Double. for example, if only HostnameLookups On and a request is made to an object that is Protected by Hostname Restrictions, Regardless of WHETER THE DOUBLE-REVERSE FAILS or NOT, CGIS WILL STILL BE Passed The Single-Reverse Result in Remote_host.

The default is Off in order to save the network traffic for those sites that do not truly need the reverse lookups done. It is also better for the end users because they do not have to suffer the extra latency that a lookup entails. Heavily loaded sites should leave this directive Off, since DNS lookups can take considerable amounts of time. The utility logresolve, compiled by default to the bin subdirectory of your installation directory, can be used to look up host names from logged IP addresses offline.

IdentityCheck Directive

Description: Enables logging of the RFC1413 identity of the remote userSyntax: IdentityCheck On | OffDefault: IdentityCheck OffContext: server config, virtual host, directoryStatus: CoreModule: core

This directive enables RFC1413-compliant logging of the remote user name for each connection, where the client machine runs identd or something similar. This information is logged in the access log.The information should not be trusted in any way except for rudimentary usage tracking.

Note that this can cause serious latency problems accessing your server since every request requires one of these lookups to be performed. When firewalls are involved each lookup might possibly fail and add 30 seconds of latency to each hit. So in general this is not very useful On Public Servers Accessible from the Internet.

Directive

Description: Encloses directives that will be processed only if a test is true at startupSyntax: ... Context: server config, virtual host, directory, .htaccessOverride: AllStatus: CoreModule: core

The ... section is used to mark directives that are conditional. The directives within an section are only processed if the test is true. If test is false, everything between the start and end Markers is ignored.

The test in the Section Directive Can Be One of Two Forms:

Parameter-name! Parameter-Name

In the former case, the directives between the start and end markers are only processed if the parameter named parameter-name is defined. The second format reverses the test, and only processes the directives if parameter-name is not defined.

The Parameter-Name Argument is a define as given on the httpd command line via -dparameter-, at the time the server was started.

sections are nest-able, which can be used to implement simple multiple-parameter tests Example:. Httpd -DReverseProxy ... # httpd.conf LoadModule rewrite_module modules / mod_rewrite.soLoadModule proxy_module modules / libproxy.so

Directive

Description: Encloses directives that are processed conditional on the presence or absence of a specific moduleSyntax: <[!] IfModule module-name> ... Context: server config, virtual host, directory, .htaccessOverride: AllStatus: CoreModule : Core

The ... section is used to mark directives that are conditional on the presence of a specific module. The directives within an section are only processed if the test is true. If test is false Everything Between The Start and End Markers Is Ignored.

Test in the Section Directive Can Be One of Two Forms:

Module Name! Module Name

In the former case, the directives between the start and end markers are only processed if the module named module name is included in Apache - either compiled in or dynamically loaded using LoadModule The second format reverses the test, and only processes the directives if. Module Name is not included.

The module name argument is the file name of the module, at the time it was compiled. For example, mod_rewrite.c. If a module consists of several source files, use the name of the file containing the string STANDARD20_MODULE_STUFF.

Sections Are Nest-Able, Which Can Be Used To Implement Simple Multiple-Module Tests.

THIS Section SHOULD INE CONFIGURATION FILE THAT WORKS WORE ONE CONFIGURATION FILE THAT WORKS WORED, DIRECTIVES NEED NOT BE PLAECED IN Sections.

INCLUDE DIRECTIVE

Description: Includes other configuration files from within the server configuration filesSyntax: Include file-path | directory-pathContext: server config, virtual host, directoryStatus: CoreModule: coreCompatibility: Wildcard matching available in 2.0.41 and later

This Directive Allows Inclusion of Other Configuration Files from Withnin The Server Configuration Files.

Shell-style (fnmatch ()) wildcard characters can be used to include several files at once, in alphabetical order. In addition, if Include points to a directory, rather than a file, Apache will read all files in that directory and any subdirectory ...................... ..

The File path specified May be an absolute path, or may be relative to the serverroot directory.

EXAMPLES:

Include /usr/local/apache2/conf/ssl.confinclude /usr/local/apache2/conf/vhosts/*.conf

OR, Providing Paths Relative to your ServerRoot Directory:

Include conf / ssl.confinclude conf / vhosts / *. Confes

Running Apachectl configtest Will Give You a list of the files That Are Being Processed During The Configuration Check:

root @ host # apachectl configtestProcessing config file: /usr/local/apache2/conf/ssl.confProcessing config file: /usr/local/apache2/conf/vhosts/vhost1.confProcessing config file: / usr / local / apache2 / conf / vhosts / vhost2.confsyntax ok

See Also

Apachectl

Keepalive Directive

Description: Enables HTTP persistent connectionsSyntax: KeepAlive On | OffDefault: KeepAlive OnContext: server config, virtual hostStatus: CoreModule: coreThe KeepAlive extension to HTTP / 1.0 and the persistent connection feature of HTTP / 1.1 provide long-lived HTTP sessions which allow multiple requests to be sent over the same TCP connection. in some cases this has been shown to result in an almost 50% speedup in latency times for HTML documents with many images. to enable KeepAlive connections, set KeepAlive On.

For HTTP / 1.0 clients, Keep-Alive connections will only be used if they are specifically requested by a client. In addition, a Keep-Alive connection with an HTTP / 1.0 client can only be used when the length of the content is known in advance. This implies that dynamic content such as CGI output, SSI pages, and server-generated directory listings will generally not use Keep-Alive connections to HTTP / 1.0 clients. For HTTP / 1.1 clients, persistent connections are the default unless otherwise specified. If The Client Requests It, Chunked Encoding Will BE Used in Order To Send Content of Unknown Length Over Persistent Connections.

See Also

MaxkeepaliveRequests

KeepaliveTimeout Directive

Description: Amount of time the server will wait for subsequent requests on a persistent connectionSyntax: KeepAliveTimeout secondsDefault: KeepAliveTimeout 15Context: server config, virtual hostStatus: CoreModule: core

...........

Setting KeepAliveTimeout to a high value may cause performance problems in heavily loaded servers. The higher the timeout, the more server processes will be kept occupied waiting on connections with idle clients. Directive

Description: Restrict enclosed access controls to only certain HTTP methodsSyntax: ... Context: server config, virtual host, directory, .htaccessOverride: AllStatus: CoreModule: core

Access Controls Are Normally Effect For All Access Methods, and this is The Usual Desired Behavior. In The General Case, Access Control Directives Should Not Be Placed within A section.

The purpose of the directive is to restrict the effect of the access controls to the nominated HTTP methods. For all other methods, the access restrictions that are enclosed in the bracket will have no effect. The following example applies the Access Control Only To The Methods Post, Put, And Delete, Leaving All Other methods unprotace:

Require Valid-user

The Method Names Listed Can Be One or More of: Get, POST, PUT, DELETE, CONNECT, OPTIONS, PATCH, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, AND UNLOCK. The Method Name IS Case-Sensitive. IF Get IS Used It Will Also Restrict Head Requests. The TRACE METHOD Cannot Be Limited.

A

section shop always be used in preference to a

section when restricting access, Since A

Section Provides Protection Against Arbitrary Methods.

Directive

Description: Restrict access controls to all HTTP methods except the named onesSyntax: ... Context: server config, virtual host, directory, .htaccessOverride: AllStatus: CoreModule: core < LimitExcept> and are used to enclose a group of access control directives which will then apply to any HTTP access method not listed in the arguments; ie, it is the opposite of a section and can be used to control Both Standard and Nonstandard / Unrecognized Methods. See The Documentation for for more details.

For example:

Require Valid-User

LimitInternalRecursion Directive

Description: Determine maximum number of internal redirects and nested subrequestsSyntax: LimitInternalRecursion number [number] Default: LimitInternalRecursion 10Context: server config, virtual hostStatus: CoreModule: coreCompatibility: Available in Apache 2.0.47 and later

An internal redirect happens, for example, when using the Action directive, which internally redirects the original request to a CGI script. A subrequest is Apache's mechanism to find out what would happen for some URI if it were requested. For example, mod_dir uses subrequests To look for the files listed in The DirectoryIndex Directive.

LimitinternalRecursion Prevents The Server from Crashing When Entering An Infinite Loop of Internal Redirects Or SubRequests. Such loops are usually caused by Misconfigurations.

The directive stores two different limits, which are evaluated on per-request basis. The first number is the maximum number of internal redirects, that may follow each other. The second number determines, how deep subrequests may be nested. If you specify only one Number, IT Will Be Assigned to Both Limits.example

LimitInternalRecursion 5

LimitRequestBody Directive

Description: Restricts the total size of the HTTP request body sent from the clientSyntax: LimitRequestBody bytesDefault: LimitRequestBody 0Context: server config, virtual host, directory, .htaccessOverride: AllStatus: CoreModule: core

This Directive Specifies The Number of Bytes from 0 (Meaning Unlom 0) TO 2147483647 (2GB) That Are ALOWED IN A Request Body.

The LimitRequestBody directive allows the user to set a limit on the allowed size of an HTTP request message body within the context in which the directive is given (server, per-directory, per-file or per-location). If the client request exceeds that limit, the server will return an error response instead of servicing the request. The size of a normal request message body will vary greatly depending on the nature of the resource and the methods allowed on that resource. CGI scripts typically use the message body for RETRIEVING FORM Information. Implementations of the Put Method Will Require A Value At Least As Large As Any Reperesent That Server Wishes To Accept for That Resource.

This Directive Gives The Server Administrator Greater Control Over Abnormal Client Request Behavior, Which May Be Useful for Avoiding Some Forms of Denial-of-Service Attacks.

IF, for Example, you are permitting file upload to a particular location, and hope to limit the size of the uploaded file to 100k, you might use the folload directive: limitRequestBody 102400

LimitRequestfields Directive

Description: Limits the number of HTTP request header fields that will be accepted from the clientSyntax: LimitRequestFields numberDefault: LimitRequestFields 100Context: server configStatus: CoreModule: core

Number is an integer from 0 (Meaning Unlimited) To 32767. The default value is defined by the compile-time constant default_limit_request_fields (100 as distributed).

The LimitRequestFields directive allows the server administrator to modify the limit on the number of request header fields allowed in an HTTP request. A server needs this value to be larger than the number of fields that a normal client request might include. The number of request header fields used by a client rarely exceeds 20, but this may vary among different client implementations, often depending upon the extent to which a user has configured their browser to support detailed content negotiation. Optional HTTP extensions are often expressed using request header fields.

This directive gives the server administrator greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks. The value should be increased if normal clients see an error response from the server that indicates too many fields WERE SENT IN The REQUEST.

For example:

LimitRequestfields 50

LimitRequestfieldsize Directive

Description: Limits the size of the HTTP request header allowed from the clientSyntax: LimitRequestFieldsize bytesDefault: LimitRequestFieldsize 8190Context: server configStatus: CoreModule: coreThis directive specifies the number of bytes from 0 to the value of the compile-time constant DEFAULT_LIMIT_REQUEST_FIELDSIZE (8190 as distributed) That Will Be allowed in an HTTP Request Header.

The LimitRequestFieldSize directive allows the server administrator to reduce the limit on the allowed size of an HTTP request header field below the normal input buffer size compiled with the server. A server needs this value to be large enough to hold any one header field from a normal client request. The size of a normal request header field will vary greatly among different client implementations, often depending upon the extent to which a user has configured their browser to support detailed content negotiation.

This Directive Gives The Server Administrator Greater Control Over Abnormal Client Request Behavior, Which May Be Useful for Avoiding Some Forms of Denial-of-Service Attacks.

For example:

LimitRequestfieldsize 4094

Under Normal Conditions, The Value Should Not Be Changed from The Default.

LimitRequestline Directive

Description: Limit The size of the http request line That Will Be Accept from The ClientSyntax: LimitRequestline Bytesdefault: LimitRequestline 8190Context: Server Configstatus: Coremodule: Core

THIS DIRECTIVE STS The Number of Bytes from 0 to the value of the compile-time constant default_limit_request_line (8190 as distributed) That Will Be allowed on the http request-line.

The LimitRequestLine directive allows the server administrator to reduce the limit on the allowed size of a client's HTTP request-line below the normal input buffer size compiled with the server. Since the request-line consists of the HTTP method, URI, and protocol version, the LimitRequestLine directive places a restriction on the length of a request-URI allowed for a request on the server. A server needs this value to be large enough to hold any of its resource names, including any information that might be passed in the query part Of A Get Request.This Directive Gives The Server Administrator Greater Control over Abnormal Client Request Behavior, Which May Be Useful for Avoiding Some Forms of Denial-of-Service Attacks.

For example:

LimitRequestline 4094

Under Normal Conditions, The Value Should Not Be Changed from The Default.

LimitxmlRequestBody Directive

Description: Limits the size of an XML-based request bodySyntax: LimitXMLRequestBody bytesDefault: LimitXMLRequestBody 1000000Context: server config, virtual host, directory, .htaccessOverride: AllStatus: CoreModule: core

Limit (in Bytes) on maximum size of an xml-based Request body. A value of 0 will disable any checking.

EXAMPLE:

LimitXmlRequestBody 0

Directive

Description: Applies the Enclosed Directives Only to match URLSSYNTAX: ... Context: Server Config, Virtual Hoststatus: Coremodule: CORE

The directive limits the scope of the enclosed directives by URL. It is similar to the directive, and starts a subsection which is terminated with a directive. sections are processed in the order they appear in the configuration file, after the sections and .htaccess files are read, and after the sections. sections operate completely outside the filesystem. This has several consequences. Most importantly, directives should NOT BE Used to Control Access To FileSystem Locations. Since Several Different Urls May Map To The Same FileSystem Location, Such Access Controls May By CIRCUMVENTED.

When to use

Use to apply directives to content that lives outside the filesystem. For content that lives in the filesystem, use and . An exception is , which is an easy way to apply a configuration to The Entire Server.

For All Origin (Non-Proxy) Requests, The Url To Be Matched IS A URL-path of the form / path /. No scheme, hostname, port, or query string may be include. For proxy requests, the Url to be matched IS of the form Scheme: // ServerName / Path, and you must include the prefix.

The Url May Use Wildcards. In a Wild-Card String,? Matches any single character, and * matches any sequences of character.

Extended Regular Expressions Can Also BE Used, with the addition of the ~ character. For example:

would match URLs that contained the substring / extra / data or / special / data. The directive behaves identical to the regex version of .The functionality is especially useful when combined with the SetHandler directive. For example , To Enable Status Requests, But Allow Them Only from browsers at foo.com, you might use:

setHandler Server-Statusorder Deny, Allowdey from ALLALLOW from .foo.com

Note About / (Slash)

The slash character has special meaning depending on where in a URL it appears. People may be used to its behavior in the filesystem where multiple adjacent slashes are frequently collapsed to a single slash (ie, / home /// foo is the same as / Home / foo). in Url-Space this is not necessarily true. The Directive and the regex version of Require you to expens ixtly specify multiple slashes if That is your inteention.

For example, would match the request URL / abc but not the request URL // abc. The (non-regex) directive behaves similarly when used for proxy requests. But when (non-regex) IS Used for Non-Proxy Requests It Will Implicitly Match Multiple Slashes WIXE, IF You Specify and the request is to / abc // defin it will match.

See Also

How , and sections work for an expected of how these Different Sections Are Combined WHEN A Request Is Received

Directive

Description: Applies the enclosed directives only to regular-expression matching URLsSyntax: ... Context: server config, virtual hostStatus: CoreModule: coreThe directive limits the scope of the enclosed directives by URL, In An Identical Manner to . However, IT Takes A Regular Expression As An Argument INSTEAD OF A Simple String. for Example:

Would Match Urls That Contained The Substring / Extra / Data OR / Special / Data.

See Also

How , and sections work for an expected of how these Different Sections Are Combined WHEN A Request Is Received

Loglevel Directive

Description: Controls The Verbosity of The ErrorLogsyntax: Loglevel LevelDefault: Loglevel WarnContext: Server Config, Virtual Hoststatus: Coremodule: Core

Loglevel Adjusts The Verbosity of the Messages Recorded in The Error Logs (See ErrorLog Directive). The Following Levels Areas Contemile, in Order of Decreasing Significance:

... Level Description Example emerg Emergencies - system is unusable ". Child can not open lock file Exiting" alert Action must be taken immediately "getpwuid: could not determine user name from uid" crit Critical Conditions "socket: Failed to get a socket , exiting child ". error error conditions" Premature end of script headers ". warn Warning conditions" child process 1234 did not exit, sending another SIGHUP "notice Normal but significant condition." httpd: caught SIGBUS, attempting to dump core in .. . "info Informational." Server seems busy, (you may need to increase StartServers, or Min / MaxSpareServers) ... "debug Debug-level messages" Opening config file ... "When a particular level is specified, messages from all Other Levels of Higher Significance Will Be Reported As Well. EG, WHEN Loglevel Info IS Specified, The Messages With log levels of notice and warn will also be posted.

Using a level of at Least crit is recommented.

For example:

Loglevel Notice

Note

.

MaxkeepaliveRequests Directive

Description: Number of Requests ALLOWED A PERSISTENT CONNECTIONSYNTAX: MaxkeepaliveRequests NumberDefault: MaxkeepaliveRequests 100Context: Server Config, Virtual HostStatus: Coremodule: Core

The MaxKeepAliveRequests directive limits the number of requests allowed per connection when KeepAlive is on. If it is set to 0, unlimited requests will be allowed. We recommend that this setting be kept to a high value for maximum server performance.

For example:

MaxkeepaliveRequests 500

NamevirtualHost Directive

Description: Designates An IP Address for Name-Virtual Hostingsyntax: NameVirtualHost Addr [: Port] Context: Server ConfigStatus: Coremodule: Core

The namevirtualhost Directive Is a Required Directive if You Want to configure name-based Virtual Hosts.

AlthiOnuGh addr can behurtname it is recommended That you always use an ip address, e.g.

NamevirtualHost 111.22.33.44

With the NameVirtualHost directive you specify the IP address on which the server will receive requests for the name-based virtual hosts. This will usually be the address to which your name-based virtual host names resolve. In cases where a firewall or other proxy receives the requests and forwards them on a different IP address to the server, you must specify the IP address of the physical interface on the machine which will be servicing the requests. If you have multiple name-based hosts on multiple addresses, repeat the directive for Each address.

Note

Note, that the "main server" and any _default_ servers will never be served for a request to a NameVirtualHost IP address (unless for some reason you specify NameVirtualHost but then do not define any VirtualHosts for that address).

Optionally You Can Specify A Port Number On Which The Name-based Virtual Hosts Should Be Used, E.G.

Namevirtualhost 111.22.33.44:8080

IPv6 Addresses Must Be Enclosed in Square Brackets, As Shown In The Following Example:

NamevirtualHost [Fe80 :: A00: 20F: Fea7: CCEA]: 8080

To Receive Requests On All Interfaces, you can use an argument of *

NamevirtualHost *

Argument to Directive

Note That The Argument to the Directive Must Exactly Match The Argument To The NamevirtualHost Directive.

NamevirtualHost 1.2.3.4 # ... See Also

Virtual Hosts Documentation

Options Directive

Description: Configures what features are available in a particular directorySyntax: Options [ | -] option [[ | -] option] ... Default: Options AllContext: server config, virtual host, directory, .htaccessOverride: OptionsStatus: CoreModule: core

The Options Directive Controls Which Server Features Are Available In a Particular Directory.

Option Can Be Set To None, in Which Case None of the Extra Features Are Enabled, or One or more of the folload:

All

All Options Except for

MultiViews. This is the default setting.

Execcgi

Execution of CGI scripts using

MOD_CGI IS Permitted.

FOLLOWSYMLINKS

The Server Will Follow Symbolic Links in this Directory.

Even wegh the server back change the pathname used to match against section.

Note Also, That this option Gets Ignored IF Set Inside a section.

Includes

Server-Side Includes provided by

MOD_INCLUDE ARE PERMITTED.

Includesnoexec

Server-Side Includes Are Permitted, But The

#exec cmd and

#exec cgi are disabled. it is still possible to

#include virtual cgi scripts from

Scriptaliased Directories.

Indexes

IF a Url Which Maps to A Directory Is Requested, and There IS NO

DirectoryIndex

E.G.,

Index.html) in That Directory, Then

MOD_AUTOINDEX WILL RETURN A FORMATTED LISTING OF THE DIRECTORY.

MultiViews

Content Negotiated "MultiViews" Are ALOWED USING

MOD_NEGOTIATION.

Symlinksifownermatch

The Server Will Only Follow Symbolic Links for Which The Target File or Directory Is Owned by The Same User ID As The Link.

NOTETHIS OPTION GETS IGNORED IF SET INSIDE A

Section.

Normally, if multiple Options could apply to a directory, then the most specific one is used and others are ignored;. The options are not merged (. See how sections are merged) However if all the options on the Options directive are preceded by a or - Symbol, The Options Are Merged. Any Options Preceded by A Are Added to The Options Currently in Force, and Any Options Precededed by a - are remoded from the options currently in force.

For Example, WITHOUT ANY AND - SYMBOLS:

Options Indexes Followsymlinks Options Includes

THE INCLUDES WILL BE SET for the / Web / DOCS / Spec Directory. HOWEVER IF The Second Options Directive Uses The and - Symbols:

Options Indexes Followsymlinks Options Includes -indexes

THE OPTIONS FOLLOWSYMLINKS AND INCLUDES ARE SEC DIRECTORY.

Note

Using -includesnoexec or -includes Disables Server-Side Includely Regardless Of The Previous Setting.

The default in the Absence of any Other settings is all.

Require Directive

Description: Selects Which Authenticated Users CAN Access A ResourceSyntax: Require Entity-Name [Entity-Name] ... Context: Directory, .htaccessOverride: AuthconfigStatus: Coremodule: Core

This Directive Selects Which Authenticated Users CAN Access A Resource. The allowed Syntaxes Are:

Require user userid [userid] ...

Only the named users can access the resource.

Require group group-name [group-name] ...

Only Users in the named groups can access the resource.

Require Valid-User

All valid users can access the resource.Require must be accompanied by AuthName and AuthType directives, and directives such as AuthUserFile and AuthGroupFile (to define users and groups) in order to work correctly Example.:

Authtype Basicauthname "Restricted Resource" Authorfile / Web / usersAuthgroupFile / Web / GroupSrequire Group Admin Admin

Access controls which are applied in this way are effective for all methods. This is what is normally desired. If you wish to apply access controls only to specific methods, while leaving other methods unprotected, then place the Require statement into a section .

See Also

Satisfy MOD_ACCESS

RLIMITCPU Directive

Description: Limits the CPU consumption of processes launched by Apache childrenSyntax: RLimitCPU seconds | max [seconds | max] Default: Unset; uses operating system defaultsContext: server config, virtual host, directory, .htaccessOverride: AllStatus: CoreModule: core

Takes 1 or 2 parameters. The first parameter sets the soft resource limit for all processes and the second parameter sets the maximum resource limit. Either parameter can be a number, or max to indicate to the server that the limit should be set to the maximum ALLOWED by The Operating System Configuration. Raising The maximum resource limited....................

This applies to processes forked off from Apache children servicing requests, not the Apache children themselves. This includes CGI scripts and SSI exec commands, but not any processes forked off from the Apache parent such as piped logs.

CPU Resource Limits Are Expressed In Seconds Per Process.

See Also

RlimitMem Rlimitnproc

RlimitMem Directive

Description: Limits the memory consumption of processes launched by Apache childrenSyntax: RLimitMEM bytes | max [bytes | max] Default: Unset; uses operating system defaultsContext: server config, virtual host, directory, .htaccessOverride: AllStatus: CoreModule: coreTakes 1 or 2 parameters. The first parameter sets the soft resource limit for all processes and the second parameter sets the maximum resource limit. Either parameter can be a number, or max to indicate to the server that the limit should be set to the maximum allowed by the operating System configuration. Raising the maximum resource limit requires That The Server Is Running as root, or in The initial startup phase.

This applies to processes forked off from Apache children servicing requests, not the Apache children themselves. This includes CGI scripts and SSI exec commands, but not any processes forked off from the Apache parent such as piped logs.

Memory Resource Limits Are Expressed in Bytes Per Process.

See Also

Rlimitcpu rlimitnproc

RlimitnProc Directive

Description: Limits the number of processes that can be launched by processes launched by Apache childrenSyntax: RLimitNPROC number | max [number | max] Default: Unset; uses operating system defaultsContext: server config, virtual host, directory, .htaccessOverride: AllStatus: CoreModule : Core

Takes 1 or 2 parameters. The first parameter sets the soft resource limit for all processes and the second parameter sets the maximum resource limit. Either parameter can be a number, or max to indicate to the server that the limit should be set to the maximum ALLOWED by The Operating System Configuration. Raising The maximum resource limited....................

This applies to processes forked off from Apache children servicing requests, not the Apache children themselves. This includes CGI scripts and SSI exec commands, but not any processes forked off from the Apache parent such as piped logs.Process limits control the number of processes per User.

Note

If CGI processes are not running under user ids other than the web server user id, this directive will limit the number of processes that the server itself can create. Evidence of this situation will be indicated by can not fork messages in the error_log.

See Also

Rlimitmem Rlimitcpu

Satisfy Directive

Description: Interaction between host-level access control and user authenticationSyntax: Satisfy Any | AllDefault: Satisfy AllContext: directory, .htaccessOverride: AuthConfigStatus: CoreModule: coreCompatibility: Influenced by and in version 2.0.51 and later

Access policy if both Allow and Require used. The parameter can be either All or Any. This directive is only useful if access to a particular area is being restricted by both username / password and client host address. In this case the default behavior (All ) is to require that the client passes the address access restriction and enters a valid username and password. With the Any option the client will be granted access if they either pass the host restriction or enter a valid username and password. This can be used to Password Restrict An Area, But To Let Clients from Particular Addresses in Without Prompting for a Password.

For example, if you wanted to let people on your network have unrestricted access to a portion of your website, but require that people outside of your network provide a password, you could use a configuration similar to the following: Require valid-userAllow from 192.168 .1 Satisfy Any

Since Version 2.0.51 Satisfy Directives Can Be Restricted to Particular Methods BY and Sections.

See Also

Allow Require

ScriptInterpretersource Directive

Description: Technique for locating the interpreter for CGI scriptsSyntax: ScriptInterpreterSource Registry | Registry-Strict | ScriptDefault: ScriptInterpreterSource ScriptContext: server config, virtual host, directory, .htaccessOverride: FileInfoStatus: CoreModule: coreCompatibility: Win32 only; option Registry-Strict is available in Apache 2.0 and later

This directive is used to control how Apache finds the interpreter used to run CGI scripts. The default setting is Script. This causes Apache to use the interpreter pointed to by the shebang line (first line, starting with #!) In the script. On Win32 Systems this Line USUALLY LOOKS LIKE:

#! C: /perl/bin/perl.exe

OR, IF Perl is in the path, simply:

#! perl

Setting ScriptInterpreterSource Registry will cause the Windows Registry tree HKEY_CLASSES_ROOT to be searched using the script file extension (eg, .pl) as a search key. The command defined by the registry subkey Shell / ExecCGI / Command or, if it does not exist, by The Subkey Shell / Open / Command IS Used To Open The Script File. If The Registry Keys Cannot Be Found, Apache Falls Back to The Behavior of The Script Option.

Security

Be careful when using ScriptInterpreterSource Registry with ScriptAlias'ed directories, because Apache will try to execute every file within this directory. The Registry setting may cause undesired program calls on files which are typically not executed. For example, the default open command on .htm files on most Windows systems will execute Microsoft Internet Explorer, so any HTTP request for an .htm file existing within the script directory would start the browser in the background on the server. This is a good way to crash your system within a minute or so .The option Registry-Strict which is new in Apache 2.0 does the same thing as Registry but uses only the subkey Shell / ExecCGI / Command. The ExecCGI key is not a common one. It must be configured manually in the windows registry and hence prevents Accidental Program Calls on Your System.

ServerAdmin Directive

Description: Email Address That The Server Includes in Error Messages Sent To The ClientSyntax: ServerAdmin Email-AddressContext: Server Config, Virtual Hoststatus: Coremodule: Core

.................. ..

IT May Be Worth Setting Up A Dedicated Address for this, E.G.

ServerAdmin www-admin@foo.example.com

AS Users Do Not Always Ment That They Are Talking About The Server!

Serveralias Directive

Description: Alternate Names for a host sales required to name-Virtual Hostsysyntax: Serveralias Hostname [HostName] ... Context: Virtual Hoststatus: Coremodule: Core

The Serveralias Directive Sets The Alternate Names for a host, for use with name-based Virtual Hosts.

ServerName Server.domain.comserveralias Server Server2.domain.com Server2 # ... See Also

Apache Virtual Host Documentation

ServerName Directive

Description: Hostname and port that the server uses to identify itselfSyntax: ServerName fully-qualified-domain-name [: port] Context: server config, virtual hostStatus: CoreModule: coreCompatibility: In version 2.0, this directive supersedes the functionality of the Port directive From Version 1.3.

The ServerName directive sets the hostname and port that the server uses to identify itself. This is used when creating redirection URLs. For example, if the name of the machine hosting the web server is simple.example.com, but the machine also has the DNS Alias ​​www.example.com and you wish the Web Server to Be So Identified, The Following Directive Should Be Used:

Servername www.example.com:80

If no ServerName is specified, then the server attempts to deduce the hostname by performing a reverse lookup on the IP address. If no port is specified in the ServerName, then the server will use the port from the incoming request. For optimal reliability and predictability You Should Specify An Explicit Hostname and Port Using The ServerName Directive.

IF you are using name-based Virtual Hosts, The ServerName Inside a Section Specifies What Hostname Must Appear in The Request's Host: Header To Match This Virtual Host.

See the description of the UseCanonicalName directive for settings which determine whether self-referential URL's (e.g., by the mod_dir module) will refer to the specified port, or to the port number given in the client's request.

See Also

Issues Regarding DNS and Apache Apache Virtual Host Documentation Usecanonicalname NameVirtualHost ServeraliaSserverPath Directive

Description: Legacy URL Pathname for a name-based Virtual Host this access by An Incompatible Browsersyntax: ServerPath URL-PATHCONTEXT: Virtual Hoststatus: Coremodule: Core

The ServerPath Directive Sets The Legacy URL Pathname for a host, for use with name-based Virtual Hosts.

See Also

Apache Virtual Host Documentation

Serverroot Directive

Description: Base Directory for the Server Instalroot Directory-PathDefault: ServerRoot / USR / local / apachecontext: Server Configstatus: Coremodule: Core

The ServerRoot directive sets the directory in which the server lives. Typically it will contain the subdirectories conf / and logs /. Relative paths in other configuration directives (such as Include or LoadModule, for example) are taken as relative to this directory.

EXAMPLE

Serverroot / Home / httpd

See Also

THE -D OPTION TO HTTPD The Security Tips for Information On How To Properly Set Permissions on The ServerRoot

Serversignature Directive

Description: Configures the footer on server-generated documentsSyntax: ServerSignature On | Off | EMailDefault: ServerSignature OffContext: server config, virtual host, directory, .htaccessOverride: AllStatus: CoreModule: core

The ServerSignature directive allows the configuration of a trailing footer line under server-generated documents (error messages, mod_proxy ftp directory listings, mod_info output, ...). The reason why you would want to enable such a footer line is that in a chain .

The Off setting, which is the default, suppresses the footer line (and is therefore compatible with the behavior of Apache-1.2 and below). The On setting simply adds a line with the server version number and ServerName of the serving virtual host, and the EMail setting additionally creates a "mailto:" reference to the ServerAdmin of the referenced document.After version 2.0.44, the details of the server version number presented are controlled by the ServerTokens directive.

See Also

ServerToKens

ServerToKens Directive

Description: Configures The Server Http Response Headersyntax: Server | Min [iMal] | Prod [UCTONLY] | OS | FullDefault: ServerToKens FullContext: Server Configstatus: Coremodule: Core

This is the server.

ServerToKens Prod [UcTonly]

Server Sends

E.G.):

Server: Apache

ServerToKens Major

Server Sends

E.G.):

Server: Apache / 2

ServerToKens Minor

Server Sends

E.G.):

Server: Apache / 2.0

ServerToKens min [Imal]

Server Sends

E.G.):

Server: Apache / 2.0.41

ServerToKens OS

Server Sends

E.G.):

Server: Apache / 2.0.41 (UNIX)

ServerToKens Full (or Not Specified)

Server Sends

E.G.):

Server: Apache / 2.0.41 (UNIX) PHP / 4.2.2 MyMOD / 1.2

This setting applies to the entire server, and cannot be enabled or disabled on a virtualhost-by-virtualhost basis.

After Version 2.0.44, This Directive Also Controls The Information Presented by The Serversignature Directive.

See Also

Serversignature

SetHandler Directive

Description: Forces all matching files to be processed by a handlerSyntax: SetHandler handler-name | NoneContext: server config, virtual host, directory, .htaccessOverride: FileInfoStatus: CoreModule: coreCompatibility: Moved into the core in Apache 2.0When placed into an .htaccess file or a or section, this directive forces all matching files to be parsed through the handler given by handler-name. For example, if you had a directory you wanted to be parsed entirely as imagemap rule files, regardless Of Extension, You Might Put The Following Into An .htaccess File In That Directory:

SetHandler IMAP-File

Another Example: if You Wanted to Have The Server Display A Status Report WHENEVER A URL of http: // Servername / Status Was Called, you might put the following inTo httpd.conf:

setHandler Server-Status

You can override an erlier defined setHandler Directive by using the value none.

See Also

AddHandler

SetInputFilter Directive

Description: Sets the filters that will process client requests and POST inputSyntax: SetInputFilter filter [; filter ...] Context: server config, virtual host, directory, .htaccessOverride: FileInfoStatus: CoreModule: core

The SetInputFilter directive sets the filter or filters which will process client requests and POST input when they are received by the server. This is in addition to any filters defined elsewhere, including the AddInputFilter directive.

IF More Than One Filter IS Specified, They Must Be Separated by SEMICOLONS in The Order In Which The Should Process The Content.

See Also

Filters Documentation

SetOutputFilter Directive

Description: Sets the filters that will process responses from the serverSyntax: SetOutputFilter filter [; filter ...] Context: server config, virtual host, directory, .htaccessOverride: FileInfoStatus: CoreModule: coreThe SetOutputFilter directive sets the filters which will process responses from The Server Before The is is in addition to any, inclished The addoutputfilter Directive.

For Example, The Following Configuration Will Process All Files in The / WWW / DATA / DIRECTORY for Server-Side Includes.

SetOutputFilter Includes

IF More Than One Filter IS Specified, They Must Be Separated by SEMICOLONS in The Order In Which The Should Process The Content.

See Also

Filters Documentation

TIMEOUT Directive

Description: Amount of Time The Server Will Wait for Certain Events Before Failing A RequestSyntax: Timeout Secondsdefault: Timeout 300Context: Server Configstatus: Coremodule: Core

The Timeout Directive Currently Defines The Amount of Time Apache Will Wait for Three Things:

The Amount of Time Betwe Request. The Amount of Time Between Receipt of TCP Packets ON A Post OR PUT Request. The Amount of Time Between Acks on Transmissions of TCP Packets in Responses.

We plan on making these separately configurable at some point down the road. The timer used to default to 1200 before 1.2, but has been lowered to 300 which is still far more than necessary in most situations. It is not set any lower by default because ................ ..

Usecanonicalname Directive

Description: Configures how the server determines its own name and portSyntax: UseCanonicalName On | Off | DNSDefault: UseCanonicalName OnContext: server config, virtual host, directoryStatus: CoreModule: coreIn many situations Apache must construct a self-referential URL - that is, a URL that refers back to the same server. With UseCanonicalName On Apache will use the hostname and port specified in the ServerName directive to construct the canonical name for the server. This name is used in all self-referential URLs, and for the values ​​of SERVER_NAME And Server_Port in CGIS.

With UseCanonicalName Off Apache will form self-referential URLs using the hostname and port supplied by the client if any are supplied (otherwise it will use the canonical name, as defined above). These values ​​are the same that are used to implement name based virtual Hosts, And Are Available with The Same Clients. The CGI Variables Server_Name and Server_Port Will Be Constructed from The Clom The Clom.

An example where this may be useful is on an intranet server where you have users connecting to the machine using short names such as www. You'll notice that if the users type a shortname, and a URL which is a directory, such as http : // www / splat, without the trailing slash then Apache will redirect them to http://www.domain.com/splat/ If you have authentication enabled, this will cause the user to have to authenticate twice (once for www. And Once Again for www.domain.com - See The FAQ ON this subject for more information. But if usecanonicalname is set off, then apache will redirect to http: // www / splat /.

There is a third option, UseCanonicalName DNS, which is intended for use with mass IP-based virtual hosting to support ancient clients that do not provide a Host:. Header With this option Apache does a reverse DNS lookup on the server IP address that the Client Connected to in Order to Work Out Self-Referenceial Urls.warning

If CGIs make assumptions about the values ​​of SERVER_NAME they may be broken by this option. The client is essentially free to give whatever value they want as a hostname. But if the CGI is only using SERVER_NAME to construct self-referential URLs then it should be Just fine.

See Also

ServerName Listen

Directive

Description: Contains directives that apply only to a specific hostname or IP addressSyntax: ... Context: server configStatus: CoreModule: core

and are used to enclose a group of directives that will apply only to a particular virtual host. Any directive that is allowed in a virtual host context may be used. When the server receives a request for a document on A Particular Virtual Host, IT Uses The Configuration Directives Enclosed in The Section. Addr CAN be:

The IP address of the virtual host; A fully qualified domain name for the IP address of the virtual host; The character *, which is used only in combination with NameVirtualHost * to match all IP addresses; or The string _default_, which is used only WITH IP Virtual Hosting to Catch Unmatch IP Addresses.

EXAMPLE

ServerAdmin webmaster@host.foo.comDocumentRoot /www/docs/host.foo.comServerName host.foo.comErrorLog logs / host.foo.com-error_logTransferLog logs / host.foo.com-access_log IPv6 Addresses Must Be Specified In Square Brackets Because The Optional Port Number Could Not Be determined OtherWise. AN IPv6 Example Is Shown Below:

ServerAdmin webmaster@host.example.comDocumentRoot /www/docs/host.example.comServerName host.example.comErrorLog logs / host.example.com-error_logTransferLog logs / host .example.com-access_log

Each Virtual Host must correspond to a different IP address, different port number or a different host name for the server, in the former case the server machine must be configured to accept IP packets for multiple addresses. (If the machine does not have multiple network Interfaces, THIS CAN BE Accomplished with the ifconfig alias command - if Your OS Supports it).

Note

.

When using IP-based virtual hosting, the special name _default_ can be specified in which case this virtual host will match any IP address that is not explicitly listed in another virtual host. In the absence of any _default_ virtual host the "main" server config , consisting of all those definitions outside any VirtualHost section, is used when no IP-match occurs. (But note that any IP address matches a NameVirtualHost directive will use neither the "main" server config nor the _default_ virtual host that. See the name . -based virtual hosting documentation for further details) You can specify a: port to change the port that is matched If unspecified then it defaults to the same port as the most recent Listen statement of the main server You may also specify:.. * To match all ports on what address. (this is recommended when used with _default_.

Security

.................... ..

See Also

Apache Virtual Host documentation Issues Regarding DNS and Apache Setting which addresses and ports Apache uses How , and sections work for an explanation of how these different sections are combined when a request is received

Available Languages: DE | EN | JA

Copyright 1999-2004 The Apache Software Foundation.Licensed Under The Apache License, Version 2.0.

Modules | Directives | FAQ | Glossary | SiteMap

转载请注明原文地址:https://www.9cbs.com/read-65582.html

New Post(0)