仮想マシン構築後、ブラウザからhttp://192.168.55.104/mybb/にアクセスして初期設定を行います。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/centos-7.4"
config.vm.hostname = "co74mybb"
config.vm.provider :virtualbox do |vbox|
vbox.name = "co74mybb"
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
# 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-config-manager --disable mysql57-community
yum-config-manager --enable mysql56-community
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 mybb DEFAULT CHARACTER SET utf8;"
export MYSQL_PWD=$MYSQL_ROOTPWD
mysql -uroot -proot -e "CREATE USER mybb@localhost IDENTIFIED BY 'mybb';"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON mybb.* TO 'mybb'@'localhost';"
mysql -uroot -proot -e "FLUSH PRIVILEGES;"
# 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-devel php-mbstring php-pdo php-mysqlnd php-gd php-xml php-zip
# install mybb
wget https://resources.mybb.com/downloads/mybb_1813.zip
yum -y install unzip
unzip mybb_1813.zip
mv Upload /opt/mybb
chown -R apache:apache /opt/mybb
ln -s /opt/mybb /var/www/html
service httpd restart
echo 'access http://192.168.55.104/mybb/';
echo 'db user: mybb password:mybb db:mybb'
SHELL
end
○MyBB初期設定画面1
○MyBB初期設定画面2
○MyBB初期設定画面3
○MyBB初期設定画面4
○MyBB初期設定画面5
○MyBB初期設定画面6
○MyBB初期設定画面7
○MyBB初期設定画面8
○MyBB初期設定画面9
○MyBB管理者画面
○MyBB画面
0 件のコメント:
コメントを投稿