Introduction
NGINX
Beforehand be sure to determine weather the web server will be using MySQL (ie. MariaDB) or PostreSQL.
# pikaur -S composer curl minify nginx php-fpm sassc wget |
# pikaur -S php-gd php-geoip php-imagic php-intl php-memcache php-pgsql php-sqlite php-sodium xdebug |
Next create the environment for the web server.
# sudo mkdir -p /nginx/conf.d /nginx/https /nginx/logs /nginx/sql /nginx/ssl /nginx/vhosts.d |
# sudo chmod -R 770 /nginx |
# sudo chmod 750 /nginx/sql |
# sudo gpasswd -a username http |
PostgreSQL
Using postgresql as a back-end will require the following setup and configuration.
# sudo chown postgres:postgres /nginx/sql |
# sudo gpasswd -a username postgres |
Swap over to the postgresql user account.
Run the database initialization.
# initdb --locale en_US.UTF-8 -E UTF8 -D '/nginx/sql/data' |
Return to the normal user account.
Modify the systemd service file to reflect the new data directory.
# sudo systemctl edit postgresql.service |
filename: postgresql.service
Environment=PGROOT=/nginx/sql PIDFile=/nginx/sql/postmaster.pid |
# sudo systemctl enable --now postgresql.service |
MariaDB
If mariadb is to be used for the back-end, the following will be required.
# sudo chown mysql:mysql /nginx/sql |
# sudo gpasswd -a username mysql |
# mariadb-install-db --user=mysql --basedir=/usr --datadir=/nginx/sql |