以下のVagratfileを使用して、Vanilla ForumsとMySQLをインストールされた仮想マシン(Debian9.3) を構築する事ができます。
仮想マシン構築後、http://192.168.1.105/vanillaforums/にアクセスして初期設定を行います。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/debian-9.3"
config.vm.hostname = "db93vanillaforums"
config.vm.provider :virtualbox do |vbox|
vbox.name = "db93vanillaforums"
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
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 vanillaforums DEFAULT CHARACTER SET utf8;"
mysql -uroot -e "CREATE USER vanillaforums@localhost IDENTIFIED BY 'vanillaforums';"
mysql -uroot -e "GRANT ALL PRIVILEGES ON vanillaforums.* TO 'vanillaforums'@'localhost';"
mysql -uroot -e "FLUSH PRIVILEGES;"
echo "sql_mode=NO_ENGINE_SUBSTITUTION" >> /etc/mysql/mysql.conf.d/mysqld.cnf
#set global SQL_MODE="NO_ENGINE_SUBSTITUTION";
systemctl restart mysql.service
# install php
apt-get -y install apache2 libapache2-mod-php7.0
apt-get -y install php7.0-gd php7.0-json php7.0-mysql php7.0-curl php7.0-mbstring
apt-get -y install php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip
apt-get -y install unzip
# install vanillaforums
apt-get -y install unzip
wget https://open.vanillaforums.com/get/vanilla-core.zip
unzip vanilla-core.zip
mv vanilla-2.5 /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.105/vanillaforums/'
echo 'db user:vanillaforums password:vanillaforums db:vanillaforums'
SHELL
end
〇初期設定の画面
〇Vanilla Forumsの画面
○関連情報
・Vanilla Forumsに関する他の情報はこちらを参照してください。
0 件のコメント:
コメントを投稿