ウェブアプリ実行環境 > 自宅 ubuntu 上に MovableType を立ち上げる
2008.07.15
2008.11.07 全面書き替え
手順
1.自宅 ubuntu にウェブアプリ(php、perl)の実行環境をつくる を参考にして自宅の ubuntu8.04 にローカルなウェブアプリ開発環境をととのえる。
2.MovableType のダウンロード&インストール
ア)/var/www/ の下に ディレクトリ MMT をつくる
イ)日本語サイトから最新バージョン MT-4.22-ja.zip をダウンロードし、ファイルマネジャで解凍する
(以下必要なら root権限で。 端末から $ sudo nautilus でファイルマネジャを立ち上げ、必要ファイルをエディタで修正・保存する。)
ウ)解凍した中の MT-4.22-ja を /var/www/MMT 直下に貼り付け、MT とリネーム
3.設定(MySQL を利用する場合)
(A)MySQL の設定
・端末から、$ mysql -u root -p エンター のあと
インストール時に設定したパスワードを入力すると、プロンプトが変わる
・mysql>create database dbmt; エンター (dbmt は任意の名前)
・mysql>show databases; エンター で一覧表が出る、dbmtがあればOK.
(B)Movable Type の設定
ア)/var/www/MMT/MT の中の mt-config.cgi-original を 別名 mt-config.cgi でコピー生成
イ)mt-config.cgi を次のように改変・保存する
*****(引用開始)********
## Movable Type configuration file ##
## ##
## This file defines system-wide settings for Movable Type ##
## In total, there are over a hundred options, but only those ##
## critical for everyone are listed below. ##
## ##
## Information on all others can be found at: ##
## http://www.sixapart.jp/movabletype/manual/3.3/config
################################################################
##################### REQUIRED SETTINGS ########################
################################################################
# The CGIPath is the URL to your Movable Type directory
CGIPath /MMT/MT/ (← 変 更 )
# The StaticWebPath is the URL to your mt-static directory
# Note: Check the installation documentation to find out
# whether this is required for your environment. If it is not,
# simply remove it or comment out the line by prepending a "#".
#StaticWebPath http://www.example.com/mt-static (←コメントアウト)
#================ DATABASE SETTINGS ==================
# REMOVE all sections below that refer to databases
# other than the one you will be using.
(←以下必要なもの以外は削除。今回はデータベースに MySQL を使用)
##### MYSQL #####
ObjectDriver DBI::mysql
Database dbmt (← MySQL に設定済みのデータベース名にする)
DBUser root
DBPassword パスワード (← MySQL に設定済みのパスワード)
DBHost localhost
******(引用おわり)************
ウ)エディターで mt-check.cgi や mt.cgi などの先頭行が #!/usr/bin/perl -w あるいは、#!/usr/bin/perl -- となっていることを確認する(perlアイコンの所在場所に一致のこと)。
4.設定(SQLite2 を利用する場合)
(A)SQLite2 の設定は不要
(B)Movable Type の設定
ア)/var/www/MMT/MT の直下にディレクトリ db をつくる
イ)/var/www/MMT/MT の中の mt-config.cgi-original を 別名 mt-config.cgi でコピー生成
ウ)mt-config.cgi を次のように改変・保存する
*****(引用開始)********
## Movable Type configuration file ##
## ##
## This file defines system-wide settings for Movable Type ##
## In total, there are over a hundred options, but only those ##
## critical for everyone are listed below. ##
## ##
## Information on all others can be found at: ##
## http://www.sixapart.jp/movabletype/manual/3.3/config
################################################################
##################### REQUIRED SETTINGS ########################
################################################################
# The CGIPath is the URL to your Movable Type directory
CGIPath /MMT/MT/ (← 変 更 )
# The StaticWebPath is the URL to your mt-static directory
# Note: Check the installation documentation to find out
# whether this is required for your environment. If it is not,
# simply remove it or comment out the line by prepending a "#".
#StaticWebPath http://www.example.com/mt-static (←コメントアウト)
#================ DATABASE SETTINGS ==================
# REMOVE all sections below that refer to databases
# other than the one you will be using.
(←以下必要なもの以外は削除。今回はデータベースに SQLite2 を使用)
UseSQLite2 1 (←1行追加 )
##### SQLITE #####
ObjectDriver DBI::sqlite
Database db/sqlitedb (←一部変更)
******(引用おわり)************
エ)エディターで mt-check.cgi や mt.cgi などの先頭行が #!/usr/bin/perl -w あるいは、#!/usr/bin/perl -- となっていることを確認する(perlアイコンの所在場所に一致のこと)。
5.端末より パーミッション指定(大雑把だが以下のとおり、入力は↑キー利用が便利)
$ sudo chmod a+rwx /var/www/MMT/MT
$ sudo chmod a+rwx /var/www/MMT/MT/*
$ sudo chmod a+rwx /var/www/MMT/MT/*/*
$ sudo chmod a+rwx /var/www/MMT/MT/*/*/*
$ sudo chmod a+rwx /var/www/MMT/MT/*/*/*/*
$ sudo chmod a+rwx /var/www/MMT/MT/*/*/*/*/* (この操作をwarningが出るまでやる)
6.ここで念のため、端末に
$ sudo /etc/init.d/apache2 restart
または、
$ sudo apache2ctl restart エンター
7.ブラウザ起動、アドレス欄に http://localhost/MMT/MT エンター
以下画面指示に従う。
(最初は mt-check.cgi おわったら、ブラウザで戻る)
(ログインすると、mt.cgi が起動。初期画面入力項目を別紙にメモすること。)
(以下略)