2018年2月26日月曜日

VagrantでEasy!AppointmentsとMySQLがインストールされた仮想マシン(Debian Stretch/9.3)を構築する

Easy!Appointmentsでスケジュールを管理する事ができます。
以下のVagrantfileを使用して、Easy!Appointmentsと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 = "db93easyappointments"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "db93easyappointments"
     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 easyappointments DEFAULT CHARACTER SET utf8;"
mysql -uroot -e "CREATE USER easyappointments@localhost IDENTIFIED BY 'easyappointments';"
mysql -uroot -e "GRANT ALL PRIVILEGES ON easyappointments.* TO 'easyappointments'@'localhost';"
mysql -uroot -e "FLUSH PRIVILEGES;"


# install Easy!Appointments
apt-get -y install apache2 apache2-bin libapache2-mod-php7.0 php7.0-mysql php7.0-mbstring php7.0-xml php7.0-json unzip
mkdir -p /opt/easyappointments
cd /opt/easyappointments
wget https://github.com/alextselegidis/easyappointments/releases/download/1.2.1/easyappointments_1.2.1.zip
unzip easyappointments_1.2.1.zip
sed -i -e "s#http://url-to-easyappointments-directory#http://192.168.55.101/easyappointments/#" /opt/easyappointments/config.php
sed -i -e "s#DB_HOST.*= '';#DB_HOST       = 'localhost';#" /opt/easyappointments/config.php
sed -i -e "s#DB_NAME.*= '';#DB_NAME       = 'easyappointments';#" /opt/easyappointments/config.php
sed -i -e "s#DB_USERNAME.*= '';#DB_USERNAME   = 'easyappointments';#" /opt/easyappointments/config.php
sed -i -e "s#DB_PASSWORD.*= '';#DB_PASSWORD   = 'easyappointments';#" /opt/easyappointments/config.php

chown -R www-data:www-data /opt/easyappointments
ln -s  /opt/easyappointments /var/www/html
service apache2 restart

echo 'access http://192.168.1.101/easyappointments/'

SHELL
end

〇Easy!Appointmentsの初期設定画面


〇Easy!Appointmentsの画面



○関連情報
・Easy!Appointmentsに関する他の記事はこちらを参照してください。

0 件のコメント:

コメントを投稿