先日 さくら VPS で無料 SSL 証明書 StartSSL を使う ように設定しましたので、MediaWiki のログインを SSL で行うように設定してみます。
SecurePages という Extension を導入しました (MediaWiki 1.19)。ダウンロードは git
コマンドで。
$ cd /path/to/wiki/extensions $ git clone http://git.fsinf.at/mediawiki/SecurePages.git SecurePages
wiki/LocalSettings.php
の最後の行に以下を加えます。
require_once ( "$IP/extensions/SecurePages/SecurePages.php" ); $wgSecurePages = array( -1 => array( 'UserLogin', 'Preferences', 'ChangePassword', 'ログイン', '個人設定', 'パスワードの変更'), );
ページソースのリンクなどに http
が含まれると Chrome では、
Your connection to someWebsite is encrypted with 256-bit encryption. However, this page includes other resources which are not secure. These resources can be viewed by others while in transit, and can be modified by an attacker to change the behaviour of the page.
のメッセージが出るようです (cf. Partial SSL in Chrome)。そこで同じく LocalSettings.php
の一部を次のように書き換えました (はじめは http://mysite.com
としていました)。
## The protocol and server name to use in fully-qualified URLs $wgServer = "//mysite.com.";
これで「ログイン」画面等セキュアであるべきページは HTTPS にリダイレクトされるようになります。どのような動作かは こちらの Wiki のログイン画面へ進んで確認してみて下さい。
ちなみに、この Wiki の名前につけた「Bauddha」とは、サンスクリット語で「仏教徒の」というほどの意味ですが、作成したもののまだまったく手を付けていません。自分の仏教の勉強用のノートに使おうと考えているのですが…