Apache Quick Reference Card
Apache Quick Reference Card
Sectional directives
This card summarizes information in the Apache documentation, which can be found at http://www.apache.org/docs/ . Each directive is listed with its arguments. Defaults are given where appropriate in parentheses at the end of the line, followed by an indication of the status of the directive (C core, B base, E extension) and the contexts in which the directive is valid (c in a conguration le, v within a virtual host section, d within a directory section, a in an access control le). Options and directives that are new for Apache 1.3 are marked 1.3 , while those that have changed are marked 1.3.
httpd -d directory -f file -C directive -c directive -L -l -S -v -V -X -d directory initial value for ServerRoot -D parameter dene parameter for <IfDefine> -f file conguration le (conf/httpd.conf ) -C directive process directive before reading cong les -c directive process directive after reading cong les -L list available conguration directives and exit -l list compiled-in modules and exit -S show vhost settings -t test syntax of conguration les and exit -v print version and build date, and exit -V show compilation settings and exit -X single-processs debug mode
1.3
1.3
Mapping directives
1.3
1.3 1.3
Cc Ec (10) C c 2
1.3
Timeout secs KeepAlive On Off KeepAliveTimeout seconds MaxKeepAliveRequests number MaxClients number MaxRequestsPerChild number ExcessRequestsPerChild number MaxSpareServers number
1.3
1.3
DocumentRoot directory (/usr/local/apache/htdocs) C cv ServerRoot directory (/usr/local/apache ) C c AccessConfig filename (conf/access.conf ) C cv ResourceConfig filename (conf/srm.conf ) C cv Include filename C cvd TypesConfig filename (conf/mime.types ) B c PidFile filename (logs/httpd.pid ) C c LockFile filename (logs/accept.lock ) C c ScoreBoardFile file (logs/apache_status ) C c ServerAdmin email-addr C cv ServerType inetd standalone (standalone ) C c ServerName name (determined automatically) C cv ServerAlias fqdn ... Cv ServerSignature On Off Email (Off) C cvda ServerPath pathname Cv ServerTokens Min imal OS Full (Full) C c BindAddress * IP-addr fqdn (*) C c Listen IP-addr: port-number Cc Port portno (80) C c User username #userid (#-1) C cv Group group-name #group-id (#-1) C cv NameVirtualHost addr :port Cc UseCanonicalName On Off (On) C cvda CoreDumpDirectory directory (as ServerRoot ) C c IdentityCheck On Off (Off) C cvd
Action MIME-type handler-name script B cvda Alias url-path real-path B cv AliasMatch url-regex path-replacement B cv ErrorDocument error-code string url C cvda UserDir directory DISABLED user ... (public_html ) B cv ENABLED user ... Redirect status url-path url B cvda RedirectMatch status url-regex dest-url B cv RedirectPermanent url-path url-dest B cvda RedirectTemp url-path url-dest B cvda Script method script B cvd ScriptAlias url-path script-dir B cv ScriptAliasMatch url-regex script-dir B cv AddHandler handler-name extension ... B cvda RemoveHandler extension ... B da SetHandler handler-name B da ImapBase map referer url (http://server ) B cvda ImapDefault error nocontent referer menu (nocontent ) B cvda url ImapMenu none formatted semiformatted unformatted B cvda RewriteBase url E cvda RewriteCond test-string cond-pattern flags E cvda RewriteEngine On Off (Off) E cvda RewriteLock filename E cv RewriteLog filename E cv RewriteLogLevel digit E cv
format-string can contain literal text and format speciers: %a Remote IP address %b Number of bytes sent (excluding headers) %{var}e Environment variable value %f Filename %h Remote host %{hdr}i Incoming header value %l Remote logname (from identd) %{label}n Labelled note from another module %{hdr}o Outgoing header value %p Canonical port number of server %P Process ID of child server process %r First line of request %s Status %t Time in Common Log Format (CLF) format %{format}t Time (format is strftime format) %T Time taken to serve the request (in seconds) %u Remote username %U URL requested %v Canonical ServerName of server %V Server name as per UseCanonicalName setting
ErrorLog file syslog :facility (logs/error_log ) C cv CustomLog file-or-pipe format-string format-name B cv env=[! var] TransferLog file-or-pipe (logs/access_log ) B cv HostnameLookups On Off Double (Off) C cvd RefererIgnore hostname ... E cv LogFormat format-string ("%h %l %u %t "%r " %s %b") B cv format-name LogLevel emerg alert crit error warn notice (error) C cv info debug
Logging directives
1.3 1.3
DefaultType MIME-type (text/html ) C cvda ForceType MIME-type B da AddEncoding MIME-encoding extension ... B cvda AddLanguage MIME-language extension ... B cvda AddType MIME-type extension ... B cvda DefaultLanguage MIME-language (no default language ) C cvda LanguagePriority MIME-language ... B cvda XBitHack On Off Full (Off) B cvda MetaFiles On Off (Off) E cvda MetaDir dir-name (.web) E cvda MetaSuffix suffix (.meta) E cvda MimeMagicFile filename E cv ContentDigest On Off (Off) C cvda ExpiresActive On Off E cvda ExpiresBytype MIME-type expiry-code E cvda ExpiresDefault expiry-code E cvda Header set append add unset header value E cvda
<Directory pattern ~ regex > ... </Directory> <DirectoryMatch regex> ... </DirectoryMatch> <Files pattern ~ regex > ... </Files> <FilesMatch regex> ... </FilesMatch> <Location pattern ~ regex > ... </Location> <LocationMatch regex> ... </LocationMatch> <VirtualHost pattern> ... </VirtualHost> <IfDefine ! parameter> ... </IfDefine> <IfModule ! module> ... </IfModule> <Limit method> ... </Limit> <LimitExcept method> ... </LimitExcept>
MinSpareServers number StartServers number ListenBacklog number LimitRequestBody nbytes LimitRequestFields number LimitRequestFieldSize nbytes LimitRequestLine nbytes SendBufferSize bytes RLimitCPU secs max secs max RLimitMEM bytes max bytes max RLimitNPROC nprocs max nprocs max ThreadsPerChild number
1.3
1.3
1.3 1.3
1.3
1.3 1.3
1.3
Scripting directives
Valid index options are: FancyIndexing , IconsHeight=pixels, IconsWidth=pixels, NameWidth=n, IconsAreLinks , ScanHTMLTitles , SupressColumnSorting , SupressDescription , SupressHTMLPreamble , SupressLastModified , SupressSize
(.htaccess ) C cv (All) C d
1.3
Valid directive groups are: None, All, AuthConfig , FileInfo, Indexes, Limit, Options
Options +feature -feature
...
(All) C cvda
Authentication method used Length of input stream data Internet media type of input stream CGI version URL part after script identier PATH_INFO translated into lesystem Query string from URL (if present) IP address of client DNS name of client Remote user id (unreliable) Name of the authenticated user HTTP request method Virtual path of the script Host-name of the server Port number of server Name and version of the protocol Server software name and version MIME types the browser will accept URL of referring document Client software identication Dened if running under mod_perl
Valid options are: None, All, ExecCGI, FollowSymLinks , Includes, IncludesNOEXEC , Indexes, MultiViews , SymLinksIfOwnerMatch
AuthName realm-name C da AuthType type C da AuthUserFile filename E da AuthGroupFile filename E da AuthAuthoritative On Off (On) B da allow from all host ... env=var B da deny from all host ... env=var B da order allow,deny deny,allow (deny,allow ) B da mutual-failure Require user user ... group group ... valid-user C da Satisfy All Any (All) C da
4
refcards.com is a trademark of Ford & Mason Ltd. The Apache feather is used with permission of the Apache Group.
BrowserMatch regexp var =value ... B cv BrowserMatchNoCase regexp var =value ... B cv PassEnv varname ... B cv SetEnv varname value B cv SetEnvIf attribute regex var =value ... B cv SetEnvIfNoCase attribute regex var =value ... B cv UnsetEnv varname ... B cv ScriptLog filename Bc ScriptLogBuffer size-bytes (1024) B c ScriptLogLength length-bytes (10385760) B c
1.3 1.3
NoProxy host domain ip-addr subnet ... AllowCONNECT port ... ProxyBlock * host domain ... ProxyDomain domain-name ProxyPass path url ProxyPassReverse path url ProxyReceiveBufferSize number-bytes ProxyRemote match remote-server ProxyRequests On Off ProxyVia On Off Full Block CacheDefaultExpire hours CacheDirLength number CacheDirLevels number CacheForceCompletion percentage-complete CacheGcInterval hours CacheLastModifiedFactor factor CacheMaxExpire hours CacheRoot directory CacheSize kb NoCache * host domain ...
Proxy/cache directives
E cv (443 563) E cv E cv E cv E cv E cv E cv E cv (Off) E cv (Off) E cv (1) E cv (1) E cv (3) E cv (90) E cv E cv (0.1) E cv (24) E cv E cv (5) E cv E cv 1.3 1.3 1.3 1.3 1.3
include another document; attribute file or virtual conditional; attribute: expr conditional; attribute: expr conditional conditional
404 405 406 407 408 409 410 411 412 413 414 415 500 501 502 503 504 505 Not found Method not allowed Not acceptable Proxy authentication required Request timeout Conict Gone Length required Precondition failed Request entity too large Request-URI too long Unsupported media type Internal server error Not implemented Bad gateway Service unavailable Gateway timeout HTTP version not supported
1.3
1.3