仮想マシン構築後、ブラウザからhttp://192.168.1.105/grav/adminで管理者画面にアクセスできます。
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/debian-9.2"
config.vm.hostname = "db92grav"
config.vm.provider :virtualbox do |vbox|
vbox.name = "db92grav"
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
# update packages
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
apt-get -y install unzip
apt-get -y install apache2 libapache2-mod-php7.0
apt-get -y install php7.0-gd php7.0-json php7.0-mbstring php7.0-xml php7.0-zip php7.0-curl
a2enmod rewrite
# install grav
wget -O grav.zip https://getgrav.org/download/core/grav/1.3.8
unzip grav.zip
mv grav /opt
ln -s /opt/grav /var/www/html
# install a skeleton
wget -O grav-skeleton-soraarticle-blog-v1.1.2.zip https://getgrav.org/download/skeletons/soraarticle-blog/1.1.2
unzip grav-skeleton-soraarticle-blog-v1.1.2.zip
cd grav-skeleton-soraarticle-blog
cp -R * /opt/grav
cd /opt/grav/
./bin/gpm install admin -y
./bin/plugin login newuser --user=admin --password=Admin123 --email=admin@localhost.localdomain --permissions=b --fullname=administrator --title=admin
chown -R www-data:www-data /opt/grav
cat << EOF >> /etc/apache2/apache2.conf
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
EOF
service apache2 restart
echo 'access http://192.168.1.105/grav/admin'
echo 'user: admin password:Admin123 '
echo '--------'
echo 'access http://192.168.1.105/grav/'
SHELL
end
〇Gravの管理者画面
〇Gravの画面
○関連情報
・Gravに関する他の記事はこちらを参照してください。
0 件のコメント:
コメントを投稿