Skip to content

MovableType 7の開発環境構築

公式のリポジトリに日本語ドキュメントがあるので、それを見てやればいいが、この手順はvagrantを使うようになっている。

LinuxではDockerを直接使えばいいので、この手順のvagrant mt-devmakeに置き替えて進めるといい。

Terminal window
$ git clone https://github.com/movabletype/mt-dev.git
Cloning ...
$ cd mt-dev
$ cp /path/to/MT7-Rxxxx.zip archive

デフォルトは192.168.58.25で実行される設定になっているが、Dockerを使う場合はlocalhostにする。これはmt-config.cgi-originalmt-config.cgi-localにコピーして編集する。

--- mt-config.cgi-original 2022-03-05 22:43:24.890623836 +0900
+++ mt-config.cgi-local 2022-03-05 23:21:34.944760358 +0900
@@ -12,13 +12,13 @@
################################################################
# The CGIPath is the URL to your Movable Type directory
-CGIPath http://192.168.58.25/cgi-bin/mt/
+CGIPath http://localhost/cgi-bin/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://192.168.58.25/mt-static
+StaticWebPath http://localhost/mt-static
#================ DATABASE SETTINGS ==================
# CHANGE setting below that refer to databases

オプションを与えてもいいが、何度も実行するのは面倒なので、ここで、.envを作る。

ARCHIVE=MT7-Rxxxx.zip
REPO=https://github.com/movabletype/mt-plugin-shared-preview.git
MT_CONFIG_CGI=mt-config.cgi-local

あとは、この状態でmakeすればいい。

Terminal window
make up

http://localhost/cgi-bin/mt/mt.cgi を開くとアクセスできる。

使い終わったら

Terminal window
make down