Drupalで『Files directory Not fully protected 』エラー

昨日に続いてCMS分散の一環でDrupalなるものをインストール。

 

で、『管理セクション』の『現状報告』でDrupalコアの更新状況が最新じゃないので危険、って書いてあるから手動で6.3.1にバージョンアップしました。

 

 

【アップデート手順】
元のsettings.phpを別途保存しておく

6.3.1をDLしてFTPでUPして上書き

保存しておいたsettings.phpをFTPでUPして上書き

ログインしたら念のため1度『管理セクション』の『言語』でjaをいったん削除して、再びjaを追加

 

 

そしたら、Drupalコアは最新になったけど今度は表題のエラー表示が・・・

 

Files directory Not fully protected

 

See https://drupal.org/SA-CORE-2013-003 for information about the recommended .htaccess file which should be added to the sites/default/files directory to help protect against arbitrary code execution.

 

 

Temporary files directory Not fully protected

 

See https://drupal.org/SA-CORE-2013-003 for information about the recommended .htaccess file which should be added to the sites/temp directory to help protect against arbitrary code execution.

 

英語だよ。面倒くさい・・・

 

 

以下、●の【解決策】が解決策を書いた部分です。

 

 

●『Files directory Not fully protected』のエラー

 

最初の『Files directory Not fully protected』に関しては簡単に修正できた。

 

 

【解決策】
sites/default/filesに以下の内容で.htaccessを作成してUP

 

# Turn off all options we don't need.
Options None
Options +FollowSymLinks

 

# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006

# Override the handler again if we're run later in the evaluation list.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003

 

# If we know how to do it safely, disable the PHP engine entirely.

php_flag engine off

# PHP 4, Apache 1.

php_flag engine off

# PHP 4, Apache 2.

php_flag engine off

 

 

●Temporary files directory Not fully protected』のエラー

 

次の『Temporary files directory Not fully protected』がリンク先通りにやってもうまく行かなかったです。

 

 

tmpってフォルダは2箇所あります、たぶん。
/tmp

/public_html/sites/default/files/tmp(こっちは最初からあったか不明です。)

 

リンク先の内容だと /tmp に 先ほどの.htaccessお最初の行に『Deny from all』を追記してUPすればOKって書いてあるけど、その通りやってもエラー表示は消えません。

 

 

【解決策】
1例です。

 

『管理セクション』→『ファイルシステム』で、

 

①テンポラリディレクトリを sites/default/files/tmp に変更する

 

上の画像のように変更したら

②sites/default/files/tmpに以下の内容で.htaccessを作成してUP

 

Deny from all

 

# Turn off all options we don't need.
Options None
Options +FollowSymLinks

 

# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006

# Override the handler again if we're run later in the evaluation list.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003

 

# If we know how to do it safely, disable the PHP engine entirely.

php_flag engine off

# PHP 4, Apache 1.

php_flag engine off

# PHP 4, Apache 2.

php_flag engine off


 

 

以上でエラー表示がなくなりました。

 

 

2つの.htaccessの違いですが

 

最初のFiles directory用の.htaccessの1番上の行に
『Deny from all』を追記したのが
2つ目のTemporary files directory用の.htaccessです。

 

ショップ作成
 
この記事を書いた人

kaimonojyoz

Firefoxはかれこれ15年以上使っていて、Firefoxなしでは生きていけない体になってしまいました笑

 

アクアリウムは海水水槽のサンゴを全滅させた黒歴史からモチベーションがほぼゼロとなり、今に至ります。

 

1番長く生きてるお魚はカクレクマノミとゴールドナゲットマロンで、もうすぐ9年になります。

このページをシェアする
guest
0 Comments
Inline Feedbacks
View all comments