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

目錄 搜索
首頁 版本說明 從1.3升級到2.0 編譯時配置的改變 運(yùn)行時配置的改變 雜項(xiàng)變化 第三方模塊 從 2.0 升級到 2.2 編譯時配置的改變 運(yùn)行時配置的改變 雜項(xiàng)變化 第三方模塊 Apache 2.1/2.2 版本的新特性 核心增強(qiáng) 模塊增強(qiáng) 程序增強(qiáng) 針對模塊開發(fā)者的變化 Apache 2.0 版本的新特性 核心的增強(qiáng) 模塊的增強(qiáng) Apache許可證 參考手冊 編譯與安裝 針對心急者的概述 要求 下載 解壓 配置源代碼樹 編譯 安裝 配置 測試 升級 啟動 Apache是怎樣啟動的 啟動時發(fā)生錯誤 隨系統(tǒng)啟動時啟動 額外信息 停止與重新啟動 簡介 立即停止 優(yōu)雅重啟 立即重啟 優(yōu)雅停止 附錄:信號和競爭條件 運(yùn)行時配置指令 主配置文件 配置文件的語法 模塊 指令的作用域 .htaccess文件 配置段 配置段(容器)的類型 文件系統(tǒng)和網(wǎng)絡(luò)空間 虛擬主機(jī) 代理 允許使用哪些指令? 配置段的合并 內(nèi)容緩沖 簡介 緩沖概述 安全方面的考慮 文件句柄緩沖 內(nèi)存緩沖 磁盤緩沖 服務(wù)器全局配置 服務(wù)器標(biāo)識 文件定位 限制資源的使用 日志文件 安全警告 錯誤日志 訪問日志 日志滾動 管道日志 虛擬主機(jī) 其他日志文件 從URL到文件系統(tǒng)的映射 相關(guān)模塊和指令 DocumentRoot DocumentRoot以外的文件 用戶目錄 URL重定向 反向代理 重寫引擎 File Not Found 安全方面的提示 保持不斷更新和升級 ServerRoot目錄的權(quán)限 服務(wù)器端包含 關(guān)于CGI 未指定為腳本的CGI 指定為腳本的CGI 其他動態(tài)內(nèi)容的來源 系統(tǒng)設(shè)置的保護(hù) 默認(rèn)配置下服務(wù)器文件的保護(hù) 觀察日志文件 動態(tài)共享對象(DSO) 實(shí)現(xiàn) 用法概要 背景知識 優(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)換說明 緩沖說明 更多信息 自定義錯誤響應(yīng) 行為 配置 自定義錯誤響應(yīng)與重定向 地址和端口綁定 概述 針對IPv6的特殊考慮 怎樣與虛擬主機(jī)協(xié)同工作 多路處理模塊(MPM) 簡介 選擇一個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)行時的配置 編譯時的配置 附錄:蹤跡的詳細(xì)分析 URL重寫指南 mod_rewrite簡介 實(shí)踐方案 URL的規(guī)劃 內(nèi)容的處理 對訪問的限制 其他 虛擬主機(jī)文檔 總述 虛擬主機(jī)支持 配置指令 基于主機(jī)名的虛擬主機(jī) 基于域名的虛擬主機(jī)和基于IP的虛擬主機(jī)比較 使用基于域名的虛擬主機(jī) 與舊版瀏覽器的兼容性 基于IP地址的虛擬主機(jī) 系統(tǒng)需求 如何配置Apache 設(shè)置多個守護(hù)進(jìn)程 配置擁有多個虛擬主機(jī)的單一守護(hù)進(jìn)程 動態(tài)配置大量虛擬主機(jī) 動機(jī) 概述 簡單的動態(tài)虛擬主機(jī) 一個實(shí)際的個人主頁系統(tǒng) 在同一個服務(wù)器上架設(shè)多個主機(jī)的虛擬系統(tǒng) 更為有效的基于IP地址的虛擬主機(jī) 使用老版本的Apache 使用mod_rewrite實(shí)現(xiàn)簡單的動態(tài)虛擬主機(jī) 使用mod_rewrite的個人主頁系統(tǒng) 使用獨(dú)立的虛擬主機(jī)配置文件 虛擬主機(jī)的普通配置示例 在一個IP地址上運(yùn)行多個基于域名的web站點(diǎn) 在多于一個IP的情況下使用基于域名的虛擬主機(jī) 在不同的IP的地址(比如一個內(nèi)部和一個外部地址)上提供相同的內(nèi)容 在不同的端口上運(yùn)行不同的站點(diǎn) 建立基于IP的虛擬主機(jī) 混用基于端口和基于IP的虛擬主機(jī) 混用基于域名和基于IP的虛擬主機(jī) 將虛擬主機(jī)和代理模塊一起使用 使用默認(rèn)虛擬主機(jī) 將一個基于域名的虛擬主機(jī)移植為一個基于IP的虛擬主機(jī) 使用ServerPath指令 深入討論虛擬主機(jī)的匹配 解析配置文件 虛擬主機(jī)匹配 小技巧 文件描述符限制 關(guān)于DNS和Apache 一個簡單示例 拒絕服務(wù) "主服務(wù)器"地址 避免這些問題的小技巧 附錄:進(jìn)一步的提示 常見問題 概述 SSL/TLS 加密 概述 文檔 mod_ssl 緒論 密碼技術(shù) 證書 安全套接字層(SSL) 參考 兼容性 配置指令 環(huán)境變量 自定義日志功能 如何... 加密方案和強(qiáng)制性高等級安全 客戶認(rèn)證和訪問控制 常見問題解答 About The Module Installation Configuration Certificates The SSL Protocol mod_ssl Support 如何.../指南 概述 認(rèn)證 相關(guān)模塊和指令 簡介 先決條件 啟用認(rèn)證 允許多人訪問 可能存在的問題 其他認(rèn)證方法 更多信息 CGI動態(tài)頁面 簡介 配置Apache以允許CGI 編寫CGI程序 程序還是不能運(yùn)行! 幕后是怎樣操作的? CGI模塊/庫 更多信息 服務(wù)器端包含 簡介 什么是SSI? 配置服務(wù)器以允許SSI 基本SSI指令 附加的例子 我還能設(shè)置其它什么? 執(zhí)行命令 高級SSI技術(shù) 總結(jié) .htaccess文件 .htaccess文件 工作原理和使用方法 (不)使用.htaccess文件的場合 指令的生效 認(rèn)證舉例 服務(wù)器端包含(SSI)舉例 CGI舉例 疑難解答 用戶網(wǎng)站目錄 用戶網(wǎng)站目錄 用UserDir設(shè)置文件路徑 限定哪些用戶可以使用此功能 啟用對每個用戶都有效的cgi目錄 允許用戶改變配置 對特定平臺的說明 概述 Microsoft Windows 其他平臺 在Microsoft Windows中使用Apache 對操作系統(tǒng)的要求 下載 Apache for Windows 安裝 Apache for Windows 配置 Apache for Windows 以服務(wù)方式運(yùn)行 Apache for Windows 作為控制臺程序運(yùn)行Apache 測試安裝 編譯Windows下的Apache 系統(tǒng)要求 命令行編譯 Developer Studio集成開發(fā)環(huán)境的工作區(qū)編譯 項(xiàng)目組件 在Novell NetWare平臺上使用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ù)語 說明 語法 默認(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 正向和反向代理 簡單示例 控制對代理服務(wù)器的訪問 緩慢啟動 局域網(wǎng)代理 協(xié)議調(diào)整 請求體 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 自動更新 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 詞匯和索引 詞匯表 模塊索引 指令索引 指令速查 譯者聲明
文字

安全方面的提示

本文中的提示和技巧有些是針對網(wǎng)絡(luò)服務(wù)器的建立的,有些是綜合性的,其余的則是針對Apache的。

保持不斷更新和升級

Apache HTTP服務(wù)器有一個很好的安全記錄和一個高度關(guān)注安全問題的開發(fā)社團(tuán)。但是這仍然不能避免在發(fā)行版中存在或大或小的問題。所以知道這個軟件的版本更新和升級補(bǔ)丁是至關(guān)重要的。如果你是直接從Apache組織得到Apache HTTP服務(wù)器的,我們強(qiáng)烈建議你訂閱Apache HTTP服務(wù)器通告郵件列表以保證能夠在第一時間得知軟件的版本更新和升級補(bǔ)丁。許多第三方Apache軟件發(fā)行版也有類似的服務(wù)。

當(dāng)然,Web服務(wù)器出現(xiàn)的問題在絕大多數(shù)時候不是由Apache源代碼引起的,而是由附加的代碼、CGI腳本、底層操作系統(tǒng)引起的。因此你必須保持機(jī)器上所有軟件的及時更新。

ServerRoot目錄的權(quán)限

通常,Apache由root用戶啟動,在提供服務(wù)時切換為由User指令所指定的用戶。正如root所執(zhí)行的任何命令那樣,你必須保證ServerRoot下的文件是受保護(hù)的,不允許非root用戶對它修改。不僅文件本身,而且目錄及其父目錄都必須只能由root來改寫。例如,如果將ServerRoot指定為/usr/local/apache ,則推薦以root身份來建立此目錄,如:

mkdir /usr/local/apache
cd /usr/local/apache
mkdir bin conf logs
chown 0 . bin conf logs
chgrp 0 . bin conf logs
chmod 755 . bin conf logs

這里已經(jīng)假定了"/"、"/usr"、"/usr/local"只能由root來改寫。在安裝httpd可執(zhí)行文件時,應(yīng)該確保它也受到了同樣的保護(hù):

cp httpd /usr/local/apache/bin
chown 0 /usr/local/apache/bin/httpd
chgrp 0 /usr/local/apache/bin/httpd
chmod 511 /usr/local/apache/bin/httpd

你可以在其中建立htdocs子目錄,該子目錄可以允許其他用戶改寫 -- root不會執(zhí)行其中任何文件,也不應(yīng)該在其中建立文件。

如果允許非root用戶對由root執(zhí)行或讀寫的文件有寫權(quán)限,則會危及系統(tǒng)。比如,別人有可能會覆蓋httpd可執(zhí)行文件,那么下一次啟動時,就會執(zhí)行惡意代碼。如果日志目錄(對非root用戶)是可寫的,別人就有可能用一個指向其他敏感文件的連接來覆蓋日志文件,使那個文件被改寫為雜亂的數(shù)據(jù)。如果日志文件本身(對非root用戶)是可寫的,別人就可能偽造日志。

服務(wù)器端包含

服務(wù)器端包含(SSI)會帶來一些潛在的安全隱患。

首先是增加了服務(wù)器的負(fù)載。Apache必須解析所有允許SSI的文件,而無論其中是否包含SSI指令。雖然增加的負(fù)載較小,但是在共享服務(wù)器環(huán)境中會變得很顯著。

SSI文件與CGI腳本一樣存在風(fēng)險。使用"exe ccmd"元素,允許SSI的文件可以執(zhí)行任何CGI腳本,以及由httpd.conf設(shè)置的執(zhí)行Apache的用戶或組所允許執(zhí)行的任何程序。

有若干方法可以在得到SSI好處的同時提高SSI文件的安全性。

服務(wù)器管理員可以使用關(guān)于CGI中所描述的suexec ,以隔離野蠻SSI文件所造成的破壞。

對.html或.htm后綴的文件允許SSI是危險的,尤其是在一個共享的或者高流量的服務(wù)器環(huán)境中。被允許SSI的文件應(yīng)該有一個單獨(dú)的后綴,比如常規(guī)的.shtml ,使服務(wù)器的負(fù)載保持在最低水平,并使風(fēng)險管理更容易。

另一個方案是,關(guān)閉SSI頁面執(zhí)行腳本和程序的功能,即在用Options指令中,用IncludesNOEXEC替換Includes 。注意,用戶仍然可以使用 <--#include virtual="..." -->來執(zhí)行位于ScriptAlias指令指定的目錄中的CGI腳本。

關(guān)于CGI

首先,你不得不信任CGI程序的作者以及你自己發(fā)現(xiàn)CGI中潛在安全漏洞的能力,無論這些漏洞是有預(yù)謀的或者僅僅是意外。CGI腳本可以執(zhí)行web服務(wù)器用戶所允許執(zhí)行的任意系統(tǒng)命令,如果沒有經(jīng)過仔細(xì)的檢查,這可能是極其危險的。

由于所有CGI腳本都以相同的身份執(zhí)行,所以可能會和其他腳本(有意或無意地)沖突。比如,用戶A憎恨用戶B,因此他就可能寫一個腳本去破壞用戶B的數(shù)據(jù)庫。suEXEC是一個允許腳本以不同的身份運(yùn)行的程序,它包含在Apache1.2以后的版本中,并被Apache服務(wù)器代碼中特殊的掛鉤所調(diào)用。還有一種常用的方法是使用CGIWrap 。

未指定為腳本的CGI

僅在下列情況下,可以考慮允許用戶執(zhí)行位于任意目錄中的CGI腳本:

  • 你絕對信任用戶不會寫一些有意無意會使系統(tǒng)遭受攻擊的腳本。
  • 你認(rèn)為安全因素與其他因素相比顯得不那么重要,存在一兩個潛在漏洞也無關(guān)緊要。
  • 你沒有用戶,而且沒人會來訪問你的服務(wù)器。

指定為腳本的CGI

把CGI集中在特定的目錄中,并由管理員決定其中的內(nèi)容。這樣絕對比使用不作為腳本的CGI來得安全,除非對這些目錄有寫權(quán)限的用戶被信任,或者管理員希望對每個CGI腳本/程序進(jìn)行潛在安全漏洞測試。

大多數(shù)站點(diǎn)都選擇這種方案,而不使用未指定為腳本的CGI。

其他動態(tài)內(nèi)容的來源

嵌入在Apache中作為模塊運(yùn)行的腳本解釋器,比如:mod_php, mod_perl, mod_tcl, mod_python 將會使用和Apache一樣的用戶身份運(yùn)行(參見User指令),所以被這些模塊執(zhí)行的腳本可能訪問任何Apache服務(wù)器能夠訪問的對象。一些腳本引擎可能提供了某些方面的限制,但是最好在假定他們并不存在的前提下做好安全防護(hù)。

系統(tǒng)設(shè)置的保護(hù)

為了得到真正嚴(yán)密的保護(hù),應(yīng)該禁止用戶使用可能導(dǎo)致安全特性被覆蓋的.htaccess文件,方法是在服務(wù)器配置文件中設(shè)置:

<Directory />
AllowOverride None
</Directory>

使所有目錄無法使用.htaccess文件,明確指定可以使用的目錄除外。

默認(rèn)配置下服務(wù)器文件的保護(hù)

默認(rèn)訪問是偶爾會被誤解的Apache特性之一。也就是,除非你采取措施,否則,如果服務(wù)器能夠通過標(biāo)準(zhǔn)URL映射規(guī)則找到一個文件,那么就可能把它提供給客戶端。比如下例:

# cd /; ln -s / public_html
Accessing http://localhost/~root/

它會允許客戶端遍歷整個文件系統(tǒng)。其解決方法是,在服務(wù)器配置中增加下列指令:

<Directory />
Order Deny,Allow
Deny from all
</Directory>

這樣,對文件系統(tǒng)的默認(rèn)訪問被禁止。而對需要訪問的區(qū)域,可以增加正確的Directory塊,比如:

<Directory /usr/users/*/public_html>
Order Deny,Allow
Allow from all
</Directory>
<Directory /usr/local/httpd>
Order Deny,Allow
Allow from all
</Directory>

必須特別注意LocationDirectory指令的相互作用,比如,即使<Directory />拒絕訪問,<Location />指令仍然可能推翻其設(shè)置。

還必須留意UserDir指令,此設(shè)置如果類似"./",則與上述例子有相同的風(fēng)險。如果你使用的是1.3或更高版本,我們強(qiáng)烈建議在服務(wù)器配置文件中包含以下指令:

UserDir disabled root

觀察日志文件

要了解服務(wù)器上發(fā)生了什么,就必須檢查日志文件。雖然日志文件只是記錄已經(jīng)發(fā)生的事件,但是它會讓你知道服務(wù)器遭受的攻擊,并幫助你判斷是否提達(dá)到了必要的安全等級。

一些例子:

grep -c "/jsp/source.jsp?/jsp/ /jsp/source.jsp??" access_log
grep "client denied" error_log | tail -n 10

上例會列出試圖使用Apache Tomcat Source.JSP Malformed Request Information Disclosure Vulnerability的攻擊次數(shù)。下例會列出最后十個被拒絕的客戶端:

[Thu Jul 11 17:18:39 2002] [error] [client foo.bar.com] client denied by server configuration: /usr/local/apache/htdocs/.htpasswd

可見,日志文件只是記錄已經(jīng)發(fā)生的事件,所以,如果客戶端可以訪問.htpasswd文件,而且在訪問日志中發(fā)現(xiàn)類似如下的記錄:

foo.bar.com - - [12/Jul/2002:01:59:13 +0200] "GET /.htpasswd HTTP/1.1"

這可能表示服務(wù)器配置文件中的下列指令已經(jīng)被注解了:

<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>

上一篇: 下一篇: