以下のVagrantfileを使用して、boltとPostgreSQL がインストールされた仮想マシン(Ubuntu16.04) を構築できます。
仮想マシン構築後、ブラウザからhttp://192.168.55.109/にアクセスして初期設定を行います。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.hostname = "ub1604boltpg"
config.vm.provider :virtualbox do |vbox|
vbox.name = "ub1604boltpg"
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
sed -i.bak -e "s#http://archive.ubuntu.com/ubuntu/#http://ftp.riken.jp/pub/Linux/ubuntu/#g" /etc/apt/sources.list
apt-get update
apt-get -y install language-pack-ja
localectl set-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja"
localectl set-keymap jp106
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
# install postgresql
apt-get -y install postgresql
echo "listen_addresses='*'" >> /etc/postgresql/9.5/main/postgresql.conf
echo "standard_conforming_strings=off" >> /etc/postgresql/9.5/main/postgresql.conf
#sed -i 's/host.*all.*all.*127.0.0.1/#host all all 127.0.0.1/g' /etc/postgresql/9.5/main/pg_hba.conf
echo "host all all 127.0.0.1/32 password" >> /etc/postgresql/9.5/main/pg_hba.conf
echo "host all all 192.168.1.0/24 password" >> /etc/postgresql/9.5/main/pg_hba.conf
echo "host all all 192.168.55.0/24 password" >> /etc/postgresql/9.5/main/pg_hba.conf
su - postgres << EOF
createdb -T template0 --locale=ja_JP.UTF-8 --encoding=UTF8 bolt
psql -c "
alter user postgres with password 'postgres';
create user bolt with password 'bolt';
grant all privileges on database bolt to bolt;
"
EOF
echo "postgres:postgres" | chpasswd
systemctl restart postgresql.service
apt-get -y install apache2 libapache2-mod-php7.0
apt-get -y install php7.0-gd php7.0-json php7.0-pgsql php7.0-pdo php7.0-curl php7.0-mbstring
apt-get -y install php7.0-mcrypt php7.0-xml php7.0-zip php7.0-intl
# install bolt
wget https://bolt.cm/distribution/bolt-latest.tar.gz
tar -xzf bolt-latest.tar.gz
cd bolt-v3.4.6
php app/nut init
sed -i -e 's/driver: sqlite/driver: pgsql\\n username: bolt\\n password: bolt\\n/' ./app/config/config.yml
cd /home/vagrant
mv bolt-v3.4.6 /opt/bolt
chown -R www-data:www-data /opt/bolt
cat << EOF > /etc/apache2/sites-available/bolt.conf
<VirtualHost *:80>
ServerName 192.168.55.109
DocumentRoot /opt/bolt/public
<Directory /opt/bolt/public>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
EOF
a2enmod rewrite
a2ensite bolt.conf
a2dissite 000-default.conf
systemctl reload apache2.service
echo 'access http://192.168.55.109/'
SHELL
end
〇boltの初期設定画面
〇boltの画面
○関連情報
・Boltに関する他の記事はこちらを参照してください。
0 件のコメント:
コメントを投稿