Personal emacs config
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1208 lines
42 KiB

  1. ;;; apache-mode.el --- Major mode for editing Apache httpd configuration files
  2. ;; Copyright (c) 2004, 2005 Karl Chen <quarl@nospam.quarl.org>
  3. ;; Copyright (c) 1999 Jonathan Marten <jonathan.marten@uk.sun.com>
  4. ;; Author: Karl Chen <quarl@nospam.quarl.org>
  5. ;; Maintainer: USAMI Kenta <tadsan@zonu.me>
  6. ;; Homepage: https://github.com/emacs-php/apache-mode
  7. ;; License: GPL-2.0-or-later
  8. ;; Keywords: languages, faces
  9. ;; Package-Version: 2.2.0
  10. ;; Package-Commit: 354f9302a8d805ac80d846adcd1cef10830b3d51
  11. ;; Version: 2.2.0
  12. ;; apache-mode.el is free software; you can redistribute it and/or modify it
  13. ;; under the terms of the GNU General Public License as published by the Free
  14. ;; Software Foundation; either version 2, or (at your option) any later
  15. ;; version.
  16. ;;
  17. ;; It is distributed in the hope that it will be useful, but WITHOUT ANY
  18. ;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  19. ;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  20. ;; details.
  21. ;;
  22. ;; You should have received a copy of the GNU General Public License along
  23. ;; with your copy of Emacs; see the file COPYING. If not, write to the Free
  24. ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  25. ;; 02111-1307, USA.
  26. ;;; Commentary:
  27. ;;
  28. ;; apache-mode is a major mode for editing Apache HTTP Server Configuration files.
  29. ;; https://httpd.apache.org/docs/2.4/en/configuring.html
  30. ;;
  31. ;; This mode supports Apache HTTP Server 2.4 and major modules.
  32. ;;; History:
  33. ;;
  34. ;; 1999-10 Jonathan Marten <jonathan.marten@uk.sun.com>
  35. ;; initial version
  36. ;;
  37. ;; 2004-09-12 Karl Chen <quarl@nospam.quarl.org>
  38. ;; rewrote pretty much everything using define-derived-mode; added support
  39. ;; for Apache 2.x; fixed highlighting in GNU Emacs; created indentation
  40. ;; function
  41. ;;
  42. ;; 2005-06-29 Kumar Appaiah <akumar_NOSPAM@ee.iitm.ac.in>
  43. ;; use syntax table instead of font-lock-keywords to highlight comments.
  44. ;;
  45. ;; 2015-08-23 David Maus <dmaus@ictsoc.de>
  46. ;; update list of directives for Apache 2.4
  47. ;;
  48. ;; 2018-07-23 USAMI Kenta <tadsan@pixiv.com>
  49. ;; more update list of directives for Apache 2.4
  50. ;;
  51. ;;; Code:
  52. ;; Requires
  53. (require 'regexp-opt)
  54. (defvar apache-indent-level 4
  55. "*Number of spaces to indent per level.")
  56. (defvar apache-mode-syntax-table
  57. (let ((table (make-syntax-table)))
  58. (modify-syntax-entry ?_ "_" table)
  59. (modify-syntax-entry ?- "_" table)
  60. (modify-syntax-entry ?\( "()" table)
  61. (modify-syntax-entry ?\) ")(" table)
  62. (modify-syntax-entry ?< "(>" table)
  63. (modify-syntax-entry ?> ")<" table)
  64. (modify-syntax-entry ?\" "\"" table)
  65. (modify-syntax-entry ?, "." table)
  66. (modify-syntax-entry ?# "<" table)
  67. (modify-syntax-entry ?\n ">#" table)
  68. table))
  69. ;;;###autoload
  70. (define-derived-mode apache-mode fundamental-mode "Apache"
  71. "Major mode for editing Apache configuration files."
  72. (set (make-local-variable 'comment-start) "# ")
  73. (set (make-local-variable 'comment-start-skip) "#\\W*")
  74. (set (make-local-variable 'comment-column) 48)
  75. (set (make-local-variable 'indent-line-function) 'apache-indent-line)
  76. (set (make-local-variable 'font-lock-defaults)
  77. '(apache-font-lock-keywords nil t
  78. ((?_ . "w")
  79. (?- . "w"))
  80. beginning-of-line)))
  81. ;; Font lock
  82. (defconst apache-font-lock-keywords
  83. (purecopy
  84. (list
  85. ;; see syntax table for comment highlighting
  86. ;; (list "^[ \t]*#.*" 0 'font-lock-comment-face t)
  87. (list (concat ; sections
  88. "^[ \t]*</?"
  89. (regexp-opt
  90. '("Directory" ; core
  91. "DirectoryMatch"
  92. "Else"
  93. "ElseIf"
  94. "Files"
  95. "FilesMatch"
  96. "If"
  97. "IfDefine"
  98. "IfModule"
  99. "Limit"
  100. "LimitExcept"
  101. "Location"
  102. "LocationMatch"
  103. "Proxy"
  104. "ProxyMatch"
  105. "VirtualHost"
  106. "AuthnProviderAlias" ; mod_authn_core
  107. "AuthzProviderAlias" ; mod_authz_core
  108. "RequireAll"
  109. "RequireAny"
  110. "RequireNone"
  111. "Macro" ; mod_macro
  112. "Perl" ; mod_perl
  113. "IfVersion" ; mod_version
  114. )
  115. 'words)
  116. ".*?>")
  117. 1 'font-lock-function-name-face)
  118. (list (concat ; directives
  119. "^[ \t]*"
  120. (regexp-opt
  121. '("AcceptFilter" ; core
  122. "AcceptMutex"
  123. "AcceptPathInfo"
  124. "AccessConfig"
  125. "AccessFileName"
  126. "AddDefaultCharset"
  127. "AddModule"
  128. "AllowEncodedSlashes"
  129. "AllowOverride"
  130. "AllowOverrideList"
  131. "AuthName"
  132. "AuthType"
  133. "BindAddress"
  134. "BS2000Account"
  135. "CGIMapExtension"
  136. "CGIPassAuth"
  137. "ClearModuleList"
  138. "ContentDigest"
  139. "CoreDumpDirectory"
  140. "DefaultRuntimeDir"
  141. "DefaultType"
  142. "Define"
  143. "DocumentRoot"
  144. "EBCDICConvert"
  145. "EBCDICConvertByType"
  146. "EBCDICKludge"
  147. "EnableMMAP"
  148. "EnableSendfile"
  149. "Error"
  150. "ErrorDocument"
  151. "ErrorLog"
  152. "ErrorLogFormat"
  153. "FileETag"
  154. "ForceType"
  155. "GprofDir"
  156. "Group"
  157. "HostnameLookups"
  158. "IdentityCheck"
  159. "Include"
  160. "IncludeOptional"
  161. "KeepAlive"
  162. "KeepAliveTimeout"
  163. "LimitInternalRecursion"
  164. "LimitRequestBody"
  165. "LimitRequestFields"
  166. "LimitRequestFieldsize"
  167. "LimitRequestLine"
  168. "LimitXMLRequestBody"
  169. "Listen"
  170. "ListenBacklog"
  171. "LockFile"
  172. "LogLevel"
  173. "MaxClients"
  174. "MaxKeepAliveRequests"
  175. "MaxRangeOverlaps"
  176. "MaxRangeReversals"
  177. "MaxRanges"
  178. "MaxRequestsPerChild"
  179. "MaxSpareServers"
  180. "MergeTrailers"
  181. "MinSpareServers"
  182. "Mutex"
  183. "NameVirtualHost"
  184. "Options"
  185. "PidFile"
  186. "Port"
  187. "Protocol"
  188. "Require"
  189. "ResourceConfig"
  190. "RLimitCPU"
  191. "RLimitMEM"
  192. "RLimitNPROC"
  193. "Satisfy"
  194. "ScoreBoardFile"
  195. "ScriptInterpreterSource"
  196. "SeeRequestTail"
  197. "SendBufferSize"
  198. "ServerAdmin"
  199. "ServerAlias"
  200. "ServerName"
  201. "ServerPath"
  202. "ServerRoot"
  203. "ServerSignature"
  204. "ServerTokens"
  205. "ServerType"
  206. "SetHandler"
  207. "SetInputFilter"
  208. "SetOutputFilter"
  209. "StartServers"
  210. "ThreadsPerChild"
  211. "ThreadStackSize"
  212. "TimeOut"
  213. "TraceEnable"
  214. "UnDefine"
  215. "UseCanonicalName"
  216. "UseCanonicalPhysicalPort"
  217. "User"
  218. "AuthLDAPAuthorizePrefix" ; mod_ authnz_ldap
  219. "AuthLDAPBindAuthoritative"
  220. "AuthLDAPCharsetConfig"
  221. "AuthLDAPCompareAsUser"
  222. "AuthLDAPInitialBindAsUser"
  223. "AuthLDAPInitialBindPattern"
  224. "AuthLDAPMaxSubGroupDepth"
  225. "AuthLDAPRemoteUserAttribute"
  226. "AuthLDAPSearchAsUser"
  227. "AuthLDAPSubGroupAttribute"
  228. "AuthLDAPSubGroupClass"
  229. "Allow" ; mod_access
  230. "Deny"
  231. "Order"
  232. "Action" ; mod_actions
  233. "Script"
  234. "Alias" ; mod_alias
  235. "AliasMatch"
  236. "Redirect"
  237. "RedirectMatch"
  238. "RedirectPermanent"
  239. "RedirectTemp"
  240. "ScriptAlias"
  241. "ScriptAliasMatch"
  242. "AllowMethods" ; mod_allowmethods
  243. "AuthAuthoritative" ; mod_auth
  244. "AuthUserFile"
  245. "AuthGroupFile"
  246. "Anonymous" ; mod_auth_anon
  247. "Anonymous_Authoritative"
  248. "Anonymous_LogEmail"
  249. "Anonymous_MustGiveEmail"
  250. "Anonymous_NoUserID"
  251. "Anonymous_VerifyEmail"
  252. "AuthBasicAuthoritative" ; mod_auth_basic
  253. "AuthBasicFake"
  254. "AuthBasicProvider"
  255. "AuthBasicUseDigestAlgorithm"
  256. "AuthDBAuthoritative" ; mod_auth_db
  257. "AuthDBGroupFile"
  258. "AuthDBUserFile"
  259. "AuthDBMAuthoritative" ; mod_auth_dbm
  260. "AuthDBMGroupFile"
  261. "AuthDBMType"
  262. "AuthDBMUserFile"
  263. "AuthDigestAlgorithm" ; mod_auth_digest
  264. "AuthDigestDomain"
  265. "AuthDigestFile"
  266. "AuthDigestGroupFile"
  267. "AuthDigestNcCheck"
  268. "AuthDigestNonceFormat"
  269. "AuthDigestNonceLifetime"
  270. "AuthDigestProvider"
  271. "AuthDigestQop"
  272. "AuthDigestShmemSize"
  273. "AuthFormAuthoritative" ; mod_auth_form
  274. "AuthFormBody"
  275. "AuthFormDisableNoStore"
  276. "AuthFormFakeBasicAuth"
  277. "AuthFormLocation"
  278. "AuthFormLoginRequiredLocation"
  279. "AuthFormLoginSuccessLocation"
  280. "AuthFormLogoutLocation"
  281. "AuthFormMethod"
  282. "AuthFormMimetype"
  283. "AuthFormPassword"
  284. "AuthFormProvider"
  285. "AuthFormSitePassphrase"
  286. "AuthFormSize"
  287. "AuthFormUsername"
  288. "AuthLDAPAuthoritative" ; mod_auth_ldap
  289. "AuthLDAPBindDN"
  290. "AuthLDAPBindPassword"
  291. "AuthLDAPCompareDNOnServer"
  292. "AuthLDAPDereferenceAliases"
  293. "AuthLDAPEnabled"
  294. "AuthLDAPFrontPageHack"
  295. "AuthLDAPGroupAttribute"
  296. "AuthLDAPGroupAttributeIsDN"
  297. "AuthLDAPRemoteUserIsDN"
  298. "AuthLDAPStartTLS"
  299. "AuthLDAPUrl"
  300. "AuthDBDUserPWQuery" ; mod_authn_dbd
  301. "AuthDBDUserRealmQuery"
  302. "AuthnCacheContext" ; mod_authn_socache
  303. "AuthnCacheEnable"
  304. "AuthnCacheProvideFor"
  305. "AuthnCacheSOCache"
  306. "AuthnCacheTimeout"
  307. "AuthnzFcgiCheckAuthnProvider" ; mod_authnz_fgci
  308. "AuthnzFcgiDefineProvider"
  309. "AuthMerging" ; mod_authz_core
  310. "AuthzSendForbiddenOnFailure"
  311. "AuthzDBDLoginToReferer" ; mod_authz_dbd
  312. "AuthzDBDQuery"
  313. "AuthzDBDRedirectQuery"
  314. "AuthzDBMType"
  315. "AddAlt" ; mod_autoindex
  316. "AddAltByEncoding"
  317. "AddAltByType"
  318. "AddDescription"
  319. "AddIcon"
  320. "AddIconByEncoding"
  321. "AddIconByType"
  322. "DefaultIcon"
  323. "FancyIndexing"
  324. "HeaderName"
  325. "IndexHeadInsert"
  326. "IndexIgnore"
  327. "IndexIgnoreReset"
  328. "IndexOptions"
  329. "IndexOrderDefault"
  330. "IndexStyleSheet"
  331. "ReadmeName"
  332. "BrowserMatch" ; mod_browser
  333. "BrowserMatchNoCase"
  334. "BufferSize" ; mod_buffer
  335. "CacheDefaultExpire" ; mod_cache
  336. "CacheDetailHeader"
  337. "CacheDisable"
  338. "CacheEnable"
  339. "CacheHeader"
  340. "CacheIgnoreCacheControl"
  341. "CacheIgnoreHeaders"
  342. "CacheIgnoreNoLastMod"
  343. "CacheIgnoreQueryString"
  344. "CacheIgnoreURLSessionIdentifiers"
  345. "CacheKeyBaseURL"
  346. "CacheLastModifiedFactor"
  347. "CacheLock"
  348. "CacheLockMaxAge"
  349. "CacheLockPath"
  350. "CacheMaxExpire"
  351. "CacheMaxFileSize"
  352. "CacheMinExpire"
  353. "CacheMinFileSize"
  354. "CacheOn"
  355. "CacheQuickHandler"
  356. "CacheStaleOnError"
  357. "CacheStoreExpired"
  358. "CacheStoreNoStore"
  359. "CacheStorePrivate"
  360. "CacheReadSize" ; mod_cache_disk
  361. "CacheReadTime"
  362. "CacheSocache" ; mod_cache_socache
  363. "CacheSocacheMaxSize"
  364. "CacheSocacheMaxTime"
  365. "CacheSocacheMinTime"
  366. "CacheSocacheReadSize"
  367. "CacheSocacheReadTime"
  368. "MetaDir" ; mod_cern_meta
  369. "MetaFiles"
  370. "MetaSuffix"
  371. "ScriptLog" ; mod_cgi
  372. "ScriptLogBuffer"
  373. "ScriptLogLength"
  374. "CGIDScriptTimeout" ; mod_cgid
  375. "ScriptLog"
  376. "ScriptLogBuffer"
  377. "ScriptLogLength"
  378. "ScriptSock"
  379. "CharsetDefault" ; mod_charset_lite
  380. "CharsetOptions"
  381. "CharsetSourceEnc"
  382. "CookieLog" ; mod_cookies
  383. "Dav" ; mod_dav
  384. "DavDepthInfinity"
  385. "DavLockDB"
  386. "DavMinTimeout"
  387. "DavGenericLockDB" ; mod_dav_lock
  388. "DBDExptime" ; mod_dbd
  389. "DBDInitSQL"
  390. "DBDKeep"
  391. "DBDMax"
  392. "DBDMin"
  393. "DBDParams"
  394. "DBDPersist"
  395. "DBDPrepareSQL"
  396. "DBDriver"
  397. "DeflateBufferSize" ; mod_deflate
  398. "DeflateCompressionLevel"
  399. "DeflateFilterNote"
  400. "DeflateInflateLimitRequestBody"
  401. "DeflateInflateRatioBurst"
  402. "DeflateInflateRatioLimit"
  403. "DeflateMemLevel"
  404. "DeflateWindowSize"
  405. "ModemStandard" ; mod_dialup
  406. "AuthDigestFile" ; mod_digest
  407. "DirectoryCheckHandler" ; mod_dir
  408. "DirectoryIndex"
  409. "DirectoryIndexRedirect"
  410. "DirectorySlash"
  411. "FallbackResource"
  412. "LoadFile" ; mod_dld
  413. "LoadModule"
  414. "DumpIOInput" ; mod_dumpio
  415. "DumpIOOutput"
  416. "ProtocolEcho" ; mod_echo
  417. "PassEnv" ; mod_env
  418. "SetEnv"
  419. "UnsetEnv"
  420. "AsyncRequestWorkerFactor" ; mod_event
  421. "Example" ; mod_example
  422. "ExpiresActive" ; mod_expires
  423. "ExpiresByType"
  424. "ExpiresDefault"
  425. "ExtFilterDefine" ; mod_ext_filter
  426. "ExtFilterOptions"
  427. "CacheFile" ; mod_file_cache
  428. "MMapFile"
  429. "AddOutputFilterByType" ; mod_filter
  430. "FilterChain"
  431. "FilterDeclare"
  432. "FilterProtocol"
  433. "FilterProvider"
  434. "FilterTrace"
  435. "Header" ; mod_headers
  436. "RequestHeader"
  437. "HeartbeatAddress" ; mod_heartbeat
  438. "HeartbeatListen"
  439. "HeartbeatMaxServers"
  440. "HeartbeatStorage"
  441. "IdentityCheckTimeout" ; mod_ident
  442. "ImapBase" ; mod_imap
  443. "ImapDefault"
  444. "ImapMenu"
  445. "SSIEndTag" ; mod_include
  446. "SSIErrorMsg"
  447. "SSIETag"
  448. "SSILastModified"
  449. "SSILegacyExprParser"
  450. "SSIStartTag"
  451. "SSITimeFormat"
  452. "SSIUndefinedEcho"
  453. "XBitHack"
  454. "AddModuleInfo" ; mod_info
  455. "ISAPICacheFile" ; mod_isapi
  456. "ISAPIFakeAsync"
  457. "ISAPIFileCache"
  458. "ISAPIAppendLogToErrors" ; mod_isapi (Win32)
  459. "ISAPIAppendLogToQuery"
  460. "ISAPILogNotSupported"
  461. "ISAPIReadAheadBuffer"
  462. "LDAPCacheEntries" ; mod_ldap
  463. "LDAPCacheTTL"
  464. "LDAPCertDBPath"
  465. "LDAPConnectionPoolTTL"
  466. "LDAPConnectionTimeout"
  467. "LDAPLibraryDebug"
  468. "LDAPOpCacheEntries"
  469. "LDAPOpCacheTTL"
  470. "LDAPReferralHopLimit"
  471. "LDAPReferrals"
  472. "LDAPRetries"
  473. "LDAPRetryDelay"
  474. "LDAPSharedCacheFile"
  475. "LDAPSharedCacheSize"
  476. "LDAPTimeout"
  477. "LDAPTrustedClientCert"
  478. "LDAPTrustedGlobalCert"
  479. "LDAPTrustedMode"
  480. "LDAPVerifyServerCert"
  481. "AgentLog" ; mod_log_agent
  482. "TransferLog" ; mod_log_common
  483. "BufferedLogs" ; mod_log_config
  484. "CookieLog"
  485. "CustomLog"
  486. "LogFormat"
  487. "TransferLog"
  488. "LogMessage" ; mod_log_debug
  489. "ForensicLog" ; mod_log_forensic
  490. "RefererIgnore" ; mod_log_referer
  491. "RefererLog"
  492. "LogIOTrackTTFB" ; mod_logio
  493. "LuaAuthzProvider" ; mod_lua
  494. "LuaCodeCache"
  495. "LuaHookAccessChecker"
  496. "LuaHookAuthChecker"
  497. "LuaHookCheckUserID"
  498. "LuaHookFixups"
  499. "LuaHookInsertFilter"
  500. "LuaHookLog"
  501. "LuaHookMapToStorage"
  502. "LuaHookTranslateName"
  503. "LuaHookTypeChecker"
  504. "LuaInherit"
  505. "LuaInputFilter"
  506. "LuaMapHandler"
  507. "LuaOutputFilter"
  508. "LuaPackageCPath"
  509. "LuaPackagePath"
  510. "LuaQuickHandler"
  511. "LuaRoot"
  512. "LuaScope"
  513. "UndefMacro" ; mod_macro
  514. "Use"
  515. "AddCharset" ; mod_mime
  516. "AddEncoding"
  517. "AddHandler"
  518. "AddInputFilter"
  519. "AddLanguage"
  520. "AddOutputFilter"
  521. "AddType"
  522. "DefaultLanguage"
  523. "ForceType"
  524. "ModMimeUsePathInfo"
  525. "MultiviewsMatch"
  526. "RemoveCharset"
  527. "RemoveEncoding"
  528. "RemoveHandler"
  529. "RemoveInputFilter"
  530. "RemoveLanguage"
  531. "RemoveOutputFilter"
  532. "RemoveType"
  533. "SetHandler"
  534. "TypesConfig"
  535. "MimeMagicFile" ; mod_mime_magic
  536. "MMapFile" ; mod_mmap_static
  537. "CacheNegotiatedDocs" ; mod_negotiation
  538. "ForceLanguagePriority"
  539. "LanguagePriority"
  540. "NWSSLTrustedCerts" ; mod_nw_ssl
  541. "NWSSLUpgradeable"
  542. "SecureListen"
  543. "PerlDispatchHandler" ; mod_perl 1
  544. "PerlFreshRestart"
  545. "PerlHandler"
  546. "PerlOpmask"
  547. "PerlRestartHandler"
  548. "PerlScript"
  549. "PerlSendHeader"
  550. "PerlSetupEnv"
  551. "PerlTaintCheck"
  552. "PerlTransHandler"
  553. "PerlWarn"
  554. "PerlAccessHandler" ; mod_perl 1+2
  555. "PerlAddVar"
  556. "PerlAuthenHandler"
  557. "PerlAuthzHandler"
  558. "PerlChildExitHandler"
  559. "PerlChildInitHandler"
  560. "PerlCleanupHandler"
  561. "PerlFixupHandler"
  562. "PerlHeaderParserHandler"
  563. "PerlInitHandler"
  564. "PerlLogHandler"
  565. "PerlModule"
  566. "PerlPassEnv"
  567. "PerlPostReadRequestHandler"
  568. "PerlRequire"
  569. "PerlSetEnv"
  570. "PerlSetVar"
  571. "PerlTypeHandler"
  572. "PerlInputFilterHandler" ; mod_perl 2
  573. "PerlInterpMax"
  574. "PerlInterpMaxRequests"
  575. "PerlInterpMaxSpare"
  576. "PerlInterpMinSpare"
  577. "PerlInterpScope"
  578. "PerlInterpStart"
  579. "PerlLoadModule"
  580. "PerlOpenLogsHandler"
  581. "PerlOptions"
  582. "PerlOutputFilterHandler"
  583. "PerlPostConfigHandler"
  584. "PerlPreConnectionHandler"
  585. "PerlProcessConnectionHandler"
  586. "PerlResponseHandler"
  587. "PerlSetInputFilter"
  588. "PerlSetOutputFilter"
  589. "PerlSwitches"
  590. "PerlTrace"
  591. "DTracePrivileges" ; mod_privileges
  592. "PrivilegesMode"
  593. "VHostCGIMode"
  594. "VHostCGIPrivs"
  595. "VHostGroup"
  596. "VHostPrivs"
  597. "VHostSecure"
  598. "VHostUser"
  599. "AllowCONNECT" ; mod_proxy
  600. "BalancerGrowth"
  601. "BalancerInherit"
  602. "BalancerMember"
  603. "BalancerPersist"
  604. "CacheDefaultExpire"
  605. "CacheDirLength"
  606. "CacheDirLevels"
  607. "CacheForceCompletion"
  608. "CacheGcInterval"
  609. "CacheLastModifiedFactor"
  610. "CacheMaxExpire"
  611. "CacheRoot"
  612. "CacheSize"
  613. "NoCache"
  614. "NoProxy"
  615. "ProxyAddHeaders"
  616. "ProxyBadHeader"
  617. "ProxyBlock"
  618. "ProxyDomain"
  619. "ProxyErrorOverride"
  620. "ProxyHTMLURLMap"
  621. "ProxyIOBufferSize"
  622. "ProxyMaxForwards"
  623. "ProxyPass"
  624. "ProxyPassInherit"
  625. "ProxyPassInterpolateEnv"
  626. "ProxyPassMatch"
  627. "ProxyPassReverse"
  628. "ProxyPassReverseCookieDomain"
  629. "ProxyPassReverseCookiePath"
  630. "ProxyPreserveHost"
  631. "ProxyReceiveBufferSize"
  632. "ProxyRemote"
  633. "ProxyRemoteMatch"
  634. "ProxyRequests"
  635. "ProxySet"
  636. "ProxySourceAddress"
  637. "ProxyStatus"
  638. "ProxyTimeout"
  639. "ProxyVia"
  640. "ProxyExpressDBMFile" ; mod_proxy_express
  641. "ProxyExpressDBMType"
  642. "ProxyExpressEnable"
  643. "ProxyFtpDirCharset" ; mod_proxy_ftp
  644. "ProxyFtpEscapeWildcards"
  645. "ProxyFtpListOnWildcard"
  646. "ProxyHTMLBufSize" ; mod_proxy_html
  647. "ProxyHTMLCharsetOut"
  648. "ProxyHTMLDocType"
  649. "ProxyHTMLEnable"
  650. "ProxyHTMLEvents"
  651. "ProxyHTMLExtended"
  652. "ProxyHTMLFixups"
  653. "ProxyHTMLInterp"
  654. "ProxyHTMLLinks"
  655. "ProxyHTMLMeta"
  656. "ProxyHTMLStripComments"
  657. "ProxySCGIInternalRedirect" ; mod_proxy_scgi
  658. "ProxySCGISendfile"
  659. "PythonAccessHandler" ; mod_python
  660. "PythonAuthenHandler"
  661. "PythonAuthzHandler"
  662. "PythonAutoReload"
  663. "PythonCleanupHandler"
  664. "PythonConnectionHandler"
  665. "PythonDebug"
  666. "PythonEnablePdb"
  667. "PythonFixupHandler"
  668. "PythonHandler"
  669. "PythonHandlerModule"
  670. "PythonHeaderParserHandler"
  671. "PythonImport"
  672. "PythonInitHandler"
  673. "PythonInputFilter"
  674. "PythonInterpPerDirective"
  675. "PythonInterpPerDirectory"
  676. "PythonInterpreter"
  677. "PythonLogHandler"
  678. "PythonOptimize"
  679. "PythonOption"
  680. "PythonOutputFilter"
  681. "PythonPath"
  682. "PythonPostReadRequestHandler"
  683. "PythonTransHandler"
  684. "PythonTypeHandler"
  685. "ReflectorHeader" ; mod_reflector
  686. "RemoteIPHeader" ; mod_remoteip
  687. "RemoteIPInternalProxy"
  688. "RemoteIPInternalProxyList"
  689. "RemoteIPProxiesHeader"
  690. "RemoteIPTrustedProxy"
  691. "RemoteIPTrustedProxyList"
  692. "RequestReadTimeout" ; mod_reqtimeout
  693. "KeptBodySize" ; mod_request
  694. "RewriteBase" ; mod_rewrite
  695. "RewriteCond"
  696. "RewriteEngine"
  697. "RewriteLock"
  698. "RewriteLog"
  699. "RewriteLogLevel"
  700. "RewriteMap"
  701. "RewriteOptions"
  702. "RewriteRule"
  703. "InputSed" ; mod_sed
  704. "OutputSed"
  705. "Session" ; mod_session
  706. "SessionEnv"
  707. "SessionExclude"
  708. "SessionHeader"
  709. "SessionInclude"
  710. "SessionMaxAge"
  711. "SessionCookieName" ; mod_session_cookie
  712. "SessionCookieName2"
  713. "SessionCookieRemove"
  714. "SessionCryptoCipher" ; mod_session_crypto
  715. "SessionCryptoDriver"
  716. "SessionCryptoPassphrase"
  717. "SessionCryptoPassphraseFile"
  718. "SessionDBDCookieName" ; mod_session_dbd
  719. "SessionDBDCookieName2"
  720. "SessionDBDCookieRemove"
  721. "SessionDBDDeleteLabel"
  722. "SessionDBDInsertLabel"
  723. "SessionDBDPerUser"
  724. "SessionDBDSelectLabel"
  725. "SessionDBDUpdateLabel"
  726. "BrowserMatch" ; mod_setenvif
  727. "BrowserMatchNoCase"
  728. "SetEnvIf"
  729. "SetEnvIfExpr"
  730. "SetEnvIfNoCase"
  731. "LoadFile" ; mod_so
  732. "LoadModule"
  733. "CheckCaseOnly" ; mod_speling
  734. "CheckSpelling"
  735. "SSLBanCipher" ; mod_ssl
  736. "SSLCACertificateFile"
  737. "SSLCACertificatePath"
  738. "SSLCacheServerPath"
  739. "SSLCacheServerPort"
  740. "SSLCacheServerRunDir"
  741. "SSLCADNRequestFile"
  742. "SSLCADNRequestPath"
  743. "SSLCARevocationCheck"
  744. "SSLCARevocationFile"
  745. "SSLCARevocationPath"
  746. "SSLCertificateChainFile"
  747. "SSLCertificateFile"
  748. "SSLCertificateKeyFile"
  749. "SSLCheckClientDN"
  750. "SSLCipherSuite"
  751. "SSLCompression"
  752. "SSLCryptoDevice"
  753. "SSLDenySSL"
  754. "SSLDisable"
  755. "SSLEnable"
  756. "SSLEngine"
  757. "SSLEngineID"
  758. "SSLExportClientCertificates"
  759. "SSLFakeBasicAuth"
  760. "SSLFIPS"
  761. "SSLHonorCipherOrder"
  762. "SSLInsecureRenegotiation"
  763. "SSLKeyNoteTrustedAssertion"
  764. "SSLKeyNoteTrustedIssuerTemplate"
  765. "SSLLog"
  766. "SSLLogLevel"
  767. "SSLMutex"
  768. "SSLNoCAList"
  769. "SSLOCSPDefaultResponder"
  770. "SSLOCSPEnable"
  771. "SSLOCSPOverrideResponder"
  772. "SSLOCSPResponderTimeout"
  773. "SSLOCSPResponseMaxAge"
  774. "SSLOCSPResponseTimeSkew"
  775. "SSLOCSPUseRequestNonce"
  776. "SSLOpenSSLConfCmd"
  777. "SSLOptions"
  778. "SSLPassPhraseDialog"
  779. "SSLProtocol"
  780. "SSLProxyCACertificateFile"
  781. "SSLProxyCACertificatePath"
  782. "SSLProxyCARevocationCheck"
  783. "SSLProxyCARevocationFile"
  784. "SSLProxyCARevocationPath"
  785. "SSLProxyCheckPeerCN"
  786. "SSLProxyCheckPeerExpire"
  787. "SSLProxyCheckPeerName"
  788. "SSLProxyCipherSuite"
  789. "SSLProxyEngine"
  790. "SSLProxyMachineCertificateChainFile"
  791. "SSLProxyMachineCertificateFile"
  792. "SSLProxyMachineCertificatePath"
  793. "SSLProxyProtocol"
  794. "SSLProxyVerify"
  795. "SSLProxyVerifyDepth"
  796. "SSLRandomFile"
  797. "SSLRandomFilePerConnection"
  798. "SSLRandomSeed"
  799. "SSLRenegBufferSize"
  800. "SSLRequire"
  801. "SSLRequireCipher"
  802. "SSLRequiredCiphers"
  803. "SSLRequireSSL"
  804. "SSLSessionCache"
  805. "SSLSessionCacheTimeout"
  806. "SSLSessionTicketKeyFile"
  807. "SSLSessionTickets"
  808. "SSLSRPUnknownUserSeed"
  809. "SSLSRPVerifierFile"
  810. "SSLStaplingCache"
  811. "SSLStaplingErrorCacheTimeout"
  812. "SSLStaplingFakeTryLater"
  813. "SSLStaplingForceURL"
  814. "SSLStaplingResponderTimeout"
  815. "SSLStaplingResponseMaxAge"
  816. "SSLStaplingResponseTimeSkew"
  817. "SSLStaplingReturnResponderErrors"
  818. "SSLStaplingStandardCacheTimeout"
  819. "SSLStrictSNIVHostCheck"
  820. "SSLUserName"
  821. "SSLUseStapling"
  822. "SSLVerifyClient"
  823. "SSLVerifyDepth"
  824. "ExtendedStatus" ; mod_status
  825. "Substitute" ; mod_substitute
  826. "SubstituteMaxLineLength"
  827. "SuexecUserGroup" ; mod_suexec
  828. "ChrootDir" ; mod_unixd
  829. "Suexec"
  830. "UserDir" ; mod_userdir
  831. "CookieDomain" ; mod_usertrack
  832. "CookieExpires"
  833. "CookieName"
  834. "CookieStyle"
  835. "CookieTracking"
  836. "VirtualDocumentRoot" ; mod_vhost_alias
  837. "VirtualDocumentRootIP"
  838. "VirtualScriptAlias"
  839. "VirtualScriptAliasIP"
  840. "WatchdogInterval" ; mod_watchdog
  841. "xml2EncAlias" ; mod_xml2enc
  842. "xml2EncDefault"
  843. "xml2StartParse"
  844. "CoreDumpDirectory" ; mpm_common
  845. "EnableExceptionHook"
  846. "GracefulShutdownTimeout"
  847. "Group"
  848. "Listen"
  849. "ListenBackLog"
  850. "LockFile"
  851. "MaxClients"
  852. "MaxConnectionsPerChild"
  853. "MaxMemFree"
  854. "MaxRequestsPerChild"
  855. "MaxRequestWorkers"
  856. "MaxSpareThreads"
  857. "MaxThreadsPerChild"
  858. "MinSpareThreads"
  859. "NumServers"
  860. "PidFile"
  861. "ReceiveBufferSize"
  862. "ScoreBoardFile"
  863. "SendBufferSize"
  864. "ServerLimit"
  865. "StartServers"
  866. "StartThreads"
  867. "ThreadLimit"
  868. "ThreadsPerChild"
  869. "User"
  870. "MaxClientsVHost" ; mpm_itk
  871. "Listen" ; mpm_netware
  872. "ListenBacklog"
  873. "MaxRequestsPerChild"
  874. "MaxSpareThreads"
  875. "MaxThreads"
  876. "MinSpareThreads"
  877. "SendBufferSize"
  878. "StartThreads"
  879. "ThreadStackSize"
  880. "AssignUserId" ; mpm_perchild
  881. "ChildPerUserId"
  882. "CoreDumpDirectory"
  883. "Group"
  884. "Listen"
  885. "ListenBacklog"
  886. "LockFile"
  887. "MaxRequestsPerChild"
  888. "MaxSpareThreads"
  889. "MaxThreadsPerChild"
  890. "MinSpareThreads"
  891. "NumServers"
  892. "PidFile"
  893. "ScoreBoardFile"
  894. "SendBufferSize"
  895. "StartThreads"
  896. "User"
  897. "ServerEnvironment" ; mpm_peruser
  898. "AcceptMutex" ; mpm_prefork
  899. "CoreDumpDirectory"
  900. "Listen"
  901. "ListenBacklog"
  902. "LockFile"
  903. "MaxRequestsPerChild"
  904. "PidFile"
  905. "ScoreBoardFile"
  906. "SendBufferSize"
  907. "ServerLimit"
  908. "StartServers"
  909. "User"
  910. "CoreDumpDirectory" ; mpm_winnt
  911. "Listen"
  912. "ListenBacklog"
  913. "MaxRequestsPerChild"
  914. "PidFile"
  915. "SendBufferSize"
  916. "ThreadsPerChild"
  917. "CoreDumpDirectory" ; mpm_worker
  918. "Group"
  919. "Listen"
  920. "ListenBacklog"
  921. "LockFile"
  922. "MaxClients"
  923. "MaxRequestsPerChild"
  924. "MaxSpareThreads"
  925. "MinSpareThreads"
  926. "PidFile"
  927. "ScoreBoardFile"
  928. "SendBufferSize"
  929. "ServerLimit"
  930. "StartServers"
  931. "ThreadLimit"
  932. "ThreadsPerChild"
  933. "User"
  934. "DefaultMode" ; (obsolete)
  935. "DocTitle"
  936. "DocTrailer"
  937. "HeadPrefix"
  938. "HeadSuffix"
  939. "HideSys"
  940. "HideURL"
  941. "HTMLDir"
  942. "HTTPLogFile"
  943. "LastURLs"
  944. "PrivateDir"
  945. "TopSites"
  946. "TopURLs"
  947. )
  948. 'words))
  949. 1 'font-lock-keyword-face)
  950. (list ; values
  951. (regexp-opt
  952. '(
  953. "add" ; (general)
  954. "All"
  955. "allow"
  956. "any"
  957. "append"
  958. "AuthConfig"
  959. "Basic"
  960. "CONNECT"
  961. "default"
  962. "DELETE"
  963. "deny"
  964. "Digest"
  965. "double"
  966. "downgrade-1.0"
  967. "email"
  968. "env"
  969. "error"
  970. "ExecCGI"
  971. "FancyIndexing"
  972. "fcntl"
  973. "FileInfo"
  974. "flock"
  975. "FollowSymLinks"
  976. "force-response-1.0"
  977. "formatted"
  978. "from"
  979. "full"
  980. "GET"
  981. "gone"
  982. "group"
  983. "IconsAreLinks"
  984. "Includes"
  985. "IncludesNOEXEC"
  986. "Indexes"
  987. "inetd"
  988. "inherit"
  989. "INode"
  990. "Limit"
  991. "map"
  992. "Minimal"
  993. "MTime"
  994. "MultiViews"
  995. "mutual-failure"
  996. "nocontent"
  997. "nokeepalive"
  998. "none"
  999. "off"
  1000. "on"
  1001. "Options"
  1002. "OS"
  1003. "os2sem"
  1004. "permanent"
  1005. "POST"
  1006. "pthread"
  1007. "PUT"
  1008. "referer"
  1009. "ScanHTMLTitles"
  1010. "seeother"
  1011. "semi-formatted"
  1012. "set"
  1013. "standalone"
  1014. "SuppressDescription"
  1015. "SuppressLastModified"
  1016. "SuppressSize"
  1017. "SymLinksIfOwnerMatch"
  1018. "sysvsem"
  1019. "temporary"
  1020. "tpfcore"
  1021. "unformatted"
  1022. "unset"
  1023. "URL"
  1024. "user"
  1025. "uslock"
  1026. "valid-user"
  1027. "3DES" ; cipher stuff
  1028. "ADH"
  1029. "ADH-DES-CBC-SHA"
  1030. "ADH-DES-CBC3-SHA"
  1031. "ADH-RC4-MD"
  1032. "ADH-RC4-MD5"
  1033. "aDSS"
  1034. "aNULL"
  1035. "aRSA"
  1036. "DES"
  1037. "DES-CBC-MD5"
  1038. "DES-CBC-SHA"
  1039. "DES-CBC3-MD5"
  1040. "DES-CBC3-SHA"
  1041. "DES-CFB-M1"
  1042. "DH"
  1043. "DH-DSS-DES-CBC-SHA"
  1044. "DH-DSS-DES-CBC3-SHA"
  1045. "DH-RSA-DES-CBC-SHA"
  1046. "DH-RSA-DES-CBC3-SHA"
  1047. "DSS"
  1048. "EDH"
  1049. "EDH-DSS-DES-CBC-SHA"
  1050. "EDH-DSS-DES-CBC3-SHA"
  1051. "EDH-RSA-DES-CBC-SHA"
  1052. "EDH-RSA-DES-CBC3-SHA"
  1053. "egd"
  1054. "eNULL"
  1055. "EXP"
  1056. "EXP-ADH-DES-CBC-SHA"
  1057. "EXP-ADH-RC4-MD5"
  1058. "EXP-DES-CBC-SHA"
  1059. "EXP-DH-DSS-DES-CBC-SHA"
  1060. "EXP-DH-RSA-DES-CBC-SHA"
  1061. "EXP-EDH-DSS-DES-CBC-SHA"
  1062. "EXP-EDH-RSA-DES-CBC"
  1063. "EXP-EDH-RSA-DES-CBC-SHA"
  1064. "EXP-RC2-CBC-MD5"
  1065. "EXP-RC4-MD5"
  1066. "EXPORT40"
  1067. "EXPORT56"
  1068. "file"
  1069. "FZA-FZA-CBC-SHA"
  1070. "FZA-NULL-SHA"
  1071. "FZA-RC4-SHA"
  1072. "HIGH"
  1073. "IDEA"
  1074. "IDEA-CBC-MD5"
  1075. "IDEA-CBC-SHA"
  1076. "kDHd"
  1077. "kDHr"
  1078. "kEDH"
  1079. "kRSA"
  1080. "LOW"
  1081. "MD5"
  1082. "MEDIUM"
  1083. "NULL"
  1084. "NULL-MD5"
  1085. "NULL-SHA"
  1086. "RC2"
  1087. "RC2-CBC-MD5"
  1088. "RC4"
  1089. "RC4-64-MD5"
  1090. "RC4-MD5"
  1091. "RC4-SHA"
  1092. "RSA"
  1093. "SHA"
  1094. "SHA1"
  1095. "send-as-is" ; mod_asis
  1096. "cgi-script" ; mod_cgi
  1097. "imap-file" ; mod_imap
  1098. "server-info" ; mod_info
  1099. "isapi-isa" ; mod_isapi
  1100. "ldap-status" ; mod_ldap
  1101. "Off" ; mod_perl
  1102. "On"
  1103. "perl-script"
  1104. "Off" ; mod_python
  1105. "On"
  1106. "python-program"
  1107. "All" ; mod_ssl
  1108. "builtin"
  1109. "CompatEnvVars"
  1110. "connect"
  1111. "dbm"
  1112. "debug"
  1113. "egd"
  1114. "error"
  1115. "exec"
  1116. "ExportCertData"
  1117. "FakeBasicAuth"
  1118. "file"
  1119. "info"
  1120. "none"
  1121. "off"
  1122. "on"
  1123. "optional"
  1124. "optional_no_ca"
  1125. "OptRenegotiate"
  1126. "require"
  1127. "sem"
  1128. "shm"
  1129. "shmcb"
  1130. "shmht"
  1131. "ssl-accurate-shutdown"
  1132. "ssl-unclean-shutdown"
  1133. "SSLv2"
  1134. "SSLv3"
  1135. "startup"
  1136. "StdEnvVars"
  1137. "StrictRequire"
  1138. "TLSv1"
  1139. "trace"
  1140. "warn"
  1141. "server-status" ; mod_status
  1142. )
  1143. 'words)
  1144. 1 'font-lock-type-face)))
  1145. "Expressions to highlight in Apache config buffers.")
  1146. (defun apache-indent-line ()
  1147. "Indent current line of Apache code."
  1148. (interactive)
  1149. (let ((savep (> (current-column) (current-indentation)))
  1150. (indent (max (apache-calculate-indentation) 0)))
  1151. (if savep
  1152. (save-excursion (indent-line-to indent))
  1153. (indent-line-to indent))))
  1154. (defun apache-previous-indentation ()
  1155. "Return the previous (non-empty/comment) indentation. Doesn't save position."
  1156. (let (indent)
  1157. (while (and (null indent)
  1158. (zerop (forward-line -1)))
  1159. (unless (looking-at "[ \t]*\\(#\\|$\\)")
  1160. (setq indent (current-indentation))))
  1161. (or indent 0)))
  1162. (defun apache-calculate-indentation ()
  1163. "Return the amount the current line should be indented."
  1164. (save-excursion
  1165. (forward-line 0)
  1166. (if (bobp)
  1167. 0
  1168. (let ((ends-section-p (looking-at "[ \t]*</"))
  1169. (indent (apache-previous-indentation)) ; moves point!
  1170. (previous-starts-section-p (looking-at "[ \t]*<[^/]")))
  1171. (if ends-section-p
  1172. (setq indent (- indent apache-indent-level)))
  1173. (if previous-starts-section-p
  1174. (setq indent (+ indent apache-indent-level)))
  1175. indent))))
  1176. ;;;###autoload
  1177. (progn
  1178. (add-to-list 'auto-mode-alist '("/\\.htaccess\\'" . apache-mode))
  1179. (add-to-list 'auto-mode-alist '("/\\(?:access\\|httpd\\|srm\\)\\.conf\\'" . apache-mode))
  1180. (add-to-list 'auto-mode-alist '("/apache2/.+\\.conf\\'" . apache-mode))
  1181. (add-to-list 'auto-mode-alist '("/httpd/conf/.+\\.conf\\'" . apache-mode))
  1182. (add-to-list 'auto-mode-alist '("/apache2/sites-\\(?:available\\|enabled\\)/" . apache-mode)))
  1183. (provide 'apache-mode)
  1184. ;;; apache-mode.el ends here