#author("2020-01-31T00:42:58+09:00","","")
#author("2020-01-31T02:06:29+09:00","","")
* デフォルトの .htaccess を Apache 2.4 用の設定に変更する [#r8b976c1]

- ページ: [[BugTrack]]
- 投稿者: [[umorigu]]
- 優先順位: 普通
- 状態: 完了
- カテゴリー: その他
- 投稿日: 2020-01-31 (金) 00:06:33
- バージョン: 1.5.2
- リリース予定バージョン: 1.5.3

** メッセージ [#pa9dc75b]
デフォルトで含まれている .htaccess のアクセス制御設定が Apache 2.2 向けの設定になっている。

例 (skin/.htaccess):

 <FilesMatch "\.(skin\.php)$">
         Order allow,deny
         Deny from all
 </FilesMatch>

これを Apache 2.4 での設定に変更する。

例: (skin/.htacces):

 <FilesMatch "\.(skin\.php)$">
   Require all denied
 </FilesMatch>

Apache 2.4 でも mod_access_compat モジュールが有効な環境では2.2の記述で動作する。
であるが、 mod_access_compat は非推奨であり、
また Apache 2.2 自体が 2017年12月にサポート切れになっていることから、
デフォルトは Apache 2.4 のものに変更するべきである。

- http:// httpd.apache.org/#apache-httpd-22-end-of-life-2018-01-01
-- Apache httpd 2.2 End-of-Life 2018-01-01

 As previously announced, the Apache HTTP Server Project has discontinued all 
 development and patch review of the 2.2.x series of releases.
 
 The Apache HTTP Server Project had long committed to provide maintenance 
 releases of the 2.2.x flavor through June of 2017. The final release 2.2.34 was 
 published in July 2017, and no further evaluation of bug reports or security 
 risks will be considered or published for 2.2.x releases.


- https:// httpd.apache.org/docs/2.4/ja/mod/mod_access_compat.html
-- mod_access_compat - Apache HTTP サーバ バージョン 2.4

*** 対象ファイル [#s6d732ab]

 .htaccess
 attach/.htaccess
 backup/.htaccess
 cache/.htaccess
 counter/.htaccess
 diff/.htaccess
 lib/.htaccess
 plugin/.htaccess
 skin/.htaccess
 wiki.en/.htaccess
 wiki/.htaccess

*** Apache 2.2 で 新設定を使った場合の動作 [#uc184fb8]

PukiWiki では主に (内部のファイルにアクセスされないため) 
Require all denied が使われている。

Apache 2.2 でも mod_auzhz_host が存在するため、
denied対象のファイルにアクセスされなければエラーは起きず、PHPも実行される。
例えば index.php にもアクセスでき、PukiWiki 動作に影響はない。

"denied"の対象ファイル、例えば skin/pukiwiki.skin.php にアクセスしようとすると、
Internal Server Error が返される。実際に発生しているエラーは以下のもの。

 configuration error:  couldn't perform authentication. AuthType not set!: /skin/pukiwiki.skin.php

正常系アクセスには影響がないため Apache 2.2 の環境でも結果として問題ない。

--------
- 対応しました commit:2d0e00ee87 -- [[umorigu]] &new{2020-01-31 (金) 00:38:20};

#comment

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Site admin: PukiWiki Development Team

PukiWiki 1.5.4+ © 2001-2022 PukiWiki Development Team. Powered by PHP 8.2.12. HTML convert time: 0.065 sec.

SourceForge