オニオンソード!!

SE&ビジネスパーソンとしてお勉強中なブログ

DebianでMovableTypeインストール [Debian][Apache2][MovableType4.1]

2008/02/16 Sat [Edit]

目標:MovableTypeをインストール

Debian GNU/Linux 3.1(coLinux)
Apache2.0.63
MovableType4.1

参考:Movable Type 4 ドキュメント

1.MovableTypeをGet

Six Apart - Movable Type のライセンスと購入について

個人ライセンス(無償)からDL手続き。
メアド登録して、ダウンロード認証キー取得

ダウンロード(MT-4_1-ja.zip)




2.ディレクトリ作成


以下のようにディレクトリを作成します。

ディレクトリの構成
種類 ディレクトリパス URL
アプリケーションディレクトリ /usr/local/apache2/cgi-bin/mt http://192.168.20.20/cgi-bin/mt/
スタティックディレクトリ /usr/local/apache2/htdocs/mt-static http://192.168.20.20/mt-static
ブログディレクトリ /usr/local/apache2/htdocs/blog http://192.168.20.20/blog/
データベースディレクトリ /home/onion/mtdb  

ダウンロードしたパッケージ(MT-4_1-ja.zip)を解凍します。
mt-static ディレクトリのすべてのファイルを作成したスタティックディレクトリにアップロードします。
mt-static ディレクトリ以外の残りのファイルを作成したアプリケーションディレクトリにアップロードします。

アプリケーションディレクトリ内のスクリプト (拡張子が cgi のファイル) の権限を755 に設定します。
ブログディレクトリとデータベースディレクトリの権限を777に設定します。


3.システムチェック用スクリプト(mt-check.cgi)実行

http://192.168.20.20/cgi-bin/mt/mt-check.cgi

Data Storage Modulesが一個も入っていませんでした。
ということで、SQLiteをインストールしてみます。


---------------------------------------------------------------
◆SQLiteインストール
 参考:SQLite Home Page


CPANシェルを使って、CPANからDBD::SQLITEをインストールします。

CPANについては、以下を参考に。
CPAN (Comprehensive Perl Archive Network)とは: - IT用語辞典バイナリ
Techknow Movable Type: CPANモジュールのインストール方法


<;準備>
 wgetインストール。CPANシェルで必要になります。
  参考:Debian -- etch の wget パッケージに関する詳細

# apt-get install wget

 その他:Lynx (ウェブブラウザ) - Wikipedia


(1)cpanセットアップ
# cpan

/etc/perl/CPAN/Config.pm initialized.

CPAN is the world-wide archive of perl resources. It consists of about
100 sites that all replicate the same contents all around the globe.
Many countries have at least one CPAN site already. The resources
found on CPAN are easily accessible with the CPAN.pm module. If you
want to use CPAN.pm, you have to configure it properly.

If you do not want to enter a dialog now, you can answer 'no' to this
question and I'll try to autoconfigure. (Note: you can revisit this
dialog anytime later by typing 'o conf init' at the cpan prompt.)

Are you ready for manual configuration? [yes]


手動でコンフィグするか?と聞かれるのでnと答えてオートでコンフィグします。

# Where is your unzip program? []

Where is your make program? [/usr/bin/make]

Where is your lynx program? [/usr/bin/lynx]

Where is your wget program? [/usr/bin/wget]

Warning: ncftpget not found in PATH
Where is your ncftpget program? []

Warning: ncftp not found in PATH
Where is your ncftp program? []


Parameters for the 'make install' command?
Typical frequently used setting:

UNINST=1 to always uninstall potentially conflicting files

Your choice: []


(2)cpan 設定項目の確認

cpan> o conf


(3)cpan 設定の変更
 設定を変更するには、o conf コマンドに続けて 項目名 値 の書式で入力します。
cpan> o conf unzip /bin/gunzip

urllist (モジュールのソースアーカイブをダウンロードするサーバのリスト) のようにひとつの項目に複数の値リストをもつものの場合

cpan> o conf urllist push ftp://ftp.cpan.jp/
と push オプションで追加します。逆にリストから値を削除するには

cpan> o conf urllist pop
と pop オプションを使います。


(4)urllistをセット
CPANの接続先を以下のURLから確認
CPAN/SITES

cpan> o conf urllist push ftp://ftp.u-aizu.ac.jp/pub/CPAN
cpan> o conf urllist push ftp://ftp.kddilabs.jp/CPAN/
cpan> o conf urllist push http://ftp.nara.wide.ad.jp/pub/CPAN/
cpan> o conf urllist push ftp://ftp.nara.wide.ad.jp/pub/CPAN/
cpan> o conf urllist push ftp://ftp.dti.ad.jp/pub/lang/CPAN/
cpan> o conf urllist push ftp://ftp.ring.gr.jp/pub/lang/perl/CPAN/
cpan> o conf urllist push http://ftp.yz.yamagata-u.ac.jp/pub/lang/cpan/
cpan> o conf urllist push ftp://ftp.yz.yamagata-u.ac.jp/pub/lang/cpan/


(5)commit
commit してはじめて反映されます
cpan> o conf commit


(6)SQLiteをインストール
cpan> install DBD::SQLite

DBIが必要だったらしく、先に入れろ言われる。素直にyでDBI入れる。
Writing /usr/local/lib/perl/5.8.4/auto/DBI/.packlist
Appending installation info to /usr/local/lib/perl/5.8.4/perllocal.pod
/usr/bin/make install -- OK

DBIは入ったようです。


Running make for M/MS/MSERGEANT/DBD-SQLite-1.14.tar.gz
Is already unwrapped into directory /root/.cpan/build/DBD-SQLite-1.14

CPAN.pm: Going to build M/MS/MSERGEANT/DBD-SQLite-1.14.tar.gz

cp lib/DBD/SQLite.pm blib/lib/DBD/SQLite.pm
/usr/bin/perl /usr/share/perl/5.8/ExtUtils/xsubpp -typemap /usr/share/perl/5.8/ExtUtils/typemap SQLite.xs > SQLite.xsc && mv SQLite.xsc SQLite.c Cannot open 'SQLite.xsi': そのようなファイルやディレクトリはありません in SQLite.xs, line 80
make: *** [SQLite.c] エラー 1
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make

なんか失敗しました。

一度cleanしてやりなおし。

cpan> clean DBD::SQLite
cpan> install DBD::SQLite

Installing /usr/local/lib/perl/5.8.4/DBD/SQLite.pm
Installing /usr/local/man/man3/DBD::SQLite.3pm
Writing /usr/local/lib/perl/5.8.4/auto/DBD/SQLite/.packlist
Appending installation info to /usr/local/lib/perl/5.8.4/perllocal.pod
/usr/bin/make install -- OK


今度は上手くいきました。
DBIを先にインストールしておくことをお勧めします。


------------------------------------------------------

もう一度mt-check

http://192.168.20.20/cgi-bin/mt/mt-check.cgi

DBI
Your server has DBI installed (version 1.602).

DBD::SQLite
Your server has DBD::SQLite installed (version 1.14).

OK


4.環境設定(mt-config.cgiの編集)

参考:環境設定ファイル mt-config.cgi の設定 | Movable Type 4 ドキュメント

mt-config.cgi-originalをコピーしてmt-config.cgiを作成
cd /usr/local/apache2/cgi-bin/mt/

cp mt-config.cgi-original mt-config.cgi

mt-config.cgiを編集
CGIPath http://192.168.20.20/cgi-bin/mt/
StaticWebPath http://192.168.20.20/mt-static
##### SQLITE #####
ObjectDriver DBI::sqlite
Database /home/onion/mtdb/mt.db
/home/onion/mtdb

もう一度システムチェック
http://192.168.20.20/cgi-bin/mt/mt-check.cgi
Movable Type System Check Successful
You're ready to go! Your server has all of the required modules installed; you do not need to perform any additional module installations. Continue with the installation instructions.

設定完了


5.管理画面

http://192.168.20.20/cgi-bin/mt/mt.cgi

以下略。
MTの設定は、他所を参考に行ってください。
ってことで、完了!


※ MT3のログをMT4に移行してみた
インポート
 SystemOverView→Tools→import
パブリッシング
 Manage Entries → PublishSite(更新マークぽいアイコン)

記事とかコメントとか問題なく移行できましたが、テンプレートの移行が上手くいきませんでした。。

この辺がうまくいかない。カテゴリーが表示されません。
<MTCategories>
<a href="<$MTCategoryArchiveLink$>"><$MTCategoryDescription$></a> |
</MTCategories>

まぁ、MT4は気が向いたら調べるかも。


Prev
PHP5のインストール失敗 [Debian][PHP]
Top
オニオンソード!!
Next
Apache上でcgiを動かす [Debian][Apache2]

Comments

 
 
 
 
 
 
 
  非公開コメント
 

Track Backs

TB URL 

Top
オニオンソード!!

ブログ内検索

カテゴリー

最近の記事

月別アーカイブ

最近のコメント

最近のトラックバック

RSSリンク

Twitter

プロフィール

Author:グリオニ
1975年 東京生まれ 男
仕事:SE

社員数10人ほどの小さな会社で一生懸命働いています。
ここ3年ほどは、金融系のお仕事が多いです。

週末は土手で草サッカー。

iKnow

Dictationバッジ

合わせて

あわせて読みたいブログパーツ

なかのひと

Amazon商品一覧【カテゴリ別】