1 / 36

Chap 15 Apache 伺服器

Chap 15 Apache 伺服器. 15-1 Apache 簡介 15-2 Apache 特色 15-3 Apache 安裝 15-4 HTTP 原理與用戶端連接 15-5 全域環境設定 15-6 主要伺服器設定. 15-1 Apache 簡介. Apache HTTP 伺服器計劃圖案. http://www.apache.org. ASF 授權條款. 重新散佈原始碼( Source Code )時,必須保留版權聲明、適用條件和宣告事項等內容。

Télécharger la présentation

Chap 15 Apache 伺服器

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chap 15 Apache伺服器 • 15-1 Apache簡介 • 15-2 Apache特色 • 15-3 Apache安裝 • 15-4 HTTP原理與用戶端連接 • 15-5 全域環境設定 • 15-6 主要伺服器設定

  2. 15-1 Apache簡介

  3. Apache HTTP伺服器計劃圖案 • http://www.apache.org

  4. ASF授權條款 • 重新散佈原始碼(Source Code)時,必須保留版權聲明、適用條件和宣告事項等內容。 • 「Apache」和「Apache Software Foundation」等字樣不可用來為任何產品背書或促銷,若有此需求,請以電子郵件連絡ASF(apache@apache.org)。 • 以二進位(Binary)的形式重新散佈時,必須在文件中重製版權聲明、適用條件和宣告事項等內容,若有其他資訊也需包含在此文件中。 • 未經ASF許可,任何由Apache伺服器衍生的產品,均不得以「Apache」命名,或在產品名稱中出現「Apache」字樣。 • 包含重新散佈的使用者文件必須加入以下文字: • This product includes software developed by the Apache Software Foundation(http://www.apache.org/).

  5. 15-2 Apache特色

  6. Apache特色 • Apache伺服器支援目前最穩定的HTTP版本 • 具有高度的設定彈性,並可與協定廠商開發的模組相互配合。 • 可以利用Apache模組支援的API自訂或開發模組內容。 • 提供完整的原始碼,並且允許自由使用及修改。 • 支援多種平台的使用

  7. Apache特色 • 支援資料庫管理驗證,允許使用大量已驗證的使用者設定密碼來保護頁面,而不會使Apache伺服器的效能大幅下降。 • 允許使用檔案或CGI Scripts來回應伺服器產生的錯誤 • 沒有限制URL重新導向和別名的數量 • 可設定的日誌檔內容 • 鼓勵使用者回饋新構想、Bug報告和修補檔(Patches) • 具有虛擬主機功能 • Apache伺服器模組可在需要時動態載入

  8. 15-3 Apache安裝

  9. 安裝Apache伺服器

  10. 開機時啟動Apache伺服器 • 方法一:以「ntsysv」設定Apache的自動啟動

  11. 開機時啟動Apache伺服器 • 方法二:以「服務設定」設定Apache的自動啟動

  12. 開機時啟動Apache伺服器 • 方法三:以「chkconfig」設定Apache的自動啟動

  13. 15-4 HTTP原理與用戶端連接

  14. 「三段式交握」(Three-Way Handshake) • 建立交談(Session) • 用戶端要求(Request) • 伺服器回應要求 (Response)

  15. HTTP檔案傳輸過程

  16. 用戶端連接 http://localhost或 http://127.0.0.1 Apache預設網頁

  17. /etc/hosts名稱解析步驟 利用/etc/hosts進行名稱解析

  18. 15-5 全域環境設定

  19. httpd.conf設定檔組成部份 • /etc/httpd/conf/httpd.conf • 全域環境設定 • 主要或預設伺服器的參數定義 • 虛擬主機設定

  20. 全域環境設定重要選項 • ServerRoot "/etc/httpd“ • PidFile run/httpd.pid • Timeout 120 • KeepAlive Off • MaxKeepAliveRequests 100 • KeepAliveTimeout 15

  21. 全域環境設定重要選項 • # StartServers: initial number of server processes to start • # MaxClients: maximum number of simultaneous client connections • # MinSpareThreads: minimum number of worker threads which are kept spare • # MaxSpareThreads: maximum number of worker threads which are kept spare • # ThreadsPerChild: constant number of worker threads in each server process • # MaxRequestsPerChild: maximum number of requests a server process serves • <IfModule worker.c> • StartServers 2 • MaxClients 150 • MinSpareThreads 25 • MaxSpareThreads 75 • ThreadsPerChild 25 • MaxRequestsPerChild 0 • </IfModule>

  22. 全域環境設定重要選項 • Listen • Listen 12.34.56.78:80 • Listen 80 • Include conf.d/*.conf • Load config files from the config directory "/etc/httpd/conf.d". • ExtendedStatus On • Generate "full" status information

  23. 15-6 主要伺服器設定

  24. 主要伺服器設定 • User/Group • ServerAdmin • ServerName • UseCanonicalName • DocumentRoot • UserDir • DirectoryIndex

  25. UserDir 使用者個人網頁 • UserDir public_html <Directory /home/*/public_html> AllowOverride All Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec <Limit GET POST OPTIONS> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS> Order deny,allow Deny from all </LimitExcept> </Directory>

  26. UserDir 使用者個人網頁http://courses.ywdeng.idv.tw/~joseph

  27. 主要伺服器設定 • AccessFileName • TypesConfig • DefaultType • MIMEMagicFile • HostnameLookups • ErrorLog • LogLevel

  28. 主要伺服器設定 • LogFormat • CustomLog • ServerSignature • Aliases • ScriptAlias • Redirect

  29. 網頁重新導向

  30. 主要伺服器設定 • IndexOptions • AddIconByEncoding • AddIconByType • AddIcon • DefaultIcon • AddDescription • ReadmeName

  31. 主要伺服器設定 • HeaderName • IndexIgnore • AddEncoding • DefaultLanguage • AddLanguage • LanguagePriority • ForceLanguagePriority

  32. 主要伺服器設定 • AddDefaultCharset • AddCharset • AddType • AddHandler • AddOutputFilter • Action • ErrorDocument • BrowserMatch • Location區塊

  33. 目前狀態資訊

  34. 主要伺服器設定 • ProxyRequests • ProxyVia • CacheRoot

  35. 快取功能的使用

  36. 主要伺服器設定 • CacheSize • CacheGcInterval • CacheMaxExpire • CacheLastModifiedFactor • CacheDefaultExpire • NoCache

More Related