〇BookStackの画面
仮想マシン構築後、ブラウザからhttp://192.168.1.103/にアクセスします。デフォルトユーザ/パスワードはadmin@admin.com/passwordです。
〇構築方法
以下のVagrantfileを使用してBookStackとMariaDBをインストールした仮想マシン(CentOS7.4)を構築する事ができます。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/centos-7.4"
config.vm.hostname = "co74bookstackmariadb"
config.vm.provider :virtualbox do |vbox|
vbox.name = "co74bookstackmariadb"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.103", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.103", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
localectl set-locale LANG=ja_JP.UTF-8
# install mariadb
yum -y install mariadb mariadb-server
sudo systemctl enable mariadb.service
sudo systemctl start mariadb.service
# change password and create users and databases.
mysql -uroot -e "SET PASSWORD = PASSWORD('root'); FLUSH PRIVILEGES;"
mysql -uroot -proot -e "CREATE DATABASE bookstack DEFAULT CHARACTER SET utf8mb4;"
mysql -uroot -proot -e "CREATE USER bookstack@localhost IDENTIFIED BY 'bookstack';"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON bookstack.* TO 'bookstack'@'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-php72 httpd php php-pdo php-mbstring php-mysql php-gd php-xml php-zip php-json php-zip php-tidy git
# install composer
curl -s https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
# install bookstack
cd /opt
git clone https://github.com/BookStackApp/BookStack.git --branch release --single-branch
cd /opt/BookStack
/usr/local/bin/composer install
cp .env.example .env
#DB_HOST=localhost
sed -i -e 's/DB_DATABASE=database_database/DB_DATABASE=bookstack/' /opt/BookStack/.env
sed -i -e 's/DB_USERNAME=database_username/DB_USERNAME=bookstack/' /opt/BookStack/.env
sed -i -e 's/DB_PASSWORD=database_user_password/DB_PASSWORD=bookstack/' /opt/BookStack/.env
php artisan key:generate --force
php artisan migrate --force
chown -R apache:apache /opt/BookStack
sed -i -e 's#DocumentRoot "/var/www/html"#DocumentRoot "/opt/BookStack/public"#' /etc/httpd/conf/httpd.conf
cat << EOF >> /etc/httpd/conf/httpd.conf
<Directory /opt/BookStack/public>
AllowOverride All
Require all granted
</Directory>
EOF
systemctl restart httpd
echo 'access to http://192.168.1.103/'
echo 'default account : admin@admin.com/password'
SHELL
end
○関連情報
・BookStackに関する他の記事はこちらを参照してください。
0 件のコメント:
コメントを投稿