以下のVagratfileを使用して、Vanilla ForumsとMySQLをインストールされた仮想マシン(CentOS7.4) を構築する事ができます。
仮想マシン構築後、http://192.168.1.109/vanillaforums/にアクセスして初期設定を行います。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/centos-7.4"
config.vm.hostname = "co74vanillaforums"
config.vm.provider :virtualbox do |vbox|
vbox.name = "co74vanillaforums"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.109", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.109", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
localectl set-locale LANG=ja_JP.UTF-8
# mysqlのインストール
sudo yum -y remove mariadb-libs
yum -y localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
yum -y install yum-utils
yum -y install mysql mysql-devel mysql-server mysql-utilities
sudo systemctl enable mysqld.service
sudo systemctl start mysqld.service
# change password and create users and databases.
chkconfig mysqld on
service mysqld start
export MYSQL_ROOTPWD='Root123#'
export MYSQL_PWD=`cat /var/log/mysqld.log | awk '/temporary password/ {print $NF}'`
mysql -uroot --connect-expired-password -e "SET PASSWORD = PASSWORD('$MYSQL_ROOTPWD');"
export MYSQL_PWD=$MYSQL_ROOTPWD
export MYSQL_ROOTPWD='root'
mysql -uroot --connect-expired-password -e "UNINSTALL PLUGIN validate_password;"
mysql -uroot --connect-expired-password -e "SET PASSWORD = PASSWORD('$MYSQL_ROOTPWD'); FLUSH PRIVILEGES;"
mysql -uroot -proot -e "CREATE DATABASE vanillaforums DEFAULT CHARACTER SET utf8;"
export MYSQL_PWD=$MYSQL_ROOTPWD
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/my.cnf
systemctl restart mysqld.service
# install apache2
yum -y install epel-release
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum -y install --enablerepo=remi,remi-php71 httpd php php-pdo php-mbstring php-mysqli php-gd php-xml php-zip php-json php-mcrypt php-zip php-imagemagick php-intl php-curl
# install vanillaforums
yum -y install unzip
wget https://open.vanillaforums.com/get/vanilla-core.zip
unzip vanilla-core.zip
mv vanilla-2.5 /opt/vanillaforums
chown -R apache:apache /opt/vanillaforums
ln -s /opt/vanillaforums /var/www/html
service httpd restart
echo 'access http://192.168.1.109/vanillaforums/'
echo 'db user:vanillaforums password:vanillaforums db:vanillaforums'
SHELL
end
〇Vanilla Forumsの初期設定画面
〇Vanilla Forumsの画面
○関連情報
・Vanilla Forumsに関する他の情報はこちらを参照してください。
0 件のコメント:
コメントを投稿