#!/usr/bin/perl ## MT INSTALLER for XREA USERS ## 05/10/21 5:23 AM ## http://www.xrea.com/ http://sb.xrea.com/showthread.php?p=64711#post64711 ## ## Special Thanks ## movabletype.org http://www.movabletype.jp/ ## ユーザー情報(適宜変更してください。) $UID = "sample"; # FTPのアカウント名:例:sample $DBUID = "sample"; # データベースのユーザー名:例:sample $DBPS = "abcdefghijk"; # データベースのパスワード:例:abcdefghijk $USV = "s101.xrea.com"; # サーバー名:例:s101.xrea.com $PATH_HOME = "/virtual/$UID"; $DIR_PUBLIC = "public_html"; ## MT運用ディレクトリ(適宜変更してください。2階層下のディレクトリの例:www.example.com\\/blog) $DIR_MT = "mt"; ## 配布されているtar.gz形式のファイル (バージョンに応じて変更してください。) $FILE_MT_TGZ = "MT-3_2-ja-2[1].tar.gz"; ## 解凍後に展開されるディレクトリ (バージョンに応じて変更してください。) $DIR_MT_TGZ = "MT-3.2-ja-2"; ## 文字コード(EUC-JP / Shift_JIS / UTF-8) EUC-JP以外はサポート対象外 $PUBLISH_CHARSET = "EUC-JP"; &install_mt; ######################################################################################################### ## install_mt ######################################################################################################### sub install_mt(){ $t=time; disp_err("$PATH_HOME/$FILE_MT_TGZ がありません。") unless(-e "$PATH_HOME/$FILE_MT_TGZ"); $SHELL = qq~ cd $PATH_HOME/$DIR_PUBLIC/ rm -rf lang-ja/ $DIR_MT_TGZ/ mv -f $DIR_MT mt_$t tar cfz backup-mt_$t.tgz mt_$t 2>&1 > /dev/null rm -rf mt_$t/ tar xfz $PATH_HOME/$FILE_MT_TGZ 2>&1 > /dev/null cd $PATH_HOME/$DIR_PUBLIC/ mv -f $DIR_MT_TGZ $DIR_MT cd $PATH_HOME/$DIR_PUBLIC/$DIR_MT/ cat mt-config.cgi-original > mt-config.cgi perl -pe 's/http:\\/\\/www.example.com\\/cgi-bin\\/mt\\//http:\\/\\/$UID.$USV\\/$DIR_MT\\//g' mt-config.cgi > mt-config.cgi_;mv -f mt-config.cgi_ mt-config.cgi perl -pe 's/# ObjectDriver DBI::mysql/ObjectDriver DBI::mysql/g' mt-config.cgi > mt-config.cgi_;mv -f mt-config.cgi_ mt-config.cgi perl -pe 's/# Database /Database $DBUID/g' mt-config.cgi > mt-config.cgi_;mv -f mt-config.cgi_ mt-config.cgi perl -pe 's/# DBUser /DBUser $DBUID/g' mt-config.cgi > mt-config.cgi_;mv -f mt-config.cgi_ mt-config.cgi perl -pe 's/# DBPassword /DBPassword $DBPS/g' mt-config.cgi > mt-config.cgi_;mv -f mt-config.cgi_ mt-config.cgi perl -pe 's/# DBHost localhost/DBHost localhost/g' mt-config.cgi > mt-config.cgi_;mv -f mt-config.cgi_ mt-config.cgi perl -pe 's/# StaticWebPath.*/StaticWebPath \\/$DIR_MT\\/mt-static\\//g' mt-config.cgi > mt-config.cgi_;mv -f mt-config.cgi_ mt-config.cgi perl -pe 's/# NoHTMLEntities 1/NoHTMLEntities 1/g' mt-config.cgi > mt-config.cgi_;mv -f mt-config.cgi_ mt-config.cgi perl -pe 's/PublishCharset utf-8/PublishCharset $PUBLISH_CHARSET/g' mt-config.cgi > mt-config.cgi_;mv -f mt-config.cgi_ mt-config.cgi chmod -R 705 $PATH_HOME/$DIR_PUBLIC/$DIR_MT chmod 700 mt-config.cgi lib extlib chmod 0 mt-check.cgi rm -f ../README* ../MT* LICENSE* ls -la ~; open(R,"$SHELL|"); @R = ; close(R); $MSG = qq~
正常に設置しました!


こちらで設定して下さい。
下記初期ユーザー名、パスワードでログインしてください。
Username:Melody
Password:Nelson


カスタマイズ、その他の質問はユーザー掲示板をご活用下さい。 ~; disp_err($MSG); } ######################################################################################################### # エラー表\示 ######################################################################################################### sub disp_err{ local($msg) = $_[0]; print "Content-type: text/html; charset=Shift_JIS\n\n"; print < $msg MSG exit(0); }