====== Mattermost ======
===== Installing PostgreSQL Database. =====
=== With Unix socket. ===
A SlackBuild for building and installing PostgreSQL can be found at SlackBuilds.org; follow the instructions there, and install PostgreSQL. After installing PostgreSQL perform the following steps:
- Initialize the PostgreSQL database: su postgres -c "initdb -D /var/lib/pgsql/10.2/data --locale=en_US.UTF-8 -A md5 -W"
- Start the PostgreSQL database: /etc/rc.d/rc.postgresql start
- Switch to the postgres Linux user account that was created during the installation.su -l postgres
- Start the PostgreSQL interactive terminal. psql
- Create the Mattermost database.CREATE DATABASE mattermostdb;
- Create mattermost user and give it the rights on the database:CREATE USER mattermost;
GRANT ALL PRIVILEGES ON DATABASE mattermostdb to mattermost;
- Exit out of psql with \q.
- Setup the Unix socket by editing file: /var/lib/pgsql/10.2/data/pg_hba.conf, replace# "local" is for Unix domain socket connections only
local all all md5
withlocal mattermostdb mattermost peer
- Add the following to "/var/lib/pgsql/10.2/data/pg_ident.conf" echo "mattermap mattermostdb mattermost" >> /var/lib/pgsql/10.2/data/pg_ident.conf
- Restart PostgreSQL exit
/etc/rc.d/rc.postgresql restart
- Add the mattermost system user: useradd --system --user-group mattermost
- Verify things are working thus far sudo -u mattermost psql --dbname=mattermostdb --username=mattermost
====== Sources ======
{{tag>howtos template}}