2014-04-29 14:47:39 +00:00
..
2014-04-29 14:47:39 +00:00
2014-04-11 16:28:17 +00:00

$OpenBSD: README,v 1.27 2014/04/11 16:28:17 ajacoutot Exp $

+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
+-----------------------------------------------------------------------

ownCloud is installed under
    ${INSTDIR}
It should point to the root directory of the HTTP server. e.g.
    # ln -s ../owncloud /var/www/htdocs/owncloud

Official installation intructions are available at:
    http://doc.owncloud.org/server/6.0/admin_manual/installation/installation_source.html

Post-installation instructions
==============================
ownCloud attempts to use the UTF-8 locale, which does not work by
default inside the /var/www chroot. This causes warning messages in
ownCloud's admin configuration page and logs. To prevent this problem,
run the following as root:
  # mkdir -p /var/www/usr/share/locale/UTF-8/
  # cp /usr/share/locale/UTF-8/LC_CTYPE \
          /var/www/usr/share/locale/UTF-8/

nginx(8) configuration
----------------------
This configuration chunk can be adapted and used in a server{} block:

-8<---------------------------------------------------------------------
        client_max_body_size 10G; # set max upload size
        fastcgi_buffers 64 4K;
        rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
        rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
        rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
        error_page 403 /core/templates/403.php;
        error_page 404 /core/templates/404.php;


        location ~ ^(.+?\.php)(/.*)?$ {
            try_files $1 = 404;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$1;
            fastcgi_param PATH_INFO $2;
            fastcgi_pass   unix:run/php-fpm.sock;
        }

        location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
                deny all;
        }

        location / {
            # The following 2 rules are only needed with webfinger
            rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
            rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;

            rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
            rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;

            rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;

            try_files $uri $uri/ index.php;
        }

        # Optional: set long EXPIRES header on static assets
        location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
            expires 30d;
            # Optional: Don't log access to assets
            access_log off;
        }
-8<---------------------------------------------------------------------

PHP configuration
-----------------
Default PHP values should be adapted according to the setup by editing:
   ${SYSCONFDIR}/php-${MODPHP_VERSION}.ini

allow_url_fopen = On
memory_limit = 512M
upload_max_filesize = 513M	# to accept large files upload
post_max_size = 513M		# sync with above value	

For enhanced performance one of these PHP packages can be installed:
    pecl-APC or xcache

Database configuration
----------------------
ownCloud can work with a PostgreSQL, MySQL or SQLite3 database.
Support for SQLite3 is included with the main php package; to use
another database, the corresponding package needs to be installed
*before* setting up ownCloud:
    php-pdo_pgsql or php-pdo_mysql

Configuration is done under:
    ${INSTDIR}/config/config.php
When running chrooted, /var/www must be stripped from paths.

By default, "datadirectory" is set to:
    /owncloud-data
which expends to ${PREFIX}/owncloud-data outside the chroot.

Cron job
--------
ownCloud needs to run background jobs on a regular basis. By default, it
will execute one task with each page loaded ("AJAX" option in the admin
interface).
The prefered way is to use a cron(8) job instead. Two options are
available and both require to edit the web server user's crontab(5).
e.g. "crontab -u www -e"
(swap "www" with the user the web server runs as)

-> "Webcron" (works in chroot)
*/15	*	*	*	*	/usr/bin/ftp -Vo - http://<hostname>/owncloud/cron.php >/dev/null

-> "Cron" (does *not* work in chroot)
*/15	*	*	*	*	${MODPHP_BIN} -f ${INSTDIR}/cron.php

LDAP user backend
-----------------
If the LDAP user backend is enabled, the "php-ldap" package will need to
be installed.

Finishing and validating the installation
-----------------------------------------
Make sure the web server can resolve its hostname (e.g. if chrooted, by
creating /var/www/etc/hosts and/or /var/www/etc/resolv.conf).

Accessing http://<hostname>/owncloud with a Web browser will finish the
installation and create a new admin user.

Updating
========
Before updating to a new release, read:
    http://doc.owncloud.org/server/6.0/admin_manual/maintenance/update.html

When using a PostgreSQL or MySQL, the corresponding MDB2 php package
must be installed to properly upgrade the database:
    php-pgsql or php-mysql

WebDAV access
=============
The personal WebDAV share can be accessed using the following URL (e.g.
with Nautilus, Thunar or Doplhin) and the corresponding user and
password for the share:
    http://<hostname>/owncloud/remote.php/webdav/

NOTE that it is highly recommended to use SSL on the webserver so that
access is done over https instead of http.

Synchronization
===============
The "ocsync" package (net/ocsync) can be installed to synchronize local
files with ownCloud. e.g.
    $ ocsync /path/to/localdir ownclouds://<username>:<password>@<hostname>/files/webdav.php/remotedir/

Encryption app and chroot
=========================
To provide server side-encryption, the "Encryption" app can be enabled
in the ownCloud admin interface. When running a chrooted web server,
some manual steps are required to make it work.

openssl(1)
----------
The openssl binary and dependent libraries must be installed in the
chroot. As root:
    mkdir /var/www/etc
    mkdir -p /var/www/usr/{lib,libexec,sbin}
    cp /usr/sbin/openssl /var/www/usr/sbin/
    cp /etc/ssl/openssl.cnf /var/www/etc/ssl/openssl.cnf # edit accordingly
    for i in $(ldd /usr/sbin/openssl | grep 'lib/' | awk '{ print $7 }'); do
    > cp -p $i /var/www$i
    > done

Make sure to update the openssl binary and libraries in the chroot
whenever they are updated on the system.

Apps and dependencies
=====================
To keep dependencies to a minimum, not all dependencies for all
installed apps are enforced. It is the job of the administrator to
manually install required packages according to the non-default apps he
wants to enable.