From 08ac0c635cbade3fccc332ce9142dc1f2cfc7655 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 15 Aug 2014 22:01:11 +0200 Subject: [PATCH 1/3] PostgreSQL with the peer authentication method. Added information how to get owncloud to use PostgreSQL which is configured to use the peer authentication method. This is the default setting in Ubuntu 14.04 (and probably other distros). Information was adopted from https://gitlab.com/gitlab-org/gitlab-ce/blob/7-1-stable/doc/install/installation.md#4-database and tested this with ownCloud 7.0.1 (stable). --- .../configuration/configuration_database.rst | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/admin_manual/configuration/configuration_database.rst b/admin_manual/configuration/configuration_database.rst index 577f3c33d..fc5422551 100644 --- a/admin_manual/configuration/configuration_database.rst +++ b/admin_manual/configuration/configuration_database.rst @@ -149,6 +149,42 @@ like this: pgsql.ignore_notice = 0 pgsql.log_notice = 0 +The default configuration for PostgreSQL (at least in Ubuntu 14.04) is to use the peer authentication method. Check :file:`/etc/postgresql/9.3/main/pg_hba.conf` to find out which authentication method is used in your setup. +To start the postgres command line mode use:: + + sudo -u postgres psql -d template1 + +Then a **template1=#** prompt will appear. Now enter the following lines and confirm them with the enter key: + +.. code-block:: sql + + CREATE USER username CREATEDB; + CREATE DATABASE owncloud OWNER username; + +You can quit the prompt by entering:: + + \q + +An ownCloud instance configured with PostgreSQL would contain the hostname on +which the database is running, a valid username and password to access it, and +the name of the database. The :file:`config/config.php` as created by the +:doc:`../installation/installation_wizard` would therefore contain entries like +this: + +.. code-block:: php + + "pgsql", + "dbname" => "owncloud", + "dbuser" => "username", + "dbpassword" => "", + "dbhost" => "/var/run/postgresql", + "dbtableprefix" => "oc_", + +IMPORTANT: The host actually points to the socket that is used to connect to the database. Using localhost here will not work if postgreSQL is configured to use peer authentication. Also note, that no password is specified, because this authentication method doesn't use a password. + +If you use another authentication method (not peer), you'll need to use the following steps to get the database setup: Now you need to create a database user and the database itself by using the PostgreSQL command line interface. The database tables will be created by ownCloud when you login for the first time. From 91718a67ac3a94d65beb09712549ff1c76373b30 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 15 Aug 2014 22:10:03 +0200 Subject: [PATCH 2/3] More information on how the parameters must be chosen. --- admin_manual/configuration/configuration_database.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/admin_manual/configuration/configuration_database.rst b/admin_manual/configuration/configuration_database.rst index fc5422551..653790477 100644 --- a/admin_manual/configuration/configuration_database.rst +++ b/admin_manual/configuration/configuration_database.rst @@ -165,10 +165,10 @@ You can quit the prompt by entering:: \q -An ownCloud instance configured with PostgreSQL would contain the hostname on -which the database is running, a valid username and password to access it, and -the name of the database. The :file:`config/config.php` as created by the -:doc:`../installation/installation_wizard` would therefore contain entries like +An ownCloud instance configured with PostgreSQL would contain the path to the socket on +which the database is running as the hostname, the system username the php process is using, +and an empty password to access it, and the name of the database. The :file:`config/config.php` as +created by the :doc:`../installation/installation_wizard` would therefore contain entries like this: .. code-block:: php From 1378679697af791e711cbf5e02f10a029ff909f1 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 20 Aug 2014 23:31:12 +0200 Subject: [PATCH 3/3] using .. note:: instead of IMPORTANT: --- admin_manual/configuration/configuration_database.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin_manual/configuration/configuration_database.rst b/admin_manual/configuration/configuration_database.rst index 653790477..184f20ef8 100644 --- a/admin_manual/configuration/configuration_database.rst +++ b/admin_manual/configuration/configuration_database.rst @@ -182,7 +182,7 @@ this: "dbhost" => "/var/run/postgresql", "dbtableprefix" => "oc_", -IMPORTANT: The host actually points to the socket that is used to connect to the database. Using localhost here will not work if postgreSQL is configured to use peer authentication. Also note, that no password is specified, because this authentication method doesn't use a password. +.. note:: The host actually points to the socket that is used to connect to the database. Using localhost here will not work if postgreSQL is configured to use peer authentication. Also note, that no password is specified, because this authentication method doesn't use a password. If you use another authentication method (not peer), you'll need to use the following steps to get the database setup: Now you need to create a database user and the database itself by using the