CentOS 64bit へのrpmforge追加をして、MTOS用Perl環境構築するには次のようにします。
$ sudo rpm -Uvh rpmforge-release-0.5.2-1.el5.rf.x86_64.rpm
$ sudo sed -i 's/enabled = 1/enabled = 0/g' /etc/yum.repos.d/rpmforge.repo
てもとの環境では、次のインストールが必要でした。mysql-server や mysql はインストール済みとします。
perl-Archive-Tar \
perl-Archive-Zip \
perl-Class-DBI-mysql \
perl-Crypt-DSA \
perl-Crypt-SSLeay \
perl-Digest-SHA1 \
perl-Cache \
perl-GD \
perl-HTML-Parser \
perl-IO-Compress-Zlib \
perl-IPC-Run \
perl-Mail-Sendmail \
perl-XML-Atom \
perl-XML-Parser \
ImageMagick-perl
ライブラリが動かないときは下記のような感じで確認すればよいようです。
MTOS-5.04-ja.zip をMTOSのサイトからダウンロードして展開(ここでは /var/www/mtos/MTOS-5.04-ja)。SELinuxを有効にしている場合は、次のような対応も必要。
$ sudo chcon system_u:object_r:httpd_sys_content_t:s0 /var/www/mtos/MTOS-5.04-ja/
$ sudo chcon -R system_u:object_r:httpd_sys_script_rw_t:s0 /var/www/mtos/MTOS-5.04-ja/mt-static
コンソールで、「mysql -u root」などとして、MySQLへ接続してから、下記でDB作成とアカウント情報登録。
GRANT all privileges ON mtos5.* TO mtos5@localhost IDENTIFIED BY 'mtos5dbadmin';
mt-config.cgi については次のような感じで設定。sendmailコマンドなどは環境によって変わります。
#AdminCGIPath https://localhost/mtos/
StaticWebPath /mtos/mt-static
##### MYSQL #####
ObjectDriver DBI::mysql
Database mtos5
DBUser mtos5
DBPassword mtos5dbadmin
DBHost localhost
DefaultLanguage ja
MailEncoding ISO-2022-JP
NoPublishMeansDraft 1
ShowIPInformation 1
#======== MAIL =======================
SMTPServer localhost
SendMailPath /usr/lib/sendmail
MailEncoding ISO-2022-JP
/etc/httpd/conf/httpd.conf へは次のような指定を最後の行へ追加。
/etc/httpd/conf.mtos/mtos.conf の内容は次のようにする。
Alias /mtos/ "/var/www/mtos/MTOS-5.04-ja/"
<Directory "/var/www/mtos/MTOS-5.04-ja/">
Options -Indexes FollowSymLinks ExecCGI
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
</Directory>
ここまで用意できたら、http://localhost/mtos/mt.cgi へアクセス。mt-check.cgi でチェック後、問題なければインストール開始。
追記:もし、cgiファイルへアクセスしても実行がされない場合は、/etc/httpd/conf/httpd.confで「AddHandler cgi-script .cgi」が有効になっているかを確認しましょう。
関連書籍: