以下のVagrantfileを使用して、PagekitとMySQLをインストールした仮想マシン(Debian Stretch/9.3 )を構築する事ができます。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/debian-9.3"
config.vm.hostname = "db93pagekit"
config.vm.provider :virtualbox do |vbox|
vbox.name = "db93pagekit"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.101", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.101", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
apt-get -y install task-japanese
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
# install mysql
wget https://dev.mysql.com/get/mysql-apt-config_0.8.9-1_all.deb
export DEBIAN_FRONTEND=noninteractive
echo mysql-apt-config mysql-apt-config/enable-repo select mysql-5.7-dmr | sudo debconf-set-selections
dpkg -i mysql-apt-config_0.8.9-1_all.deb
apt-get update
apt-get -y install mysql-server
mysql -uroot -e "CREATE DATABASE pagekit DEFAULT CHARACTER SET utf8;"
mysql -uroot -e "CREATE USER pagekit@localhost IDENTIFIED BY 'pagekit';"
mysql -uroot -e "GRANT ALL PRIVILEGES ON pagekit.* TO 'pagekit'@'localhost';"
mysql -uroot -e "FLUSH PRIVILEGES;"
apt-get -y install apache2 libapache2-mod-php7.0
apt-get -y install php7.0-gd php7.0-json php7.0-mysql php7.0-pdo php7.0-curl php7.0-mbstring
apt-get -y install php7.0-mcrypt php7.0-xml php7.0-zip php7.0-intl
# install pagekit
apt-get -y install unzip
mkdir -p /opt/pagekit
cd /opt/pagekit
wget https://github.com/pagekit/pagekit/releases/download/1.0.13/pagekit-1.0.13.zip
unzip pagekit-*
chown -R www-data:www-data /opt/pagekit
ln -s /opt/pagekit /var/www/html
service apache2 restart
echo 'access http://192.168.55.101/pagekit/'
echo 'db user: pagekit password:pagekit db:pagekit'
SHELL
end
〇Pagekitの初期設定画面1
〇Pagekitの初期設定画面2
〇Pagekitの初期設定画面3
〇Pagekitの画面
○関連情報
・Pagekitに関する他の記事はこちらを参照してください。
0 件のコメント:
コメントを投稿