Movable Typeのインストール

ここは、blogツールであるMovable Typeを使ってどんどんblogろう!というページである。


– 広告 –

 

perlの確認

Movable Typeは、perlのバージョン5.004_04以降で動いている。そのため、perlのバージョンとインストール先を確認しておく。

バージョン

perlのバージョンの確認は、

perl -v

で行える。このコマンドで表示される情報の先頭部分にバージョン番号が書かれている。この番号が5.0より大きな数字であればよい。

インストール先

perlのインストール先は、

which perl

で確認できる。このインストール場所はMovable Typeで使うスクリプトファイルに指定する。

Movable Typeの入手

インストール先

まずはMovable Typeをインストールする場所を決めておく。これは任意に決めてよい。ここでは、/usr/local/MovableTypeに入れることにする。

cd /usr/local
mkdir MovableType
cd MovableType

最新版のダウンロード

MovableTypeのサイトからダウンロードできる。
ここの、Getting StartedDownload Movable Type Version 2.64からMT-2.64-full-lib.tar.gzを/usr/local/MovableTypeにダウンロードする。

このファイルをダウンロードするには、いくつかの選択肢と指定する項目がある。

項目選択肢や指定するもの
Select the type of distribution you wish to download.Full Version, with Libralies
Select the decompression method that your computer supports.GZipped TAR
Name (Required):名前が要る
Email address (Required):e-mailアドレスを指定
Would you like to join MT-users, ……Movable Typeからのアナウンスを欲しいときはYesを選択する
I accept the terms of this license agreement
I do not accept the terms of this license agreement
I accept the terms ……を選択

ダウンロードファイルの伸長

ダウンロードしたファイルを伸張する。

tar zxvf MT-2.64-full-lib.tar.gz

apacheの設定

環境ファイルの設定

Movable Typeの用意ができたのでapacheの環境ファイルにMovable Type用の設定を追加する。環境ファイルの編集はrootで行う。

su
cd /usr/local/apache/conf

httpd.confの任意の場所(Alias /icons/ “/usr/local/apache2/icons/”とある行の下辺り)に、以下の行を追加する。

Alias /blog/ “/usr/local/MovableType/MT-2.64-full-lib/”

<Directory “/usr/local/MovableType/MT-2.64-full-lib”>
Options ExecCGI
AddHandler cgi-script .cgi
</Directory>

これらの行は次の意味を持つ。

意味
Alias /blog/ “/usr/local/MovableType/MT-2.64-full-lib/”http://xxx/blog/
とすれば、Movable Type本体にアクセスできるようになる。

apacheの再起動

httpd.confを更新したときはapacheの再起動をする。

cd /usr/local/apache2/bin
./apachectl configtest

と入力して、

Syntax OK

と出ればよし。続けて、

./apachectl stop
./apachectl start

環境の設定と、場合によってはDBのインストール(長い!!)

Movable Typeでは、書き込んだ内容をデータベースに溜めていく。デフォルトでは、DB_Fileと呼ばれるものを使う。これはBerkeley DBというデータベースエンジンをperlで動作させるものである。ただし環境によってはBerkeley DBやDB_Fileがインストールされていないかもしれない。Movabel Typeにはデータベースエンジンがインストールされているかどうかのチェック機能がある。

Movable Typeの設定

まずはMovable Typeをインストールしたディレクトリに移る。

cd /usr/local/MovableType/MT-2.64-full-lib

mt.cfgの設定

mt.cfgは、Movable Type全体の環境設定ファイルである。このファイルは以下の行を設定する。

CGIPath http://192.168.1.7/blog/
DataSource /usr/local/MovableType/db

これらの行の設定値は以下の通りである。

項目設定値
CGIPathインストールしたMovable TableのURL
DataSourceデータベースファイルの格納先

ディレクトリ生成

DataSourceで指定したディレクトリを作り、パーミッションを変更する。

cd /usr/local/MovableType
mkdir db
chmod 777 db

データベースエンジンのチェック

ブラウザから、
http://192.168.1.7/blog/mt-check.cgi
とすると、Movable Tyepに必要なモジュール等がインストールされているかどうかをチェックしてくれる。

CHECKING FOR DATA STORAGE MODULES: The following modules are used by the different data storage options in Movable Type. In order run the system, your server needs to have at least one of these modules installed.

に続けて、

DB_File… Your server has DB_File installed (version 1.806).

と出れば、DB_Fileはインストールされている。

DB_File… Your server does not have DB_File installed. DB_File is required if you want to use the Berkeley DB/DB_File backend. Please consult the installation instructions for help in installing DB_File.

と出れば、DB_Fileはインストールされていない。DB_Fileをインストールする。DB_Fileのインストールが終了したらブラウザからもう一度
http://192.168.1.7/blog/mt-check.cgi

DB_File…
Your server has DB_File installed (version 1.806).

とでればOK。

Movable Tyepの初期化

ブラウザから
http://192.168.1.7/blog/mt-load.cgi
とすると、

Loading initial data into system…
Loading weblog…
Loading author…
Loading permissions…
Loading templates…
Mapping templates to blog archive types…
Mapping template ID ’11’ to ‘Daily’
Mapping template ID ’11’ to ‘Weekly’
Mapping template ID ’11’ to ‘Monthly’
Mapping template ID ’12’ to ‘Category’
Mapping template ID ’13’ to ‘Individual’

Done loading initial data! All went well.

VERY IMPORTANT NOTE:

Now that you have run mt-load.cgi, you will never need to run it
again. You should now delete mt-load.cgi from your webserver.

FAILURE TO DELETE mt-load.cgi INTRODUCES A MAJOR SECURITY RISK.

画面上にと表示されれば、初期化は終了。
最後の数行は、mt-load.cgiが残っていると、誰かが初期化するかもしれないので消しておくこと意味。

使ってみる

ログイン

http://192.168.1.7/blog/mt.cgi
でUsernameとPasswordを聞いてくるので

  • UsernameにMelody
  • PasswordにNelson

と入力してログインできればOK。

日本語化

Movable Typeは標準状態では日本語の表示ができない。ここでは、みらの氏のblogで公開している日本語化パッチを使用して日本語を表示できるようにする。日本語化は作業量が多いので別ページにまとめてある。


URLの指定

ここまでで、Movable Typeを使えるようになったが、現在ブラウザで指定するURLは、

http://192.168.1.7/blog/mt.cgi

となっている。これを

http://192.168.1.7/blog/

と、ファイルを指定しなくても良いようにapacheの環境ファイルを編集しておく。
これは、apacheの設定で編集した部分に変更を加える。

su
cd /usr/local/apache/conf

現在、Movable Typeに関する記述は以下のようになっている。

Alias /blog/ “/usr/local/MovableType/MT-2.64-full-lib/”

<Directory “/usr/local/MovableType/MT-2.64-full-lib”>
Options ExecCGI
AddHandler cgi-script .cgi
</Directory>

この、AddHandlerの行の次に、

DirectoryIndex mt.cgi

を追加する。

Alias /blog/ “/usr/local/MovableType/MT-2.64-full-lib/”

<Directory “/usr/local/MovableType/MT-2.64-full-lib”>
Options ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex mt.cgi
</Directory>

こーゆーふうになればOK。apacheの再起動を忘れずに…

cd /usr/local/apache2/bin
./apachectl configtest

と入力して、

Syntax OK

と出ればよし。続けて、

./apachectl stop
./apachectl start

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です