From a6ddf48bcd79a6ebd1378636183a5f9a6211a440 Mon Sep 17 00:00:00 2001 From: j-ed Date: Mon, 28 Jan 2013 08:49:11 -0800 Subject: [PATCH 1/7] Create configuration_database.rst Added description of database specific parameters. --- admin_manual/configuration_database.rst | 214 ++++++++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 admin_manual/configuration_database.rst diff --git a/admin_manual/configuration_database.rst b/admin_manual/configuration_database.rst new file mode 100644 index 000000000..641b01c25 --- /dev/null +++ b/admin_manual/configuration_database.rst @@ -0,0 +1,214 @@ + +Database Configuration +====================== + +To get ownCloud up-an-running it is necessary to choose a database in which all +administrative data should be held. Three different database type are currently +supported, SQLite (http://www.sqlite.org/), MySQL (http://www.mysql.com/) and +PostgreSQL (http://www.postgresql.org/). By default SQLite is choosen because +it is a file based database with the least administrative overhead. + +Requirements +------------ + +If you decide to use MySQL or PostgreSQL you need to install and set-up the +database first. These steps will not be covered by this description. + +Parameters +---------- + +* **SQLite database** + + If you decide to use a SQLite database make sure that you have installed and + enabled the SQLite extension in PHP. The PHP configuration could look like this: + :: + + cat /etc/php5/conf.d/sqlite3.ini + # configuration for PHP SQLite3 module + extension=pdo_sqlite.so + extension=sqlite3.so + + It is not necessary to create a database and a database user in advance because + this will automatically be done by ownCloud when you login for the first time. + + In the ownCloud counfiguration you need to set at least the ``datadirectory`` + parameter to the directory where your data and database should be stored. + No authentication is required to access the database therefore most of the + default parameters could be taken as it. + :: + + "dbtype" => "sqlite", + "dbname" => "owncloud", + "dbuser" => "", + "dbpassword" => "", + "dbhost" => "", + "dbtableprefix" => "", + "datadirectory" => "/www/htdocs/owncloud/data", + +* **MySQL database** + + If you decide to use a MySQL database make sure that you have installed and + enabled the MySQL extension in PHP and that the ``mysql.default_socket`` + points to the correct socket, if the database runs on same server as ownCloud. + The PHP configuration could look like this: + :: + + cat /etc/php5/conf.d/mysql.ini + # configuration for PHP MySQL module + extension=pdo_mysql.so + extension=mysql.so + + [mysql] + mysql.allow_local_infile=On + mysql.allow_persistent=On + mysql.cache_size=2000 + mysql.max_persistent=-1 + mysql.max_links=-1 + mysql.default_port= + mysql.default_socket=/var/lib/mysql/mysql.sock + mysql.default_host= + mysql.default_user= + mysql.default_password= + mysql.connect_timeout=60 + mysql.trace_mode=Off + + Now you need to create a database user and the database itself by using the MySQL + command line interface. The database tables will be created by ownCloud when you + login for the first time. + :: + + # mysql -hlocalhost -uroot -proot-password + mysql> CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; + mysql> CREATE DATABASE IF NOT EXISTS owncloud; + mysql> GRANT ALL PRIVILEGES ON owncloud.* TO 'username'@'localhost' IDENTIFIED BY 'password'; + mysql> QUIT + + In the ownCloud counfiguration you need to set the hostname on which the + database is running and a valid username and password to access it. + :: + + "dbtype" => "mysql", + "dbname" => "owncloud", + "dbuser" => "username", + "dbpassword" => "password", + "dbhost" => "localhost", + "dbtableprefix" => "", + +* **PostgreSQL database** + + If you decide to use a PostgreSQL database make sure that you have installed + and enabled the PostgreSQL extension in PHP. The PHP configuration could look + like this: + :: + + cat /etc/php5/conf.d/pgsql.ini + # configuration for PHP PostgreSQL module + extension=pdo_pgsql.so + extension=pgsql.so + + [PostgresSQL] + pgsql.allow_persistent = On + pgsql.auto_reset_persistent = Off + pgsql.max_persistent = -1 + pgsql.max_links = -1 + pgsql.ignore_notice = 0 + pgsql.log_notice = 0 + + 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. + :: + + # psql -hlocalhost -Upostgres + postgres=# CREATE USER username WITH PASSWORD 'password'; + postgres=# CREATE DATABASE owncloud TEMPLATE template0 ENCODING 'UNICODE'; + postgres=# ALTER DATABASE owncloud OWNER TO username; + postgres=# GRANT ALL PRIVILEGES ON DATABASE owncloud TO username; + postgres=# \q + + In the ownCloud counfiguration you need to set the hostname on which the database + is running and a valid username (and password) to access it. If the database has + been installed on the same server as ownCloud a password is very often not required + to access the database. + :: + + "dbtype" => "pgsql", + "dbname" => "owncloud", + "dbuser" => "username", + "dbpassword" => "password", + "dbhost" => "localhost", + "dbtableprefix" => "", + +Trouble Shooting +---------------- + +1. **How can I find out if my MySQL/PostgreSQL server is reachable?** + + Use the ping command to check the server availability: + :: + + # ping db.server.dom + PING db.server.dom (ip-address) 56(84) bytes of data. + 64 bytes from your-server.local.lan (192.168.1.10): icmp_req=1 ttl=64 time=3.64 ms + 64 bytes from your-server.local.lan (192.168.1.10): icmp_req=2 ttl=64 time=0.055 ms + 64 bytes from your-server.local.lan (192.168.1.10): icmp_req=3 ttl=64 time=0.062 ms + +2. **How can I find out if a created user can access a database?** + + The easiet way to test if a database can be accessed is by starting the command line + interface: + + SQLite + + # sqlite3 /www/htdocs/owncloud/data/owncloud.db + sqlite> .version + SQLite 3.7.15.1 2012-12-19 20:39:10 6b85b767d0ff7975146156a99ad673f2c1a23318 + sqlite> .quit + + MySQL + + # mysql -hlocalhost -uusername -ppassword + mysql> SHOW VARIABLES LIKE "version"; + +---------------+--------+ + | Variable_name | Value | + +---------------+--------+ + | version | 5.1.67 | + +---------------+--------+ + 1 row in set (0.00 sec) + mysql> quit + + PostgreSQL + + # ./psql -hlocalhost -Uusername -downcloud + postgres=# SELECT version(); + version + ----------------------------------------------------------------------------------------------------- + PostgreSQL 8.4.12 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.3 20080704 (prerelease), 32-bit + (1 row) + postgres=# \q + +3. **Are there any other useful SQL commands which are worse to know?** + + Show database users + + SQLite : No database user is required. + MySQL : SELECT User,Host FROM mysql.user; + PostgreSQL: SELECT * from pg_user; + + Show available databases + + SQLite : .databases (normally one database per file!) + MySQL : SHOW DATABASES; + PostgreSQL: \l + + Show ownCloud tables in database + + SQLite : .tables + MySQL : USE owncloud; SHOW TABLES; + PostgreSQL: \c owncloud; \d + + Quit database + + SQLite : .quit + MySQL : quit + PostgreSQL: \q From afb6519a68391a222c3bf54caeb48b580563a1bd Mon Sep 17 00:00:00 2001 From: j-ed Date: Mon, 28 Jan 2013 18:11:31 +0100 Subject: [PATCH 2/7] Update admin_manual/configuration_database.rst --- admin_manual/configuration_database.rst | 136 ++++++++++++------------ 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/admin_manual/configuration_database.rst b/admin_manual/configuration_database.rst index 641b01c25..9e0b745a8 100644 --- a/admin_manual/configuration_database.rst +++ b/admin_manual/configuration_database.rst @@ -1,4 +1,3 @@ - Database Configuration ====================== @@ -17,10 +16,11 @@ database first. These steps will not be covered by this description. Parameters ---------- -* **SQLite database** +* **SQLite Database** If you decide to use a SQLite database make sure that you have installed and - enabled the SQLite extension in PHP. The PHP configuration could look like this: + enabled the SQLite extension in PHP. The PHP configuration could look like + this: :: cat /etc/php5/conf.d/sqlite3.ini @@ -28,8 +28,9 @@ Parameters extension=pdo_sqlite.so extension=sqlite3.so - It is not necessary to create a database and a database user in advance because - this will automatically be done by ownCloud when you login for the first time. + It is not necessary to create a database and a database user in advance + because this will automatically be done by ownCloud when you login for the + first time. In the ownCloud counfiguration you need to set at least the ``datadirectory`` parameter to the directory where your data and database should be stored. @@ -45,11 +46,11 @@ Parameters "dbtableprefix" => "", "datadirectory" => "/www/htdocs/owncloud/data", -* **MySQL database** +* **MySQL Database** If you decide to use a MySQL database make sure that you have installed and enabled the MySQL extension in PHP and that the ``mysql.default_socket`` - points to the correct socket, if the database runs on same server as ownCloud. + points to the correct socket (if the database runs on same server as ownCloud). The PHP configuration could look like this: :: @@ -72,9 +73,9 @@ Parameters mysql.connect_timeout=60 mysql.trace_mode=Off - Now you need to create a database user and the database itself by using the MySQL - command line interface. The database tables will be created by ownCloud when you - login for the first time. + Now you need to create a database user and the database itself by using the + MySQL command line interface. The database tables will be created by ownCloud + when you login for the first time. :: # mysql -hlocalhost -uroot -proot-password @@ -83,7 +84,7 @@ Parameters mysql> GRANT ALL PRIVILEGES ON owncloud.* TO 'username'@'localhost' IDENTIFIED BY 'password'; mysql> QUIT - In the ownCloud counfiguration you need to set the hostname on which the + In the ownCloud configuration you need to set the hostname on which the database is running and a valid username and password to access it. :: @@ -94,7 +95,7 @@ Parameters "dbhost" => "localhost", "dbtableprefix" => "", -* **PostgreSQL database** +* **PostgreSQL Database** If you decide to use a PostgreSQL database make sure that you have installed and enabled the PostgreSQL extension in PHP. The PHP configuration could look @@ -114,9 +115,9 @@ Parameters pgsql.ignore_notice = 0 pgsql.log_notice = 0 - 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. + 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. :: # psql -hlocalhost -Upostgres @@ -126,10 +127,10 @@ Parameters postgres=# GRANT ALL PRIVILEGES ON DATABASE owncloud TO username; postgres=# \q - In the ownCloud counfiguration you need to set the hostname on which the database - is running and a valid username (and password) to access it. If the database has - been installed on the same server as ownCloud a password is very often not required - to access the database. + In the ownCloud configuration you need to set the hostname on which the + database is running and a valid username (and sometimes a password) to + access it. If the database has been installed on the same server as + ownCloud a password is very often not required to access the database. :: "dbtype" => "pgsql", @@ -146,7 +147,6 @@ Trouble Shooting Use the ping command to check the server availability: :: - # ping db.server.dom PING db.server.dom (ip-address) 56(84) bytes of data. 64 bytes from your-server.local.lan (192.168.1.10): icmp_req=1 ttl=64 time=3.64 ms @@ -155,60 +155,60 @@ Trouble Shooting 2. **How can I find out if a created user can access a database?** - The easiet way to test if a database can be accessed is by starting the command line - interface: + The easiet way to test if a database can be accessed is by starting the + command line interface: - SQLite + **SQLite** + :: + # sqlite3 /www/htdocs/owncloud/data/owncloud.db + sqlite> .version + SQLite 3.7.15.1 2012-12-19 20:39:10 6b85b767d0ff7975146156a99ad673f2c1a23318 + sqlite> .quit - # sqlite3 /www/htdocs/owncloud/data/owncloud.db - sqlite> .version - SQLite 3.7.15.1 2012-12-19 20:39:10 6b85b767d0ff7975146156a99ad673f2c1a23318 - sqlite> .quit + **MySQL** + :: + # mysql -hlocalhost -uusername -ppassword + mysql> SHOW VARIABLES LIKE "version"; + +---------------+--------+ + | Variable_name | Value | + +---------------+--------+ + | version | 5.1.67 | + +---------------+--------+ + 1 row in set (0.00 sec) + mysql> quit - MySQL - - # mysql -hlocalhost -uusername -ppassword - mysql> SHOW VARIABLES LIKE "version"; - +---------------+--------+ - | Variable_name | Value | - +---------------+--------+ - | version | 5.1.67 | - +---------------+--------+ - 1 row in set (0.00 sec) - mysql> quit - - PostgreSQL - - # ./psql -hlocalhost -Uusername -downcloud - postgres=# SELECT version(); - version - ----------------------------------------------------------------------------------------------------- - PostgreSQL 8.4.12 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.3 20080704 (prerelease), 32-bit - (1 row) - postgres=# \q + **PostgreSQL** + :: + # ./psql -hlocalhost -Uusername -downcloud + postgres=# SELECT version(); + version + ----------------------------------------------------------------------------------------------------- + PostgreSQL 8.4.12 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.3 20080704 (prerelease), 32-bit + (1 row) + postgres=# \q 3. **Are there any other useful SQL commands which are worse to know?** - Show database users + **Show Database Users** + :: + SQLite : No database user is required. + MySQL : SELECT User,Host FROM mysql.user; + PostgreSQL: SELECT * from pg_user; - SQLite : No database user is required. - MySQL : SELECT User,Host FROM mysql.user; - PostgreSQL: SELECT * from pg_user; + **Show available Databases** + :: + SQLite : .databases (normally one database per file!) + MySQL : SHOW DATABASES; + PostgreSQL: \l - Show available databases + **Show ownCloud Tables in Database** + :: + SQLite : .tables + MySQL : USE owncloud; SHOW TABLES; + PostgreSQL: \c owncloud; \d - SQLite : .databases (normally one database per file!) - MySQL : SHOW DATABASES; - PostgreSQL: \l - - Show ownCloud tables in database - - SQLite : .tables - MySQL : USE owncloud; SHOW TABLES; - PostgreSQL: \c owncloud; \d - - Quit database - - SQLite : .quit - MySQL : quit - PostgreSQL: \q + **Quit Database** + :: + SQLite : .quit + MySQL : quit + PostgreSQL: \q From 9319716e02b317440f562d3da3782251ff8b53e8 Mon Sep 17 00:00:00 2001 From: j-ed Date: Mon, 28 Jan 2013 10:15:19 -0800 Subject: [PATCH 3/7] Create configuration_automation.rst added description of the automatic configuration file. --- admin_manual/configuration_automation.rst | 76 +++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 admin_manual/configuration_automation.rst diff --git a/admin_manual/configuration_automation.rst b/admin_manual/configuration_automation.rst new file mode 100644 index 000000000..acfe20bd9 --- /dev/null +++ b/admin_manual/configuration_automation.rst @@ -0,0 +1,76 @@ +Automatic Configuration +======================= + +If you need to install ownCloud on multiple servers you normally do not want +to set-up each instance separately as described in the `Database Configuration` +chapter. For this reason the automatic configuration feature has been introduced. + +To take advance of this feature you need to create a configuration file, called +``../owncloud/config/autoconfig.php`` and set the parameters as required. The +file will automatically been removed after the initial configuration has been +applied. + +Parameters +---------- + + You need to keep in mind that two parameters are named differently in this + configuration file compared to the normal ``config.php``file. + :: + +----------------+---------------+ + | autoconfig.php | config.php | + +================+===============+ + | directory | datadirectory | + | dbpass | dbpassword | + +----------------+---------------+ + +* **SQLite Database** + + :: + "sqlite", + "dbname" => "owncloud", + "dbtableprefix" => "", + "directory" => "/www/htdocs/owncloud/data", + ); + ?> + +* **MySQL Database** + + Keep in mind that the automatic configuration does not unburden you from + creating the database user and database itself in advance, as described + in the `Database Configuration` chapter. + :: + "mysql", + "dbname" => "owncloud", + "dbuser" => "username", + "dbpass" => "password", + "dbhost" => "localhost", + "dbtableprefix" => "", + "adminlogin" => "root", + "adminpass" => "root-password", + "directory" => "/www/htdocs/owncloud/data", + ); + ?> + +* **PostgreSQL Database** + + Keep in mind that the automatic configuration does not unburden you from + creating the database user and database itself in advance, as described + in the `Database Configuration` chapter. + :: + "pgsql", + "dbname" => "owncloud", + "dbuser" => "username", + "dbpass" => "password", + "dbhost" => "localhost", + "dbtableprefix" => "", + "adminlogin" => "root", + "adminpass" => "root-password", + "directory" => "/www/htdocs/owncloud/data", + ); + ?> From 1b20d3489e28f0483db5b34a7050d3ad0795df0c Mon Sep 17 00:00:00 2001 From: j-ed Date: Mon, 28 Jan 2013 19:31:42 +0100 Subject: [PATCH 4/7] Update admin_manual/configuration_automation.rst --- admin_manual/configuration_automation.rst | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/admin_manual/configuration_automation.rst b/admin_manual/configuration_automation.rst index acfe20bd9..f2a1adf42 100644 --- a/admin_manual/configuration_automation.rst +++ b/admin_manual/configuration_automation.rst @@ -2,29 +2,29 @@ Automatic Configuration ======================= If you need to install ownCloud on multiple servers you normally do not want -to set-up each instance separately as described in the `Database Configuration` +to set-up each instance separately as described in the `Database Configuration`_ chapter. For this reason the automatic configuration feature has been introduced. To take advance of this feature you need to create a configuration file, called ``../owncloud/config/autoconfig.php`` and set the parameters as required. The -file will automatically been removed after the initial configuration has been +file will automatically be removed after the initial configuration has been applied. Parameters ---------- - You need to keep in mind that two parameters are named differently in this - configuration file compared to the normal ``config.php``file. - :: - +----------------+---------------+ - | autoconfig.php | config.php | - +================+===============+ - | directory | datadirectory | - | dbpass | dbpassword | - +----------------+---------------+ +You need to keep in mind that two parameters are named differently in this +configuration file compared to the normal ``config.php`` file. + ++----------------+---------------+ +| autoconfig.php | config.php | ++================+===============+ +| directory | datadirectory | ++----------------+---------------+ +| dbpass | dbpassword | ++----------------+---------------+ * **SQLite Database** - :: Date: Tue, 29 Jan 2013 09:24:19 +0100 Subject: [PATCH 5/7] Update admin_manual/configuration_automation.rst fixed internal links. --- admin_manual/configuration_automation.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/admin_manual/configuration_automation.rst b/admin_manual/configuration_automation.rst index f2a1adf42..cc39b751a 100644 --- a/admin_manual/configuration_automation.rst +++ b/admin_manual/configuration_automation.rst @@ -2,8 +2,9 @@ Automatic Configuration ======================= If you need to install ownCloud on multiple servers you normally do not want -to set-up each instance separately as described in the `Database Configuration`_ -chapter. For this reason the automatic configuration feature has been introduced. +to set-up each instance separately as described in the `Database Configuration` +chapter (:doc:`./configuration_database`). For this reason the automatic +configuration feature has been introduced. To take advance of this feature you need to create a configuration file, called ``../owncloud/config/autoconfig.php`` and set the parameters as required. The @@ -39,7 +40,7 @@ configuration file compared to the normal ``config.php`` file. Keep in mind that the automatic configuration does not unburden you from creating the database user and database in advance, as described in the - `Database Configuration`_ chapter. + `Database Configuration` chapter (:doc:`./configuration_database`). :: Date: Tue, 29 Jan 2013 09:25:36 +0100 Subject: [PATCH 6/7] Update admin_manual/configuration_automation.rst --- admin_manual/configuration_automation.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin_manual/configuration_automation.rst b/admin_manual/configuration_automation.rst index cc39b751a..c5975d6c7 100644 --- a/admin_manual/configuration_automation.rst +++ b/admin_manual/configuration_automation.rst @@ -2,7 +2,7 @@ Automatic Configuration ======================= If you need to install ownCloud on multiple servers you normally do not want -to set-up each instance separately as described in the `Database Configuration` +to set-up each instance separately as described in the ``Database Configuration`` chapter (:doc:`./configuration_database`). For this reason the automatic configuration feature has been introduced. @@ -40,7 +40,7 @@ configuration file compared to the normal ``config.php`` file. Keep in mind that the automatic configuration does not unburden you from creating the database user and database in advance, as described in the - `Database Configuration` chapter (:doc:`./configuration_database`). + ``Database Configuration`` chapter (:doc:`./configuration_database`). :: Date: Wed, 30 Jan 2013 05:08:58 -0800 Subject: [PATCH 7/7] Create configuration_logging.rst added description of logging parameters. --- admin_manual/configuration_logging.rst | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 admin_manual/configuration_logging.rst diff --git a/admin_manual/configuration_logging.rst b/admin_manual/configuration_logging.rst new file mode 100644 index 000000000..9f2015254 --- /dev/null +++ b/admin_manual/configuration_logging.rst @@ -0,0 +1,39 @@ +Logging Configuration +===================== + +To get an idea of how the current status of an ownCloud system is or to +solve issues log information is a good point to start with. ownCloud allows +to configure the way how and which depth of information should be logged. + +Parameters +---------- + + First you need to decide in which way logging should be done. You can + choose between the two options ``owncloud`` and ``syslog``. Then you need + to configure the log level which directly influences how much information + will be logged. You can choose between ``0=DEBUG``, ``1=INFO``, ``2=WARN`` + and ``3=ERROR``. + The most detailed information will be written if ``0`` (DEBUG) is set, the + least information will be written if ``3`` (ERROR) is set. Keep in mind that + it might slow down the whole system if a too detailed logging will has been + configured. By default the log level is set to ``2`` (WARN). + + **owncloud** + - All log information will be written to a separate log file which can be + viewed using the log menu in the admin menu of ownCloud. By default a log + file named ``owncloud.log`` will be created in the directory which has + been configured by the ``datadirectory`` parameter. + :: + + "log_type" => "owncloud", + "logfile" => "owncloud.log", + "loglevel" => "3", + + **syslog** + - All log information will be send to the default syslog deamon of a system. + :: + + "log_type" => "syslog", + "logfile" => "", + "loglevel" => "3", +