1%YAML 1.2
2---
3# http://www.sublimetext.com/docs/3/syntax.html
4name: Apache Conf
5file_extensions:
6  - envvars
7  - htaccess
8  - HTACCESS
9  - htgroups
10  - HTGROUPS
11  - htpasswd
12  - HTPASSWD
13  - .htaccess
14  - .HTACCESS
15  - .htgroups
16  - .HTGROUPS
17  - .htpasswd
18  - .HTPASSWD
19scope: source.apacheconf
20contexts:
21  main:
22    - match: ^(\s)*(#).*$\n?
23      scope: comment.line.hash.ini
24      captures:
25        1: punctuation.definition.comment.apacheconf
26    - match: (<)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost|Macro|If|Else|ElseIf)(\s(.+?))?(>)
27      captures:
28        1: punctuation.definition.tag.apacheconf
29        2: entity.tag.apacheconf
30        4: string.value.apacheconf
31        5: punctuation.definition.tag.apacheconf
32    - match: (</)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost|Macro|If|Else|ElseIf)(>)
33      captures:
34        1: punctuation.definition.tag.apacheconf
35        2: entity.tag.apacheconf
36        3: punctuation.definition.tag.apacheconf
37    - match: (?<=(Rewrite(Rule|Cond)))\s+(.+?)\s+(.+?)($|\s)
38      captures:
39        3: string.regexp.apacheconf
40        4: string.replacement.apacheconf
41    - match: (?<=RedirectMatch)(\s+(\d\d\d|permanent|temp|seeother|gone))?\s+(.+?)\s+((.+?)($|\s))?
42      captures:
43        2: entity.status.apacheconf
44        3: string.regexp.apacheconf
45        5: string.path.apacheconf
46    - match: (?<=Redirect)(\s+(\d\d\d|permanent|temp|seeother|gone))?\s+(.+?)\s+((.+?)($|\s))?
47      captures:
48        2: entity.status.apacheconf
49        3: string.path.apacheconf
50        5: string.path.apacheconf
51    - match: (?<=ScriptAliasMatch|AliasMatch)\s+(.+?)\s+((.+?)\s)?
52      captures:
53        1: string.regexp.apacheconf
54        3: string.path.apacheconf
55    - match: (?<=RedirectPermanent|RedirectTemp|ScriptAlias|Alias)\s+(.+?)\s+((.+?)($|\s))?
56      captures:
57        1: string.path.apacheconf
58        3: string.path.apacheconf
59    - match: \b(AcceptPathInfo|AccessFileName|AddDefaultCharset|AddOutputFilterByType|AllowEncodedSlashes|AllowOverride|AuthName|AuthType|CGIMapExtension|ContentDigest|DefaultType|Define|DocumentRoot|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|FileETag|ForceType|HostnameLookups|IdentityCheck|Include(Optional)?|KeepAlive|KeepAliveTimeout|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|LogLevel|MaxKeepAliveRequests|Mutex|NameVirtualHost|Options|Require|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScriptInterpreterSource|ServerAdmin|ServerAlias|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetHandler|SetInputFilter|SetOutputFilter|Time(O|o)ut|TraceEnable|UseCanonicalName|Use|ErrorLogFormat|GlobalLog|PHPIniDir|SSLHonorCipherOrder|SSLCompression|SSLUseStapling|SSLStapling\w+|SSLCARevocationCheck|SSLSRPVerifierFile|SSLSessionTickets|RequestReadTimeout|ProxyHTML\w+|MaxRanges)\b
60      captures:
61        1: keyword.core.apacheconf
62    - match: \b(AcceptMutex|AssignUserID|BS2000Account|ChildPerUserID|CoreDumpDirectory|EnableExceptionHook|Group|Listen|ListenBacklog|LockFile|MaxClients|MaxConnectionsPerChild|MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxRequestWorkers|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MinSpareServers|MinSpareThreads|NumServers|PidFile|ReceiveBufferSize|ScoreBoardFile|SendBufferSize|ServerLimit|StartServers|StartThreads|ThreadLimit|ThreadsPerChild|ThreadStackSize|User|Win32DisableAcceptEx)\b
63      captures:
64        1: keyword.mpm.apacheconf
65    - match: \b(Allow|Deny|Order)\b
66      captures:
67        1: keyword.access.apacheconf
68    - match: \b(Action|Script)\b
69      captures:
70        1: keyword.actions.apacheconf
71    - match: \b(Alias|AliasMatch|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ScriptAlias|ScriptAliasMatch)\b
72      captures:
73        1: keyword.alias.apacheconf
74    - match: \b(AuthAuthoritative|AuthGroupFile|AuthUserFile|AuthBasicProvider|AuthBasicFake|AuthBasicAuthoritative|AuthBasicUseDigestAlgorithm)\b
75      captures:
76        1: keyword.auth.apacheconf
77    - match: \b(Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail)\b
78      captures:
79        1: keyword.auth_anon.apacheconf
80    - match: \b(AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile)\b
81      captures:
82        1: keyword.auth_dbm.apacheconf
83    - match: \b(AuthDigestAlgorithm|AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize|AuthDigestProvider)\b
84      captures:
85        1: keyword.auth_digest.apacheconf
86    - match: \b(AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl)\b
87      captures:
88        1: keyword.auth_ldap.apacheconf
89    - match: \b(AddAlt|AddAltByEncoding|AddAltByType|AddDescription|AddIcon|AddIconByEncoding|AddIconByType|DefaultIcon|HeaderName|IndexIgnore|IndexOptions|IndexOrderDefault|IndexStyleSheet|IndexHeadInsert|ReadmeName)\b
90      captures:
91        1: keyword.autoindex.apacheconf
92    - match: \b(BalancerMember|BalancerGrowth|BalancerPersist|BalancerInherit)\b
93      captures:
94        1: keyword.filter.apacheconf
95    - match: \b(CacheDefaultExpire|CacheDisable|CacheEnable|CacheForceCompletion|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire)\b
96      captures:
97        1: keyword.cache.apacheconf
98    - match: \b(MetaDir|MetaFiles|MetaSuffix)\b
99      captures:
100        1: keyword.cern_meta.apacheconf
101    - match: \b(ScriptLog|ScriptLogBuffer|ScriptLogLength)\b
102      captures:
103        1: keyword.cgi.apacheconf
104    - match: \b(ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock)\b
105      captures:
106        1: keyword.cgid.apacheconf
107    - match: \b(CharsetDefault|CharsetOptions|CharsetSourceEnc)\b
108      captures:
109        1: keyword.charset_lite.apacheconf
110    - match: \b(Dav|DavDepthInfinity|DavMinTimeout|DavLockDB)\b
111      captures:
112        1: keyword.dav.apacheconf
113    - match: \b(DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize)\b
114      captures:
115        1: keyword.deflate.apacheconf
116    - match: \b(DirectoryIndex|DirectorySlash|FallbackResource)\b
117      captures:
118        1: keyword.dir.apacheconf
119    - match: \b(CacheDirLength|CacheDirLevels|CacheExpiryCheck|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheMaxFileSize|CacheMinFileSize|CacheRoot|CacheSize|CacheTimeMargin)\b
120      captures:
121        1: keyword.disk_cache.apacheconf
122    - match: \b(DumpIOInput|DumpIOOutput)\b
123      captures:
124        1: keyword.dumpio.apacheconf
125    - match: \b(PassEnv|SetEnv|UnsetEnv)\b
126      captures:
127        1: keyword.env.apacheconf
128    - match: \b(ExpiresActive|ExpiresByType|ExpiresDefault)\b
129      captures:
130        1: keyword.expires.apacheconf
131    - match: \b(ExtFilterDefine|ExtFilterOptions)\b
132      captures:
133        1: keyword.ext_filter.apacheconf
134    - match: \b(CacheFile|MMapFile)\b
135      captures:
136        1: keyword.file_cache.apacheconf
137    - match: \b(AddOutputFilterByType|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace)\b
138      captures:
139        1: keyword.filter.apacheconf
140    - match: \b(Header|RequestHeader)\b
141      captures:
142        1: keyword.headers.apacheconf
143    - match: \b(ImapBase|ImapDefault|ImapMenu)\b
144      captures:
145        1: keyword.imap.apacheconf
146    - match: \b(SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|XBitHack)\b
147      captures:
148        1: keyword.include.apacheconf
149    - match: \b(ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer)\b
150      captures:
151        1: keyword.isapi.apacheconf
152    - match: \b(LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTrustedCA|LDAPTrustedCAType)\b
153      captures:
154        1: keyword.ldap.apacheconf
155    - match: \b(BufferedLogs|CookieLog|CustomLog|LogFormat|TransferLog|ForensicLog)\b
156      captures:
157        1: keyword.log.apacheconf
158    - match: \b(MCacheMaxObjectCount|MCacheMaxObjectSize|MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize)\b
159      captures:
160        1: keyword.mem_cache.apacheconf
161    - match: \b(AddCharset|AddEncoding|AddHandler|AddInputFilter|AddLanguage|AddOutputFilter|AddType|DefaultLanguage|ModMimeUsePathInfo|MultiviewsMatch|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|TypesConfig)\b
162      captures:
163        1: keyword.mime.apacheconf
164    - match: \b(ProtocolEcho|Example|AddModuleInfo|MimeMagicFile|CheckSpelling|ExtendedStatus|SuexecUserGroup|UserDir)\b
165      captures:
166        1: keyword.misc.apacheconf
167    - match: \b(CacheNegotiatedDocs|ForceLanguagePriority|LanguagePriority)\b
168      captures:
169        1: keyword.negotiation.apacheconf
170    - match: \b(NWSSLTrustedCerts|NWSSLUpgradeable|SecureListen)\b
171      captures:
172        1: keyword.nw_ssl.apacheconf
173    - match: \b(AllowCONNECT|NoProxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyFtpDirCharset|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassMatch|ProxyPassReverse|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia)\b
174      captures:
175        1: keyword.proxy.apacheconf
176    - match: \b(RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule)\b
177      captures:
178        1: keyword.rewrite.apacheconf
179    - match: \b(BrowserMatch|BrowserMatchNoCase|SetEnvIf|SetEnvIfNoCase)\b
180      captures:
181        1: keyword.setenvif.apacheconf
182    - match: \b(LoadFile|LoadModule)\b
183      captures:
184        1: keyword.so.apacheconf
185    - match: \b(SSLCACertificateFile|SSLCACertificatePath|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth|SSLInsecureRenegotiation|SSLOpenSSLConfCmd)\b
186      captures:
187        1: keyword.ssl.apacheconf
188    - match: \b(Substitute|SubstituteInheritBefore|SubstituteMaxLineLength)\b
189      captures:
190        1: keyword.substitute.apacheconf
191    - match: \b(CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking)\b
192      captures:
193        1: keyword.usertrack.apacheconf
194    - match: \b(VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP)\b
195      captures:
196        1: keyword.vhost_alias.apacheconf
197    - match: \b(php_value|php_flag|php_admin_value|php_admin_flag)\b(\s+(.+?)(\s+(".+?"|.+?))?)?\s
198      captures:
199        1: keyword.php.apacheconf
200        3: entity.property.apacheconf
201        5: string.value.apacheconf
202    - match: '(%\{)((HTTP_USER_AGENT|HTTP_REFERER|HTTP_COOKIE|HTTP_FORWARDED|HTTP_HOST|HTTP_PROXY_CONNECTION|HTTP_ACCEPT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|REMOTE_USER|REMOTE_IDENT|REQUEST_METHOD|SCRIPT_FILENAME|PATH_INFO|QUERY_STRING|AUTH_TYPE|DOCUMENT_ROOT|SERVER_ADMIN|SERVER_NAME|SERVER_ADDR|SERVER_PORT|SERVER_PROTOCOL|SERVER_SOFTWARE|TIME_YEAR|TIME_MON|TIME_DAY|TIME_HOUR|TIME_MIN|TIME_SEC|TIME_WDAY|TIME|API_VERSION|THE_REQUEST|REQUEST_URI|REQUEST_FILENAME|IS_SUBREQ|HTTPS)|(.*?))(\})'
203      captures:
204        1: punctuation.variable.apacheconf
205        3: variable.env.apacheconf
206        4: variable.misc.apacheconf
207        5: punctuation.variable.apacheconf
208    - match: \b((text|image|application|video|audio)/.+?)\s
209      captures:
210        1: entity.mime-type.apacheconf
211    - match: \b(?i)(export|from|unset|set|on|off)\b
212      captures:
213        1: entity.helper.apacheconf
214    - match: \b(\d+)\b
215      captures:
216        1: constant.numeric.integer.decimal.apacheconf
217    - match: '\s(\[)(.*?)(\])\s'
218      captures:
219        1: punctuation.definition.flag.apacheconf
220        2: string.flag.apacheconf
221        3: punctuation.definition.flag.apacheconf
222