Apache Server

 

主要設定檔

/etc/apache2/httpd.conf

Apache的主要設定檔,裡面描述Apache相關設定檔的存放位置。內容分成三個區塊:Global Environment
、Main Server Configuration、Virtual Server Configuration。

Global Environment

 

 

Main Server Configuration

 

 

Virtual Server Configuration

 

server-tuning.conf

  

StartServers 5 : Apache 啟動時的服務行程數為5個

MinSpareServers 5 : 最少保留5個服務行程數給 Apache Server

MaxSpareSevers 10 : 最多保留10個服務行程數 Apache Server

MaxClients 150 : 最多能同時應付150個 Client 端的連線

ServerLimit 150 : 限制 MaxClients 的數目

MaxRequestsPerChild 10000 : 每個程式能夠提供的最大傳輸次數為 10000

 

KeepAlive On :打開持續連線功能。當Client完成一個連線請求後,並不會馬上斷線,則是會等到限定的時間過後才會斷線

MaxKeepAliveRequests 100 : 設定持續連線下的最大需求數0 代表沒有限制

KeepAliveTimeout 15 :15秒內 Client 沒有任何的操作命令,則會在15秒後自動斷線

 

/etc/apache2/uid.conf

 

當 Apache 啟動時,先以 root 身分啟動主要控制程式 httpd2-prefork,接者再以 wwwrun 帳號執行其它的行程

 

/etc/apache2/mod_userdir.conf

 

有關使用者個人網頁的相關設定,包括個人網頁的根目錄位置、存取權限的控管等

 

UserDir disabled root : 不開放存取 root 的個人網頁。
UserDir public_html : 設定使用者個人網頁所存放的根目錄名稱預設為 public_html。個人網頁必須存放在自己家目錄下的 public_html 目錄之中。

 

首頁『檔案的檔名』設定

 

用戶端在網址列只輸入到目錄,例如140.123.79.177/時,Apache預設拿出的首頁檔案的檔名順序

vi /etc/apache2/httpd.conf

DirectoryIndex index.htm index.html index.html.var

  

實例

輸入 140.123.79.177/

 

建立網頁

 

在 public_html 目錄下用 vi文書處理器 建立 text.html 檔 輸入 welcome to web site 文字

 

在瀏覽器看結果

  

例外一種方式

 

用 Expression Web 4 建立一個網頁檔

輸入字串 "meeting 時間到了" 並儲存網頁檔 "meeting"

 

開啟 WinSCP , Host name 輸入 IP ,輸入 User name ,Passwd

 

把網頁檔 "meeting" 放進 public_html

 

能進入 /public_html 目錄,vi 開啟 meeting.html 檢視網頁程式碼

 

用瀏覽器開起網頁輸入 140.123.79.177/~ibm/meeting