Update install doc

This commit is contained in:
Benjamin Renard 2022-04-24 16:56:37 +02:00
parent 9886cb0720
commit 78ffe5a8c7

View file

@ -2,37 +2,38 @@
## Dependencies : ## Dependencies :
This Debian packages have to be installed : Some Debian packages have to be installed :
- git *(only for deployment only)* ```bash
- composer (and unzip or zip) apt install git composer php-cli php-mail php-mail-mine php-net-smtp php-auth-sasl php-json php-mbstring php-intl smarty3
- php-cli # for PostgreSQL DB backend
- php-mail apt install php-pgsql
- php-mail-mine # for MySQL/MariaDB DB backend
- php-net-smtp apt install php-mysql
- php-auth-sasl # for sqlite DB backend
- php-json apt install sqlite3 php-sqlite3
- 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
## Deployment : ## Deployment :
To deploy this application, for instance in */var/www/eesyphp*, run this commands : To deploy this application, for instance in */var/www/eesyphp*, run this commands :
cd /var/www ```bash
adduser --home /var/www/eesyphp --no-create-home --disabled-password --gid 33 eesyphp cd /var/www
git clone https://gogs.example.org/example/eesyphp.git /var/www/eesyphp adduser --home /var/www/eesyphp --no-create-home --disabled-password --gid 33 eesyphp
chown eesyphp: /var/www/eesyphp git clone https://gogs.example.org/example/eesyphp.git /var/www/eesyphp
ln -s /var/www/eesyphp/bin/items.wrapper /usr/local/bin/eesyphp chown eesyphp: /var/www/eesyphp
ln -s /var/www/eesyphp/docs/eesyphp.cron /etc/cron.d/eesyphp ln -s /var/www/eesyphp/bin/items.wrapper /usr/local/bin/eesyphp
ln -s /var/www/eesyphp/docs/eesyphplogrotate /etc/logrotate.d/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 : ## Install PHP dependencies :
su - eesyphp ```bash
composer install su - eesyphp
composer install
```
## Initialize database : ## 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 : To initialize SQLite database, run this commands :
cd /var/www/eesyphp/data ```bash
sqlite3 db.sqlite3 < sqlite.init-db.sql cd /var/www/eesyphp/data
sqlite3 db.sqlite3 < sqlite.init-db.sql
```
### PostgreSQL ### PostgreSQL
To initialize PostgreSQL database, run this commands : To initialize PostgreSQL database, run this commands :
su - postgres ```bash
createuser -P items su - postgres
createdb -O items items createuser -P items
psql items < /var/www/eesyphp/data/pgsql.init-db.sql createdb -O items items
psql items < /var/www/eesyphp/data/pgsql.init-db.sql
```
### MariaDB / MySQL ### MariaDB / MySQL
To initialize MariaDB / MySQL database, run this commands : To initialize MariaDB / MySQL database, run this commands :
sudo mysql << EOF ```bash
CREATE DATABASE items; sudo mysql << EOF
GRANT ALL ON items.* TO items@localhost IDENTIFIED BY 'items'; CREATE DATABASE items;
EOF GRANT ALL ON items.* TO items@localhost IDENTIFIED BY 'items';
sudo mysql items < /var/www/eesyphp/data/mariadb-mysql.init-db.sql EOF
sudo mysql items < /var/www/eesyphp/data/mariadb-mysql.init-db.sql
```
## Configure PHP FPM pool : ## Configure PHP FPM pool :
@ -73,7 +79,7 @@ You could configure a dedicated *PHP FPM pool*.
[eesyphp] [eesyphp]
user = eesyphp user = eesyphp
group = www-data group = www-data
listen = /run/php7.0-fpm_eesyphp.sock listen = /run/php/php7.3-fpm-eesyphp.sock
listen.owner = www-data listen.owner = www-data
listen.group = www-data listen.group = www-data
pm = dynamic pm = dynamic
@ -117,7 +123,7 @@ You could configure a dedicated *VirtualHost*.
SSLCertificateKeyFile /etc/letsencrypt/live/eesyphp.example.org/privkey.pem SSLCertificateKeyFile /etc/letsencrypt/live/eesyphp.example.org/privkey.pem
<FilesMatch \.php$> <FilesMatch \.php$>
SetHandler "proxy:unix:/run/php7.0-fpm_eesyphp.sock|fcgi:///" SetHandler "proxy:unix:/run/php/php7.3-fpm-eesyphp.sock|fcgi:///"
</FilesMatch> </FilesMatch>
<Directory /var/www/eesyphp/public_html> <Directory /var/www/eesyphp/public_html>