[owncloud/el6] drop db server deps, explain pgsql 9 dep, improve db docs
Adam Williamson
adamwill at fedoraproject.org
Wed Oct 29 23:30:01 UTC 2014
commit 295fd991a7364f922030e1d300fc65d7b1082e92
Author: Adam Williamson <awilliam at redhat.com>
Date: Wed Oct 29 16:18:50 2014 -0700
drop db server deps, explain pgsql 9 dep, improve db docs
owncloud-mysql.txt | 39 +++++++++++++++++++++++---------
owncloud-postgresql.txt | 56 ++++++++++++++++++++++++++++++++++++++--------
owncloud.spec | 40 +++++++++++++++++++++++++++------
3 files changed, 107 insertions(+), 28 deletions(-)
---
diff --git a/owncloud-mysql.txt b/owncloud-mysql.txt
index 0490bd7..4712eed 100644
--- a/owncloud-mysql.txt
+++ b/owncloud-mysql.txt
@@ -1,14 +1,31 @@
-Configure MySQL for ownCloud
-============================
-Before you can use MySQL as database backend, you need to follow a couple of steps:
+Configure MariaDB / MySQL for ownCloud
+======================================
-1. make sure that your mysql service is configured and running properly
-2. log in to mysql as privileged user to create the database and a dedicated user account for ownCloud:
-mysql -u root -p
- CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
- CREATE DATABASE IF NOT EXISTS owncloud;
- GRANT ALL PRIVILEGES ON owncloud.* TO 'username'@'localhost' IDENTIFIED BY 'password';
+To use MariaDB / MySQL as database backend, you need to do the following:
-Choose identifier and password accordingly.
+1. Make sure that your mysql service is configured and running properly. If this
+ is a fresh install, you will need to run "systemctl enable mysqld.service;
+ systemctl start mysqld.service" (or mariadb.service) as root. It's also
+ strongly advised to run "mysql_secure_installation" after starting the
+ database for the first time.
-Now you can launch the ownCloud setup screen, select MySQL in the advanced settings and fill in your credentials.
+2. Log in to the database as privileged user to create the database and a
+ dedicated user account for ownCloud:
+ $ mysql -u root -p
+ CREATE DATABASE IF NOT EXISTS owncloud;
+ GRANT ALL PRIVILEGES ON owncloud.* TO 'username'@'localhost' IDENTIFIED BY 'password';
+ Choose identifier and password accordingly.
+
+Now you can launch the ownCloud setup screen, select MySQL in the advanced
+settings and fill in your credentials.
+
+The above is for a database running on the same system as ownCloud. If you
+are using a remote database server, you must change 'username'@'localhost' to
+something more appropriate and ensure network access to the server is enabled.
+
+References
+==========
+
+https://fedoraproject.org/wiki/MariaDB
+https://mariadb.com/kb/en/mariadb/documentation/
+http://doc.owncloud.org/server/7.0/admin_manual/configuration/configuration_database.html
diff --git a/owncloud-postgresql.txt b/owncloud-postgresql.txt
index b4afe02..2e9f144 100644
--- a/owncloud-postgresql.txt
+++ b/owncloud-postgresql.txt
@@ -1,15 +1,51 @@
Configure PostgreSQL for ownCloud
=================================
-Before you can use PostgreSQL as database backend, you need to follow a couple of steps:
-1. make sure that your PostgreSQL service is configured and running properly
-2. log in to PostgreSQL as system user to create the database and a dedicated user account for ownCloud:
-su - -c "psql" postgres
- CREATE USER username WITH PASSWORD 'password';
- CREATE DATABASE owncloud TEMPLATE template0 ENCODING 'UNICODE';
- ALTER DATABASE owncloud OWNER TO username;
- GRANT ALL PRIVILEGES ON DATABASE owncloud TO username;
+Most importantly, please be aware that ownCloud 6 and higher require at least
+PostgreSQL 9.0. The version in the official EL 6 repository, 8.4, is not
+compatible with ownCloud 6. If you wish to host the database on the same
+system as ownCloud, or another EL 6 system, you must use third-party
+PostgreSQL 9.x packages, such as those provided by postgresql.org itself.
-Choose identifier and password accordingly.
+To use PostgreSQL as database backend, you need to do the following:
-Now you can launch the ownCloud setup screen, select PostgreSQL in the advanced settings and fill in your credentials.
+1. Make sure that your PostgreSQL service is configured and running properly.
+ If this is a fresh install, you will need to run "service postgresql9-3
+ initdb" as root, then "chkconfig postgresql9-3 on; service postgresql9-3
+ start", all assuming use of PostgreSQL 9.3 packages from postgresql.org.
+ For more details on installation and initial configuration of these packages
+ for EL 6, see https://wiki.postgresql.org/wiki/YUM_Installation and
+ https://wiki.postgresql.org/wiki/First_steps
+
+2. Log in to PostgreSQL as system user to create the database and a dedicated
+ user account for ownCloud:
+ # su - -c "psql" postgres
+ CREATE USER username WITH PASSWORD 'password';
+ CREATE DATABASE owncloud TEMPLATE template0 ENCODING 'UNICODE';
+ ALTER DATABASE owncloud OWNER TO username;
+ GRANT ALL PRIVILEGES ON DATABASE owncloud TO username;
+ Choose identifier and password accordingly.
+
+3. ownCloud talks to PostgreSQL via TCP/IP, so you need to configure an
+ appropriate authentication mechanism in /var/lib/pgsql/data/pg_hba.conf.
+ For a simple configuration with ownCloud and PostgreSQL on the same host,
+ set the METHOD for the lines that apply to localhost TCP/IP connections
+ to "password". ownCloud does *not* use a socket to communicate with the
+ database, so the 'local' line in pg_hba.conf does *not* apply to it.
+ Note that this will result in the password being sent unencrypted from
+ ownCloud to the PostgreSQL server. For more details, see
+ http://www.postgresql.org/docs/9.3/static/auth-pg-hba-conf.html.
+
+4. You also need to allow the web server to communicate with the database by
+ TCP/IP: SELinux disallows this by default. Run:
+ # setsebool -P httpd_can_network_connect_db on
+
+Now you can launch the ownCloud setup screen, select PostgreSQL in the advanced
+settings and fill in your credentials.
+
+References
+==========
+
+https://fedoraproject.org/wiki/PostgreSQL
+http://www.postgresql.org/docs
+http://doc.owncloud.org/server/7.0/admin_manual/configuration/configuration_database.html
diff --git a/owncloud.spec b/owncloud.spec
index dd43bfb..b39d735 100644
--- a/owncloud.spec
+++ b/owncloud.spec
@@ -1,6 +1,6 @@
Name: owncloud
Version: 6.0.5
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Private file sync and share server
License: AGPLv3+ and MIT and BSD and CC-BY and CC-BY-SA and GPLv3 and Public Domain and (MPLv1.1 or GPLv2+ or LGPLv2+) and (MIT or GPL+) and (MIT or GPLv2) and ASL 2.0 and LGPLv3
@@ -122,33 +122,52 @@ Requires: php-fpm nginx
%package mysql
-Summary: Virtual package providing MySQL dependencies for %{name}
+Summary: MySQL database support for ownCloud
Provides: %{name}-database = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
Requires: php-mysql
-Requires: mysql-server
%description mysql
%{summary}
+This package ensures the necessary dependencies are in place for ownCloud to
+work with MySQL / MariaDB databases. It does not require a MySQL / MariaDB
+server to be installed, as you may well wish to use a remote database
+server. Obviously, if you want the database to be on the same system as
+ownCloud itself, you must also install and enable a MySQL / MariaDB server
+package. See README.mysql for more details.
+
%package postgresql
-Summary: Virtual package providing PostgreSQL dependencies for %{name}
+Summary: PostgreSQL database support for ownCloud
Provides: %{name}-database = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
Requires: php-pgsql
-Requires: postgresql-server
%description postgresql
%{summary}
+This package ensures the necessary dependencies are in place for ownCloud to
+work with a PostgreSQL database. It does not require the PostgreSQL server
+package to be installed, as you may well wish to use a remote database
+server.
+
+Please be aware that ownCloud 6 and higher do not support PostgreSQL versions
+earlier than 9. Your PostgreSQL server must be running at least version 9.0.
+
+If you want the database to be on the same system as ownCloud itself, you must
+also install and enable a PostgreSQL 9.0 or higher server package. PostgreSQL
+runs a repository containing EL 6 packages for PostgreSQL 9.x.
+
+See README.postgresql for more details.
+
%package sqlite
-Summary: Virtual package providing Sqlite3 dependencies for %{name}
+Summary: SQLite 3 database support for ownCloud
Provides: %{name}-database = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
@@ -157,6 +176,9 @@ Requires: php-sqlite3 php-pcre
%description sqlite
%{summary}
+This package ensures the necessary dependencies are in place for ownCloud to
+work with an SQLite 3 database stored on the local system.
+
%prep
%setup -q -n %{name}
@@ -276,7 +298,7 @@ ln -s %{pear_phpdir}/Crypt %{buildroot}%{_datadir}/%{name}/apps/files_encryption
ln -s %{_datadir}/php/Zend %{buildroot}%{_datadir}/%{name}/apps/search_lucene/3rdparty/Zend
-%if 0%{?rhel}
+%if 0%{?rhel} < 7
%post
semanage fcontext -a -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}/config.php' 2>/dev/null || :
semanage fcontext -a -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}' 2>/dev/null || :
@@ -355,6 +377,10 @@ fi
%changelog
+* Wed Oct 29 2014 Adam Williamson <awilliam at redhat.com> - 6.0.5-3
+- don't depend on database server packages, explain pgsql 9.x situation
+- improve database docs (from master, tweaked for EL 6)
+
* Wed Oct 29 2014 Adam Williamson <awilliam at redhat.com> - 6.0.5-2
- fix selinux restorecon to affect directory as well as config file
More information about the scm-commits
mailing list