〇Gravの管理者画面
〇構築方法
以下のVagrantfileを使用して、Grav CMSとMySQLをインストールした仮想マシンを構築する事ができます。
仮想マシン構築後、ブラウザからhttp://192.168.1.105/grav/adminで管理者画面にアクセスできます。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/debian-10"
config.vm.hostname = "db10grav"
config.vm.network "public_network", ip:"192.168.1.103", :netmask => "255.255.255.0"
config.vm.network "private_network", ip: "192.168.55.103", :netmask => "255.255.255.0"
config.vm.provider :virtualbox do |vbox|
vbox.name = "db10grav"
vbox.gui = true
vbox.cpus = 2
vbox.memory = 2048
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
apt-get -y install task-japanese gawk
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
timedatectl set-timezone Asia/Tokyo
# install apache and php
apt-get -y install unzip
apt-get -y install apache2 libapache2-mod-php7.3
apt-get -y install php7.3-gd php7.3-json php7.3-mbstring php7.3-xml php7.3-zip php7.3-curl
a2enmod rewrite
# install grav
wget -O grav.zip https://getgrav.org/download/core/grav-admin/1.6.11
unzip grav.zip
mv grav-admin /opt/grav
ln -s /opt/grav /var/www/html
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
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
EOF
service apache2 restart
echo 'access http://192.168.1.103/grav/admin'
echo 'user: admin password:Admin123 '
echo '--------'
echo 'access http://192.168.1.103/grav/'
SHELL
end
0 件のコメント:
コメントを投稿