Linux伺服器---apache配置檔案
Apache配置檔案
Apache的配置檔案預設路徑是“/etc/httpd/conf/httpd.conf”,編輯該檔案就可以修改Apache的配置
1、設定網頁主目錄,引數DocumentRoot就是網頁存放的主目錄。開啟配置檔案httpd.conf,查詢DocumentRoot(大約292行)
|
2、設定連線埠,通過引數listen來設定連線的埠,預設80.(大約136行)
|
3、設定連線超時,引數timeout,當連線超過一定的空閒時間,就會自動斷開。(大約68行)
|
4、設定字符集,引數AddDefaultCharset
,建議最好設定utf-8,這是通用的。(大約753行)
|
5、設定伺服器名稱,引數ServerName。這是伺服器的域名,必須有dns解析才可以訪問。如果你沒有合法的域名,那麼只能通過ip地址來訪問
|
6、設定keepalive,提高網路效率,預設是關閉的。(大約76行)
|
7、設定keepaliverequest,設定為0 的時候沒有限制,不過最好還是用預設值,或者自己根據情況來改變。(大約83行)
|