2018年2月17日土曜日

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

Easy!Appointmentsでスケジュールを管理する事ができます。
以下のVagrantfileを使用して、Easy!AppointmentsとMySQLをインストールした仮想マシン(Ubuntu16.04)を構築する事ができます。
構築後、ブラウザからhttp://192.168.55.105/easyappointments/にアクセスします。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "bento/ubuntu-16.04"
  config.vm.hostname = "ub1604easyappointments"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "ub1604easyappointments"
     vbox.cpus = 2
     vbox.memory = 2048
     vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
  end
config.vm.network "private_network", ip: "192.168.55.105", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.105", :netmask => "255.255.255.0"
  config.vm.provision "shell", inline: <<-SHELL
# update packages
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade

# install mysql
echo "mysql-server-5.7 mysql-server/root_password password root" | sudo debconf-set-selections
echo "mysql-server-5.7 mysql-server/root_password_again password root" | sudo debconf-set-selections
apt-get -y install mysql-server-5.7
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 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.105/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.105/easyappointments/'
SHELL
end

〇Easy!Appointmentsの初期設定画面


〇Easy!Appointmentsの画面



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

0 件のコメント:

コメントを投稿