Apache Quick Reference Card

Revision 1.6 for Apache version 1.3.6 Andrew Ford refcards.com TM

ClearModuleList AddModule module ... AddModuleInfo module text ExtendedStatus On Off

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 configuration file, v – within a virtual host section, d – within a directory section, a – in an access control file). Options and directives that are new for Apache 1.3 are marked 1.3 , while those that have changed are marked 1.3.

¢ £ ¤ Sectional directives <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>

Cc Cc E cv (Off) E c C cv C cv C cvda C cvda C cv C cv Cc C cvda C cvda C cvda C cvda

1.3 1.3 1.3 1.3 1.3 1.3 1.3 1.3 1.3

¥¦ ¥¦ ¥ ¥

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

(5) C c (5) C c (511) C c
C cvda (100) C c (8190) C c (8190) C c Cc C cvda C cvda C cvda (50) C c

1.3 1.3 1.3 1.3 1.3

¢ ¢

£ ¨ ¤ ¥¢ £ ¤ ¦ £ ¤©¥ ¢ £ ¤ ¦ ¢ £ ¤©¥ ¢ £ ¤¦

1.3

File typing directives
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

Command line options

httpd -d directory -f file -C directive -c directive -L -l -S -v -V -X -d directory initial value for ServerRoot -D parameter define parameter for <IfDefine> -f file configuration file (conf/httpd.conf ) -C directive process directive before reading config files -c directive process directive after reading config files -L list available configuration directives and exit -l list compiled-in modules and exit -S show vhost settings -t test syntax of configuration files and exit -v print version and build date, and exit -V show compilation settings and exit -X single-processs debug mode

 

 

¡      ¡           ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

Logging directives

1.3 1.3 1.3 1.3

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

¢

£

¢ £ £ ¤ £ ¦

¦

¥

¢

¦¤

£

¤

1.3 1.3

1.3

¤

1.3 1.3 1.3

¢

1.3

General configuration directives
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

1.3

¢

£

¤

¢

¥

¢

¢ £ £ ¤ ¢ ¥ ¦£ £ ¤ ¢ £ £ ¤ ¦ £ ¤ £ ¤ ¥ ¦ ¢ £ ¤ ¢ £ ¤

1.3 1.3

format-string can contain literal text and format specifiers: %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

£

£

£

£

£

§ §

¢ £ £ ¤ ¢ £ ¤ ¢ £ ¤ ¢ £ ¤ £

£

1.3 1.3 1.3 1.3

¢ ¢

£

£ £ £

¤ ¥

Mapping directives

1.3

1.3

Performance tuning directives
Timeout secs KeepAlive On Off KeepAliveTimeout seconds MaxKeepAliveRequests number MaxClients number MaxRequestsPerChild number ExcessRequestsPerChild number MaxSpareServers number
2

¢ £ ¤

1.3 1.3 1.3

(300) C c (On) C c (15) C c (100) C c (256) C c
Cc Ec (10) C c 1.3

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

¤

¢

¥

¥

¦

¦

¤

¢

£ ¤

1.3 1.3

¦£

1.3

1.3 1.3

¢

£ ¤ ¢ £

¢

£

£

£ ¤ £

£

£

¢ £ ¤

¥

£

¦

¤

1.3

1

3

attributes: var. (index.1 status codes Continue Switching protocols OK Created Accepted Non-authoritative information No content Reset content Partial content Multiple choices Moved permanently Moved temporarily See other Not modified Use proxy Bad request Unauthorized Payment required Forbidden 1.apache-ssl. internal business use. SupressHTMLPreamble ..org The Apache/Perl Integration Project http://www.3 Proxy/cache directives Scripting directives BrowserMatch regexp var =value .net PHP: Hypertext Processor http://www.6 for Apache version 1.6 [May 1999] Published by Ford & Mason Ltd.... B cv BrowserMatchNoCase regexp var =value . 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 ... Permission is granted to print and duplicate this card for persional or individual. All. B cv ScriptLog filename Bc ScriptLogBuffer size-bytes (1024) B c ScriptLogLength length-bytes (10385760) B c ¥ ¥ ¦ ¦ ¥ ¥ ¦ ¦ 1.apache..... 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 Conflict 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 HTTP 1. valid-user C da Satisfy All Any (All) C da ¢ £ ¤ ...3 E cvda E cvda 1. attribute: cmd or cgi (IncludesNOEXEC option disables exec) fsize print size of file. Limit....com TM quick reference card..apacheweek....... (.refcards..3 Valid index options are: FancyIndexing .3 Size Description DefaultIcon url B cvda AddAlt "string" file .apache.org mod ssl home page http://java. B cvda AddAltByEncoding "string" MIME-encoding . SupressColumnSorting . Revision 1.3 1.com/survey Netcraft Server Survey http://www. ExecCGI. 6 ..deny deny. attribute: file or virtual flastmod print file modification time.com Apache Week http://www. SupressLastModified .3 1. ScanHTMLTitles . All rights reserved.. --> Elements are: config controls parsing. FollowSymLinks . value printenv print a list of all variables and their values exec execute a shell command or CGI script. attribute: expr conditional.. (All) C cvda Authentication method used Length of input stream data Internet media type of input stream CGI version URL part after script identifier PATH_INFO translated into filesystem 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 identification Defined if running under mod_perl Apache Web Resources http://www. IconsHeight= pixels. attributes: errmsg. AllowOverride directive-group . B cv SetEnv varname value B cv SetEnvIf attribute regex var =value . sizefmt (one of bytes or abbrev)... 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 . B cvda AddDescription "description" file-pattern B cvda IndexOptions +option -option .org The Java-Apache Project http://perl.allow (deny...netcraft.3 ¢ £ £ ¤ ¤ ¢ £ £ NoProxy host domain ip-addr subnet . Options Options +feature -feature Valid options are: None... env=var B da deny from all host . B cvda IndexOrderDefault Ascending Descending Name Date B cvda 1..com.org Apache-SSL home page http://www. MultiViews .. (no options) B cvda 1. NameWidth= n.com Quick Reference Cards Server Side Includes (SSI) Format is: <!--#element attr =value . attribute file or virtual 5 Apache Quick Reference Card A refcards. B cvda AddIconByType icon MIME-type .3. ¢ ¢ £ £ £ £ ¤ £ ¤ ¢ £ ¤ ¢ £ £ £ ¤ Common Gateway Interface (CGI) variables AUTH_TYPE CONTENT_LENGTH CONTENT_TYPE GATEWAY_INTERFACE PATH_INFO PATH_TRANSLATED QUERY_STRING REMOTE_ADDR REMOTE_HOST REMOTE_IDENT REMOTE_USER REQUEST_METHOD SCRIPT_NAME SERVER_NAME SERVER_PORT SERVER_PROTOCOL SERVER_SOFTWARE HTTP_ACCEPT HTTP_REFERER HTTP_USER_AGENT MOD_PERL ¢ £ £ ¤ 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. AllowCONNECT port ... IncludesNOEXEC ..apache. Indexes.. B cvda AddIcon icon file .php.com ¢ £ ¤ ¢ £ £ ¤ ¢ £ £ ¤ ¢ £ £ ¤ ¢ £ ¢ £ ¤ 4 £ ¤ refcards. FileInfo. Please send feedback to: feedback@refcards.. ProxyBlock * host domain .modssl. Includes.. All..3 Valid directive groups are: None.3 Directory indexing directives DirectoryIndex file .3 1..3 1.3 1.. AuthConfig .apache. IconsWidth= pixels. SupressDescription .com is a trademark of Ford & Mason Ltd.... DATE_LOCAL . B cvda AddIconByEncoding icon MIME-encoding ... Indexes.3 include if elif else endif 100 101 200 201 202 203 204 205 206 300 301 302 303 304 305 400 401 402 403 include another document. attribute var (can be a CGI variable or one of: DATE_GMT.htaccess ) C cv (All) C d 1. B cv PassEnv varname .org Apache Module Registry http://www. attribute file or virtual conditional... DOCUMENT_NAME . Copies of this card (& others) can be ordered through our web site: http://www. B cv SetEnvIfNoCase attribute regex var =value . group group .html ) B cvda ReadmeName filename B cvda HeaderName filename B cvda IndexIgnore pattern ... 1999 Ford & Mason Ltd.allow ) B da mutual-failure Require user user .. B cv UnsetEnv varname .org Apache home page http://modules. DOCUMENT_URI or LAST_MODIFIED ) set set the value of a variable.1) E cv (24) E cv E cv (5) E cv E cv 1. B cvda AddAltByType "string" MIME-type . The Apache feather is used with permission of the Apache Group. c 1998. timefmt (strftime format) echo print the value of a variable. SupressSize ¢ £ ¤ Access control directives AccessFileName filename .. which also has versions available for downloading.RewriteMap map-name map-type :map-source RewriteOptions option RewriteRule pattern substitution flags ¥ ¦ E cv 1.refcards.3 1. IconsAreLinks . env=var B da order allow.

Sign up to vote on this title
UsefulNot useful