apache refcard-a4

2

Click here to load reader

Upload: abdelmonem-naamane

Post on 19-May-2015

499 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Apache refcard-a4

Apache Quick Reference CardRevision 1.6for Apacheversion1.3.6

Andrew Ford refcards.com TM

This cardsummarizesinformationin theApachedocumentation,whichcanbefoundathttp://www.apache.org/docs/.Eachdirective is listed with its arguments. Defaults are givenwhereappropriatein parenthesesat theendof the line, followedby an indicationof thestatusof thedirective (C – core,B – base,E – extension)andthecontexts in which thedirective is valid (c –in a configurationfile, v – within a virtual hostsection,d – withina directorysection,a – in anaccesscontrolfile).Optionsanddirectivesthatarenew for Apache1.3aremarked1.3,while thosethathave changedaremarked1.3.

Command line optionshttpd

�-d directory � � -f file � � -C directive ��-c directive � � -L � � -l � � -S � � -v � � -V � � -X �

-d directory initial valuefor ServerRoot-D parameter defineparameterfor <IfDefine>-f file configurationfile (conf/httpd.conf)-C directive processdirective beforereadingconfigfiles 1.3-c directive processdirective afterreadingconfigfiles 1.3-L list availableconfigurationdirectivesandexit 1.3-l list compiled-inmodulesandexit 1.3-S show vhost settings-t testsyntaxof configurationfiles andexit-v print versionandbuild date,andexit-V show compilationsettingsandexit 1.3-X single-processsdebug mode

General configuration dir ectivesDocumentRoot directory (/usr/local/apache/htdocs)C cvServerRoot directory (/usr/local/apache)C cAccessConfig filename (conf/access.conf)C cvResourceConfig filename (conf/srm.conf)C cvInclude filename C cvd 1.3TypesConfig filename (conf/mime.types)B cPidFile filename (logs/httpd.pid)C cLockFile filename (logs/accept.lock)C cScoreBoardFile file (logs/apache_status)C cServerAdmin email-addr C cvServerType � inetd � standalone � (standalone)C cServerName name (determined automatically) C cvServerAlias fqdn ... C vServerSignature � On � Off � Email � (Off) C cvda 1.3ServerPath pathname C vServerTokens � Min � imal � � OS � Full � (Full) C c 1.3BindAddress � * � IP-addr � fqdn � (*) C cListen � IP-addr: � port-number C cPort portno (80)C cUser � username � #userid � (#-1) C cvGroup � group-name � #group-id � (#-1) C cvNameVirtualHost addr � :port � C c 1.3UseCanonicalName � On � Off � (On) C cvda 1.3CoreDumpDirectory directory (as ServerRoot)C c 1.3IdentityCheck � On � Off � (Off) C cvd

ClearModuleList C cAddModule module ... C cAddModuleInfo module text E cv 1.3ExtendedStatus � On � Off � (Off) E c 1.3

Sectionaldir ectives<Directory � pattern � ~ regex � > ... </Directory> C cv 1.3<DirectoryMatch regex> ... </DirectoryMatch> C cv 1.3<Files � pattern � ~ regex � > ... </Files> C cvda 1.3<FilesMatch regex> ... </FilesMatch> C cvda 1.3<Location � pattern � ~ regex � > ... </Location> C cv 1.3<LocationMatch regex> ... </LocationMatch> C cv 1.3<VirtualHost pattern> ... </VirtualHost> C c<IfDefine � ! � parameter> ... </IfDefine> C cvda 1.3<IfModule � ! � module> ... </IfModule> C cvda<Limit method> ... </Limit> C cvda<LimitExcept method> ... </LimitExcept> C cvda

Logging dir ectivesErrorLog � file � syslog � :facility � � (logs/error_log)C cv 1.3CustomLog file-or-pipe � format-string � format-name �

� env=[! � var]B cv 1.3

TransferLog file-or-pipe (logs/access_log)B cvHostnameLookups � On � Off � Double � (Off) C cvd 1.3RefererIgnore hostname ... E cvLogFormat format-string

� format-name �("%h %l %u %t � "%r � " %s %b") B cv 1.3

LogLevel � emerg � alert � crit � error � warn � notice �info � debug �

(error) C cv 1.3

format-string cancontainliteral text andformatspecifiers:%a RemoteIP address%b Numberof bytessent(excludingheaders)%{var}e Environmentvariablevalue%f Filename%h Remotehost%{hdr}i Incomingheadervalue%l Remotelogname(from identd)%{label}n Labellednotefrom anothermodule 1.3%{hdr}o Outgoingheadervalue%p Canonicalport numberof server%P ProcessID of child server process%r First line of request%s Status%t Time in CommonLog Format(CLF) format%{format}t Time (format is strftime format)%T Time takento serve therequest(in seconds)%u Remoteusername%U URL requested%v CanonicalServerName of server%V Server nameasperUseCanonicalName setting 1.3

Performancetuning dir ectivesTimeout secs (300)C cKeepAlive � On � Off � (On) C cKeepAliveTimeout seconds (15)C cMaxKeepAliveRequests number (100)C cMaxClients number (256)C cMaxRequestsPerChild number C cExcessRequestsPerChild number E c 1.3MaxSpareServers number (10)C c

MinSpareServers number (5)C cStartServers number (5)C cListenBacklog number (511)C c 1.3LimitRequestBody nbytes C cvda 1.3LimitRequestFields number (100)C c 1.3LimitRequestFieldSize nbytes (8190)C c 1.3LimitRequestLine nbytes (8190)C c 1.3SendBufferSize bytes C cRLimitCPU � secs � max ��� � secs � max � � C cvdaRLimitMEM � bytes � max �� � bytes � max � � C cvdaRLimitNPROC � nprocs � max �� � nprocs � max � � C cvdaThreadsPerChild number (50)C c 1.3

File typing dir ectivesDefaultType MIME-type (text/html)C cvdaForceType MIME-type B daAddEncoding MIME-encoding extension ... B cvdaAddLanguage MIME-language extension ... B cvdaAddType MIME-type extension ... B cvdaDefaultLanguage MIME-language (no default language)C cvda 1.3LanguagePriority MIME-language ... B cvdaXBitHack � On � Off � Full � (Off) B cvdaMetaFiles � On � Off � (Off) E cvda 1.3MetaDir dir-name (.web) E cvda 1.3MetaSuffix suffix (.meta) E cvda 1.3MimeMagicFile filename E cv 1.3ContentDigest � On � Off � (Off) C cvdaExpiresActive � On � Off � E cvdaExpiresBytype MIME-type expiry-code E cvdaExpiresDefault expiry-code E cvdaHeader � set � append � add � unset � header value E cvda

Mapping dir ectivesAction � MIME-type � handler-name � script B cvdaAlias url-path real-path B cvAliasMatch url-regex path-replacement B cv 1.3ErrorDocument error-code � string � url � C cvdaUserDir � directory � DISABLED � user ... � �

ENABLED user ... �(public_html)B cv 1.3

Redirect � status � url-path url B cvdaRedirectMatch � status � url-regex dest-url B cv 1.3RedirectPermanent url-path url-dest B cvdaRedirectTemp url-path url-dest B cvdaScript method script B cvdScriptAlias url-path script-dir B cvScriptAliasMatch url-regex script-dir B cv 1.3AddHandler handler-name extension ... B cvdaRemoveHandler extension ... B da 1.3SetHandler handler-name B daImapBase � map � referer � url � (http://server)B cvdaImapDefault � error � nocontent � referer � menu

� url �(nocontent)B cvda

ImapMenu � none � formatted � semiformatted � unformatted � B cvdaRewriteBase url E cvdaRewriteCond test-string cond-pattern � flags � E cvdaRewriteEngine � On � Off � (Off) E cvdaRewriteLock filename E cv 1.3RewriteLog filename E cvRewriteLogLevel digit E cv

1 2 3

Page 2: Apache refcard-a4

RewriteMap map-name map-type:map-source E cv 1.3RewriteOptions option E cvdaRewriteRule pattern substitution � flags � E cvda 1.3

Scripting dir ectivesBrowserMatch regexp var � =value � ... B cvBrowserMatchNoCase regexp var � =value � ... B cvPassEnv varname ... B cvSetEnv varname value B cvSetEnvIf attribute regex var � =value � ... B cv 1.3SetEnvIfNoCase attribute regex var � =value � ... B cv 1.3UnsetEnv varname ... B cvScriptLog filename B cScriptLogBuffer size-bytes (1024)B cScriptLogLength length-bytes (10385760)B c

Dir ectory indexing dir ectivesDirectoryIndex file ... (index.html)B cvdaReadmeName filename B cvdaHeaderName filename B cvdaIndexIgnore pattern ... B cvdaIndexOrderDefault � Ascending � Descending �� Name � Date �

Size � Description �B cvda 1.3

DefaultIcon url B cvdaAddAlt "string" file ... B cvdaAddAltByEncoding "string" MIME-encoding ... B cvdaAddAltByType "string" MIME-type ... B cvdaAddIcon icon file ... B cvdaAddIconByType icon MIME-type ... B cvdaAddIconByEncoding icon MIME-encoding ... B cvdaAddDescription "description" file-pattern B cvdaIndexOptions � +option � -option � ... (no options) B cvda 1.3

Valid index optionsare:FancyIndexing,IconsHeight=pixels, IconsWidth=pixels,NameWidth=n, IconsAreLinks, ScanHTMLTitles,SupressColumnSorting, SupressDescription,SupressHTMLPreamble, SupressLastModified, SupressSize

Accesscontrol dir ectivesAccessFileName filename ... (.htaccess)C cv 1.3AllowOverride directive-group ... (All) C d

Valid directive groupsare:None, All, AuthConfig, FileInfo,Indexes, Limit, Options

Options � +feature � -feature � ... (All) C cvda

Valid optionsare:None, All, ExecCGI, FollowSymLinks,Includes, IncludesNOEXEC, Indexes, MultiViews,SymLinksIfOwnerMatch

AuthName realm-name C daAuthType type C daAuthUserFile filename E daAuthGroupFile filename E daAuthAuthoritative � On � Off � (On) B daallow from � all � host ... � env=var � B dadeny from � all � host ... � env=var � B daorder � allow,deny � deny,allow �

mutual-failure �(deny,allow)B da

Require � user user ... � group group ... � valid-user � C daSatisfy � All � Any � (All) C da

Proxy/cachedir ectivesNoProxy � host � domain � ip-addr � subnet � ... E cv 1.3AllowCONNECT port ... (443 563) E cv 1.3ProxyBlock � * � host � domain � ... E cvProxyDomain domain-name E cv 1.3ProxyPass path url E cvProxyPassReverse path url E cv 1.3ProxyReceiveBufferSize number-bytes E cv 1.3ProxyRemote match remote-server E cvProxyRequests � On � Off � (Off) E cvProxyVia � On � Off � Full � Block � (Off) E cv 1.3CacheDefaultExpire hours (1)E cvCacheDirLength number (1)E cvCacheDirLevels number (3)E cvCacheForceCompletion percentage-complete (90)E cv 1.3CacheGcInterval hours E cvCacheLastModifiedFactor factor (0.1) E cvCacheMaxExpire hours (24)E cvCacheRoot directory E cvCacheSize kb (5)E cvNoCache � * � host � domain � ... E cv

Common GatewayInterface (CGI) variablesAUTH_TYPE AuthenticationmethodusedCONTENT_LENGTH Lengthof inputstreamdataCONTENT_TYPE Internetmediatypeof inputstreamGATEWAY_INTERFACE CGI versionPATH_INFO URL partafterscriptidentifierPATH_TRANSLATED PATH_INFO translatedinto filesystemQUERY_STRING Querystringfrom URL (if present)REMOTE_ADDR IP addressof clientREMOTE_HOST DNSnameof clientREMOTE_IDENT Remoteuserid (unreliable)REMOTE_USER Nameof theauthenticateduserREQUEST_METHOD HTTPrequestmethodSCRIPT_NAME Virtual pathof thescriptSERVER_NAME Host-nameof theserverSERVER_PORT Portnumberof serverSERVER_PROTOCOL Nameandversionof theprotocolSERVER_SOFTWARE ServersoftwarenameandversionHTTP_ACCEPT MIME typesthebrowserwill acceptHTTP_REFERER URL of referringdocumentHTTP_USER_AGENT ClientsoftwareidentificationMOD_PERL Definedif runningundermod_perlServer SideIncludes (SSI)Formatis: <!--#element attr=value ... -->Elementsare:config controlsparsing;attributes: errmsg, sizefmt (oneof

bytes or abbrev), timefmt (strftime format)echo print the value of a variable; attribute var (can be

a CGI variable or one of: DATE_GMT, DATE_LOCAL,DOCUMENT_NAME, DOCUMENT_URI or LAST_MODIFIED)

set setthevalueof a variable;attributes:var, valueprintenv print a list of all variablesandtheir valuesexec executea shell commandor CGI script; attribute: cmd

or cgi (IncludesNOEXEC optiondisablesexec)fsize print sizeof file; attribute:file or virtualflastmod print file modificationtime; attributefile or virtual

include includeanotherdocument;attributefile or virtualif conditional;attribute:exprelif conditional;attribute:exprelse conditionalendif conditional

HTTP 1.1statuscodes100 Continue101 Switchingprotocols200 OK201 Created202 Accepted203 Non-authoritative information204 No content205 Resetcontent206 Partial content300 Multiple choices301 Movedpermanently302 Movedtemporarily303 Seeother304 Not modified305 Useproxy400 Badrequest401 Unauthorized402 Paymentrequired403 Forbidden

404 Not found405 Methodnotallowed406 Not acceptable407 Proxyauthenticationrequired408 Requesttimeout409 Conflict410 Gone411 Lengthrequired412 Preconditionfailed413 Requestentity too large414 Request-URItoo long415 Unsupportedmediatype500 Internalserver error501 Not implemented502 Badgateway503 Serviceunavailable504 Gateway timeout505 HTTP versionnot supported

ApacheWebResourceshttp://www.apache.org Apachehomepagehttp://modules.apache.org ApacheModuleRegistryhttp://www.apache-ssl.org Apache-SSLhomepagehttp://www.modssl.org mod sslhomepagehttp://java.apache.org TheJava-ApacheProjecthttp://perl.apache.org TheApache/PerlIntegrationProjecthttp://www.php.net PHP:Hypertext Processorhttp://www.apacheweek.com ApacheWeekhttp://www.netcraft.com/survey NetcraftServer Surveyhttp://www.refcards.com QuickReferenceCards

ApacheQuick ReferenceCardA refcards.com TM quick referencecard.Revision 1.6for Apacheversion1.3.6 [May 1999]Publishedby Ford& MasonLtd.c�

1998,1999Ford& MasonLtd. All rightsreserved.Permissionis grantedto print andduplicatethis cardfor persionalor in-dividual, internalbusinessuse. Copiesof this card(& others)canbeor-deredthroughour website: http://www.refcards.com, which alsohasversionsavailablefor downloading.Pleasesendfeedbackto: [email protected] is a trademarkof Ford & MasonLtd.TheApachefeatheris usedwith permissionof theApacheGroup.

4 5 6