1 / 30

Apache 基礎設定篇

Apache 基礎設定篇. 國立中正大學校園網路策進會 副會長 林偉傑. 什麼是 Apache. Apache 是由 apache 開發小組所開發的一套 web 伺服器軟體 , 以目前來說 web 站台使用 apache 的比 例約為 56%, 是所有 web 軟體使用比率最高的. Apache 的特點. 擴充性高 功能強大 設定簡單 穩定性高 安全性高 免費. 如何取得 Apache 原始碼. http://www.apache.org/dist/httpd/binaries/ 可依照所使用平台取得最新的 apache 原始碼

Télécharger la présentation

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. Apache 基礎設定篇 國立中正大學校園網路策進會 副會長 林偉傑

  2. 什麼是 Apache Apache 是由apache 開發小組所開發的一套web 伺服器軟體,以目前來說web站台使用apache的比 例約為56%, 是所有web軟體使用比率最高的.

  3. Apache的特點 • 擴充性高 • 功能強大 • 設定簡單 • 穩定性高 • 安全性高 • 免費

  4. 如何取得Apache原始碼 http://www.apache.org/dist/httpd/binaries/ 可依照所使用平台取得最新的apache原始碼 目前最新的版本是1.3.22 是2001年10月15日所發 行的 ,檔名為apache_1.3.22.tar.gz

  5. 解壓縮apache 1.要以root身分來安裝apache 2.解壓縮apache_1.3.22.tar.gz 至 /usr/local 3.tar zxvf apache_1.3.22.tar.gz –C 在/usr/local下會產生一個apache_1.3.22的子目錄

  6. Apache目錄介紹(1) ABOUT_APACHE 關於apache server的資料 Announcement 版權宣告 INSTALL 安裝apache 的說明 LICENSE 使用許可的說明 README apache 原始程式碼的說明檔 README-WIN.TXT apache 原始程式碼的說明檔 windows版

  7. Apache目錄介紹(2) README.configure auto-configure的的介紹與使用 WARNING-WIN.TXT apache windows版本的注意事項 cgi-bin/ CGI程式的安裝位置 conf/ apache 系統設定檔的位置 Makefile.tmpl 使用auto-configure 製造的安裝參考檔 configure auto-configure的執行檔 htdocs/ HTML格式的說明文件 icons/ apache 所使用的預設圖示 src/ apache 的原始程式碼

  8. 安裝apache 至/usr/local/apache_1.3.22之下輸入以下指令: ./configure --prefix=/usr/local/apache 就會幫你把Makefile檔做好 此時再輸入 make 指令,就會按照妳的需要把apache 給編譯好 再輸入make install 已安裝apache 至目錄下 /usr/local/apache/conf -- 存放設定檔 ex. httpd.conf,srm.conf,access.conf etc.

  9. 測試apache server 輸入以下指令 /usr/local/apache/bin/apachetl start 此時用瀏覽器再連上server應該就可以看到 apache的預設畫面.

  10. apache 設定檔簡介 access.conf -設定系統中的存取方式 以及環境 srm.conf -設定檔案目錄可使用的 資源與位置 httpd.conf -啟動時的基本環境

  11. ServerType 語法 ServerType [standalone/inetd] 說明: httpd的啟動方式 standalone-開機後立即執行 inetd-需要時才臨時啟動 範例 ServerType standalone

  12. ServerRoot 語法 ServerRoot "安裝目錄絕對路徑" 說明 安裝目錄絕對路徑 指的就是config時 “--prefix=“所指定的目錄,我們是安裝在 /usr/local/apache 下所以應該這樣填寫 範例 ServerRoot "/usr/local/apache"

  13. Timeout 語法 Timeout [秒數] 說明 設定httpd等待使用者下一個指令的時間, 如果時間內使用者都未下指令, 則終止服務 範例 Timeout 300

  14. KeepAlive 語法 KeepAlive [On/off] 說明 http 1.1 以後每次連線可以提出多個要求, 同時下載多個檔案以加快網路下載速度. 範例 KeepAlive On

  15. MaxKeepAliveRequests 語法 MaxKeepAliveRequests [數目] 說明 每次連線可提出要求的數量,0為不限次數 範例 ex.MaxKeepAliveRequests 100

  16. KeepAliveTimeout 語法 KeepAliveTimeout [秒數] 說明 設定要求等待的時間上限 範例 KeepAliveTimeout 15

  17. SpareServers 語法 MinSpareServers [數量] MaxSpareServers [數量] 說明 MinSpareServers 設定最少等待服務的 process數量 MaxSpareServers 設定最多等待服務的 process數量 範例 MinSpareServers 5 MaxSpareServers 10

  18. StartServers 語法 StartServers [數量] 說明 設定當httpd閒置時,等待服務的 process 數量 範例 StartServers 5

  19. MaxClients 語法 MaxClients [數量] 說明 設定可同時連線的process數量,太多有可能 造成系統效能大幅降低或是不穩定 範例 MaxClients 150

  20. MaxRequestsPerChild 語法 MaxRequestsPerChild [數量] 說明 設定每個連線的子process所能接受的最大 服務次數,當達到此數目時process則會自動關閉 ex.MaxRequestsPerChild 0

  21. Listen 語法 Listen [Port/ IP address:port] 說明 讓apache 除了本身的port (預設是port 80) 之外,還可指定port服務,如果有alias ip,可另外針 對其他特定ip or port服務 範例 #Listen 3000 #Listen 12.34.56.78:80

  22. BindAddress 語法 BindAddress [*/IP/DN] 說明 強迫apache只對某個特定的IP or DN 反應 範例 #BindAddress * 附註 如果要採用Virtual host 的功能,請設成 BindAddress *

  23. Port 語法 Port [編號] 說明 指定http 的服務閘道 範例 Port 80

  24. ServerAdmin 語法 ServerAdmin [e-mail address] 說明 設定web管理者的e-mail位置,方便系統發生 錯誤時通知管理者 範例 ServerAdmin you@your.address

  25. ServerName 語法 ServerName [Domain Name] 說明 設定server的domain name,所使用的 domain name必須是已在dns上註冊完成 範例 #ServerName new.host.name

  26. DocumentRoot 語法 DocumentRoot "目錄名稱" 說明 放置server主網頁的目錄 範例 DocumentRoot "/usr/local/apache/htdocs"

  27. UserDir 語法 UserDir [目錄名稱] 說明 放置主機使用者個人網頁的目錄 範例 UserDir public_html

  28. DirectoryIndex 語法 DirectoryIndex [檔案名稱1] [檔案名稱2][檔案名稱3] 說明 當使用者沒指定檔名時,第一個瀏覽的檔案名稱 範例 DirectoryIndex index.html index.htm

  29. UseCanonicalName 語法 UseCanonicalName [On/Off] 說明 是否使用DNS上的註冊名稱代替 serverName的設定 範例 UseCanonicalName On

  30. End Ending

More Related