亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Verzeichnis suchen
首頁 版本說明 從1.3升級(jí)到2.0 編譯時(shí)配置的改變 運(yùn)行時(shí)配置的改變 雜項(xiàng)變化 第三方模塊 從 2.0 升級(jí)到 2.2 編譯時(shí)配置的改變 運(yùn)行時(shí)配置的改變 雜項(xiàng)變化 第三方模塊 Apache 2.1/2.2 版本的新特性 核心增強(qiáng) 模塊增強(qiáng) 程序增強(qiáng) 針對(duì)模塊開發(fā)者的變化 Apache 2.0 版本的新特性 核心的增強(qiáng) 模塊的增強(qiáng) Apache許可證 參考手冊(cè) 編譯與安裝 針對(duì)心急者的概述 要求 下載 解壓 配置源代碼樹 編譯 安裝 配置 測(cè)試 升級(jí) 啟動(dòng) Apache是怎樣啟動(dòng)的 啟動(dòng)時(shí)發(fā)生錯(cuò)誤 隨系統(tǒng)啟動(dòng)時(shí)啟動(dòng) 額外信息 停止與重新啟動(dòng) 簡介 立即停止 優(yōu)雅重啟 立即重啟 優(yōu)雅停止 附錄:信號(hào)和競爭條件 運(yùn)行時(shí)配置指令 主配置文件 配置文件的語法 模塊 指令的作用域 .htaccess文件 配置段 配置段(容器)的類型 文件系統(tǒng)和網(wǎng)絡(luò)空間 虛擬主機(jī) 代理 允許使用哪些指令? 配置段的合并 內(nèi)容緩沖 簡介 緩沖概述 安全方面的考慮 文件句柄緩沖 內(nèi)存緩沖 磁盤緩沖 服務(wù)器全局配置 服務(wù)器標(biāo)識(shí) 文件定位 限制資源的使用 日志文件 安全警告 錯(cuò)誤日志 訪問日志 日志滾動(dòng) 管道日志 虛擬主機(jī) 其他日志文件 從URL到文件系統(tǒng)的映射 相關(guān)模塊和指令 DocumentRoot DocumentRoot以外的文件 用戶目錄 URL重定向 反向代理 重寫引擎 File Not Found 安全方面的提示 保持不斷更新和升級(jí) ServerRoot目錄的權(quán)限 服務(wù)器端包含 關(guān)于CGI 未指定為腳本的CGI 指定為腳本的CGI 其他動(dòng)態(tài)內(nèi)容的來源 系統(tǒng)設(shè)置的保護(hù) 默認(rèn)配置下服務(wù)器文件的保護(hù) 觀察日志文件 動(dòng)態(tài)共享對(duì)象(DSO) 實(shí)現(xiàn) 用法概要 背景知識(shí) 優(yōu)點(diǎn)和缺點(diǎn) 內(nèi)容協(xié)商 關(guān)于內(nèi)容協(xié)商 Apache中的內(nèi)容協(xié)商 協(xié)商的方法 打亂品質(zhì)值 透明內(nèi)容協(xié)商的擴(kuò)展 超鏈和名稱轉(zhuǎn)換說明 緩沖說明 更多信息 自定義錯(cuò)誤響應(yīng) 行為 配置 自定義錯(cuò)誤響應(yīng)與重定向 地址和端口綁定 概述 針對(duì)IPv6的特殊考慮 怎樣與虛擬主機(jī)協(xié)同工作 多路處理模塊(MPM) 簡介 選擇一個(gè)MPM 默認(rèn)的MPM 環(huán)境變量 設(shè)置環(huán)境變量 使用環(huán)境變量 用于特殊目的的環(huán)境變量 示例 處理器的使用 什么是處理器? 例子 程序員注意事項(xiàng) 過濾器 Apache2中的過濾器 智能過慮 使用過濾器 CGI腳本的Suexec執(zhí)行 開始之前 suEXEC的安全模型 配置和安裝suEXEC 啟用和禁用suEXEC 使用suEXEC 調(diào)試suEXEC 謹(jǐn)防Jabberwock:警告和舉例 性能調(diào)整 硬件和操作系統(tǒng) 運(yùn)行時(shí)的配置 編譯時(shí)的配置 附錄:蹤跡的詳細(xì)分析 URL重寫指南 mod_rewrite簡介 實(shí)踐方案 URL的規(guī)劃 內(nèi)容的處理 對(duì)訪問的限制 其他 虛擬主機(jī)文檔 總述 虛擬主機(jī)支持 配置指令 基于主機(jī)名的虛擬主機(jī) 基于域名的虛擬主機(jī)和基于IP的虛擬主機(jī)比較 使用基于域名的虛擬主機(jī) 與舊版瀏覽器的兼容性 基于IP地址的虛擬主機(jī) 系統(tǒng)需求 如何配置Apache 設(shè)置多個(gè)守護(hù)進(jìn)程 配置擁有多個(gè)虛擬主機(jī)的單一守護(hù)進(jìn)程 動(dòng)態(tài)配置大量虛擬主機(jī) 動(dòng)機(jī) 概述 簡單的動(dòng)態(tài)虛擬主機(jī) 一個(gè)實(shí)際的個(gè)人主頁系統(tǒng) 在同一個(gè)服務(wù)器上架設(shè)多個(gè)主機(jī)的虛擬系統(tǒng) 更為有效的基于IP地址的虛擬主機(jī) 使用老版本的Apache 使用mod_rewrite實(shí)現(xiàn)簡單的動(dòng)態(tài)虛擬主機(jī) 使用mod_rewrite的個(gè)人主頁系統(tǒng) 使用獨(dú)立的虛擬主機(jī)配置文件 虛擬主機(jī)的普通配置示例 在一個(gè)IP地址上運(yùn)行多個(gè)基于域名的web站點(diǎn) 在多于一個(gè)IP的情況下使用基于域名的虛擬主機(jī) 在不同的IP的地址(比如一個(gè)內(nèi)部和一個(gè)外部地址)上提供相同的內(nèi)容 在不同的端口上運(yùn)行不同的站點(diǎn) 建立基于IP的虛擬主機(jī) 混用基于端口和基于IP的虛擬主機(jī) 混用基于域名和基于IP的虛擬主機(jī) 將虛擬主機(jī)和代理模塊一起使用 使用默認(rèn)虛擬主機(jī) 將一個(gè)基于域名的虛擬主機(jī)移植為一個(gè)基于IP的虛擬主機(jī) 使用ServerPath指令 深入討論虛擬主機(jī)的匹配 解析配置文件 虛擬主機(jī)匹配 小技巧 文件描述符限制 關(guān)于DNS和Apache 一個(gè)簡單示例 拒絕服務(wù) "主服務(wù)器"地址 避免這些問題的小技巧 附錄:進(jìn)一步的提示 常見問題 概述 SSL/TLS 加密 概述 文檔 mod_ssl 緒論 密碼技術(shù) 證書 安全套接字層(SSL) 參考 兼容性 配置指令 環(huán)境變量 自定義日志功能 如何... 加密方案和強(qiáng)制性高等級(jí)安全 客戶認(rèn)證和訪問控制 常見問題解答 About The Module Installation Configuration Certificates The SSL Protocol mod_ssl Support 如何.../指南 概述 認(rèn)證 相關(guān)模塊和指令 簡介 先決條件 啟用認(rèn)證 允許多人訪問 可能存在的問題 其他認(rèn)證方法 更多信息 CGI動(dòng)態(tài)頁面 簡介 配置Apache以允許CGI 編寫CGI程序 程序還是不能運(yùn)行! 幕后是怎樣操作的? CGI模塊/庫 更多信息 服務(wù)器端包含 簡介 什么是SSI? 配置服務(wù)器以允許SSI 基本SSI指令 附加的例子 我還能設(shè)置其它什么? 執(zhí)行命令 高級(jí)SSI技術(shù) 總結(jié) .htaccess文件 .htaccess文件 工作原理和使用方法 (不)使用.htaccess文件的場(chǎng)合 指令的生效 認(rèn)證舉例 服務(wù)器端包含(SSI)舉例 CGI舉例 疑難解答 用戶網(wǎng)站目錄 用戶網(wǎng)站目錄 用UserDir設(shè)置文件路徑 限定哪些用戶可以使用此功能 啟用對(duì)每個(gè)用戶都有效的cgi目錄 允許用戶改變配置 對(duì)特定平臺(tái)的說明 概述 Microsoft Windows 其他平臺(tái) 在Microsoft Windows中使用Apache 對(duì)操作系統(tǒng)的要求 下載 Apache for Windows 安裝 Apache for Windows 配置 Apache for Windows 以服務(wù)方式運(yùn)行 Apache for Windows 作為控制臺(tái)程序運(yùn)行Apache 測(cè)試安裝 編譯Windows下的Apache 系統(tǒng)要求 命令行編譯 Developer Studio集成開發(fā)環(huán)境的工作區(qū)編譯 項(xiàng)目組件 在Novell NetWare平臺(tái)上使用Apache Requirements Downloading Apache for NetWare Installing Apache for NetWare Running Apache for NetWare Configuring Apache for NetWare Compiling Apache for NetWare 在HP-UX中運(yùn)行Apache The Apache EBCDIC Port Overview of the Apache EBCDIC Port Design Goals Technical Solution Porting Notes Document Storage Notes Apache Modules' Status Third Party Modules' Status 服務(wù)器與支持程序 概述 httpd 語法 選項(xiàng) ab 語法 選項(xiàng) Bugs apachectl 語法 選項(xiàng) apxs 語法 選項(xiàng) 舉例 configure 語法 選項(xiàng) 環(huán)境變量 dbmmanage 語法 選項(xiàng) Bugs htcacheclean 語法 選項(xiàng) 返回值 htdbm 語法 選項(xiàng) Bugs 返回值 舉例 安全方面的考慮 限制 htdigest 語法 選項(xiàng) htpasswd 語法 選項(xiàng) 返回值 舉例 安全方面的考慮 限制 logresolve 語法 選項(xiàng) rotatelogs 語法 選項(xiàng) Portability suexec 語法 選項(xiàng) 其他程序 log_server_status split-logfile 雜項(xiàng)文檔 概述 相關(guān)標(biāo)準(zhǔn) HTTP推薦標(biāo)準(zhǔn) HTML推薦標(biāo)準(zhǔn) 認(rèn)證 語言/國家代碼 Apache 模塊 描述模塊的術(shù)語 說明 狀態(tài) 源代碼文件 模塊標(biāo)識(shí)符 兼容性 描述指令的術(shù)語 說明 語法 默認(rèn)值(Default) 作用域(Context) 覆蓋項(xiàng)(Override) 狀態(tài) 模塊(Module) 兼容性(Compatibility) Apache核心(Core)特性 AcceptFilter AcceptPathInfo AccessFileName AddDefaultCharset AddOutputFilterByType AllowEncodedSlashes AllowOverride AuthName AuthType CGIMapExtension ContentDigest DefaultType <Directory> <DirectoryMatch> DocumentRoot EnableMMAP EnableSendfile ErrorDocument ErrorLog FileETag <Files> <FilesMatch> ForceType HostnameLookups <IfDefine> <IfModule> Include KeepAlive KeepAliveTimeout <Limit> <LimitExcept> LimitInternalRecursion LimitRequestBody LimitRequestFields LimitRequestFieldSize LimitRequestLine LimitXMLRequestBody <Location> <LocationMatch> LogLevel MaxKeepAliveRequests NameVirtualHost Options Require RLimitCPU RLimitMEM RLimitNPROC Satisfy ScriptInterpreterSource ServerAdmin ServerAlias ServerName ServerPath ServerRoot ServerSignature ServerTokens SetHandler SetInputFilter SetOutputFilter TimeOut TraceEnable UseCanonicalName UseCanonicalPhysicalPort <VirtualHost> Apache MPM 公共指令 AcceptMutex CoreDumpDirectory EnableExceptionHook GracefulShutdownTimeout Group Listen ListenBackLog LockFile MaxClients MaxMemFree MaxRequestsPerChild MaxSpareThreads MinSpareThreads PidFile ReceiveBufferSize ScoreBoardFile SendBufferSize ServerLimit StartServers StartThreads ThreadLimit ThreadsPerChild ThreadStackSize User Apache MPM beos MaxRequestsPerThread CoreDumpDirectory Group Listen ListenBacklog MaxClients MaxMemFree MaxSpareThreads MinSpareThreads PidFile ReceiveBufferSize ScoreBoardFile SendBufferSize StartThreads User Apache MPM event AcceptMutex CoreDumpDirectory EnableExceptionHook Group Listen ListenBacklog LockFile MaxClients MaxMemFree MaxRequestsPerChild MaxSpareThreads MinSpareThreads PidFile ScoreBoardFile SendBufferSize ServerLimit StartServers ThreadLimit ThreadsPerChild ThreadStackSize User Apache MPM netware MaxThreads Listen ListenBacklog MaxMemFree MaxRequestsPerChild MaxSpareThreads MinSpareThreads ReceiveBufferSize SendBufferSize StartThreads ThreadStackSize Apache MPM os2 Group Listen ListenBacklog MaxRequestsPerChild MaxSpareThreads MinSpareThreads PidFile ReceiveBufferSize SendBufferSize StartServers User Apache MPM prefork 工作方式 MaxSpareServers MinSpareServers AcceptMutex CoreDumpDirectory EnableExceptionHook Group Listen ListenBacklog LockFile MaxClients MaxMemFree MaxRequestsPerChild PidFile ReceiveBufferSize ScoreBoardFile SendBufferSize ServerLimit StartServers User Apache MPM winnt Win32DisableAcceptEx CoreDumpDirectory Listen ListenBacklog MaxMemFree MaxRequestsPerChild PidFile ReceiveBufferSize ScoreBoardFile SendBufferSize ThreadLimit ThreadsPerChild ThreadStackSize Apache MPM worker 工作方式 AcceptMutex CoreDumpDirectory EnableExceptionHook Group Listen ListenBacklog LockFile MaxClients MaxMemFree MaxRequestsPerChild MaxSpareThreads MinSpareThreads PidFile ReceiveBufferSize ScoreBoardFile SendBufferSize ServerLimit StartServers ThreadLimit ThreadsPerChild ThreadStackSize User Apache Module mod_actions Action指令 Script指令 Apache Module mod_alias 處理順序 Alias AliasMatch Redirect RedirectMatch RedirectPermanent RedirectTemp ScriptAlias ScriptAliasMatch Apache Module mod_asis 用法 Apache Module mod_auth_basic AuthBasicAuthoritative AuthBasicProvider Apache Module mod_auth_digest 使用摘要認(rèn)證 配合 MS Internet Explorer 6 工作 AuthDigestAlgorithm AuthDigestDomain AuthDigestNcCheck AuthDigestNonceFormat AuthDigestNonceLifetime AuthDigestProvider AuthDigestQop AuthDigestShmemSize Apache Module mod_authn_alias 示例 <AuthnProviderAlias> Apache Module mod_authn_anon 示例 Anonymous Anonymous_LogEmail Anonymous_MustGiveEmail Anonymous_NoUserID Anonymous_VerifyEmail Apache Module mod_authn_dbd 配置示例 AuthDBDUserPWQuery AuthDBDUserRealmQuery Apache Module mod_authn_dbm AuthDBMType AuthDBMUserFile Apache Module mod_authn_default AuthDefaultAuthoritative Apache Module mod_authn_file AuthUserFile Apache Module mod_authnz_ldap Contents Operation The require Directives 舉例 Using TLS Using SSL Using Microsoft FrontPage with mod_authnz_ldap AuthLDAPBindDN AuthLDAPBindPassword AuthLDAPCharsetConfig AuthLDAPCompareDNOnServer AuthLDAPDereferenceAliases AuthLDAPGroupAttribute AuthLDAPGroupAttributeIsDN AuthLDAPRemoteUserIsDN AuthLDAPUrl AuthzLDAPAuthoritative Apache Module mod_authz_dbm AuthDBMGroupFile AuthzDBMAuthoritative AuthzDBMType Apache Module mod_authz_default AuthzDefaultAuthoritative Apache Module mod_authz_groupfile AuthGroupFile AuthzGroupFileAuthoritative Apache Module mod_authz_host Allow Deny Order Apache Module mod_authz_owner 配置示例 AuthzOwnerAuthoritative Apache Module mod_authz_user AuthzUserAuthoritative Apache Module mod_autoindex Autoindex Request Query Arguments AddAlt AddAltByEncoding AddAltByType AddDescription AddIcon AddIconByEncoding AddIconByType DefaultIcon HeaderName IndexIgnore IndexOptions IndexOrderDefault IndexStyleSheet ReadmeName Apache Module mod_cache Related Modules and Directives 配置示例 CacheDefaultExpire CacheDisable CacheEnable CacheIgnoreCacheControl CacheIgnoreHeaders CacheIgnoreNoLastMod CacheLastModifiedFactor CacheMaxExpire CacheStoreNoStore CacheStorePrivate Apache Module mod_cern_meta MetaDir MetaFiles MetaSuffix Apache Module mod_cgi CGI 環(huán)境變量 CGI 腳本的調(diào)試 ScriptLog ScriptLogBuffer ScriptLogLength Apache Module mod_cgid ScriptSock ScriptLog ScriptLogBuffer ScriptLogLength Apache Module mod_charset_lite Common Problems CharsetDefault CharsetOptions CharsetSourceEnc Apache Module mod_dav Enabling WebDAV Security Issues Complex Configurations Dav DavDepthInfinity DavMinTimeout Apache Module mod_dav_fs DavLockDB Apache Module mod_dav_lock DavGenericLockDB Apache Module mod_dbd Connection Pooling Apache DBD API SQL Prepared Statements DBDExptime DBDKeep DBDMax DBDMin DBDParams DBDPersist DBDPrepareSQL DBDriver Apache Module mod_deflate 配置舉例 啟用壓縮 代理服務(wù)器 DeflateBufferSize DeflateCompressionLevel DeflateFilterNote DeflateMemLevel DeflateWindowSize Apache Module mod_dir DirectoryIndex DirectorySlash Apache Module mod_disk_cache CacheDirLength CacheDirLevels CacheMaxFileSize CacheMinFileSize CacheRoot Apache Module mod_dumpio 啟用dumpio支持 DumpIOInput DumpIOOutput Apache Module mod_echo ProtocolEcho Apache Module mod_env PassEnv SetEnv UnsetEnv Apache Module mod_example Compiling the example module Using the mod_example Module Example Apache Module mod_expires 交替間隔語法 ExpiresActive ExpiresByType ExpiresDefault Apache Module mod_ext_filter 舉例 ExtFilterDefine ExtFilterOptions Apache Module mod_file_cache Using mod_file_cache CacheFile MMapFile Apache Module mod_filter Smart Filtering Filter Declarations Configuring the Chain Examples Protocol Handling FilterChain FilterDeclare FilterProtocol FilterProvider FilterTrace Apache Module mod_headers 處理順序 前處理和后處理 舉例 Header RequestHeader Apache Module mod_ident IdentityCheck IdentityCheckTimeout Apache Module mod_imagemap New Features Imagemap File Example Mapfile Referencing your mapfile ImapBase ImapDefault ImapMenu Apache Module mod_include Enabling Server-Side Includes PATH_INFO with Server Side Includes Basic Elements Include Variables Variable Substitution Flow Control Elements SSIEndTag SSIErrorMsg SSIStartTag SSITimeFormat SSIUndefinedEcho XBitHack Apache Module mod_info 安全問題 選擇哪些信息可以被顯示 已知的局限 AddModuleInfo Apache Module mod_isapi 用法 附加注釋 程序員注記 ISAPIAppendLogToErrors ISAPIAppendLogToQuery ISAPICacheFile ISAPIFakeAsync ISAPILogNotSupported ISAPIReadAheadBuffer Apache Module mod_ldap 示例配置 LDAP 連接池 LDAP 緩沖 使用SSL/TLS SSL/TLS 證書 LDAPCacheEntries LDAPCacheTTL LDAPConnectionTimeout LDAPOpCacheEntries LDAPOpCacheTTL LDAPSharedCacheFile LDAPSharedCacheSize LDAPTrustedClientCert LDAPTrustedGlobalCert LDAPTrustedMode LDAPVerifyServerCert Apache Module mod_log_config 定制日志文件格式 安全考慮 BufferedLogs CookieLog CustomLog LogFormat TransferLog Apache Module mod_log_forensic 定制日志文件格式 安全考慮 ForensicLog Apache Module mod_logio 定制日志文件格式 Apache Module mod_mem_cache MCacheMaxObjectCount MCacheMaxObjectSize MCacheMaxStreamingBuffer MCacheMinObjectSize MCacheRemovalAlgorithm MCacheSize Apache Module mod_mime 帶多擴(kuò)展名的文件 內(nèi)容編碼 字符集和語言 AddCharset AddEncoding AddHandler AddInputFilter AddLanguage AddOutputFilter AddType DefaultLanguage ModMimeUsePathInfo MultiviewsMatch RemoveCharset RemoveEncoding RemoveHandler RemoveInputFilter RemoveLanguage RemoveOutputFilter RemoveType TypesConfig Apache Module mod_mime_magic "Magic文件"的格式 性能問題 注意 MimeMagicFile Apache Module mod_negotiation 類型表 MultiViews CacheNegotiatedDocs ForceLanguagePriority LanguagePriority Apache Module mod_nw_ssl NWSSLTrustedCerts NWSSLUpgradeable SecureListen Apache Module mod_proxy 正向和反向代理 簡單示例 控制對(duì)代理服務(wù)器的訪問 緩慢啟動(dòng) 局域網(wǎng)代理 協(xié)議調(diào)整 請(qǐng)求體 AllowCONNECT NoProxy <Proxy> ProxyBadHeader ProxyBlock ProxyDomain ProxyErrorOverride ProxyIOBufferSize <ProxyMatch> ProxyMaxForwards ProxyPass ProxyPassReverse ProxyPassReverseCookieDomain ProxyPassReverseCookiePath ProxyPreserveHost ProxyReceiveBufferSize ProxyRemote ProxyRemoteMatch ProxyRequests ProxyTimeout ProxyVia Apache Module mod_proxy_ajp Overview of the protocol Basic Packet Structure Request Packet Structure Response Packet Structure Apache Module mod_proxy_balancer Load balancer scheduler algorithm Request Counting Algorithm Weighted Traffic Counting Algorithm Enabling Balancer Manager Support Apache Module mod_proxy_connect Apache Module mod_proxy_ftp 為什么xxx類型的文件不能從FTP下載? 如何強(qiáng)制文件xxx使用FTP的ASCII形式下載? 我如何使用FTP上傳? 我如何能訪問我自己home目錄以外的FTP文件? 我如何才能在瀏覽器的URL框中隱藏FTP的明文密碼? Apache Module mod_proxy_http Apache Module mod_rewrite 特殊字符的引用 環(huán)境變量 實(shí)用方案 RewriteBase RewriteCond RewriteEngine RewriteLock RewriteLog RewriteLogLevel RewriteMap RewriteOptions RewriteRule Apache Module mod_setenvif BrowserMatch BrowserMatchNoCase SetEnvIf SetEnvIfNoCase Apache Module mod_so 為Windows創(chuàng)建可加載模塊 LoadFile LoadModule Apache Module mod_speling CheckSpelling Apache Module mod_ssl 環(huán)境變量 Custom Log Formats SSLCACertificateFile SSLCACertificatePath SSLCADNRequestFile SSLCADNRequestPath SSLCARevocationFile SSLCARevocationPath SSLCertificateChainFile SSLCertificateFile SSLCertificateKeyFile SSLCipherSuite SSLCryptoDevice SSLEngine SSLHonorCipherOrder SSLMutex SSLOptions SSLPassPhraseDialog SSLProtocol SSLProxyCACertificateFile SSLProxyCACertificatePath SSLProxyCARevocationFile SSLProxyCARevocationPath SSLProxyCipherSuite SSLProxyEngine SSLProxyMachineCertificateFile SSLProxyMachineCertificatePath SSLProxyProtocol SSLProxyVerify SSLProxyVerifyDepth SSLRandomSeed SSLRequire SSLRequireSSL SSLSessionCache SSLSessionCacheTimeout SSLUserName SSLVerifyClient SSLVerifyDepth Apache Module mod_status Enabling Status Support 自動(dòng)更新 Machine Readable Status File ExtendedStatus Apache Module mod_suexec SuexecUserGroup Apache Module mod_unique_id Theory Apache Module mod_userdir UserDir Apache Module mod_usertrack Logging 2-digit or 4-digit dates for cookies? CookieDomain CookieExpires CookieName CookieStyle CookieTracking Apache Module mod_version <IfVersion> Apache Module mod_vhost_alias 目錄名稱的轉(zhuǎn)換 示例 VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP 開發(fā)者文檔 Overview Topics External Resources Apache API notes Basic concepts How handlers work Resource allocation and resource pools Configuration Debugging Memory Allocation in APR Available debugging options Allowable Combinations Activating Debugging Options Documenting Apache 2.0 Apache 2.0 Hook Functions Creating a hook function Hooking the hook Converting Modules from Apache 1.3 to Apache 2.0 The easier changes ... The messier changes... Request Processing in Apache 2.0 The Request Processing Cycle The Request Parsing Phase The Security Phase The Preparation Phase The Handler Phase How Filters Work in Apache 2.0 Filter Types How are filters inserted? Asis Explanations 詞匯和索引 詞匯表 模塊索引 指令索引 指令速查 譯者聲明
Figuren

Apache模塊 mod_log_config

說明 允許記錄日志和定制日志文件格式
狀態(tài) 基本(B)
模塊名 log_config_module
源文件 mod_log_config.c

概述

本模塊提供了靈活的方法將客戶請(qǐng)求記錄到日志。日志可以用自定義的格式直接寫入文件,或者傳送到一個(gè)外部程序繼續(xù)處理。條件日志功能可以實(shí)現(xiàn)根據(jù)請(qǐng)求的特征來決定一個(gè)日志信息是否被包含在最終的日志記錄里面。

本模塊提供了三個(gè)指令:TransferLog指令用來指定日志文件,LogFormat指令用來定義日志格式,CustomLog指令可以同時(shí)完成指定日志文件和定義日志格式。TransferLogCustomLog指令在每個(gè)服務(wù)器上都可以被多次使用,以便將同一個(gè)請(qǐng)求記錄到多個(gè)文件中。

定制日志文件格式

LogFormatCustomLog指令的格式化參數(shù)是一個(gè)字符串。這個(gè)字符串會(huì)在每次請(qǐng)求發(fā)生的時(shí)候,被記錄到日志中去。它可以包含將被原樣寫入日志的文本字符串以及C風(fēng)格的控制字符"\n"和"\t"以實(shí)現(xiàn)換行與制表。文本中的引號(hào)和反斜杠應(yīng)通過"\"來轉(zhuǎn)義。

請(qǐng)求本身的情況將通過在格式字符串中放置各種"%"轉(zhuǎn)義符的方法來記錄,它們?cè)趯懭肴罩疚募r(shí),根據(jù)下表的定義進(jìn)行轉(zhuǎn)換:

格式字符串 描述
%% 百分號(hào)(Apache2.0.44或更高的版本)
%a 遠(yuǎn)端IP地址
%A 本機(jī)IP地址
%B 除HTTP頭以外傳送的字節(jié)數(shù)
%b 以CLF格式顯示的除HTTP頭以外傳送的字節(jié)數(shù),也就是當(dāng)沒有字節(jié)傳送時(shí)顯示'-'而不是0。
%{Foobar}C 在請(qǐng)求中傳送給服務(wù)端的cookieFoobar的內(nèi)容。
%D 服務(wù)器處理本請(qǐng)求所用時(shí)間,以微為單位。
%{FOOBAR}e 環(huán)境變量FOOBAR的值
%f 文件名
%h 遠(yuǎn)端主機(jī)
%H 請(qǐng)求使用的協(xié)議
%{Foobar}i 發(fā)送到服務(wù)器的請(qǐng)求頭Foobar:的內(nèi)容。
%l 遠(yuǎn)端登錄名(由identd而來,如果支持的話),除非IdentityCheck設(shè)為"On",否則將得到一個(gè)"-"。
%m 請(qǐng)求的方法
%{Foobar}n 來自另一個(gè)模塊的注解Foobar的內(nèi)容。
%{Foobar}o 應(yīng)答頭Foobar:的內(nèi)容。
%p 服務(wù)器服務(wù)于該請(qǐng)求的標(biāo)準(zhǔn)端口。
%P 為本請(qǐng)求提供服務(wù)的子進(jìn)程的PID。
%{format}P 服務(wù)于該請(qǐng)求的PID或TID(線程ID),format的取值范圍為:pidtid(2.0.46及以后版本)以及hextid(需要APR1.2.0及以上版本)
%q 查詢字符串(若存在則由一個(gè)"?"引導(dǎo),否則返回空串)
%r 請(qǐng)求的第一行
%s 狀態(tài)。對(duì)于內(nèi)部重定向的請(qǐng)求,這個(gè)狀態(tài)指的是原始請(qǐng)求的狀態(tài),---%>s則指的是最后請(qǐng)求的狀態(tài)。
%t 時(shí)間,用普通日志時(shí)間格式(標(biāo)準(zhǔn)英語格式)
%{format}t 時(shí)間,用strftime(3)指定的格式表示的時(shí)間。(默認(rèn)情況下按本地化格式)
%T 處理完請(qǐng)求所花時(shí)間,以秒為單位。
%u 遠(yuǎn)程用戶名(根據(jù)驗(yàn)證信息而來;如果返回status(%s)為401,可能是假的)
%U 請(qǐng)求的URL路徑,不包含查詢字符串。
%v 對(duì)該請(qǐng)求提供服務(wù)的標(biāo)準(zhǔn)ServerName。
%V 根據(jù)UseCanonicalName指令設(shè)定的服務(wù)器名稱。
%X 請(qǐng)求完成時(shí)的連接狀態(tài):
X= 連接在應(yīng)答完成前中斷。
+= 應(yīng)答傳送完后繼續(xù)保持連接。
-= 應(yīng)答傳送完后關(guān)閉連接。

(在1.3以后的版本中,這個(gè)指令是%c,但這樣就和過去的SSL語法:%{var}c沖突了)

%I 接收的字節(jié)數(shù),包括請(qǐng)求頭的數(shù)據(jù),并且不能為零。要使用這個(gè)指令你必須啟用mod_logio模塊。
%O 發(fā)送的字節(jié)數(shù),包括請(qǐng)求頭的數(shù)據(jù),并且不能為零。要使用這個(gè)指令你必須啟用mod_logio模塊。

修飾符

可以緊跟在"%"后面加上一個(gè)逗號(hào)分隔的狀態(tài)碼列表來限制記錄的條目。例如,"%400,501{User-agent}i"只記錄狀態(tài)碼400和501發(fā)生時(shí)的User-agent頭內(nèi)容;不滿足條件時(shí)用"-"代替。狀態(tài)碼前還可以加上"!"前綴表示否定,"%!200,304,302{Referer}i"記錄所有不同于200,304,302的狀態(tài)碼發(fā)生時(shí)的Referer頭內(nèi)容。

"<"和">"修飾符可以用來指定對(duì)于已被內(nèi)部重定向的請(qǐng)求是選擇原始的請(qǐng)求還是選擇最終的請(qǐng)求。默認(rèn)情況下,%s, %U, %T, %D, %r 使用原始請(qǐng)求,而所有其他格式串則選擇最終請(qǐng)求。例如,%>s 可以用于記錄請(qǐng)求的最終狀態(tài),而 %<u 則記錄一個(gè)已經(jīng)被內(nèi)部重定向到非認(rèn)證資源的請(qǐng)求的原始認(rèn)證用戶。

一些說明

出于安全考慮,從2.0.46版本開始,%r, %i, %o 中的特殊字符,除了雙引號(hào)(")和反斜線(\)分別用 \"\\ 進(jìn)行轉(zhuǎn)義、空白字符用C風(fēng)格(\n, \t 等)進(jìn)行轉(zhuǎn)義以外,非打印字符和其它特殊字符使用 \xhh 格式進(jìn)行轉(zhuǎn)義(hh是該字符的16進(jìn)制編碼)。在2.0.46以前的版本中,這些內(nèi)容會(huì)被完整的按原樣記錄。這種做法將導(dǎo)致客戶端可以在日志中插入控制字符,所以你在處理這些日志文件的時(shí)候要特別小心。

在2.0版本中(不同于1.3),%b%B 格式字符串并不表示發(fā)送到客戶端的字節(jié)數(shù),而只是簡單的表示HTTP應(yīng)答字節(jié)數(shù)(在連接中斷或使用SSL時(shí)與前者有所不同)。mod_logio提供的 %O 格式字符串將會(huì)記錄發(fā)送的實(shí)際字節(jié)數(shù)。

示例

一些常見的格式串:

通用日志格式(CLF)
"%h %l %u %t \"%r\" %>s %b"
帶虛擬主機(jī)的通用日志格式
"%v %h %l %u %t \"%r\" %>s %b"
NCSA擴(kuò)展/組合日志格式
"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
Referer日志格式
"%{Referer}i -> %U"
Agent(Browser)日志格式
"%{User-agent}i"

安全考慮

如果放置日志文件的目錄對(duì)除啟動(dòng)Apache服務(wù)以外的其他用戶可寫,可能會(huì)對(duì)系統(tǒng)的安全性造成威脅,具體的討論請(qǐng)參見安全方面的提示。

BufferedLogs 指令

說明 在將日志寫入磁盤前先在內(nèi)存中進(jìn)行緩沖
語法 BufferedLogs On|Off
默認(rèn)值 BufferedLogs Off
作用域 server config
狀態(tài) 基本(B)
模塊 mod_log_config
兼容性 僅在 Apache 2.0.41 及以后的版本中可用

BufferedLogs指令使得mod_log_config先在內(nèi)存中緩沖一些日志內(nèi)容,然后一次性寫入磁盤,而不是立即寫入。在一些系統(tǒng)上這樣做可以提高磁盤性能。這個(gè)設(shè)置僅能夠針對(duì)全局進(jìn)行設(shè)置,不能單獨(dú)針對(duì)虛擬主機(jī)進(jìn)行設(shè)置。

這是一個(gè)試驗(yàn)性的指令,請(qǐng)?jiān)谑褂弥卸嗉有⌒摹?/div>

CookieLog 指令

說明 設(shè)定針對(duì)cookies的日志文件名
語法 CookieLog filename
作用域 server config, virtual host
狀態(tài) 基本(B)
模塊 mod_log_config
兼容性 反對(duì)使用該指令

CookieLog指令使用cookies作為日志文件名。文件是相對(duì)于ServerRoot目錄的。包含本指令僅僅是為了保持與mod_cookies模塊的兼容,并且反對(duì)使用。

CustomLog 指令

說明 設(shè)定日志的文件名和格式
語法 CustomLog file|pipe format|nickname [env=[!]environment-variable]
作用域 server config, virtual host
狀態(tài) 基本(B)
模塊 mod_log_config

CustomLog指令用來對(duì)服務(wù)器的請(qǐng)求進(jìn)行日志記錄??梢灾付ㄈ罩镜母袷?,也可以使用環(huán)境變量根據(jù)請(qǐng)求的特征來自由地組織日志。

第一個(gè)參數(shù)指定了日志記錄的位置,可以使用以下兩種方式來設(shè)定:

file
相對(duì)于ServerRoot的日志文件名。
pipe
管道符"|"后面緊跟著一個(gè)把日志輸出當(dāng)作標(biāo)準(zhǔn)輸入的處理程序路徑。

安全

如果這里用到了程序,那么這個(gè)程序是以啟動(dòng)httpd的用戶來執(zhí)行的。因此如果啟動(dòng)httpd的用戶是root ,那這個(gè)程序也將以root身份來運(yùn)行;你需要確認(rèn)這個(gè)程序是安全的。

注意

當(dāng)在非UNIX平臺(tái)上輸入文件路徑的時(shí)候,要特別注意即使平臺(tái)本身是使用反斜杠(\)來分隔路徑的,在這里也只能使用正斜杠(/)。通常在配置文件里只用正斜杠(/)來分隔路徑總是不會(huì)錯(cuò)的。

第二個(gè)參數(shù)指定了寫入日志文件的內(nèi)容。它既可以是由前面的LogFormat指令定義的nickname ,也可以是直接按日志格式一節(jié)所描述的規(guī)則定義的format字符串。

例如:以下兩組指令的結(jié)果是完全一樣的:

# 使用nickname
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log common

# 明確使用格式格式字符串
CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b"

第三個(gè)參數(shù)是可選的,它根據(jù)服務(wù)器上特定的環(huán)境變量是否被設(shè)置來決定是否對(duì)某一特定的請(qǐng)求進(jìn)行日志記錄。如果這個(gè)特定的環(huán)境變量被設(shè)置(或者在"env=!name"的情況下未被設(shè)置),那么這個(gè)請(qǐng)求將被記錄。

可以使用mod_setenvif和/或mod_rewrite模塊來為每個(gè)請(qǐng)求設(shè)置環(huán)境變量。例如:如果你想在服務(wù)器上將所有對(duì)GIF圖片的請(qǐng)求記錄在不同于主日志文件的另一個(gè)日志文件中,你可以使用下面的指令:

SetEnvIf Request_URI \.gif$ gif-image
CustomLog gif-requests.log common env=gif-image
CustomLog nongif-requests.log common env=!gif-image

或者為了復(fù)制舊有的RefererIgnore指令的行為,你可以使用下面的指令:

SetEnvIf Referer example\.com localreferer
CustomLog referer.log referer env=!localreferer

LogFormat 指令

說明 定義訪問日志的記錄格式
語法 LogFormat format|nickname [nickname]
默認(rèn)值 LogFormat "%h %l %u %t \"%r\" %>s %b"
作用域 server config, virtual host
狀態(tài) 基本(B)
模塊 mod_log_config

本指令定義訪問日志的記錄格式。

LogFormat指令可以使用兩種定義格式中的一種。在第一種格式中,指令只帶一個(gè)參數(shù),以定義后續(xù)的TransferLog指令定義的日志格式。這個(gè)唯一的參數(shù)可以按上述自定義日志格式小節(jié)所描述的format來定義。另外它也可以通過下述的方法使用nickname來引用某個(gè)之前的LogFormat定義的日志格式。

第二種定義LogFormat指令的格式中,將一個(gè)直接的format和一個(gè)nickname聯(lián)系起來。這樣在后續(xù)的LogFormatCustomLog指令中,就不用一再重復(fù)整個(gè)冗長的格式串。定義別名的LogFormat指令僅僅用來定義一個(gè)nickname ,而不做其它任何事情:也就是說,它只是定義了這個(gè)別名,它既沒有實(shí)際應(yīng)用這個(gè)別名,也不是把它設(shè)為默認(rèn)的格式。因此,它不會(huì)影響后續(xù)的TransferLog指令。另外,LogFormat不能用一個(gè)別名來定義另一個(gè)別名。注意,別名不能包含百分號(hào)(%)。

示例

LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common

TransferLog 指令

說明 指定日志文件的位置
語法 TransferLog file|pipe
作用域 server config, virtual host
狀態(tài) 基本(B)
模塊 mod_log_config

本指令除不允許直接定義日志格式或根據(jù)條件進(jìn)行日志記錄外,與CustomLog指令有完全相同的參數(shù)和功能。實(shí)際應(yīng)用中,日志的格式是由最近的非別名定義的LogFormat指令指定。如果沒有定義任何日志格式,則使用通用日志格式。

示例

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
TransferLog logs/access_log

Vorheriger Artikel: N?chster Artikel: