2018年4月15日日曜日

VagrantでVanilla Forums2.5.1、Percona Serverがインストールされた仮想マシン(Ubuntu16.04)を構築する

Vanilla ForumsはPHP製の掲示板ソフトウェアです。
以下のVagratfileを使用して、Vanilla ForumsとPercona Serverをインストールされた仮想マシン(Ubuntu16.04) を構築する事ができます。
仮想マシン構築後、http://192.168.1.106/vanillaforums/にアクセスして初期設定を行います。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "bento/ubuntu-16.04"
  config.vm.hostname = "ub1604vanillaforums251percona"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "ub1604vanillaforums251percona"
     vbox.cpus = 2
     vbox.memory = 2048
     vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
  end
config.vm.network "private_network", ip: "192.168.55.107", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.107", :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 percona server
export DEBIAN_FRONTEND=noninteractive
echo "percona-server-server-5.7 percona-server-server/root_password password root" | sudo debconf-set-selections
echo "percona-server-server-5.7 percona-server-server/root_password_again password root" | sudo debconf-set-selections
wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb
dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb
apt-get update
apt-get -y install percona-server-server-5.7
mysql -uroot -proot -e "CREATE DATABASE vanillaforums DEFAULT CHARACTER SET utf8mb4;"
mysql -uroot -proot -e "CREATE USER vanillaforums@localhost IDENTIFIED BY 'vanillaforums';"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON vanillaforums.* TO 'vanillaforums'@'localhost';"
mysql -uroot -proot -e "FLUSH PRIVILEGES;"
echo "sql_mode=NO_ENGINE_SUBSTITUTION" >> /etc/mysql/mysql.conf.d/mysqld.cnf
systemctl restart mysql.service

apt-get -y install software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
apt-get -y install apache2 libapache2-mod-php7.1
apt-get -y install php7.1-gd php7.1-json php7.1-mysql php7.1-pdo php7.1-curl php7.1-mbstring
apt-get -y install php7.1-mcrypt php7.1-xml php7.1-zip php7.1-intl

# install vanillaforums
apt-get -y install unzip
wget https://open.vanillaforums.com/get/vanilla-core-2.5.1.zip
unzip vanilla-core-2.5.1.zip
mv vanilla-2.5.1 /opt/vanillaforums
chown -R www-data:www-data /opt/vanillaforums
ln -s  /opt/vanillaforums /var/www/html

service apache2 restart
echo 'access http://192.168.1.107/vanillaforums/'
echo 'db user:vanillaforums  password:vanillaforums  db:vanillaforums'
SHELL
end

〇Vanilla Forumsの初期設定画面


〇Vanilla Forumsの画面


0 件のコメント:

コメントを投稿