Drupal 導入記(アップグレード:7.23->7.24)

Drupal 7.23 -> 7.24

セキュリティーホールが見つかった。やばいのでアップグレードする。モジュールは、ワン・クリックで更新できるが Core はちょっと面倒くさい。

1)バックアップ
1−1)まずは全ディレクトリーのバックアップ

$ cd <drupal top>/..
$ sudo tar -zcvf <backup dir>/druapl7.tar.gz <druap top>

1−2)drupal 用のデータベースのバックアップ

こちらは、Home » Administration » Configuration » System で "Quick Backup" する。

2)サイトをメンテモードにする

Home » Administration » Configuration » Development » Maintenance mode 
"Put site into maintenance mode" にチェックをいれ、configuration を保存する。

3)Drupal ディレクトリーをクリーンアップ(sites 以外の削除)

$ cd <drupal top>
$ sudo for i in `ls | grep -v sites`; do rm -rf $i; done

4)最新 drupal のインストール

$ cd <drupal top>
$ sudo wget http://drupal.org/files/projects/drupal-7.24.tar.gz
$ sudo tar -zxvf drupal-7.24.tar.gz
$ sudo mv drupal-7.24/* .

5)Core file の変更

$ cd <drupal top>
$ diff -u drupal-7.24/.htaccess .htaccess

マルチサイトのカスタマイズがあったので昔のものをそのまま使用

今回特別の変更として .htaccess の修正がある(drupal team 推奨、3カ所)

$ cat dot.htaccess
# 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
<Files *>
 # Override the handler again if we're run later in the evaluation list.
 SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>
 
# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
  php_flag engine off
</IfModule>
$ sudo cp -p dot.htaccess <drupal top>/sites/default/files/.htaccess
$ sudo cp -p dot.htaccess /tmp/.htaccess
$ sudo cp -p dot.htaccess <backup directory>/.htaccess
 

6)データベースの更新

http://www-jlc.kek.jp/jlc/update.php にアクセス、指示に従い更新

7)Status の確認

Administration » Reports » Status
エラーがないことを確認

8)settings.php の確認

$update_free_access が FALSE になっていることを確認

9)メンテナンスモードの解除

Home » Administration » Configuration » Development » Maintenance mode 
"Put site into maintenance mode" のチェックをはずし、configuration を保存する。


 

Subgroup: