From 78ffe5a8c71a0412c1363b177f6d5156d321a5c2 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Sun, 24 Apr 2022 16:56:37 +0200 Subject: [PATCH] Update install doc --- docs/install.md | 78 ++++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/docs/install.md b/docs/install.md index 69e56f9..e129f47 100644 --- a/docs/install.md +++ b/docs/install.md @@ -2,37 +2,38 @@ ## Dependencies : -This Debian packages have to be installed : +Some Debian packages have to be installed : - - git *(only for deployment only)* - - composer (and unzip or zip) - - php-cli - - php-mail - - php-mail-mine - - php-net-smtp - - php-auth-sasl - - php-json - - php-mbstring - - php-pgsql *(for PostgreSQL DB backend)* - - php-sqlite3 *(for sqlite DB backend, sqlite3 tool (provided by the same name package) is also used to create the DB file)* - - smarty3 +```bash +apt install git composer php-cli php-mail php-mail-mine php-net-smtp php-auth-sasl php-json php-mbstring php-intl smarty3 +# for PostgreSQL DB backend +apt install php-pgsql +# for MySQL/MariaDB DB backend +apt install php-mysql +# for sqlite DB backend +apt install sqlite3 php-sqlite3 +``` ## Deployment : To deploy this application, for instance in */var/www/eesyphp*, run this commands : - cd /var/www - adduser --home /var/www/eesyphp --no-create-home --disabled-password --gid 33 eesyphp - git clone https://gogs.example.org/example/eesyphp.git /var/www/eesyphp - chown eesyphp: /var/www/eesyphp - ln -s /var/www/eesyphp/bin/items.wrapper /usr/local/bin/eesyphp - ln -s /var/www/eesyphp/docs/eesyphp.cron /etc/cron.d/eesyphp - ln -s /var/www/eesyphp/docs/eesyphplogrotate /etc/logrotate.d/eesyphp +```bash +cd /var/www +adduser --home /var/www/eesyphp --no-create-home --disabled-password --gid 33 eesyphp +git clone https://gogs.example.org/example/eesyphp.git /var/www/eesyphp +chown eesyphp: /var/www/eesyphp +ln -s /var/www/eesyphp/bin/items.wrapper /usr/local/bin/eesyphp +ln -s /var/www/eesyphp/docs/eesyphp.cron /etc/cron.d/eesyphp +ln -s /var/www/eesyphp/docs/eesyphplogrotate /etc/logrotate.d/eesyphp +``` ## Install PHP dependencies : - su - eesyphp - composer install +```bash +su - eesyphp +composer install +``` ## Initialize database : @@ -40,28 +41,33 @@ To deploy this application, for instance in */var/www/eesyphp*, run this command To initialize SQLite database, run this commands : - cd /var/www/eesyphp/data - sqlite3 db.sqlite3 < sqlite.init-db.sql +```bash +cd /var/www/eesyphp/data +sqlite3 db.sqlite3 < sqlite.init-db.sql +``` ### PostgreSQL To initialize PostgreSQL database, run this commands : - su - postgres - createuser -P items - createdb -O items items - psql items < /var/www/eesyphp/data/pgsql.init-db.sql +```bash +su - postgres +createuser -P items +createdb -O items items +psql items < /var/www/eesyphp/data/pgsql.init-db.sql +``` ### MariaDB / MySQL To initialize MariaDB / MySQL database, run this commands : - sudo mysql << EOF - CREATE DATABASE items; - GRANT ALL ON items.* TO items@localhost IDENTIFIED BY 'items'; - EOF - sudo mysql items < /var/www/eesyphp/data/mariadb-mysql.init-db.sql - +```bash +sudo mysql << EOF +CREATE DATABASE items; +GRANT ALL ON items.* TO items@localhost IDENTIFIED BY 'items'; +EOF +sudo mysql items < /var/www/eesyphp/data/mariadb-mysql.init-db.sql +``` ## Configure PHP FPM pool : @@ -73,7 +79,7 @@ You could configure a dedicated *PHP FPM pool*. [eesyphp] user = eesyphp group = www-data -listen = /run/php7.0-fpm_eesyphp.sock +listen = /run/php/php7.3-fpm-eesyphp.sock listen.owner = www-data listen.group = www-data pm = dynamic @@ -117,7 +123,7 @@ You could configure a dedicated *VirtualHost*. SSLCertificateKeyFile /etc/letsencrypt/live/eesyphp.example.org/privkey.pem - SetHandler "proxy:unix:/run/php7.0-fpm_eesyphp.sock|fcgi:///" + SetHandler "proxy:unix:/run/php/php7.3-fpm-eesyphp.sock|fcgi:///"