2018年3月19日月曜日

VagrantでEasy!AppointmentsとMariaDBがインストールされた仮想マシン(CentOS7.4)を構築する

Easy!Appointmentsでスケジュールを管理する事ができます。
以下のVagrantfileを使用して、Easy!AppointmentsとMariaDBをインストールした仮想マシン(CentOS7.4)を構築する事ができます。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "bento/centos-7.4"
  config.vm.hostname = "co74easyappointmentsmariadb"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "co74easyappointmentsmariadb"
     vbox.cpus = 2
     vbox.memory = 2048
     vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
  end
config.vm.network "private_network", ip: "192.168.55.104", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.104", :netmask => "255.255.255.0"
  config.vm.provision "shell", inline: <<-SHELL
localectl set-locale LANG=ja_JP.UTF-8

# install mariadb
yum -y install mariadb mariadb-server
sudo systemctl enable mariadb.service
sudo systemctl start mariadb.service

# change password and create users and databases.
mysql -uroot -e "SET PASSWORD = PASSWORD('root'); FLUSH PRIVILEGES;"
mysql -uroot -proot -e "CREATE DATABASE easyappointments DEFAULT CHARACTER SET utf8;"
mysql -uroot -proot -e "CREATE USER easyappointments@localhost IDENTIFIED BY 'easyappointments';"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON easyappointments.* TO 'easyappointments'@'localhost';"
mysql -uroot -proot -e "FLUSH PRIVILEGES;"

# install apache2
yum -y install --enablerepo=remi,remi-php71 httpd php php-devel php-mbstring php-pdo php-mysqlnd php-gd php-xml php-zip
sed -i -e 's#;date.timezone =#date.timezone="Asia/Tokyo"#' /etc/php.ini

# install Easy!Appointments
mkdir -p /opt/easyappointments
cd /opt/easyappointments
yum -y install unzip
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.104/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 apache:apache /opt/easyappointments
ln -s  /opt/easyappointments /var/www/html
service httpd restart

echo 'access http://192.168.1.104/easyappointments/'
SHELL
end

〇Easy!Appointmentsの初期設定画面


〇Easy!Appointmentsの画面



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

0 件のコメント:

コメントを投稿