====== Test de Grav pour le site de Caliban ====== $ sudo lxc-create -t download -n grav -- --dist debian --release buster --arch amd64 $ sudo lxc-start -n grav $ sudo lxc-attach -n grav root@grav:/# dpkg-reconfigure locales (choose fr_BE.UTF-8 ) root@grav:/# apt update root@grav:/# apt install nginx wget unzip root@grav:/# cd /var/www/ root@grav:/var/www/# wget -O grav-admin-v1.6.16.zip https://getgrav.org/download/core/grav-admin/1.6.16 root@grav:/var/www# unzip grav-admin-v1.6.16.zip root@grav:/var/www# rm -r html/ root@grav:/var/www# mv grav-admin/ html/ root@grav:/var/www# chown -R www-data:www-data html/ Je voulais changer la configuration de Nginx au minimum mais il faut bien installer et activer PHP. (Et mince, il installe apache2 par défaut, faut le virer...) root@grav:/var/www/html# apt install php7.3 php7.3-fpm php7.3-mbstring php7.3-zip php7.3-xml php7.3-gd php7.3-curl root@grav:/var/www/html# apt remove apache2 root@grav:/var/www/html# rm /etc/systemd/system/apache2.service root@grav:/var/www/html# rm /etc/systemd/system/apache-htcacheclean.service root@grav:/var/www/html# systemctl daemon-reload On peut récupérer la configuration nginx par défaut : [[https://github.com/getgrav/grav/blob/master/webserver-configs/nginx.conf|https://github.com/getgrav/grav/blob/master/webserver-configs/nginx.conf]] root@grav:/var/www/html# vim /etc/nginx/sites-enabled/default À changer dans la configuration : (...) root /var/www/html; (...) fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; (...) On relance nginx : root@grav:/var/www/html# systemctl reload nginx {{ ::capture_du_2019-10-10_16-38-39-grav.png?400 |}} {{ ::screenshot_2019-10-10_dashboard_grav.png?400 |}} ===== Ajouter un utilisateur ===== Il faut le faire depuis la ligne de commande (source: [[https://learn.getgrav.org/16/admin-panel/faq|https://learn.getgrav.org/16/admin-panel/faq]]) root@grav:/var/www/html# bin/plugin login newuser Creating new user Enter a username: fred Enter a password: Repeat the password: Enter an email: info@caliban.be Please choose a set of permissions: [a] Admin Access [s] Site Access [b] Admin and Site Access > a Enter a fullname: Fred Enter a title: Site Administrator Please choose the state for the account: [enabled ] Enabled [disabled] Disabled > enabled Success! User fred created. Les utilisateurs créés sont dans le dossier ''user/accounts/'' : root@grav:/var/www/html/user/accounts# ls caliban.yaml fred.yaml micmac.yaml nico.yaml simon.yaml ===== Problèmes rencontrés ===== ==== Error 500 ==== Il y a apparemment un problème avec le thème qu'on a testé. J'ai résolu l'erreur avec ce script qui remet les bons droits : root@grav:/var/www/html# cat script.sh #!/bin/sh chown -R www-data:www-data . find . -type f | xargs chmod 664 find ./bin -type f | xargs chmod 775 find . -type d | xargs chmod 775 find . -type d | xargs chmod +s root@grav:/var/www/html# chmod +x script.sh root@grav:/var/www/html# ./script.sh J'ai désactivé le thème pour voir si le problème vient bien de là. ===== Sources ===== * [[https://learn.getgrav.org/16/basics/installation|Installation de Grav 1.6 (learn.getgrav.org)]]