Apache2.2和Apache2.4中httpd.conf設定檔 許可權的異同

來源:互聯網
上載者:User

標籤:http   mmap   開啟   span   socket   xxx   apache   UI   ssl   

Windows環境從Apache2.2改成Apache2.4後httpd.conf中的設定異同。

1、許可權設定方式變更

2.2使用Order Deny / Allow的方式,2.4改用Require

apache2.2:

Order deny,allowDeny from all

apache2.4:

Require all denied

此處比較常用的有如下幾種:

Require all denied

Require all granted

Require host xxx.com

Require ip 192.168.1 192.168.2

Require local

注意:若有設定在htaccess檔案中的也要修改

2、設定日誌紀錄方式變更

RewriteLogLevel 指令改為 logLevel

LOGLEVEL設定第一個值是針對整個Apache的預設等級,後方可以對指定的模組修改此模組的日誌記錄等級

比如:

LogLevel warn rewrite: warn

3、Namevirtualhost 被移除

4、需載入更多的模組

開啟Gzip在apache2.2中需載入mod_deflate,apache2.4中需載入mod_filter和mod_deflate

開啟SSL在apache2.2中需載入mod_ssl,apache2.4中需載入mod_socache_shmcb和mod_ssl

5、在windows環境建議的設定

  EnableSendfile Off

EnableMMAP Off

當Log日誌出現AcceptEx failed等錯誤時建議設定

AcceptFilter http noneAcceptFilter https none

說明:Win32DisableAcceptEx在apache2.4中被AcceptFilter None取代

6、Listen設定的調整

以443為例,不可以只設定Listen 443

會出現以下錯誤:

(OS 10048)一次只能用一個通訊端地址(通訊協定/網路位址/串連) : AH00072: make_sock: could not bind to address [::]:443

(OS 10048)一次只能用一個通訊端地址(通訊協定/網路位址/串連) : AH00072: make_sock: could not bind to address 0.0.0.0:443

AH00451: no listening sockets available, shutting down

AH00015: Unable to open logs

因此需指定監聽的IP,可設定多個

例如:

Listen 192.168.2.1:443Listen 127.0.0.1:443

Apache2.2和Apache2.4中httpd.conf設定檔 許可權的異同

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.