260614d
Configure PostgreSQL for ownCloud
260614d
=================================
260614d
260614d
To use PostgreSQL as database backend, you need to do the following:
260614d
260614d
1. Make sure that your PostgreSQL service is configured and running properly.
260614d
   If this is a fresh install, you will need to run "postgresql-setup initdb"
260614d
   as root, then "systemctl enable postgresql.service; systemctl start
260614d
   postgresql.service". For more details on initial configuration of PostgreSQL
260614d
   in Fedora, see https://fedoraproject.org/wiki/PostgreSQL
260614d
260614d
2. Log in to PostgreSQL as system user to create the database and a dedicated
260614d
   user account for ownCloud:
260614d
   # su - -c "psql" postgres
260614d
     CREATE USER username WITH PASSWORD 'password';
260614d
     CREATE DATABASE nextcloud TEMPLATE template0 ENCODING 'UNICODE';
260614d
     ALTER DATABASE nextcloud OWNER TO username;
260614d
     GRANT ALL PRIVILEGES ON DATABASE nextcloud TO username;
260614d
   Choose identifier and password accordingly.
260614d
   
260614d
3. ownCloud talks to PostgreSQL via TCP/IP, so you need to configure an
260614d
   appropriate authentication mechanism in /var/lib/pgsql/data/pg_hba.conf.
260614d
   For a simple configuration with ownCloud and PostgreSQL on the same host,
260614d
   set the METHOD for the lines that apply to localhost TCP/IP connections
260614d
   to "password". ownCloud does *not* use a socket to communicate with the
260614d
   database, so the 'local' line in pg_hba.conf does *not* apply to it.
260614d
   Note that this will result in the password being sent unencrypted from
260614d
   ownCloud to the PostgreSQL server. For more details, see
260614d
   http://www.postgresql.org/docs/9.3/static/auth-pg-hba-conf.html.
260614d
   
260614d
4. You also need to allow the web server to communicate with the database by
260614d
   TCP/IP: SELinux disallows this by default. Run:
260614d
   # setsebool -P httpd_can_network_connect_db on
260614d
   
260614d
Now you can launch the ownCloud setup screen, select PostgreSQL in the advanced
260614d
settings and fill in your credentials.
260614d
260614d
References
260614d
==========
260614d
260614d
https://fedoraproject.org/wiki/PostgreSQL
260614d
http://www.postgresql.org/docs
260614d
http://doc.nextcloud.org/server/7.0/admin_manual/configuration/configuration_database.html