Own Cloud Admin Manual

45
ownCloud Administrators Manual Release 5.0 The ownCloud developers December 27, 2012

Transcript of Own Cloud Admin Manual

Page 1: Own Cloud Admin Manual

ownCloud Administrators ManualRelease 50

The ownCloud developers

December 27 2012

CONTENTS

1 Introduction 111 Target audience 112 Structure of this document 1

2 Installation 321 Manual Installation 322 Linux Distributions 523 Web server Notes 724 Mac OS X 925 Windows 7 and Windows Server 2008 926 Univention Corporate Server 1527 Appliances 20

3 Updating ownCloud 2131 Update 2132 Upgrade 21

4 User Authentication with LDAP 2341 Basic Settings 2342 Advanced Settings 2443 Microsoft Active Directory 2744 Testing the configuration 2745 ownCloud LDAP Internals 2846 User and Group Mapping 2847 Caching 28

5 Serving static files via web server 2951 Apache2 (X-Sendfile) 2952 Nginx (X-Accel-Redirect) 3053 How do I know itrsquos working 31

6 Custom Mount Configuration 3361 Example 3362 Local Filesystem 3463 FTP 3464 WebDAV 3465 OpenStack Swift 3566 SMB 35

7 Custom User Backend Configuration 37

i

71 IMAP 3772 SMB 3773 FTP 38

8 Migrating ownCloud Installs 39

9 Indices and tables 41

ii

CHAPTER

ONE

INTRODUCTION

This is the administrators manual for ownCloud a flexible open source file sync and share solution It comprises ofthe ownCloud server as well as client applications for Microsoft Windows Mac OS X and Linux (Desktop Client)and mobile clients for the Android and Apple iOS operating system

11 Target audience

This guide is targeted towards people who want to install administer and optimize ownCloud Server If you want tolearn how to use the Web UI or how to install clients on the server please refer to the User Manual or the DesktopClient Manual respectively

12 Structure of this document

The next chapters describes how to set up ownCloud Server on different platforms and operating systems as well ashow to update existing installations

Further chapters will then detail on integrating ownCloud into your existing environment eg how to setup LDAP orhow to mount your storage

1

ownCloud Administrators Manual Release 50

2 Chapter 1 Introduction

CHAPTER

TWO

INSTALLATION

This chapter will introduce you to the installation of ownCloud in different scenarios

If you want to just try ownCloud in a virtual machine without any configuration skip ahead to the appliance sectionwhere you will find ready-to-use images

21 Manual Installation

If you do not want to use packages here is how you setup ownCloud on from scratch using a classic LAMP (LinuxApache MySQL PHP) setup

211 Prerequisites

To run ownCloud your webserver must have the following installed

bull php5 (gt= 53)

bull php5-json

bull php-xml

bull php-mbstring

bull php5-zip

bull php5-gd

And as optional dependencies

bull php5-sqlite (gt= 3)

bull curl

bull libcurl3

bull libcurl3-dev

bull php5-curl

bull php5-intl

bull php-pdo

Commands for Ubuntu and Debian

apt-get install apache2 php5 php5-json php-xml php-mbstring php5-zip php5-gdapt-get install php5-sqlite curl libcurl3 libcurl3-dev php5-curl php-pdo

3

ownCloud Administrators Manual Release 50

Todo

Document other distributions

You donrsquot need any WebDAV support of your webserver (ie apachersquos mod_webdav) to access your ownCloud datavia WebDAV ownCloud has a WebDAV server built in

212 Extract ownCloud and Copy to Your Webserver

tar -xjf pathtodownloadedowncloud-xxxtarbz2cp -r owncloud pathtoyourwebserver

213 Set the Directory Permissions

The owner of your webserver must own the apps data and config directories in your ownCloud install You can dothis by running the following command for the apps data and config directories

chown -R www-datawww-data pathtoyourowncloudinstalldata

Replace www-datawww-data with the user and group of the owner of your webserver

Note The data directory will only be created after setup has run (see below) and is not present by default in thetarballs

214 Enable htaccess and mod_rewrite if Running Apache

If you are running the apache webserver it is recommended that you enable htaccess files as ownCloud usesthem to enhance security and allows you to use webfinger To enable htaccess files you need to ensure thatAllowOverride is set to All in the Directory varwww section of your virtual host file This is usually inetcapache2sites-enabled000-default You should also run a2enmod rewrite and a2enmodheaders Then restart apache service apache2 restart (for Ubuntu systems) In order for the maximum upload sizeto be configurable the htaccess file in the owncloud folder needs to be made writable by the server

215 Follow the Install Wizard

Open your web browser and navigate to your ownCloud instance If you are installing ownCloud on the same machineas you will access the install wizard from the url will be httplocalhost (or httplocalhostowncloud) For basicinstalls we recommend SQLite as it is easy to setup (ownCloud will do it for you) For larger installs you shoulduse MySQL or PostgreSQL Click on the Advanced options to show the configuration options You may enter admincredentials and let ownCloud create its own database user or enter a preconfigured user If you are not using apacheas the webserver please set the data directory to a location outside of the document root See the advanced installsettings

216 Test your Installation

Login and start using ownCloud Check your web servers errror log If it shows error you might have missed adependency or hit a bug with your particular configuration

4 Chapter 2 Installation

ownCloud Administrators Manual Release 50

If you plan on using the Webfinger app and your ownCloud installation is not in the webroot then yoursquoll have tomanually link varwwwwell-known to pathtoyourowncloudwell-known

22 Linux Distributions

This section describes the installation process for different distributions If there are pre-made packages from own-Cloud you are encouraged to prefer those over the vendor-provided ones since they usually are more up-to-date

221 Archlinux

There are two AUR packages for ownCloud

bull stable version

bull development version

222 openSUSE

Note ready-to-use SLES and openSUSE RPM packages are available in the openSUSE Build Service ownCloudrepository

1 Copy ownCloud to Apachersquos server directory srvwwwhtdocs

2 Give the web server the necessary permissions sudo chown -R wwwrun owncloud

bull If you do not use ldquosudordquo then you have to become root and execute chown -R wwwrun owncloudin the directory

bull (If yoursquore using mysql you have to set the database character set to something else then utf~8 for examplelatin1 otherwise some keys will be to long for mysql)

3 Open the folder in a browser and complete the setup wizard

If have followed the steps above and want to try it out run this command in a terminal to start Apache if itrsquos not alreadyrunning

1 sudo etcinitdapache2 start

2 Go to httpservernameowncloud and walk through the setup

223 Fedora

Note ready-to-use RPM packages are available in the openSUSE Build Service ownCloud repository

Make sure SELinux is disabled or else the installation process will fail with the following message Config file(configconfigphp) is not writable for the webserver

Configure Apache

1 If you already have a website running from Document Root but would still like to install OwnCloud you can usea Name-based virtual host entry and subdomain

2 Edit your DNS record following this example point owncloudfoocom gt ipipipip

22 Linux Distributions 5

ownCloud Administrators Manual Release 50

Todo

224 CentOS 5 amp 6

Note ready-to-use CentOS RPM packages are available in the openSUSE Build Service ownCloud repository

1 Create a new file in etchttpdconf and call it owncloudconf

2 You can use the following as an example

ltIfModule mod_aliascgtAlias owncloud varwwwowncloudltIfModulegtltDirectory varwwwowncloudgt

Options NoneOrder allowdenyallow from all

ltDirectorygtltVirtualHost 80gt

ServerAdmin foofoofarmcomDocumentRoot varwwwhtmlowncloudServerName owncloudfoocomErrorLog logsowncloudfooinfo-error_logCustomLog logsowncloudfooinfo-access_log common

ltVirtualHostgt

3 Now edit your httpdconf file which is usually located in etchttpdconfhttpdconf

4 Add the following to the bottom Include etchttpdconfowncloudconf

5 Restart apache and now when you point your browser to owncloudfoocom it should properly load withoutdisturbing foocom

225 Gentoo

Basically do everything like for a standard web server (see above) Changepermissions chown -R apacheapache owncloudAllow htaccess modifyetcapache2vhostsd00_default_vhostconf and make sure this is in

ltDirectory varwwwlocalhosthtdocsowncloudgtOptions Indexes FollowSymLinks MultiViewsAllowOverride AllOrder allowdenyallow from all

ltDirectorygt

226 PCLinuxOS

Follow the Tutorial ownCloud installation and setup on the PCLinuxOS web site

6 Chapter 2 Installation

ownCloud Administrators Manual Release 50

23 Web server Notes

The most popular server choice for ownCloud is Apache which is why it is also the combinations tested best Howeverit is also possible to run ownCloud on other web servers This section does not cover Microsoft Internet InformationServices (IIS) it is covered in the Windows 7 and Windows Server 2008 section

231 Nginx Configuration

bull You need to insert the following code into your nginx config file

bull Adjust server_name root ssl_certificate and ssl_certificate_key to suit your needs

bull Make sure your SSL certificates are readable by the server (see httpwikinginxorgHttpSslModule)

redirect http to httpsserver

listen 80server_name owncloudexampleorgrewrite ^ https$server_name$request_uri permanent enforce https

owncloud (ssltls)server

listen 443 sslssl_certificate etcnginxcertsservercrtssl_certificate_key etcnginxcertsserverkeyserver_name owncloudexampleorgroot pathtoowncloudindex indexphpclient_max_body_size 1000M set maximum upload size

deny direct accesslocation ^ ^(data|config|ht|db_structurexml|README) deny all

default try orderlocation try_files $uri $uri webdav

owncloud WebDAVlocation webdav fastcgi_split_path_info ^(+php)()$fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

enable phplocation ^ php$ fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

23 Web server Notes 7

ownCloud Administrators Manual Release 50

Note You can use Owncloud without SSLTLS support but we strongly encourage you not to do that

bull Remove the server block containing the redirect

bull Change listen 443 ssl to listen 80

bull Remove ssl_certificate and ssl_certificate_key

bull Remove fastcgi_params HTTPS on

Note If you want to effectively increase maximum upload size you will also have to modify your php-fpmconfiguration (usually at etcphp5fpmphpini) and increase upload_max_filesize andpost_max_size values Yoursquoll need to restart php5-fpm and nginx services in order these changes to be applied

232 Lighttpd Configuration

This assumes that you are familiar with installing PHP application on lighttpd

It is important to note that the htaccess files used by ownCloud to protect the data folder are ignored by lighttpdso you have to secure it by yourself otherwise your ownclouddblsquo database and user data are publicly readableeven if directory listing is off You need to add two snippets to your lighttpd configuration file

Disable access to data folder

$HTTP[url] =^ ^ownclouddata urlaccess-deny = ()

Disable directory listing

$HTTP[url] =^ ^owncloud($|) dir-listingactivate = disable

233 Yaws Configuration

This should be in your yaws_serverconf In the configuration file the dir_listings = false is impor-tant and also the redirect from data to somewhere else because files will be saved in this directory and it shouldnot be accessible from the outside A configuration file would look like this

ltserver owncloudmyservercomgtport = 80listen = 0000docroot = varwwwowncloudsrcallowed_scripts = phpphp_handler = ltcgi usrlocalbinphp-cgigterrormod_404 = yaws_404_to_index_phpaccess_log = falsedir_listings = falseltredirectgt

data ==

8 Chapter 2 Installation

ownCloud Administrators Manual Release 50

ltredirectgtltservergt

The apache htaccess file that comes with ownCloud is configured to redirect requests to nonexistent pages Toemulate that behaviour you need a custom error handler for yaws See this github gist for further instructions on howto create and compile that error handler

234 Hiawatha Configuration

Add WebDAVapp = yes to the ownCloud virtual host Users accessing WebDAV from MacOS will also need toadd AllowDotFiles = yes

Disable access to data folder

UrlToolkit ToolkitID = denyDataMatch ^data DenyAccess

235 PageKite Configuration

You can use this PageKite how to to make your local ownCloud accessible from the internet using PageKite

24 Mac OS X

Todo

This section of the manual needs to be revised

This relies on MAMP which provides the required environment

1 Install MAMP and run it

2 Go to lsquoPreferences Apachersquo and set lsquoDocument Rootrsquo to UsersltYOUR USER NAMEgtSites so yourSites directory will be used as Apache root

3 Download ownCloud

4 Move it to ~Sites and extract it tar xfpj owncloud-45tarbz2

5 Now you can set it up by going to httplocalhost8888owncloud

25 Windows 7 and Windows Server 2008

Note You must move the data directory outside of your public root (See advanced install settings)

This section describes how to install ownCloud on Windows with IIS (Internet Information Services)

It assumes that you have a vanilla non-IIS enabled Windows machine ndash Windows 7 or Server 2008 After enablingIIS the steps are essentially identical for Windows 7 and Windows Server 2008

24 Mac OS X 9

ownCloud Administrators Manual Release 50

For installation physical access or a remote desktop connection is required You should leverage MySQL as the backend database for ownCloud If you do not want to use MySQL it is possible to use Postgres or SQLite insteadMicrosoft SQL Server is not yet support

Enabling SSL is not yet covered by this section

Note If you make your desktop machine or server available outside your LAN you must maintain it Monitor thelogs manage the access apply patches to avoid compromising the system at large

There are 4 primary steps to the installation and then a 5th step required for configuring everything to allow files largerthan the default 2MB

1 Install IIS with CGI support ndash enable IIS on your Windows machine

2 Install PHP ndash Grab download and install PHP

3 Install MySQL ndash Setup the MySQL server manager and enable ownCloud to create an instance

4 Install ownCloud ndash The whole reason we are here

5 Configure upload sizes and timeouts to enable large file uploads ndash So that you can upload larger files

251 Activate IIS with CGI Support

Windows 7

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 There is a box labeled Internet Information Services expand it

4 Expand World Wide Web Services and all the folders underneath

5 Select the folders as illustrated in the picture below to get your IIS server up and running

You do not need an FTP server running so you should tune that feature off for your server You definitely need the IISManagement Console as that is the easiest way to start stop restart you server as well as where you change certificateoptions and manage items like file upload size You must check the CGI box under Application Development Featuresbecause CGI is how you enable PHP on IIS

You have to turn off WebDAV publishing or the Windows WebDAV conflicts with the ownCloud WebDAV interfaceThis might already be turned off for you just make sure it stays that way The common HTTP features are the featuresyou would expect from a web server With the selections on this page IIS will now serve up a web page for you

Restart IIS by going to the IIS manager (Start ndashgt IIS Manager) Select your website and on the far right side is asection titled Manage Server Make sure that the service is started or click Start to start the services selected Oncethis is complete you should be able to go to a web browser and navigate to httplocalhostlsquo

This should open the standard IIS 7 splash page which is just a static image that says your web server is runningAssuming you were able to get the splash page it is safe to say your web server is now up and running

Windows Server 2008

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 This will bring up the Server Manager

10 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 2: Own Cloud Admin Manual

CONTENTS

1 Introduction 111 Target audience 112 Structure of this document 1

2 Installation 321 Manual Installation 322 Linux Distributions 523 Web server Notes 724 Mac OS X 925 Windows 7 and Windows Server 2008 926 Univention Corporate Server 1527 Appliances 20

3 Updating ownCloud 2131 Update 2132 Upgrade 21

4 User Authentication with LDAP 2341 Basic Settings 2342 Advanced Settings 2443 Microsoft Active Directory 2744 Testing the configuration 2745 ownCloud LDAP Internals 2846 User and Group Mapping 2847 Caching 28

5 Serving static files via web server 2951 Apache2 (X-Sendfile) 2952 Nginx (X-Accel-Redirect) 3053 How do I know itrsquos working 31

6 Custom Mount Configuration 3361 Example 3362 Local Filesystem 3463 FTP 3464 WebDAV 3465 OpenStack Swift 3566 SMB 35

7 Custom User Backend Configuration 37

i

71 IMAP 3772 SMB 3773 FTP 38

8 Migrating ownCloud Installs 39

9 Indices and tables 41

ii

CHAPTER

ONE

INTRODUCTION

This is the administrators manual for ownCloud a flexible open source file sync and share solution It comprises ofthe ownCloud server as well as client applications for Microsoft Windows Mac OS X and Linux (Desktop Client)and mobile clients for the Android and Apple iOS operating system

11 Target audience

This guide is targeted towards people who want to install administer and optimize ownCloud Server If you want tolearn how to use the Web UI or how to install clients on the server please refer to the User Manual or the DesktopClient Manual respectively

12 Structure of this document

The next chapters describes how to set up ownCloud Server on different platforms and operating systems as well ashow to update existing installations

Further chapters will then detail on integrating ownCloud into your existing environment eg how to setup LDAP orhow to mount your storage

1

ownCloud Administrators Manual Release 50

2 Chapter 1 Introduction

CHAPTER

TWO

INSTALLATION

This chapter will introduce you to the installation of ownCloud in different scenarios

If you want to just try ownCloud in a virtual machine without any configuration skip ahead to the appliance sectionwhere you will find ready-to-use images

21 Manual Installation

If you do not want to use packages here is how you setup ownCloud on from scratch using a classic LAMP (LinuxApache MySQL PHP) setup

211 Prerequisites

To run ownCloud your webserver must have the following installed

bull php5 (gt= 53)

bull php5-json

bull php-xml

bull php-mbstring

bull php5-zip

bull php5-gd

And as optional dependencies

bull php5-sqlite (gt= 3)

bull curl

bull libcurl3

bull libcurl3-dev

bull php5-curl

bull php5-intl

bull php-pdo

Commands for Ubuntu and Debian

apt-get install apache2 php5 php5-json php-xml php-mbstring php5-zip php5-gdapt-get install php5-sqlite curl libcurl3 libcurl3-dev php5-curl php-pdo

3

ownCloud Administrators Manual Release 50

Todo

Document other distributions

You donrsquot need any WebDAV support of your webserver (ie apachersquos mod_webdav) to access your ownCloud datavia WebDAV ownCloud has a WebDAV server built in

212 Extract ownCloud and Copy to Your Webserver

tar -xjf pathtodownloadedowncloud-xxxtarbz2cp -r owncloud pathtoyourwebserver

213 Set the Directory Permissions

The owner of your webserver must own the apps data and config directories in your ownCloud install You can dothis by running the following command for the apps data and config directories

chown -R www-datawww-data pathtoyourowncloudinstalldata

Replace www-datawww-data with the user and group of the owner of your webserver

Note The data directory will only be created after setup has run (see below) and is not present by default in thetarballs

214 Enable htaccess and mod_rewrite if Running Apache

If you are running the apache webserver it is recommended that you enable htaccess files as ownCloud usesthem to enhance security and allows you to use webfinger To enable htaccess files you need to ensure thatAllowOverride is set to All in the Directory varwww section of your virtual host file This is usually inetcapache2sites-enabled000-default You should also run a2enmod rewrite and a2enmodheaders Then restart apache service apache2 restart (for Ubuntu systems) In order for the maximum upload sizeto be configurable the htaccess file in the owncloud folder needs to be made writable by the server

215 Follow the Install Wizard

Open your web browser and navigate to your ownCloud instance If you are installing ownCloud on the same machineas you will access the install wizard from the url will be httplocalhost (or httplocalhostowncloud) For basicinstalls we recommend SQLite as it is easy to setup (ownCloud will do it for you) For larger installs you shoulduse MySQL or PostgreSQL Click on the Advanced options to show the configuration options You may enter admincredentials and let ownCloud create its own database user or enter a preconfigured user If you are not using apacheas the webserver please set the data directory to a location outside of the document root See the advanced installsettings

216 Test your Installation

Login and start using ownCloud Check your web servers errror log If it shows error you might have missed adependency or hit a bug with your particular configuration

4 Chapter 2 Installation

ownCloud Administrators Manual Release 50

If you plan on using the Webfinger app and your ownCloud installation is not in the webroot then yoursquoll have tomanually link varwwwwell-known to pathtoyourowncloudwell-known

22 Linux Distributions

This section describes the installation process for different distributions If there are pre-made packages from own-Cloud you are encouraged to prefer those over the vendor-provided ones since they usually are more up-to-date

221 Archlinux

There are two AUR packages for ownCloud

bull stable version

bull development version

222 openSUSE

Note ready-to-use SLES and openSUSE RPM packages are available in the openSUSE Build Service ownCloudrepository

1 Copy ownCloud to Apachersquos server directory srvwwwhtdocs

2 Give the web server the necessary permissions sudo chown -R wwwrun owncloud

bull If you do not use ldquosudordquo then you have to become root and execute chown -R wwwrun owncloudin the directory

bull (If yoursquore using mysql you have to set the database character set to something else then utf~8 for examplelatin1 otherwise some keys will be to long for mysql)

3 Open the folder in a browser and complete the setup wizard

If have followed the steps above and want to try it out run this command in a terminal to start Apache if itrsquos not alreadyrunning

1 sudo etcinitdapache2 start

2 Go to httpservernameowncloud and walk through the setup

223 Fedora

Note ready-to-use RPM packages are available in the openSUSE Build Service ownCloud repository

Make sure SELinux is disabled or else the installation process will fail with the following message Config file(configconfigphp) is not writable for the webserver

Configure Apache

1 If you already have a website running from Document Root but would still like to install OwnCloud you can usea Name-based virtual host entry and subdomain

2 Edit your DNS record following this example point owncloudfoocom gt ipipipip

22 Linux Distributions 5

ownCloud Administrators Manual Release 50

Todo

224 CentOS 5 amp 6

Note ready-to-use CentOS RPM packages are available in the openSUSE Build Service ownCloud repository

1 Create a new file in etchttpdconf and call it owncloudconf

2 You can use the following as an example

ltIfModule mod_aliascgtAlias owncloud varwwwowncloudltIfModulegtltDirectory varwwwowncloudgt

Options NoneOrder allowdenyallow from all

ltDirectorygtltVirtualHost 80gt

ServerAdmin foofoofarmcomDocumentRoot varwwwhtmlowncloudServerName owncloudfoocomErrorLog logsowncloudfooinfo-error_logCustomLog logsowncloudfooinfo-access_log common

ltVirtualHostgt

3 Now edit your httpdconf file which is usually located in etchttpdconfhttpdconf

4 Add the following to the bottom Include etchttpdconfowncloudconf

5 Restart apache and now when you point your browser to owncloudfoocom it should properly load withoutdisturbing foocom

225 Gentoo

Basically do everything like for a standard web server (see above) Changepermissions chown -R apacheapache owncloudAllow htaccess modifyetcapache2vhostsd00_default_vhostconf and make sure this is in

ltDirectory varwwwlocalhosthtdocsowncloudgtOptions Indexes FollowSymLinks MultiViewsAllowOverride AllOrder allowdenyallow from all

ltDirectorygt

226 PCLinuxOS

Follow the Tutorial ownCloud installation and setup on the PCLinuxOS web site

6 Chapter 2 Installation

ownCloud Administrators Manual Release 50

23 Web server Notes

The most popular server choice for ownCloud is Apache which is why it is also the combinations tested best Howeverit is also possible to run ownCloud on other web servers This section does not cover Microsoft Internet InformationServices (IIS) it is covered in the Windows 7 and Windows Server 2008 section

231 Nginx Configuration

bull You need to insert the following code into your nginx config file

bull Adjust server_name root ssl_certificate and ssl_certificate_key to suit your needs

bull Make sure your SSL certificates are readable by the server (see httpwikinginxorgHttpSslModule)

redirect http to httpsserver

listen 80server_name owncloudexampleorgrewrite ^ https$server_name$request_uri permanent enforce https

owncloud (ssltls)server

listen 443 sslssl_certificate etcnginxcertsservercrtssl_certificate_key etcnginxcertsserverkeyserver_name owncloudexampleorgroot pathtoowncloudindex indexphpclient_max_body_size 1000M set maximum upload size

deny direct accesslocation ^ ^(data|config|ht|db_structurexml|README) deny all

default try orderlocation try_files $uri $uri webdav

owncloud WebDAVlocation webdav fastcgi_split_path_info ^(+php)()$fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

enable phplocation ^ php$ fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

23 Web server Notes 7

ownCloud Administrators Manual Release 50

Note You can use Owncloud without SSLTLS support but we strongly encourage you not to do that

bull Remove the server block containing the redirect

bull Change listen 443 ssl to listen 80

bull Remove ssl_certificate and ssl_certificate_key

bull Remove fastcgi_params HTTPS on

Note If you want to effectively increase maximum upload size you will also have to modify your php-fpmconfiguration (usually at etcphp5fpmphpini) and increase upload_max_filesize andpost_max_size values Yoursquoll need to restart php5-fpm and nginx services in order these changes to be applied

232 Lighttpd Configuration

This assumes that you are familiar with installing PHP application on lighttpd

It is important to note that the htaccess files used by ownCloud to protect the data folder are ignored by lighttpdso you have to secure it by yourself otherwise your ownclouddblsquo database and user data are publicly readableeven if directory listing is off You need to add two snippets to your lighttpd configuration file

Disable access to data folder

$HTTP[url] =^ ^ownclouddata urlaccess-deny = ()

Disable directory listing

$HTTP[url] =^ ^owncloud($|) dir-listingactivate = disable

233 Yaws Configuration

This should be in your yaws_serverconf In the configuration file the dir_listings = false is impor-tant and also the redirect from data to somewhere else because files will be saved in this directory and it shouldnot be accessible from the outside A configuration file would look like this

ltserver owncloudmyservercomgtport = 80listen = 0000docroot = varwwwowncloudsrcallowed_scripts = phpphp_handler = ltcgi usrlocalbinphp-cgigterrormod_404 = yaws_404_to_index_phpaccess_log = falsedir_listings = falseltredirectgt

data ==

8 Chapter 2 Installation

ownCloud Administrators Manual Release 50

ltredirectgtltservergt

The apache htaccess file that comes with ownCloud is configured to redirect requests to nonexistent pages Toemulate that behaviour you need a custom error handler for yaws See this github gist for further instructions on howto create and compile that error handler

234 Hiawatha Configuration

Add WebDAVapp = yes to the ownCloud virtual host Users accessing WebDAV from MacOS will also need toadd AllowDotFiles = yes

Disable access to data folder

UrlToolkit ToolkitID = denyDataMatch ^data DenyAccess

235 PageKite Configuration

You can use this PageKite how to to make your local ownCloud accessible from the internet using PageKite

24 Mac OS X

Todo

This section of the manual needs to be revised

This relies on MAMP which provides the required environment

1 Install MAMP and run it

2 Go to lsquoPreferences Apachersquo and set lsquoDocument Rootrsquo to UsersltYOUR USER NAMEgtSites so yourSites directory will be used as Apache root

3 Download ownCloud

4 Move it to ~Sites and extract it tar xfpj owncloud-45tarbz2

5 Now you can set it up by going to httplocalhost8888owncloud

25 Windows 7 and Windows Server 2008

Note You must move the data directory outside of your public root (See advanced install settings)

This section describes how to install ownCloud on Windows with IIS (Internet Information Services)

It assumes that you have a vanilla non-IIS enabled Windows machine ndash Windows 7 or Server 2008 After enablingIIS the steps are essentially identical for Windows 7 and Windows Server 2008

24 Mac OS X 9

ownCloud Administrators Manual Release 50

For installation physical access or a remote desktop connection is required You should leverage MySQL as the backend database for ownCloud If you do not want to use MySQL it is possible to use Postgres or SQLite insteadMicrosoft SQL Server is not yet support

Enabling SSL is not yet covered by this section

Note If you make your desktop machine or server available outside your LAN you must maintain it Monitor thelogs manage the access apply patches to avoid compromising the system at large

There are 4 primary steps to the installation and then a 5th step required for configuring everything to allow files largerthan the default 2MB

1 Install IIS with CGI support ndash enable IIS on your Windows machine

2 Install PHP ndash Grab download and install PHP

3 Install MySQL ndash Setup the MySQL server manager and enable ownCloud to create an instance

4 Install ownCloud ndash The whole reason we are here

5 Configure upload sizes and timeouts to enable large file uploads ndash So that you can upload larger files

251 Activate IIS with CGI Support

Windows 7

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 There is a box labeled Internet Information Services expand it

4 Expand World Wide Web Services and all the folders underneath

5 Select the folders as illustrated in the picture below to get your IIS server up and running

You do not need an FTP server running so you should tune that feature off for your server You definitely need the IISManagement Console as that is the easiest way to start stop restart you server as well as where you change certificateoptions and manage items like file upload size You must check the CGI box under Application Development Featuresbecause CGI is how you enable PHP on IIS

You have to turn off WebDAV publishing or the Windows WebDAV conflicts with the ownCloud WebDAV interfaceThis might already be turned off for you just make sure it stays that way The common HTTP features are the featuresyou would expect from a web server With the selections on this page IIS will now serve up a web page for you

Restart IIS by going to the IIS manager (Start ndashgt IIS Manager) Select your website and on the far right side is asection titled Manage Server Make sure that the service is started or click Start to start the services selected Oncethis is complete you should be able to go to a web browser and navigate to httplocalhostlsquo

This should open the standard IIS 7 splash page which is just a static image that says your web server is runningAssuming you were able to get the splash page it is safe to say your web server is now up and running

Windows Server 2008

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 This will bring up the Server Manager

10 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 3: Own Cloud Admin Manual

71 IMAP 3772 SMB 3773 FTP 38

8 Migrating ownCloud Installs 39

9 Indices and tables 41

ii

CHAPTER

ONE

INTRODUCTION

This is the administrators manual for ownCloud a flexible open source file sync and share solution It comprises ofthe ownCloud server as well as client applications for Microsoft Windows Mac OS X and Linux (Desktop Client)and mobile clients for the Android and Apple iOS operating system

11 Target audience

This guide is targeted towards people who want to install administer and optimize ownCloud Server If you want tolearn how to use the Web UI or how to install clients on the server please refer to the User Manual or the DesktopClient Manual respectively

12 Structure of this document

The next chapters describes how to set up ownCloud Server on different platforms and operating systems as well ashow to update existing installations

Further chapters will then detail on integrating ownCloud into your existing environment eg how to setup LDAP orhow to mount your storage

1

ownCloud Administrators Manual Release 50

2 Chapter 1 Introduction

CHAPTER

TWO

INSTALLATION

This chapter will introduce you to the installation of ownCloud in different scenarios

If you want to just try ownCloud in a virtual machine without any configuration skip ahead to the appliance sectionwhere you will find ready-to-use images

21 Manual Installation

If you do not want to use packages here is how you setup ownCloud on from scratch using a classic LAMP (LinuxApache MySQL PHP) setup

211 Prerequisites

To run ownCloud your webserver must have the following installed

bull php5 (gt= 53)

bull php5-json

bull php-xml

bull php-mbstring

bull php5-zip

bull php5-gd

And as optional dependencies

bull php5-sqlite (gt= 3)

bull curl

bull libcurl3

bull libcurl3-dev

bull php5-curl

bull php5-intl

bull php-pdo

Commands for Ubuntu and Debian

apt-get install apache2 php5 php5-json php-xml php-mbstring php5-zip php5-gdapt-get install php5-sqlite curl libcurl3 libcurl3-dev php5-curl php-pdo

3

ownCloud Administrators Manual Release 50

Todo

Document other distributions

You donrsquot need any WebDAV support of your webserver (ie apachersquos mod_webdav) to access your ownCloud datavia WebDAV ownCloud has a WebDAV server built in

212 Extract ownCloud and Copy to Your Webserver

tar -xjf pathtodownloadedowncloud-xxxtarbz2cp -r owncloud pathtoyourwebserver

213 Set the Directory Permissions

The owner of your webserver must own the apps data and config directories in your ownCloud install You can dothis by running the following command for the apps data and config directories

chown -R www-datawww-data pathtoyourowncloudinstalldata

Replace www-datawww-data with the user and group of the owner of your webserver

Note The data directory will only be created after setup has run (see below) and is not present by default in thetarballs

214 Enable htaccess and mod_rewrite if Running Apache

If you are running the apache webserver it is recommended that you enable htaccess files as ownCloud usesthem to enhance security and allows you to use webfinger To enable htaccess files you need to ensure thatAllowOverride is set to All in the Directory varwww section of your virtual host file This is usually inetcapache2sites-enabled000-default You should also run a2enmod rewrite and a2enmodheaders Then restart apache service apache2 restart (for Ubuntu systems) In order for the maximum upload sizeto be configurable the htaccess file in the owncloud folder needs to be made writable by the server

215 Follow the Install Wizard

Open your web browser and navigate to your ownCloud instance If you are installing ownCloud on the same machineas you will access the install wizard from the url will be httplocalhost (or httplocalhostowncloud) For basicinstalls we recommend SQLite as it is easy to setup (ownCloud will do it for you) For larger installs you shoulduse MySQL or PostgreSQL Click on the Advanced options to show the configuration options You may enter admincredentials and let ownCloud create its own database user or enter a preconfigured user If you are not using apacheas the webserver please set the data directory to a location outside of the document root See the advanced installsettings

216 Test your Installation

Login and start using ownCloud Check your web servers errror log If it shows error you might have missed adependency or hit a bug with your particular configuration

4 Chapter 2 Installation

ownCloud Administrators Manual Release 50

If you plan on using the Webfinger app and your ownCloud installation is not in the webroot then yoursquoll have tomanually link varwwwwell-known to pathtoyourowncloudwell-known

22 Linux Distributions

This section describes the installation process for different distributions If there are pre-made packages from own-Cloud you are encouraged to prefer those over the vendor-provided ones since they usually are more up-to-date

221 Archlinux

There are two AUR packages for ownCloud

bull stable version

bull development version

222 openSUSE

Note ready-to-use SLES and openSUSE RPM packages are available in the openSUSE Build Service ownCloudrepository

1 Copy ownCloud to Apachersquos server directory srvwwwhtdocs

2 Give the web server the necessary permissions sudo chown -R wwwrun owncloud

bull If you do not use ldquosudordquo then you have to become root and execute chown -R wwwrun owncloudin the directory

bull (If yoursquore using mysql you have to set the database character set to something else then utf~8 for examplelatin1 otherwise some keys will be to long for mysql)

3 Open the folder in a browser and complete the setup wizard

If have followed the steps above and want to try it out run this command in a terminal to start Apache if itrsquos not alreadyrunning

1 sudo etcinitdapache2 start

2 Go to httpservernameowncloud and walk through the setup

223 Fedora

Note ready-to-use RPM packages are available in the openSUSE Build Service ownCloud repository

Make sure SELinux is disabled or else the installation process will fail with the following message Config file(configconfigphp) is not writable for the webserver

Configure Apache

1 If you already have a website running from Document Root but would still like to install OwnCloud you can usea Name-based virtual host entry and subdomain

2 Edit your DNS record following this example point owncloudfoocom gt ipipipip

22 Linux Distributions 5

ownCloud Administrators Manual Release 50

Todo

224 CentOS 5 amp 6

Note ready-to-use CentOS RPM packages are available in the openSUSE Build Service ownCloud repository

1 Create a new file in etchttpdconf and call it owncloudconf

2 You can use the following as an example

ltIfModule mod_aliascgtAlias owncloud varwwwowncloudltIfModulegtltDirectory varwwwowncloudgt

Options NoneOrder allowdenyallow from all

ltDirectorygtltVirtualHost 80gt

ServerAdmin foofoofarmcomDocumentRoot varwwwhtmlowncloudServerName owncloudfoocomErrorLog logsowncloudfooinfo-error_logCustomLog logsowncloudfooinfo-access_log common

ltVirtualHostgt

3 Now edit your httpdconf file which is usually located in etchttpdconfhttpdconf

4 Add the following to the bottom Include etchttpdconfowncloudconf

5 Restart apache and now when you point your browser to owncloudfoocom it should properly load withoutdisturbing foocom

225 Gentoo

Basically do everything like for a standard web server (see above) Changepermissions chown -R apacheapache owncloudAllow htaccess modifyetcapache2vhostsd00_default_vhostconf and make sure this is in

ltDirectory varwwwlocalhosthtdocsowncloudgtOptions Indexes FollowSymLinks MultiViewsAllowOverride AllOrder allowdenyallow from all

ltDirectorygt

226 PCLinuxOS

Follow the Tutorial ownCloud installation and setup on the PCLinuxOS web site

6 Chapter 2 Installation

ownCloud Administrators Manual Release 50

23 Web server Notes

The most popular server choice for ownCloud is Apache which is why it is also the combinations tested best Howeverit is also possible to run ownCloud on other web servers This section does not cover Microsoft Internet InformationServices (IIS) it is covered in the Windows 7 and Windows Server 2008 section

231 Nginx Configuration

bull You need to insert the following code into your nginx config file

bull Adjust server_name root ssl_certificate and ssl_certificate_key to suit your needs

bull Make sure your SSL certificates are readable by the server (see httpwikinginxorgHttpSslModule)

redirect http to httpsserver

listen 80server_name owncloudexampleorgrewrite ^ https$server_name$request_uri permanent enforce https

owncloud (ssltls)server

listen 443 sslssl_certificate etcnginxcertsservercrtssl_certificate_key etcnginxcertsserverkeyserver_name owncloudexampleorgroot pathtoowncloudindex indexphpclient_max_body_size 1000M set maximum upload size

deny direct accesslocation ^ ^(data|config|ht|db_structurexml|README) deny all

default try orderlocation try_files $uri $uri webdav

owncloud WebDAVlocation webdav fastcgi_split_path_info ^(+php)()$fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

enable phplocation ^ php$ fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

23 Web server Notes 7

ownCloud Administrators Manual Release 50

Note You can use Owncloud without SSLTLS support but we strongly encourage you not to do that

bull Remove the server block containing the redirect

bull Change listen 443 ssl to listen 80

bull Remove ssl_certificate and ssl_certificate_key

bull Remove fastcgi_params HTTPS on

Note If you want to effectively increase maximum upload size you will also have to modify your php-fpmconfiguration (usually at etcphp5fpmphpini) and increase upload_max_filesize andpost_max_size values Yoursquoll need to restart php5-fpm and nginx services in order these changes to be applied

232 Lighttpd Configuration

This assumes that you are familiar with installing PHP application on lighttpd

It is important to note that the htaccess files used by ownCloud to protect the data folder are ignored by lighttpdso you have to secure it by yourself otherwise your ownclouddblsquo database and user data are publicly readableeven if directory listing is off You need to add two snippets to your lighttpd configuration file

Disable access to data folder

$HTTP[url] =^ ^ownclouddata urlaccess-deny = ()

Disable directory listing

$HTTP[url] =^ ^owncloud($|) dir-listingactivate = disable

233 Yaws Configuration

This should be in your yaws_serverconf In the configuration file the dir_listings = false is impor-tant and also the redirect from data to somewhere else because files will be saved in this directory and it shouldnot be accessible from the outside A configuration file would look like this

ltserver owncloudmyservercomgtport = 80listen = 0000docroot = varwwwowncloudsrcallowed_scripts = phpphp_handler = ltcgi usrlocalbinphp-cgigterrormod_404 = yaws_404_to_index_phpaccess_log = falsedir_listings = falseltredirectgt

data ==

8 Chapter 2 Installation

ownCloud Administrators Manual Release 50

ltredirectgtltservergt

The apache htaccess file that comes with ownCloud is configured to redirect requests to nonexistent pages Toemulate that behaviour you need a custom error handler for yaws See this github gist for further instructions on howto create and compile that error handler

234 Hiawatha Configuration

Add WebDAVapp = yes to the ownCloud virtual host Users accessing WebDAV from MacOS will also need toadd AllowDotFiles = yes

Disable access to data folder

UrlToolkit ToolkitID = denyDataMatch ^data DenyAccess

235 PageKite Configuration

You can use this PageKite how to to make your local ownCloud accessible from the internet using PageKite

24 Mac OS X

Todo

This section of the manual needs to be revised

This relies on MAMP which provides the required environment

1 Install MAMP and run it

2 Go to lsquoPreferences Apachersquo and set lsquoDocument Rootrsquo to UsersltYOUR USER NAMEgtSites so yourSites directory will be used as Apache root

3 Download ownCloud

4 Move it to ~Sites and extract it tar xfpj owncloud-45tarbz2

5 Now you can set it up by going to httplocalhost8888owncloud

25 Windows 7 and Windows Server 2008

Note You must move the data directory outside of your public root (See advanced install settings)

This section describes how to install ownCloud on Windows with IIS (Internet Information Services)

It assumes that you have a vanilla non-IIS enabled Windows machine ndash Windows 7 or Server 2008 After enablingIIS the steps are essentially identical for Windows 7 and Windows Server 2008

24 Mac OS X 9

ownCloud Administrators Manual Release 50

For installation physical access or a remote desktop connection is required You should leverage MySQL as the backend database for ownCloud If you do not want to use MySQL it is possible to use Postgres or SQLite insteadMicrosoft SQL Server is not yet support

Enabling SSL is not yet covered by this section

Note If you make your desktop machine or server available outside your LAN you must maintain it Monitor thelogs manage the access apply patches to avoid compromising the system at large

There are 4 primary steps to the installation and then a 5th step required for configuring everything to allow files largerthan the default 2MB

1 Install IIS with CGI support ndash enable IIS on your Windows machine

2 Install PHP ndash Grab download and install PHP

3 Install MySQL ndash Setup the MySQL server manager and enable ownCloud to create an instance

4 Install ownCloud ndash The whole reason we are here

5 Configure upload sizes and timeouts to enable large file uploads ndash So that you can upload larger files

251 Activate IIS with CGI Support

Windows 7

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 There is a box labeled Internet Information Services expand it

4 Expand World Wide Web Services and all the folders underneath

5 Select the folders as illustrated in the picture below to get your IIS server up and running

You do not need an FTP server running so you should tune that feature off for your server You definitely need the IISManagement Console as that is the easiest way to start stop restart you server as well as where you change certificateoptions and manage items like file upload size You must check the CGI box under Application Development Featuresbecause CGI is how you enable PHP on IIS

You have to turn off WebDAV publishing or the Windows WebDAV conflicts with the ownCloud WebDAV interfaceThis might already be turned off for you just make sure it stays that way The common HTTP features are the featuresyou would expect from a web server With the selections on this page IIS will now serve up a web page for you

Restart IIS by going to the IIS manager (Start ndashgt IIS Manager) Select your website and on the far right side is asection titled Manage Server Make sure that the service is started or click Start to start the services selected Oncethis is complete you should be able to go to a web browser and navigate to httplocalhostlsquo

This should open the standard IIS 7 splash page which is just a static image that says your web server is runningAssuming you were able to get the splash page it is safe to say your web server is now up and running

Windows Server 2008

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 This will bring up the Server Manager

10 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 4: Own Cloud Admin Manual

CHAPTER

ONE

INTRODUCTION

This is the administrators manual for ownCloud a flexible open source file sync and share solution It comprises ofthe ownCloud server as well as client applications for Microsoft Windows Mac OS X and Linux (Desktop Client)and mobile clients for the Android and Apple iOS operating system

11 Target audience

This guide is targeted towards people who want to install administer and optimize ownCloud Server If you want tolearn how to use the Web UI or how to install clients on the server please refer to the User Manual or the DesktopClient Manual respectively

12 Structure of this document

The next chapters describes how to set up ownCloud Server on different platforms and operating systems as well ashow to update existing installations

Further chapters will then detail on integrating ownCloud into your existing environment eg how to setup LDAP orhow to mount your storage

1

ownCloud Administrators Manual Release 50

2 Chapter 1 Introduction

CHAPTER

TWO

INSTALLATION

This chapter will introduce you to the installation of ownCloud in different scenarios

If you want to just try ownCloud in a virtual machine without any configuration skip ahead to the appliance sectionwhere you will find ready-to-use images

21 Manual Installation

If you do not want to use packages here is how you setup ownCloud on from scratch using a classic LAMP (LinuxApache MySQL PHP) setup

211 Prerequisites

To run ownCloud your webserver must have the following installed

bull php5 (gt= 53)

bull php5-json

bull php-xml

bull php-mbstring

bull php5-zip

bull php5-gd

And as optional dependencies

bull php5-sqlite (gt= 3)

bull curl

bull libcurl3

bull libcurl3-dev

bull php5-curl

bull php5-intl

bull php-pdo

Commands for Ubuntu and Debian

apt-get install apache2 php5 php5-json php-xml php-mbstring php5-zip php5-gdapt-get install php5-sqlite curl libcurl3 libcurl3-dev php5-curl php-pdo

3

ownCloud Administrators Manual Release 50

Todo

Document other distributions

You donrsquot need any WebDAV support of your webserver (ie apachersquos mod_webdav) to access your ownCloud datavia WebDAV ownCloud has a WebDAV server built in

212 Extract ownCloud and Copy to Your Webserver

tar -xjf pathtodownloadedowncloud-xxxtarbz2cp -r owncloud pathtoyourwebserver

213 Set the Directory Permissions

The owner of your webserver must own the apps data and config directories in your ownCloud install You can dothis by running the following command for the apps data and config directories

chown -R www-datawww-data pathtoyourowncloudinstalldata

Replace www-datawww-data with the user and group of the owner of your webserver

Note The data directory will only be created after setup has run (see below) and is not present by default in thetarballs

214 Enable htaccess and mod_rewrite if Running Apache

If you are running the apache webserver it is recommended that you enable htaccess files as ownCloud usesthem to enhance security and allows you to use webfinger To enable htaccess files you need to ensure thatAllowOverride is set to All in the Directory varwww section of your virtual host file This is usually inetcapache2sites-enabled000-default You should also run a2enmod rewrite and a2enmodheaders Then restart apache service apache2 restart (for Ubuntu systems) In order for the maximum upload sizeto be configurable the htaccess file in the owncloud folder needs to be made writable by the server

215 Follow the Install Wizard

Open your web browser and navigate to your ownCloud instance If you are installing ownCloud on the same machineas you will access the install wizard from the url will be httplocalhost (or httplocalhostowncloud) For basicinstalls we recommend SQLite as it is easy to setup (ownCloud will do it for you) For larger installs you shoulduse MySQL or PostgreSQL Click on the Advanced options to show the configuration options You may enter admincredentials and let ownCloud create its own database user or enter a preconfigured user If you are not using apacheas the webserver please set the data directory to a location outside of the document root See the advanced installsettings

216 Test your Installation

Login and start using ownCloud Check your web servers errror log If it shows error you might have missed adependency or hit a bug with your particular configuration

4 Chapter 2 Installation

ownCloud Administrators Manual Release 50

If you plan on using the Webfinger app and your ownCloud installation is not in the webroot then yoursquoll have tomanually link varwwwwell-known to pathtoyourowncloudwell-known

22 Linux Distributions

This section describes the installation process for different distributions If there are pre-made packages from own-Cloud you are encouraged to prefer those over the vendor-provided ones since they usually are more up-to-date

221 Archlinux

There are two AUR packages for ownCloud

bull stable version

bull development version

222 openSUSE

Note ready-to-use SLES and openSUSE RPM packages are available in the openSUSE Build Service ownCloudrepository

1 Copy ownCloud to Apachersquos server directory srvwwwhtdocs

2 Give the web server the necessary permissions sudo chown -R wwwrun owncloud

bull If you do not use ldquosudordquo then you have to become root and execute chown -R wwwrun owncloudin the directory

bull (If yoursquore using mysql you have to set the database character set to something else then utf~8 for examplelatin1 otherwise some keys will be to long for mysql)

3 Open the folder in a browser and complete the setup wizard

If have followed the steps above and want to try it out run this command in a terminal to start Apache if itrsquos not alreadyrunning

1 sudo etcinitdapache2 start

2 Go to httpservernameowncloud and walk through the setup

223 Fedora

Note ready-to-use RPM packages are available in the openSUSE Build Service ownCloud repository

Make sure SELinux is disabled or else the installation process will fail with the following message Config file(configconfigphp) is not writable for the webserver

Configure Apache

1 If you already have a website running from Document Root but would still like to install OwnCloud you can usea Name-based virtual host entry and subdomain

2 Edit your DNS record following this example point owncloudfoocom gt ipipipip

22 Linux Distributions 5

ownCloud Administrators Manual Release 50

Todo

224 CentOS 5 amp 6

Note ready-to-use CentOS RPM packages are available in the openSUSE Build Service ownCloud repository

1 Create a new file in etchttpdconf and call it owncloudconf

2 You can use the following as an example

ltIfModule mod_aliascgtAlias owncloud varwwwowncloudltIfModulegtltDirectory varwwwowncloudgt

Options NoneOrder allowdenyallow from all

ltDirectorygtltVirtualHost 80gt

ServerAdmin foofoofarmcomDocumentRoot varwwwhtmlowncloudServerName owncloudfoocomErrorLog logsowncloudfooinfo-error_logCustomLog logsowncloudfooinfo-access_log common

ltVirtualHostgt

3 Now edit your httpdconf file which is usually located in etchttpdconfhttpdconf

4 Add the following to the bottom Include etchttpdconfowncloudconf

5 Restart apache and now when you point your browser to owncloudfoocom it should properly load withoutdisturbing foocom

225 Gentoo

Basically do everything like for a standard web server (see above) Changepermissions chown -R apacheapache owncloudAllow htaccess modifyetcapache2vhostsd00_default_vhostconf and make sure this is in

ltDirectory varwwwlocalhosthtdocsowncloudgtOptions Indexes FollowSymLinks MultiViewsAllowOverride AllOrder allowdenyallow from all

ltDirectorygt

226 PCLinuxOS

Follow the Tutorial ownCloud installation and setup on the PCLinuxOS web site

6 Chapter 2 Installation

ownCloud Administrators Manual Release 50

23 Web server Notes

The most popular server choice for ownCloud is Apache which is why it is also the combinations tested best Howeverit is also possible to run ownCloud on other web servers This section does not cover Microsoft Internet InformationServices (IIS) it is covered in the Windows 7 and Windows Server 2008 section

231 Nginx Configuration

bull You need to insert the following code into your nginx config file

bull Adjust server_name root ssl_certificate and ssl_certificate_key to suit your needs

bull Make sure your SSL certificates are readable by the server (see httpwikinginxorgHttpSslModule)

redirect http to httpsserver

listen 80server_name owncloudexampleorgrewrite ^ https$server_name$request_uri permanent enforce https

owncloud (ssltls)server

listen 443 sslssl_certificate etcnginxcertsservercrtssl_certificate_key etcnginxcertsserverkeyserver_name owncloudexampleorgroot pathtoowncloudindex indexphpclient_max_body_size 1000M set maximum upload size

deny direct accesslocation ^ ^(data|config|ht|db_structurexml|README) deny all

default try orderlocation try_files $uri $uri webdav

owncloud WebDAVlocation webdav fastcgi_split_path_info ^(+php)()$fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

enable phplocation ^ php$ fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

23 Web server Notes 7

ownCloud Administrators Manual Release 50

Note You can use Owncloud without SSLTLS support but we strongly encourage you not to do that

bull Remove the server block containing the redirect

bull Change listen 443 ssl to listen 80

bull Remove ssl_certificate and ssl_certificate_key

bull Remove fastcgi_params HTTPS on

Note If you want to effectively increase maximum upload size you will also have to modify your php-fpmconfiguration (usually at etcphp5fpmphpini) and increase upload_max_filesize andpost_max_size values Yoursquoll need to restart php5-fpm and nginx services in order these changes to be applied

232 Lighttpd Configuration

This assumes that you are familiar with installing PHP application on lighttpd

It is important to note that the htaccess files used by ownCloud to protect the data folder are ignored by lighttpdso you have to secure it by yourself otherwise your ownclouddblsquo database and user data are publicly readableeven if directory listing is off You need to add two snippets to your lighttpd configuration file

Disable access to data folder

$HTTP[url] =^ ^ownclouddata urlaccess-deny = ()

Disable directory listing

$HTTP[url] =^ ^owncloud($|) dir-listingactivate = disable

233 Yaws Configuration

This should be in your yaws_serverconf In the configuration file the dir_listings = false is impor-tant and also the redirect from data to somewhere else because files will be saved in this directory and it shouldnot be accessible from the outside A configuration file would look like this

ltserver owncloudmyservercomgtport = 80listen = 0000docroot = varwwwowncloudsrcallowed_scripts = phpphp_handler = ltcgi usrlocalbinphp-cgigterrormod_404 = yaws_404_to_index_phpaccess_log = falsedir_listings = falseltredirectgt

data ==

8 Chapter 2 Installation

ownCloud Administrators Manual Release 50

ltredirectgtltservergt

The apache htaccess file that comes with ownCloud is configured to redirect requests to nonexistent pages Toemulate that behaviour you need a custom error handler for yaws See this github gist for further instructions on howto create and compile that error handler

234 Hiawatha Configuration

Add WebDAVapp = yes to the ownCloud virtual host Users accessing WebDAV from MacOS will also need toadd AllowDotFiles = yes

Disable access to data folder

UrlToolkit ToolkitID = denyDataMatch ^data DenyAccess

235 PageKite Configuration

You can use this PageKite how to to make your local ownCloud accessible from the internet using PageKite

24 Mac OS X

Todo

This section of the manual needs to be revised

This relies on MAMP which provides the required environment

1 Install MAMP and run it

2 Go to lsquoPreferences Apachersquo and set lsquoDocument Rootrsquo to UsersltYOUR USER NAMEgtSites so yourSites directory will be used as Apache root

3 Download ownCloud

4 Move it to ~Sites and extract it tar xfpj owncloud-45tarbz2

5 Now you can set it up by going to httplocalhost8888owncloud

25 Windows 7 and Windows Server 2008

Note You must move the data directory outside of your public root (See advanced install settings)

This section describes how to install ownCloud on Windows with IIS (Internet Information Services)

It assumes that you have a vanilla non-IIS enabled Windows machine ndash Windows 7 or Server 2008 After enablingIIS the steps are essentially identical for Windows 7 and Windows Server 2008

24 Mac OS X 9

ownCloud Administrators Manual Release 50

For installation physical access or a remote desktop connection is required You should leverage MySQL as the backend database for ownCloud If you do not want to use MySQL it is possible to use Postgres or SQLite insteadMicrosoft SQL Server is not yet support

Enabling SSL is not yet covered by this section

Note If you make your desktop machine or server available outside your LAN you must maintain it Monitor thelogs manage the access apply patches to avoid compromising the system at large

There are 4 primary steps to the installation and then a 5th step required for configuring everything to allow files largerthan the default 2MB

1 Install IIS with CGI support ndash enable IIS on your Windows machine

2 Install PHP ndash Grab download and install PHP

3 Install MySQL ndash Setup the MySQL server manager and enable ownCloud to create an instance

4 Install ownCloud ndash The whole reason we are here

5 Configure upload sizes and timeouts to enable large file uploads ndash So that you can upload larger files

251 Activate IIS with CGI Support

Windows 7

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 There is a box labeled Internet Information Services expand it

4 Expand World Wide Web Services and all the folders underneath

5 Select the folders as illustrated in the picture below to get your IIS server up and running

You do not need an FTP server running so you should tune that feature off for your server You definitely need the IISManagement Console as that is the easiest way to start stop restart you server as well as where you change certificateoptions and manage items like file upload size You must check the CGI box under Application Development Featuresbecause CGI is how you enable PHP on IIS

You have to turn off WebDAV publishing or the Windows WebDAV conflicts with the ownCloud WebDAV interfaceThis might already be turned off for you just make sure it stays that way The common HTTP features are the featuresyou would expect from a web server With the selections on this page IIS will now serve up a web page for you

Restart IIS by going to the IIS manager (Start ndashgt IIS Manager) Select your website and on the far right side is asection titled Manage Server Make sure that the service is started or click Start to start the services selected Oncethis is complete you should be able to go to a web browser and navigate to httplocalhostlsquo

This should open the standard IIS 7 splash page which is just a static image that says your web server is runningAssuming you were able to get the splash page it is safe to say your web server is now up and running

Windows Server 2008

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 This will bring up the Server Manager

10 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 5: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

2 Chapter 1 Introduction

CHAPTER

TWO

INSTALLATION

This chapter will introduce you to the installation of ownCloud in different scenarios

If you want to just try ownCloud in a virtual machine without any configuration skip ahead to the appliance sectionwhere you will find ready-to-use images

21 Manual Installation

If you do not want to use packages here is how you setup ownCloud on from scratch using a classic LAMP (LinuxApache MySQL PHP) setup

211 Prerequisites

To run ownCloud your webserver must have the following installed

bull php5 (gt= 53)

bull php5-json

bull php-xml

bull php-mbstring

bull php5-zip

bull php5-gd

And as optional dependencies

bull php5-sqlite (gt= 3)

bull curl

bull libcurl3

bull libcurl3-dev

bull php5-curl

bull php5-intl

bull php-pdo

Commands for Ubuntu and Debian

apt-get install apache2 php5 php5-json php-xml php-mbstring php5-zip php5-gdapt-get install php5-sqlite curl libcurl3 libcurl3-dev php5-curl php-pdo

3

ownCloud Administrators Manual Release 50

Todo

Document other distributions

You donrsquot need any WebDAV support of your webserver (ie apachersquos mod_webdav) to access your ownCloud datavia WebDAV ownCloud has a WebDAV server built in

212 Extract ownCloud and Copy to Your Webserver

tar -xjf pathtodownloadedowncloud-xxxtarbz2cp -r owncloud pathtoyourwebserver

213 Set the Directory Permissions

The owner of your webserver must own the apps data and config directories in your ownCloud install You can dothis by running the following command for the apps data and config directories

chown -R www-datawww-data pathtoyourowncloudinstalldata

Replace www-datawww-data with the user and group of the owner of your webserver

Note The data directory will only be created after setup has run (see below) and is not present by default in thetarballs

214 Enable htaccess and mod_rewrite if Running Apache

If you are running the apache webserver it is recommended that you enable htaccess files as ownCloud usesthem to enhance security and allows you to use webfinger To enable htaccess files you need to ensure thatAllowOverride is set to All in the Directory varwww section of your virtual host file This is usually inetcapache2sites-enabled000-default You should also run a2enmod rewrite and a2enmodheaders Then restart apache service apache2 restart (for Ubuntu systems) In order for the maximum upload sizeto be configurable the htaccess file in the owncloud folder needs to be made writable by the server

215 Follow the Install Wizard

Open your web browser and navigate to your ownCloud instance If you are installing ownCloud on the same machineas you will access the install wizard from the url will be httplocalhost (or httplocalhostowncloud) For basicinstalls we recommend SQLite as it is easy to setup (ownCloud will do it for you) For larger installs you shoulduse MySQL or PostgreSQL Click on the Advanced options to show the configuration options You may enter admincredentials and let ownCloud create its own database user or enter a preconfigured user If you are not using apacheas the webserver please set the data directory to a location outside of the document root See the advanced installsettings

216 Test your Installation

Login and start using ownCloud Check your web servers errror log If it shows error you might have missed adependency or hit a bug with your particular configuration

4 Chapter 2 Installation

ownCloud Administrators Manual Release 50

If you plan on using the Webfinger app and your ownCloud installation is not in the webroot then yoursquoll have tomanually link varwwwwell-known to pathtoyourowncloudwell-known

22 Linux Distributions

This section describes the installation process for different distributions If there are pre-made packages from own-Cloud you are encouraged to prefer those over the vendor-provided ones since they usually are more up-to-date

221 Archlinux

There are two AUR packages for ownCloud

bull stable version

bull development version

222 openSUSE

Note ready-to-use SLES and openSUSE RPM packages are available in the openSUSE Build Service ownCloudrepository

1 Copy ownCloud to Apachersquos server directory srvwwwhtdocs

2 Give the web server the necessary permissions sudo chown -R wwwrun owncloud

bull If you do not use ldquosudordquo then you have to become root and execute chown -R wwwrun owncloudin the directory

bull (If yoursquore using mysql you have to set the database character set to something else then utf~8 for examplelatin1 otherwise some keys will be to long for mysql)

3 Open the folder in a browser and complete the setup wizard

If have followed the steps above and want to try it out run this command in a terminal to start Apache if itrsquos not alreadyrunning

1 sudo etcinitdapache2 start

2 Go to httpservernameowncloud and walk through the setup

223 Fedora

Note ready-to-use RPM packages are available in the openSUSE Build Service ownCloud repository

Make sure SELinux is disabled or else the installation process will fail with the following message Config file(configconfigphp) is not writable for the webserver

Configure Apache

1 If you already have a website running from Document Root but would still like to install OwnCloud you can usea Name-based virtual host entry and subdomain

2 Edit your DNS record following this example point owncloudfoocom gt ipipipip

22 Linux Distributions 5

ownCloud Administrators Manual Release 50

Todo

224 CentOS 5 amp 6

Note ready-to-use CentOS RPM packages are available in the openSUSE Build Service ownCloud repository

1 Create a new file in etchttpdconf and call it owncloudconf

2 You can use the following as an example

ltIfModule mod_aliascgtAlias owncloud varwwwowncloudltIfModulegtltDirectory varwwwowncloudgt

Options NoneOrder allowdenyallow from all

ltDirectorygtltVirtualHost 80gt

ServerAdmin foofoofarmcomDocumentRoot varwwwhtmlowncloudServerName owncloudfoocomErrorLog logsowncloudfooinfo-error_logCustomLog logsowncloudfooinfo-access_log common

ltVirtualHostgt

3 Now edit your httpdconf file which is usually located in etchttpdconfhttpdconf

4 Add the following to the bottom Include etchttpdconfowncloudconf

5 Restart apache and now when you point your browser to owncloudfoocom it should properly load withoutdisturbing foocom

225 Gentoo

Basically do everything like for a standard web server (see above) Changepermissions chown -R apacheapache owncloudAllow htaccess modifyetcapache2vhostsd00_default_vhostconf and make sure this is in

ltDirectory varwwwlocalhosthtdocsowncloudgtOptions Indexes FollowSymLinks MultiViewsAllowOverride AllOrder allowdenyallow from all

ltDirectorygt

226 PCLinuxOS

Follow the Tutorial ownCloud installation and setup on the PCLinuxOS web site

6 Chapter 2 Installation

ownCloud Administrators Manual Release 50

23 Web server Notes

The most popular server choice for ownCloud is Apache which is why it is also the combinations tested best Howeverit is also possible to run ownCloud on other web servers This section does not cover Microsoft Internet InformationServices (IIS) it is covered in the Windows 7 and Windows Server 2008 section

231 Nginx Configuration

bull You need to insert the following code into your nginx config file

bull Adjust server_name root ssl_certificate and ssl_certificate_key to suit your needs

bull Make sure your SSL certificates are readable by the server (see httpwikinginxorgHttpSslModule)

redirect http to httpsserver

listen 80server_name owncloudexampleorgrewrite ^ https$server_name$request_uri permanent enforce https

owncloud (ssltls)server

listen 443 sslssl_certificate etcnginxcertsservercrtssl_certificate_key etcnginxcertsserverkeyserver_name owncloudexampleorgroot pathtoowncloudindex indexphpclient_max_body_size 1000M set maximum upload size

deny direct accesslocation ^ ^(data|config|ht|db_structurexml|README) deny all

default try orderlocation try_files $uri $uri webdav

owncloud WebDAVlocation webdav fastcgi_split_path_info ^(+php)()$fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

enable phplocation ^ php$ fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

23 Web server Notes 7

ownCloud Administrators Manual Release 50

Note You can use Owncloud without SSLTLS support but we strongly encourage you not to do that

bull Remove the server block containing the redirect

bull Change listen 443 ssl to listen 80

bull Remove ssl_certificate and ssl_certificate_key

bull Remove fastcgi_params HTTPS on

Note If you want to effectively increase maximum upload size you will also have to modify your php-fpmconfiguration (usually at etcphp5fpmphpini) and increase upload_max_filesize andpost_max_size values Yoursquoll need to restart php5-fpm and nginx services in order these changes to be applied

232 Lighttpd Configuration

This assumes that you are familiar with installing PHP application on lighttpd

It is important to note that the htaccess files used by ownCloud to protect the data folder are ignored by lighttpdso you have to secure it by yourself otherwise your ownclouddblsquo database and user data are publicly readableeven if directory listing is off You need to add two snippets to your lighttpd configuration file

Disable access to data folder

$HTTP[url] =^ ^ownclouddata urlaccess-deny = ()

Disable directory listing

$HTTP[url] =^ ^owncloud($|) dir-listingactivate = disable

233 Yaws Configuration

This should be in your yaws_serverconf In the configuration file the dir_listings = false is impor-tant and also the redirect from data to somewhere else because files will be saved in this directory and it shouldnot be accessible from the outside A configuration file would look like this

ltserver owncloudmyservercomgtport = 80listen = 0000docroot = varwwwowncloudsrcallowed_scripts = phpphp_handler = ltcgi usrlocalbinphp-cgigterrormod_404 = yaws_404_to_index_phpaccess_log = falsedir_listings = falseltredirectgt

data ==

8 Chapter 2 Installation

ownCloud Administrators Manual Release 50

ltredirectgtltservergt

The apache htaccess file that comes with ownCloud is configured to redirect requests to nonexistent pages Toemulate that behaviour you need a custom error handler for yaws See this github gist for further instructions on howto create and compile that error handler

234 Hiawatha Configuration

Add WebDAVapp = yes to the ownCloud virtual host Users accessing WebDAV from MacOS will also need toadd AllowDotFiles = yes

Disable access to data folder

UrlToolkit ToolkitID = denyDataMatch ^data DenyAccess

235 PageKite Configuration

You can use this PageKite how to to make your local ownCloud accessible from the internet using PageKite

24 Mac OS X

Todo

This section of the manual needs to be revised

This relies on MAMP which provides the required environment

1 Install MAMP and run it

2 Go to lsquoPreferences Apachersquo and set lsquoDocument Rootrsquo to UsersltYOUR USER NAMEgtSites so yourSites directory will be used as Apache root

3 Download ownCloud

4 Move it to ~Sites and extract it tar xfpj owncloud-45tarbz2

5 Now you can set it up by going to httplocalhost8888owncloud

25 Windows 7 and Windows Server 2008

Note You must move the data directory outside of your public root (See advanced install settings)

This section describes how to install ownCloud on Windows with IIS (Internet Information Services)

It assumes that you have a vanilla non-IIS enabled Windows machine ndash Windows 7 or Server 2008 After enablingIIS the steps are essentially identical for Windows 7 and Windows Server 2008

24 Mac OS X 9

ownCloud Administrators Manual Release 50

For installation physical access or a remote desktop connection is required You should leverage MySQL as the backend database for ownCloud If you do not want to use MySQL it is possible to use Postgres or SQLite insteadMicrosoft SQL Server is not yet support

Enabling SSL is not yet covered by this section

Note If you make your desktop machine or server available outside your LAN you must maintain it Monitor thelogs manage the access apply patches to avoid compromising the system at large

There are 4 primary steps to the installation and then a 5th step required for configuring everything to allow files largerthan the default 2MB

1 Install IIS with CGI support ndash enable IIS on your Windows machine

2 Install PHP ndash Grab download and install PHP

3 Install MySQL ndash Setup the MySQL server manager and enable ownCloud to create an instance

4 Install ownCloud ndash The whole reason we are here

5 Configure upload sizes and timeouts to enable large file uploads ndash So that you can upload larger files

251 Activate IIS with CGI Support

Windows 7

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 There is a box labeled Internet Information Services expand it

4 Expand World Wide Web Services and all the folders underneath

5 Select the folders as illustrated in the picture below to get your IIS server up and running

You do not need an FTP server running so you should tune that feature off for your server You definitely need the IISManagement Console as that is the easiest way to start stop restart you server as well as where you change certificateoptions and manage items like file upload size You must check the CGI box under Application Development Featuresbecause CGI is how you enable PHP on IIS

You have to turn off WebDAV publishing or the Windows WebDAV conflicts with the ownCloud WebDAV interfaceThis might already be turned off for you just make sure it stays that way The common HTTP features are the featuresyou would expect from a web server With the selections on this page IIS will now serve up a web page for you

Restart IIS by going to the IIS manager (Start ndashgt IIS Manager) Select your website and on the far right side is asection titled Manage Server Make sure that the service is started or click Start to start the services selected Oncethis is complete you should be able to go to a web browser and navigate to httplocalhostlsquo

This should open the standard IIS 7 splash page which is just a static image that says your web server is runningAssuming you were able to get the splash page it is safe to say your web server is now up and running

Windows Server 2008

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 This will bring up the Server Manager

10 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 6: Own Cloud Admin Manual

CHAPTER

TWO

INSTALLATION

This chapter will introduce you to the installation of ownCloud in different scenarios

If you want to just try ownCloud in a virtual machine without any configuration skip ahead to the appliance sectionwhere you will find ready-to-use images

21 Manual Installation

If you do not want to use packages here is how you setup ownCloud on from scratch using a classic LAMP (LinuxApache MySQL PHP) setup

211 Prerequisites

To run ownCloud your webserver must have the following installed

bull php5 (gt= 53)

bull php5-json

bull php-xml

bull php-mbstring

bull php5-zip

bull php5-gd

And as optional dependencies

bull php5-sqlite (gt= 3)

bull curl

bull libcurl3

bull libcurl3-dev

bull php5-curl

bull php5-intl

bull php-pdo

Commands for Ubuntu and Debian

apt-get install apache2 php5 php5-json php-xml php-mbstring php5-zip php5-gdapt-get install php5-sqlite curl libcurl3 libcurl3-dev php5-curl php-pdo

3

ownCloud Administrators Manual Release 50

Todo

Document other distributions

You donrsquot need any WebDAV support of your webserver (ie apachersquos mod_webdav) to access your ownCloud datavia WebDAV ownCloud has a WebDAV server built in

212 Extract ownCloud and Copy to Your Webserver

tar -xjf pathtodownloadedowncloud-xxxtarbz2cp -r owncloud pathtoyourwebserver

213 Set the Directory Permissions

The owner of your webserver must own the apps data and config directories in your ownCloud install You can dothis by running the following command for the apps data and config directories

chown -R www-datawww-data pathtoyourowncloudinstalldata

Replace www-datawww-data with the user and group of the owner of your webserver

Note The data directory will only be created after setup has run (see below) and is not present by default in thetarballs

214 Enable htaccess and mod_rewrite if Running Apache

If you are running the apache webserver it is recommended that you enable htaccess files as ownCloud usesthem to enhance security and allows you to use webfinger To enable htaccess files you need to ensure thatAllowOverride is set to All in the Directory varwww section of your virtual host file This is usually inetcapache2sites-enabled000-default You should also run a2enmod rewrite and a2enmodheaders Then restart apache service apache2 restart (for Ubuntu systems) In order for the maximum upload sizeto be configurable the htaccess file in the owncloud folder needs to be made writable by the server

215 Follow the Install Wizard

Open your web browser and navigate to your ownCloud instance If you are installing ownCloud on the same machineas you will access the install wizard from the url will be httplocalhost (or httplocalhostowncloud) For basicinstalls we recommend SQLite as it is easy to setup (ownCloud will do it for you) For larger installs you shoulduse MySQL or PostgreSQL Click on the Advanced options to show the configuration options You may enter admincredentials and let ownCloud create its own database user or enter a preconfigured user If you are not using apacheas the webserver please set the data directory to a location outside of the document root See the advanced installsettings

216 Test your Installation

Login and start using ownCloud Check your web servers errror log If it shows error you might have missed adependency or hit a bug with your particular configuration

4 Chapter 2 Installation

ownCloud Administrators Manual Release 50

If you plan on using the Webfinger app and your ownCloud installation is not in the webroot then yoursquoll have tomanually link varwwwwell-known to pathtoyourowncloudwell-known

22 Linux Distributions

This section describes the installation process for different distributions If there are pre-made packages from own-Cloud you are encouraged to prefer those over the vendor-provided ones since they usually are more up-to-date

221 Archlinux

There are two AUR packages for ownCloud

bull stable version

bull development version

222 openSUSE

Note ready-to-use SLES and openSUSE RPM packages are available in the openSUSE Build Service ownCloudrepository

1 Copy ownCloud to Apachersquos server directory srvwwwhtdocs

2 Give the web server the necessary permissions sudo chown -R wwwrun owncloud

bull If you do not use ldquosudordquo then you have to become root and execute chown -R wwwrun owncloudin the directory

bull (If yoursquore using mysql you have to set the database character set to something else then utf~8 for examplelatin1 otherwise some keys will be to long for mysql)

3 Open the folder in a browser and complete the setup wizard

If have followed the steps above and want to try it out run this command in a terminal to start Apache if itrsquos not alreadyrunning

1 sudo etcinitdapache2 start

2 Go to httpservernameowncloud and walk through the setup

223 Fedora

Note ready-to-use RPM packages are available in the openSUSE Build Service ownCloud repository

Make sure SELinux is disabled or else the installation process will fail with the following message Config file(configconfigphp) is not writable for the webserver

Configure Apache

1 If you already have a website running from Document Root but would still like to install OwnCloud you can usea Name-based virtual host entry and subdomain

2 Edit your DNS record following this example point owncloudfoocom gt ipipipip

22 Linux Distributions 5

ownCloud Administrators Manual Release 50

Todo

224 CentOS 5 amp 6

Note ready-to-use CentOS RPM packages are available in the openSUSE Build Service ownCloud repository

1 Create a new file in etchttpdconf and call it owncloudconf

2 You can use the following as an example

ltIfModule mod_aliascgtAlias owncloud varwwwowncloudltIfModulegtltDirectory varwwwowncloudgt

Options NoneOrder allowdenyallow from all

ltDirectorygtltVirtualHost 80gt

ServerAdmin foofoofarmcomDocumentRoot varwwwhtmlowncloudServerName owncloudfoocomErrorLog logsowncloudfooinfo-error_logCustomLog logsowncloudfooinfo-access_log common

ltVirtualHostgt

3 Now edit your httpdconf file which is usually located in etchttpdconfhttpdconf

4 Add the following to the bottom Include etchttpdconfowncloudconf

5 Restart apache and now when you point your browser to owncloudfoocom it should properly load withoutdisturbing foocom

225 Gentoo

Basically do everything like for a standard web server (see above) Changepermissions chown -R apacheapache owncloudAllow htaccess modifyetcapache2vhostsd00_default_vhostconf and make sure this is in

ltDirectory varwwwlocalhosthtdocsowncloudgtOptions Indexes FollowSymLinks MultiViewsAllowOverride AllOrder allowdenyallow from all

ltDirectorygt

226 PCLinuxOS

Follow the Tutorial ownCloud installation and setup on the PCLinuxOS web site

6 Chapter 2 Installation

ownCloud Administrators Manual Release 50

23 Web server Notes

The most popular server choice for ownCloud is Apache which is why it is also the combinations tested best Howeverit is also possible to run ownCloud on other web servers This section does not cover Microsoft Internet InformationServices (IIS) it is covered in the Windows 7 and Windows Server 2008 section

231 Nginx Configuration

bull You need to insert the following code into your nginx config file

bull Adjust server_name root ssl_certificate and ssl_certificate_key to suit your needs

bull Make sure your SSL certificates are readable by the server (see httpwikinginxorgHttpSslModule)

redirect http to httpsserver

listen 80server_name owncloudexampleorgrewrite ^ https$server_name$request_uri permanent enforce https

owncloud (ssltls)server

listen 443 sslssl_certificate etcnginxcertsservercrtssl_certificate_key etcnginxcertsserverkeyserver_name owncloudexampleorgroot pathtoowncloudindex indexphpclient_max_body_size 1000M set maximum upload size

deny direct accesslocation ^ ^(data|config|ht|db_structurexml|README) deny all

default try orderlocation try_files $uri $uri webdav

owncloud WebDAVlocation webdav fastcgi_split_path_info ^(+php)()$fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

enable phplocation ^ php$ fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

23 Web server Notes 7

ownCloud Administrators Manual Release 50

Note You can use Owncloud without SSLTLS support but we strongly encourage you not to do that

bull Remove the server block containing the redirect

bull Change listen 443 ssl to listen 80

bull Remove ssl_certificate and ssl_certificate_key

bull Remove fastcgi_params HTTPS on

Note If you want to effectively increase maximum upload size you will also have to modify your php-fpmconfiguration (usually at etcphp5fpmphpini) and increase upload_max_filesize andpost_max_size values Yoursquoll need to restart php5-fpm and nginx services in order these changes to be applied

232 Lighttpd Configuration

This assumes that you are familiar with installing PHP application on lighttpd

It is important to note that the htaccess files used by ownCloud to protect the data folder are ignored by lighttpdso you have to secure it by yourself otherwise your ownclouddblsquo database and user data are publicly readableeven if directory listing is off You need to add two snippets to your lighttpd configuration file

Disable access to data folder

$HTTP[url] =^ ^ownclouddata urlaccess-deny = ()

Disable directory listing

$HTTP[url] =^ ^owncloud($|) dir-listingactivate = disable

233 Yaws Configuration

This should be in your yaws_serverconf In the configuration file the dir_listings = false is impor-tant and also the redirect from data to somewhere else because files will be saved in this directory and it shouldnot be accessible from the outside A configuration file would look like this

ltserver owncloudmyservercomgtport = 80listen = 0000docroot = varwwwowncloudsrcallowed_scripts = phpphp_handler = ltcgi usrlocalbinphp-cgigterrormod_404 = yaws_404_to_index_phpaccess_log = falsedir_listings = falseltredirectgt

data ==

8 Chapter 2 Installation

ownCloud Administrators Manual Release 50

ltredirectgtltservergt

The apache htaccess file that comes with ownCloud is configured to redirect requests to nonexistent pages Toemulate that behaviour you need a custom error handler for yaws See this github gist for further instructions on howto create and compile that error handler

234 Hiawatha Configuration

Add WebDAVapp = yes to the ownCloud virtual host Users accessing WebDAV from MacOS will also need toadd AllowDotFiles = yes

Disable access to data folder

UrlToolkit ToolkitID = denyDataMatch ^data DenyAccess

235 PageKite Configuration

You can use this PageKite how to to make your local ownCloud accessible from the internet using PageKite

24 Mac OS X

Todo

This section of the manual needs to be revised

This relies on MAMP which provides the required environment

1 Install MAMP and run it

2 Go to lsquoPreferences Apachersquo and set lsquoDocument Rootrsquo to UsersltYOUR USER NAMEgtSites so yourSites directory will be used as Apache root

3 Download ownCloud

4 Move it to ~Sites and extract it tar xfpj owncloud-45tarbz2

5 Now you can set it up by going to httplocalhost8888owncloud

25 Windows 7 and Windows Server 2008

Note You must move the data directory outside of your public root (See advanced install settings)

This section describes how to install ownCloud on Windows with IIS (Internet Information Services)

It assumes that you have a vanilla non-IIS enabled Windows machine ndash Windows 7 or Server 2008 After enablingIIS the steps are essentially identical for Windows 7 and Windows Server 2008

24 Mac OS X 9

ownCloud Administrators Manual Release 50

For installation physical access or a remote desktop connection is required You should leverage MySQL as the backend database for ownCloud If you do not want to use MySQL it is possible to use Postgres or SQLite insteadMicrosoft SQL Server is not yet support

Enabling SSL is not yet covered by this section

Note If you make your desktop machine or server available outside your LAN you must maintain it Monitor thelogs manage the access apply patches to avoid compromising the system at large

There are 4 primary steps to the installation and then a 5th step required for configuring everything to allow files largerthan the default 2MB

1 Install IIS with CGI support ndash enable IIS on your Windows machine

2 Install PHP ndash Grab download and install PHP

3 Install MySQL ndash Setup the MySQL server manager and enable ownCloud to create an instance

4 Install ownCloud ndash The whole reason we are here

5 Configure upload sizes and timeouts to enable large file uploads ndash So that you can upload larger files

251 Activate IIS with CGI Support

Windows 7

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 There is a box labeled Internet Information Services expand it

4 Expand World Wide Web Services and all the folders underneath

5 Select the folders as illustrated in the picture below to get your IIS server up and running

You do not need an FTP server running so you should tune that feature off for your server You definitely need the IISManagement Console as that is the easiest way to start stop restart you server as well as where you change certificateoptions and manage items like file upload size You must check the CGI box under Application Development Featuresbecause CGI is how you enable PHP on IIS

You have to turn off WebDAV publishing or the Windows WebDAV conflicts with the ownCloud WebDAV interfaceThis might already be turned off for you just make sure it stays that way The common HTTP features are the featuresyou would expect from a web server With the selections on this page IIS will now serve up a web page for you

Restart IIS by going to the IIS manager (Start ndashgt IIS Manager) Select your website and on the far right side is asection titled Manage Server Make sure that the service is started or click Start to start the services selected Oncethis is complete you should be able to go to a web browser and navigate to httplocalhostlsquo

This should open the standard IIS 7 splash page which is just a static image that says your web server is runningAssuming you were able to get the splash page it is safe to say your web server is now up and running

Windows Server 2008

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 This will bring up the Server Manager

10 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 7: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

Todo

Document other distributions

You donrsquot need any WebDAV support of your webserver (ie apachersquos mod_webdav) to access your ownCloud datavia WebDAV ownCloud has a WebDAV server built in

212 Extract ownCloud and Copy to Your Webserver

tar -xjf pathtodownloadedowncloud-xxxtarbz2cp -r owncloud pathtoyourwebserver

213 Set the Directory Permissions

The owner of your webserver must own the apps data and config directories in your ownCloud install You can dothis by running the following command for the apps data and config directories

chown -R www-datawww-data pathtoyourowncloudinstalldata

Replace www-datawww-data with the user and group of the owner of your webserver

Note The data directory will only be created after setup has run (see below) and is not present by default in thetarballs

214 Enable htaccess and mod_rewrite if Running Apache

If you are running the apache webserver it is recommended that you enable htaccess files as ownCloud usesthem to enhance security and allows you to use webfinger To enable htaccess files you need to ensure thatAllowOverride is set to All in the Directory varwww section of your virtual host file This is usually inetcapache2sites-enabled000-default You should also run a2enmod rewrite and a2enmodheaders Then restart apache service apache2 restart (for Ubuntu systems) In order for the maximum upload sizeto be configurable the htaccess file in the owncloud folder needs to be made writable by the server

215 Follow the Install Wizard

Open your web browser and navigate to your ownCloud instance If you are installing ownCloud on the same machineas you will access the install wizard from the url will be httplocalhost (or httplocalhostowncloud) For basicinstalls we recommend SQLite as it is easy to setup (ownCloud will do it for you) For larger installs you shoulduse MySQL or PostgreSQL Click on the Advanced options to show the configuration options You may enter admincredentials and let ownCloud create its own database user or enter a preconfigured user If you are not using apacheas the webserver please set the data directory to a location outside of the document root See the advanced installsettings

216 Test your Installation

Login and start using ownCloud Check your web servers errror log If it shows error you might have missed adependency or hit a bug with your particular configuration

4 Chapter 2 Installation

ownCloud Administrators Manual Release 50

If you plan on using the Webfinger app and your ownCloud installation is not in the webroot then yoursquoll have tomanually link varwwwwell-known to pathtoyourowncloudwell-known

22 Linux Distributions

This section describes the installation process for different distributions If there are pre-made packages from own-Cloud you are encouraged to prefer those over the vendor-provided ones since they usually are more up-to-date

221 Archlinux

There are two AUR packages for ownCloud

bull stable version

bull development version

222 openSUSE

Note ready-to-use SLES and openSUSE RPM packages are available in the openSUSE Build Service ownCloudrepository

1 Copy ownCloud to Apachersquos server directory srvwwwhtdocs

2 Give the web server the necessary permissions sudo chown -R wwwrun owncloud

bull If you do not use ldquosudordquo then you have to become root and execute chown -R wwwrun owncloudin the directory

bull (If yoursquore using mysql you have to set the database character set to something else then utf~8 for examplelatin1 otherwise some keys will be to long for mysql)

3 Open the folder in a browser and complete the setup wizard

If have followed the steps above and want to try it out run this command in a terminal to start Apache if itrsquos not alreadyrunning

1 sudo etcinitdapache2 start

2 Go to httpservernameowncloud and walk through the setup

223 Fedora

Note ready-to-use RPM packages are available in the openSUSE Build Service ownCloud repository

Make sure SELinux is disabled or else the installation process will fail with the following message Config file(configconfigphp) is not writable for the webserver

Configure Apache

1 If you already have a website running from Document Root but would still like to install OwnCloud you can usea Name-based virtual host entry and subdomain

2 Edit your DNS record following this example point owncloudfoocom gt ipipipip

22 Linux Distributions 5

ownCloud Administrators Manual Release 50

Todo

224 CentOS 5 amp 6

Note ready-to-use CentOS RPM packages are available in the openSUSE Build Service ownCloud repository

1 Create a new file in etchttpdconf and call it owncloudconf

2 You can use the following as an example

ltIfModule mod_aliascgtAlias owncloud varwwwowncloudltIfModulegtltDirectory varwwwowncloudgt

Options NoneOrder allowdenyallow from all

ltDirectorygtltVirtualHost 80gt

ServerAdmin foofoofarmcomDocumentRoot varwwwhtmlowncloudServerName owncloudfoocomErrorLog logsowncloudfooinfo-error_logCustomLog logsowncloudfooinfo-access_log common

ltVirtualHostgt

3 Now edit your httpdconf file which is usually located in etchttpdconfhttpdconf

4 Add the following to the bottom Include etchttpdconfowncloudconf

5 Restart apache and now when you point your browser to owncloudfoocom it should properly load withoutdisturbing foocom

225 Gentoo

Basically do everything like for a standard web server (see above) Changepermissions chown -R apacheapache owncloudAllow htaccess modifyetcapache2vhostsd00_default_vhostconf and make sure this is in

ltDirectory varwwwlocalhosthtdocsowncloudgtOptions Indexes FollowSymLinks MultiViewsAllowOverride AllOrder allowdenyallow from all

ltDirectorygt

226 PCLinuxOS

Follow the Tutorial ownCloud installation and setup on the PCLinuxOS web site

6 Chapter 2 Installation

ownCloud Administrators Manual Release 50

23 Web server Notes

The most popular server choice for ownCloud is Apache which is why it is also the combinations tested best Howeverit is also possible to run ownCloud on other web servers This section does not cover Microsoft Internet InformationServices (IIS) it is covered in the Windows 7 and Windows Server 2008 section

231 Nginx Configuration

bull You need to insert the following code into your nginx config file

bull Adjust server_name root ssl_certificate and ssl_certificate_key to suit your needs

bull Make sure your SSL certificates are readable by the server (see httpwikinginxorgHttpSslModule)

redirect http to httpsserver

listen 80server_name owncloudexampleorgrewrite ^ https$server_name$request_uri permanent enforce https

owncloud (ssltls)server

listen 443 sslssl_certificate etcnginxcertsservercrtssl_certificate_key etcnginxcertsserverkeyserver_name owncloudexampleorgroot pathtoowncloudindex indexphpclient_max_body_size 1000M set maximum upload size

deny direct accesslocation ^ ^(data|config|ht|db_structurexml|README) deny all

default try orderlocation try_files $uri $uri webdav

owncloud WebDAVlocation webdav fastcgi_split_path_info ^(+php)()$fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

enable phplocation ^ php$ fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

23 Web server Notes 7

ownCloud Administrators Manual Release 50

Note You can use Owncloud without SSLTLS support but we strongly encourage you not to do that

bull Remove the server block containing the redirect

bull Change listen 443 ssl to listen 80

bull Remove ssl_certificate and ssl_certificate_key

bull Remove fastcgi_params HTTPS on

Note If you want to effectively increase maximum upload size you will also have to modify your php-fpmconfiguration (usually at etcphp5fpmphpini) and increase upload_max_filesize andpost_max_size values Yoursquoll need to restart php5-fpm and nginx services in order these changes to be applied

232 Lighttpd Configuration

This assumes that you are familiar with installing PHP application on lighttpd

It is important to note that the htaccess files used by ownCloud to protect the data folder are ignored by lighttpdso you have to secure it by yourself otherwise your ownclouddblsquo database and user data are publicly readableeven if directory listing is off You need to add two snippets to your lighttpd configuration file

Disable access to data folder

$HTTP[url] =^ ^ownclouddata urlaccess-deny = ()

Disable directory listing

$HTTP[url] =^ ^owncloud($|) dir-listingactivate = disable

233 Yaws Configuration

This should be in your yaws_serverconf In the configuration file the dir_listings = false is impor-tant and also the redirect from data to somewhere else because files will be saved in this directory and it shouldnot be accessible from the outside A configuration file would look like this

ltserver owncloudmyservercomgtport = 80listen = 0000docroot = varwwwowncloudsrcallowed_scripts = phpphp_handler = ltcgi usrlocalbinphp-cgigterrormod_404 = yaws_404_to_index_phpaccess_log = falsedir_listings = falseltredirectgt

data ==

8 Chapter 2 Installation

ownCloud Administrators Manual Release 50

ltredirectgtltservergt

The apache htaccess file that comes with ownCloud is configured to redirect requests to nonexistent pages Toemulate that behaviour you need a custom error handler for yaws See this github gist for further instructions on howto create and compile that error handler

234 Hiawatha Configuration

Add WebDAVapp = yes to the ownCloud virtual host Users accessing WebDAV from MacOS will also need toadd AllowDotFiles = yes

Disable access to data folder

UrlToolkit ToolkitID = denyDataMatch ^data DenyAccess

235 PageKite Configuration

You can use this PageKite how to to make your local ownCloud accessible from the internet using PageKite

24 Mac OS X

Todo

This section of the manual needs to be revised

This relies on MAMP which provides the required environment

1 Install MAMP and run it

2 Go to lsquoPreferences Apachersquo and set lsquoDocument Rootrsquo to UsersltYOUR USER NAMEgtSites so yourSites directory will be used as Apache root

3 Download ownCloud

4 Move it to ~Sites and extract it tar xfpj owncloud-45tarbz2

5 Now you can set it up by going to httplocalhost8888owncloud

25 Windows 7 and Windows Server 2008

Note You must move the data directory outside of your public root (See advanced install settings)

This section describes how to install ownCloud on Windows with IIS (Internet Information Services)

It assumes that you have a vanilla non-IIS enabled Windows machine ndash Windows 7 or Server 2008 After enablingIIS the steps are essentially identical for Windows 7 and Windows Server 2008

24 Mac OS X 9

ownCloud Administrators Manual Release 50

For installation physical access or a remote desktop connection is required You should leverage MySQL as the backend database for ownCloud If you do not want to use MySQL it is possible to use Postgres or SQLite insteadMicrosoft SQL Server is not yet support

Enabling SSL is not yet covered by this section

Note If you make your desktop machine or server available outside your LAN you must maintain it Monitor thelogs manage the access apply patches to avoid compromising the system at large

There are 4 primary steps to the installation and then a 5th step required for configuring everything to allow files largerthan the default 2MB

1 Install IIS with CGI support ndash enable IIS on your Windows machine

2 Install PHP ndash Grab download and install PHP

3 Install MySQL ndash Setup the MySQL server manager and enable ownCloud to create an instance

4 Install ownCloud ndash The whole reason we are here

5 Configure upload sizes and timeouts to enable large file uploads ndash So that you can upload larger files

251 Activate IIS with CGI Support

Windows 7

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 There is a box labeled Internet Information Services expand it

4 Expand World Wide Web Services and all the folders underneath

5 Select the folders as illustrated in the picture below to get your IIS server up and running

You do not need an FTP server running so you should tune that feature off for your server You definitely need the IISManagement Console as that is the easiest way to start stop restart you server as well as where you change certificateoptions and manage items like file upload size You must check the CGI box under Application Development Featuresbecause CGI is how you enable PHP on IIS

You have to turn off WebDAV publishing or the Windows WebDAV conflicts with the ownCloud WebDAV interfaceThis might already be turned off for you just make sure it stays that way The common HTTP features are the featuresyou would expect from a web server With the selections on this page IIS will now serve up a web page for you

Restart IIS by going to the IIS manager (Start ndashgt IIS Manager) Select your website and on the far right side is asection titled Manage Server Make sure that the service is started or click Start to start the services selected Oncethis is complete you should be able to go to a web browser and navigate to httplocalhostlsquo

This should open the standard IIS 7 splash page which is just a static image that says your web server is runningAssuming you were able to get the splash page it is safe to say your web server is now up and running

Windows Server 2008

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 This will bring up the Server Manager

10 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 8: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

If you plan on using the Webfinger app and your ownCloud installation is not in the webroot then yoursquoll have tomanually link varwwwwell-known to pathtoyourowncloudwell-known

22 Linux Distributions

This section describes the installation process for different distributions If there are pre-made packages from own-Cloud you are encouraged to prefer those over the vendor-provided ones since they usually are more up-to-date

221 Archlinux

There are two AUR packages for ownCloud

bull stable version

bull development version

222 openSUSE

Note ready-to-use SLES and openSUSE RPM packages are available in the openSUSE Build Service ownCloudrepository

1 Copy ownCloud to Apachersquos server directory srvwwwhtdocs

2 Give the web server the necessary permissions sudo chown -R wwwrun owncloud

bull If you do not use ldquosudordquo then you have to become root and execute chown -R wwwrun owncloudin the directory

bull (If yoursquore using mysql you have to set the database character set to something else then utf~8 for examplelatin1 otherwise some keys will be to long for mysql)

3 Open the folder in a browser and complete the setup wizard

If have followed the steps above and want to try it out run this command in a terminal to start Apache if itrsquos not alreadyrunning

1 sudo etcinitdapache2 start

2 Go to httpservernameowncloud and walk through the setup

223 Fedora

Note ready-to-use RPM packages are available in the openSUSE Build Service ownCloud repository

Make sure SELinux is disabled or else the installation process will fail with the following message Config file(configconfigphp) is not writable for the webserver

Configure Apache

1 If you already have a website running from Document Root but would still like to install OwnCloud you can usea Name-based virtual host entry and subdomain

2 Edit your DNS record following this example point owncloudfoocom gt ipipipip

22 Linux Distributions 5

ownCloud Administrators Manual Release 50

Todo

224 CentOS 5 amp 6

Note ready-to-use CentOS RPM packages are available in the openSUSE Build Service ownCloud repository

1 Create a new file in etchttpdconf and call it owncloudconf

2 You can use the following as an example

ltIfModule mod_aliascgtAlias owncloud varwwwowncloudltIfModulegtltDirectory varwwwowncloudgt

Options NoneOrder allowdenyallow from all

ltDirectorygtltVirtualHost 80gt

ServerAdmin foofoofarmcomDocumentRoot varwwwhtmlowncloudServerName owncloudfoocomErrorLog logsowncloudfooinfo-error_logCustomLog logsowncloudfooinfo-access_log common

ltVirtualHostgt

3 Now edit your httpdconf file which is usually located in etchttpdconfhttpdconf

4 Add the following to the bottom Include etchttpdconfowncloudconf

5 Restart apache and now when you point your browser to owncloudfoocom it should properly load withoutdisturbing foocom

225 Gentoo

Basically do everything like for a standard web server (see above) Changepermissions chown -R apacheapache owncloudAllow htaccess modifyetcapache2vhostsd00_default_vhostconf and make sure this is in

ltDirectory varwwwlocalhosthtdocsowncloudgtOptions Indexes FollowSymLinks MultiViewsAllowOverride AllOrder allowdenyallow from all

ltDirectorygt

226 PCLinuxOS

Follow the Tutorial ownCloud installation and setup on the PCLinuxOS web site

6 Chapter 2 Installation

ownCloud Administrators Manual Release 50

23 Web server Notes

The most popular server choice for ownCloud is Apache which is why it is also the combinations tested best Howeverit is also possible to run ownCloud on other web servers This section does not cover Microsoft Internet InformationServices (IIS) it is covered in the Windows 7 and Windows Server 2008 section

231 Nginx Configuration

bull You need to insert the following code into your nginx config file

bull Adjust server_name root ssl_certificate and ssl_certificate_key to suit your needs

bull Make sure your SSL certificates are readable by the server (see httpwikinginxorgHttpSslModule)

redirect http to httpsserver

listen 80server_name owncloudexampleorgrewrite ^ https$server_name$request_uri permanent enforce https

owncloud (ssltls)server

listen 443 sslssl_certificate etcnginxcertsservercrtssl_certificate_key etcnginxcertsserverkeyserver_name owncloudexampleorgroot pathtoowncloudindex indexphpclient_max_body_size 1000M set maximum upload size

deny direct accesslocation ^ ^(data|config|ht|db_structurexml|README) deny all

default try orderlocation try_files $uri $uri webdav

owncloud WebDAVlocation webdav fastcgi_split_path_info ^(+php)()$fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

enable phplocation ^ php$ fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

23 Web server Notes 7

ownCloud Administrators Manual Release 50

Note You can use Owncloud without SSLTLS support but we strongly encourage you not to do that

bull Remove the server block containing the redirect

bull Change listen 443 ssl to listen 80

bull Remove ssl_certificate and ssl_certificate_key

bull Remove fastcgi_params HTTPS on

Note If you want to effectively increase maximum upload size you will also have to modify your php-fpmconfiguration (usually at etcphp5fpmphpini) and increase upload_max_filesize andpost_max_size values Yoursquoll need to restart php5-fpm and nginx services in order these changes to be applied

232 Lighttpd Configuration

This assumes that you are familiar with installing PHP application on lighttpd

It is important to note that the htaccess files used by ownCloud to protect the data folder are ignored by lighttpdso you have to secure it by yourself otherwise your ownclouddblsquo database and user data are publicly readableeven if directory listing is off You need to add two snippets to your lighttpd configuration file

Disable access to data folder

$HTTP[url] =^ ^ownclouddata urlaccess-deny = ()

Disable directory listing

$HTTP[url] =^ ^owncloud($|) dir-listingactivate = disable

233 Yaws Configuration

This should be in your yaws_serverconf In the configuration file the dir_listings = false is impor-tant and also the redirect from data to somewhere else because files will be saved in this directory and it shouldnot be accessible from the outside A configuration file would look like this

ltserver owncloudmyservercomgtport = 80listen = 0000docroot = varwwwowncloudsrcallowed_scripts = phpphp_handler = ltcgi usrlocalbinphp-cgigterrormod_404 = yaws_404_to_index_phpaccess_log = falsedir_listings = falseltredirectgt

data ==

8 Chapter 2 Installation

ownCloud Administrators Manual Release 50

ltredirectgtltservergt

The apache htaccess file that comes with ownCloud is configured to redirect requests to nonexistent pages Toemulate that behaviour you need a custom error handler for yaws See this github gist for further instructions on howto create and compile that error handler

234 Hiawatha Configuration

Add WebDAVapp = yes to the ownCloud virtual host Users accessing WebDAV from MacOS will also need toadd AllowDotFiles = yes

Disable access to data folder

UrlToolkit ToolkitID = denyDataMatch ^data DenyAccess

235 PageKite Configuration

You can use this PageKite how to to make your local ownCloud accessible from the internet using PageKite

24 Mac OS X

Todo

This section of the manual needs to be revised

This relies on MAMP which provides the required environment

1 Install MAMP and run it

2 Go to lsquoPreferences Apachersquo and set lsquoDocument Rootrsquo to UsersltYOUR USER NAMEgtSites so yourSites directory will be used as Apache root

3 Download ownCloud

4 Move it to ~Sites and extract it tar xfpj owncloud-45tarbz2

5 Now you can set it up by going to httplocalhost8888owncloud

25 Windows 7 and Windows Server 2008

Note You must move the data directory outside of your public root (See advanced install settings)

This section describes how to install ownCloud on Windows with IIS (Internet Information Services)

It assumes that you have a vanilla non-IIS enabled Windows machine ndash Windows 7 or Server 2008 After enablingIIS the steps are essentially identical for Windows 7 and Windows Server 2008

24 Mac OS X 9

ownCloud Administrators Manual Release 50

For installation physical access or a remote desktop connection is required You should leverage MySQL as the backend database for ownCloud If you do not want to use MySQL it is possible to use Postgres or SQLite insteadMicrosoft SQL Server is not yet support

Enabling SSL is not yet covered by this section

Note If you make your desktop machine or server available outside your LAN you must maintain it Monitor thelogs manage the access apply patches to avoid compromising the system at large

There are 4 primary steps to the installation and then a 5th step required for configuring everything to allow files largerthan the default 2MB

1 Install IIS with CGI support ndash enable IIS on your Windows machine

2 Install PHP ndash Grab download and install PHP

3 Install MySQL ndash Setup the MySQL server manager and enable ownCloud to create an instance

4 Install ownCloud ndash The whole reason we are here

5 Configure upload sizes and timeouts to enable large file uploads ndash So that you can upload larger files

251 Activate IIS with CGI Support

Windows 7

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 There is a box labeled Internet Information Services expand it

4 Expand World Wide Web Services and all the folders underneath

5 Select the folders as illustrated in the picture below to get your IIS server up and running

You do not need an FTP server running so you should tune that feature off for your server You definitely need the IISManagement Console as that is the easiest way to start stop restart you server as well as where you change certificateoptions and manage items like file upload size You must check the CGI box under Application Development Featuresbecause CGI is how you enable PHP on IIS

You have to turn off WebDAV publishing or the Windows WebDAV conflicts with the ownCloud WebDAV interfaceThis might already be turned off for you just make sure it stays that way The common HTTP features are the featuresyou would expect from a web server With the selections on this page IIS will now serve up a web page for you

Restart IIS by going to the IIS manager (Start ndashgt IIS Manager) Select your website and on the far right side is asection titled Manage Server Make sure that the service is started or click Start to start the services selected Oncethis is complete you should be able to go to a web browser and navigate to httplocalhostlsquo

This should open the standard IIS 7 splash page which is just a static image that says your web server is runningAssuming you were able to get the splash page it is safe to say your web server is now up and running

Windows Server 2008

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 This will bring up the Server Manager

10 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 9: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

Todo

224 CentOS 5 amp 6

Note ready-to-use CentOS RPM packages are available in the openSUSE Build Service ownCloud repository

1 Create a new file in etchttpdconf and call it owncloudconf

2 You can use the following as an example

ltIfModule mod_aliascgtAlias owncloud varwwwowncloudltIfModulegtltDirectory varwwwowncloudgt

Options NoneOrder allowdenyallow from all

ltDirectorygtltVirtualHost 80gt

ServerAdmin foofoofarmcomDocumentRoot varwwwhtmlowncloudServerName owncloudfoocomErrorLog logsowncloudfooinfo-error_logCustomLog logsowncloudfooinfo-access_log common

ltVirtualHostgt

3 Now edit your httpdconf file which is usually located in etchttpdconfhttpdconf

4 Add the following to the bottom Include etchttpdconfowncloudconf

5 Restart apache and now when you point your browser to owncloudfoocom it should properly load withoutdisturbing foocom

225 Gentoo

Basically do everything like for a standard web server (see above) Changepermissions chown -R apacheapache owncloudAllow htaccess modifyetcapache2vhostsd00_default_vhostconf and make sure this is in

ltDirectory varwwwlocalhosthtdocsowncloudgtOptions Indexes FollowSymLinks MultiViewsAllowOverride AllOrder allowdenyallow from all

ltDirectorygt

226 PCLinuxOS

Follow the Tutorial ownCloud installation and setup on the PCLinuxOS web site

6 Chapter 2 Installation

ownCloud Administrators Manual Release 50

23 Web server Notes

The most popular server choice for ownCloud is Apache which is why it is also the combinations tested best Howeverit is also possible to run ownCloud on other web servers This section does not cover Microsoft Internet InformationServices (IIS) it is covered in the Windows 7 and Windows Server 2008 section

231 Nginx Configuration

bull You need to insert the following code into your nginx config file

bull Adjust server_name root ssl_certificate and ssl_certificate_key to suit your needs

bull Make sure your SSL certificates are readable by the server (see httpwikinginxorgHttpSslModule)

redirect http to httpsserver

listen 80server_name owncloudexampleorgrewrite ^ https$server_name$request_uri permanent enforce https

owncloud (ssltls)server

listen 443 sslssl_certificate etcnginxcertsservercrtssl_certificate_key etcnginxcertsserverkeyserver_name owncloudexampleorgroot pathtoowncloudindex indexphpclient_max_body_size 1000M set maximum upload size

deny direct accesslocation ^ ^(data|config|ht|db_structurexml|README) deny all

default try orderlocation try_files $uri $uri webdav

owncloud WebDAVlocation webdav fastcgi_split_path_info ^(+php)()$fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

enable phplocation ^ php$ fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

23 Web server Notes 7

ownCloud Administrators Manual Release 50

Note You can use Owncloud without SSLTLS support but we strongly encourage you not to do that

bull Remove the server block containing the redirect

bull Change listen 443 ssl to listen 80

bull Remove ssl_certificate and ssl_certificate_key

bull Remove fastcgi_params HTTPS on

Note If you want to effectively increase maximum upload size you will also have to modify your php-fpmconfiguration (usually at etcphp5fpmphpini) and increase upload_max_filesize andpost_max_size values Yoursquoll need to restart php5-fpm and nginx services in order these changes to be applied

232 Lighttpd Configuration

This assumes that you are familiar with installing PHP application on lighttpd

It is important to note that the htaccess files used by ownCloud to protect the data folder are ignored by lighttpdso you have to secure it by yourself otherwise your ownclouddblsquo database and user data are publicly readableeven if directory listing is off You need to add two snippets to your lighttpd configuration file

Disable access to data folder

$HTTP[url] =^ ^ownclouddata urlaccess-deny = ()

Disable directory listing

$HTTP[url] =^ ^owncloud($|) dir-listingactivate = disable

233 Yaws Configuration

This should be in your yaws_serverconf In the configuration file the dir_listings = false is impor-tant and also the redirect from data to somewhere else because files will be saved in this directory and it shouldnot be accessible from the outside A configuration file would look like this

ltserver owncloudmyservercomgtport = 80listen = 0000docroot = varwwwowncloudsrcallowed_scripts = phpphp_handler = ltcgi usrlocalbinphp-cgigterrormod_404 = yaws_404_to_index_phpaccess_log = falsedir_listings = falseltredirectgt

data ==

8 Chapter 2 Installation

ownCloud Administrators Manual Release 50

ltredirectgtltservergt

The apache htaccess file that comes with ownCloud is configured to redirect requests to nonexistent pages Toemulate that behaviour you need a custom error handler for yaws See this github gist for further instructions on howto create and compile that error handler

234 Hiawatha Configuration

Add WebDAVapp = yes to the ownCloud virtual host Users accessing WebDAV from MacOS will also need toadd AllowDotFiles = yes

Disable access to data folder

UrlToolkit ToolkitID = denyDataMatch ^data DenyAccess

235 PageKite Configuration

You can use this PageKite how to to make your local ownCloud accessible from the internet using PageKite

24 Mac OS X

Todo

This section of the manual needs to be revised

This relies on MAMP which provides the required environment

1 Install MAMP and run it

2 Go to lsquoPreferences Apachersquo and set lsquoDocument Rootrsquo to UsersltYOUR USER NAMEgtSites so yourSites directory will be used as Apache root

3 Download ownCloud

4 Move it to ~Sites and extract it tar xfpj owncloud-45tarbz2

5 Now you can set it up by going to httplocalhost8888owncloud

25 Windows 7 and Windows Server 2008

Note You must move the data directory outside of your public root (See advanced install settings)

This section describes how to install ownCloud on Windows with IIS (Internet Information Services)

It assumes that you have a vanilla non-IIS enabled Windows machine ndash Windows 7 or Server 2008 After enablingIIS the steps are essentially identical for Windows 7 and Windows Server 2008

24 Mac OS X 9

ownCloud Administrators Manual Release 50

For installation physical access or a remote desktop connection is required You should leverage MySQL as the backend database for ownCloud If you do not want to use MySQL it is possible to use Postgres or SQLite insteadMicrosoft SQL Server is not yet support

Enabling SSL is not yet covered by this section

Note If you make your desktop machine or server available outside your LAN you must maintain it Monitor thelogs manage the access apply patches to avoid compromising the system at large

There are 4 primary steps to the installation and then a 5th step required for configuring everything to allow files largerthan the default 2MB

1 Install IIS with CGI support ndash enable IIS on your Windows machine

2 Install PHP ndash Grab download and install PHP

3 Install MySQL ndash Setup the MySQL server manager and enable ownCloud to create an instance

4 Install ownCloud ndash The whole reason we are here

5 Configure upload sizes and timeouts to enable large file uploads ndash So that you can upload larger files

251 Activate IIS with CGI Support

Windows 7

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 There is a box labeled Internet Information Services expand it

4 Expand World Wide Web Services and all the folders underneath

5 Select the folders as illustrated in the picture below to get your IIS server up and running

You do not need an FTP server running so you should tune that feature off for your server You definitely need the IISManagement Console as that is the easiest way to start stop restart you server as well as where you change certificateoptions and manage items like file upload size You must check the CGI box under Application Development Featuresbecause CGI is how you enable PHP on IIS

You have to turn off WebDAV publishing or the Windows WebDAV conflicts with the ownCloud WebDAV interfaceThis might already be turned off for you just make sure it stays that way The common HTTP features are the featuresyou would expect from a web server With the selections on this page IIS will now serve up a web page for you

Restart IIS by going to the IIS manager (Start ndashgt IIS Manager) Select your website and on the far right side is asection titled Manage Server Make sure that the service is started or click Start to start the services selected Oncethis is complete you should be able to go to a web browser and navigate to httplocalhostlsquo

This should open the standard IIS 7 splash page which is just a static image that says your web server is runningAssuming you were able to get the splash page it is safe to say your web server is now up and running

Windows Server 2008

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 This will bring up the Server Manager

10 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 10: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

23 Web server Notes

The most popular server choice for ownCloud is Apache which is why it is also the combinations tested best Howeverit is also possible to run ownCloud on other web servers This section does not cover Microsoft Internet InformationServices (IIS) it is covered in the Windows 7 and Windows Server 2008 section

231 Nginx Configuration

bull You need to insert the following code into your nginx config file

bull Adjust server_name root ssl_certificate and ssl_certificate_key to suit your needs

bull Make sure your SSL certificates are readable by the server (see httpwikinginxorgHttpSslModule)

redirect http to httpsserver

listen 80server_name owncloudexampleorgrewrite ^ https$server_name$request_uri permanent enforce https

owncloud (ssltls)server

listen 443 sslssl_certificate etcnginxcertsservercrtssl_certificate_key etcnginxcertsserverkeyserver_name owncloudexampleorgroot pathtoowncloudindex indexphpclient_max_body_size 1000M set maximum upload size

deny direct accesslocation ^ ^(data|config|ht|db_structurexml|README) deny all

default try orderlocation try_files $uri $uri webdav

owncloud WebDAVlocation webdav fastcgi_split_path_info ^(+php)()$fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

enable phplocation ^ php$ fastcgi_pass 1270019000 or use php-fpm with unixvarrunphp-fpmphp-fpmsockfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_namefastcgi_param HTTPS oninclude fastcgi_params

23 Web server Notes 7

ownCloud Administrators Manual Release 50

Note You can use Owncloud without SSLTLS support but we strongly encourage you not to do that

bull Remove the server block containing the redirect

bull Change listen 443 ssl to listen 80

bull Remove ssl_certificate and ssl_certificate_key

bull Remove fastcgi_params HTTPS on

Note If you want to effectively increase maximum upload size you will also have to modify your php-fpmconfiguration (usually at etcphp5fpmphpini) and increase upload_max_filesize andpost_max_size values Yoursquoll need to restart php5-fpm and nginx services in order these changes to be applied

232 Lighttpd Configuration

This assumes that you are familiar with installing PHP application on lighttpd

It is important to note that the htaccess files used by ownCloud to protect the data folder are ignored by lighttpdso you have to secure it by yourself otherwise your ownclouddblsquo database and user data are publicly readableeven if directory listing is off You need to add two snippets to your lighttpd configuration file

Disable access to data folder

$HTTP[url] =^ ^ownclouddata urlaccess-deny = ()

Disable directory listing

$HTTP[url] =^ ^owncloud($|) dir-listingactivate = disable

233 Yaws Configuration

This should be in your yaws_serverconf In the configuration file the dir_listings = false is impor-tant and also the redirect from data to somewhere else because files will be saved in this directory and it shouldnot be accessible from the outside A configuration file would look like this

ltserver owncloudmyservercomgtport = 80listen = 0000docroot = varwwwowncloudsrcallowed_scripts = phpphp_handler = ltcgi usrlocalbinphp-cgigterrormod_404 = yaws_404_to_index_phpaccess_log = falsedir_listings = falseltredirectgt

data ==

8 Chapter 2 Installation

ownCloud Administrators Manual Release 50

ltredirectgtltservergt

The apache htaccess file that comes with ownCloud is configured to redirect requests to nonexistent pages Toemulate that behaviour you need a custom error handler for yaws See this github gist for further instructions on howto create and compile that error handler

234 Hiawatha Configuration

Add WebDAVapp = yes to the ownCloud virtual host Users accessing WebDAV from MacOS will also need toadd AllowDotFiles = yes

Disable access to data folder

UrlToolkit ToolkitID = denyDataMatch ^data DenyAccess

235 PageKite Configuration

You can use this PageKite how to to make your local ownCloud accessible from the internet using PageKite

24 Mac OS X

Todo

This section of the manual needs to be revised

This relies on MAMP which provides the required environment

1 Install MAMP and run it

2 Go to lsquoPreferences Apachersquo and set lsquoDocument Rootrsquo to UsersltYOUR USER NAMEgtSites so yourSites directory will be used as Apache root

3 Download ownCloud

4 Move it to ~Sites and extract it tar xfpj owncloud-45tarbz2

5 Now you can set it up by going to httplocalhost8888owncloud

25 Windows 7 and Windows Server 2008

Note You must move the data directory outside of your public root (See advanced install settings)

This section describes how to install ownCloud on Windows with IIS (Internet Information Services)

It assumes that you have a vanilla non-IIS enabled Windows machine ndash Windows 7 or Server 2008 After enablingIIS the steps are essentially identical for Windows 7 and Windows Server 2008

24 Mac OS X 9

ownCloud Administrators Manual Release 50

For installation physical access or a remote desktop connection is required You should leverage MySQL as the backend database for ownCloud If you do not want to use MySQL it is possible to use Postgres or SQLite insteadMicrosoft SQL Server is not yet support

Enabling SSL is not yet covered by this section

Note If you make your desktop machine or server available outside your LAN you must maintain it Monitor thelogs manage the access apply patches to avoid compromising the system at large

There are 4 primary steps to the installation and then a 5th step required for configuring everything to allow files largerthan the default 2MB

1 Install IIS with CGI support ndash enable IIS on your Windows machine

2 Install PHP ndash Grab download and install PHP

3 Install MySQL ndash Setup the MySQL server manager and enable ownCloud to create an instance

4 Install ownCloud ndash The whole reason we are here

5 Configure upload sizes and timeouts to enable large file uploads ndash So that you can upload larger files

251 Activate IIS with CGI Support

Windows 7

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 There is a box labeled Internet Information Services expand it

4 Expand World Wide Web Services and all the folders underneath

5 Select the folders as illustrated in the picture below to get your IIS server up and running

You do not need an FTP server running so you should tune that feature off for your server You definitely need the IISManagement Console as that is the easiest way to start stop restart you server as well as where you change certificateoptions and manage items like file upload size You must check the CGI box under Application Development Featuresbecause CGI is how you enable PHP on IIS

You have to turn off WebDAV publishing or the Windows WebDAV conflicts with the ownCloud WebDAV interfaceThis might already be turned off for you just make sure it stays that way The common HTTP features are the featuresyou would expect from a web server With the selections on this page IIS will now serve up a web page for you

Restart IIS by going to the IIS manager (Start ndashgt IIS Manager) Select your website and on the far right side is asection titled Manage Server Make sure that the service is started or click Start to start the services selected Oncethis is complete you should be able to go to a web browser and navigate to httplocalhostlsquo

This should open the standard IIS 7 splash page which is just a static image that says your web server is runningAssuming you were able to get the splash page it is safe to say your web server is now up and running

Windows Server 2008

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 This will bring up the Server Manager

10 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 11: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

Note You can use Owncloud without SSLTLS support but we strongly encourage you not to do that

bull Remove the server block containing the redirect

bull Change listen 443 ssl to listen 80

bull Remove ssl_certificate and ssl_certificate_key

bull Remove fastcgi_params HTTPS on

Note If you want to effectively increase maximum upload size you will also have to modify your php-fpmconfiguration (usually at etcphp5fpmphpini) and increase upload_max_filesize andpost_max_size values Yoursquoll need to restart php5-fpm and nginx services in order these changes to be applied

232 Lighttpd Configuration

This assumes that you are familiar with installing PHP application on lighttpd

It is important to note that the htaccess files used by ownCloud to protect the data folder are ignored by lighttpdso you have to secure it by yourself otherwise your ownclouddblsquo database and user data are publicly readableeven if directory listing is off You need to add two snippets to your lighttpd configuration file

Disable access to data folder

$HTTP[url] =^ ^ownclouddata urlaccess-deny = ()

Disable directory listing

$HTTP[url] =^ ^owncloud($|) dir-listingactivate = disable

233 Yaws Configuration

This should be in your yaws_serverconf In the configuration file the dir_listings = false is impor-tant and also the redirect from data to somewhere else because files will be saved in this directory and it shouldnot be accessible from the outside A configuration file would look like this

ltserver owncloudmyservercomgtport = 80listen = 0000docroot = varwwwowncloudsrcallowed_scripts = phpphp_handler = ltcgi usrlocalbinphp-cgigterrormod_404 = yaws_404_to_index_phpaccess_log = falsedir_listings = falseltredirectgt

data ==

8 Chapter 2 Installation

ownCloud Administrators Manual Release 50

ltredirectgtltservergt

The apache htaccess file that comes with ownCloud is configured to redirect requests to nonexistent pages Toemulate that behaviour you need a custom error handler for yaws See this github gist for further instructions on howto create and compile that error handler

234 Hiawatha Configuration

Add WebDAVapp = yes to the ownCloud virtual host Users accessing WebDAV from MacOS will also need toadd AllowDotFiles = yes

Disable access to data folder

UrlToolkit ToolkitID = denyDataMatch ^data DenyAccess

235 PageKite Configuration

You can use this PageKite how to to make your local ownCloud accessible from the internet using PageKite

24 Mac OS X

Todo

This section of the manual needs to be revised

This relies on MAMP which provides the required environment

1 Install MAMP and run it

2 Go to lsquoPreferences Apachersquo and set lsquoDocument Rootrsquo to UsersltYOUR USER NAMEgtSites so yourSites directory will be used as Apache root

3 Download ownCloud

4 Move it to ~Sites and extract it tar xfpj owncloud-45tarbz2

5 Now you can set it up by going to httplocalhost8888owncloud

25 Windows 7 and Windows Server 2008

Note You must move the data directory outside of your public root (See advanced install settings)

This section describes how to install ownCloud on Windows with IIS (Internet Information Services)

It assumes that you have a vanilla non-IIS enabled Windows machine ndash Windows 7 or Server 2008 After enablingIIS the steps are essentially identical for Windows 7 and Windows Server 2008

24 Mac OS X 9

ownCloud Administrators Manual Release 50

For installation physical access or a remote desktop connection is required You should leverage MySQL as the backend database for ownCloud If you do not want to use MySQL it is possible to use Postgres or SQLite insteadMicrosoft SQL Server is not yet support

Enabling SSL is not yet covered by this section

Note If you make your desktop machine or server available outside your LAN you must maintain it Monitor thelogs manage the access apply patches to avoid compromising the system at large

There are 4 primary steps to the installation and then a 5th step required for configuring everything to allow files largerthan the default 2MB

1 Install IIS with CGI support ndash enable IIS on your Windows machine

2 Install PHP ndash Grab download and install PHP

3 Install MySQL ndash Setup the MySQL server manager and enable ownCloud to create an instance

4 Install ownCloud ndash The whole reason we are here

5 Configure upload sizes and timeouts to enable large file uploads ndash So that you can upload larger files

251 Activate IIS with CGI Support

Windows 7

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 There is a box labeled Internet Information Services expand it

4 Expand World Wide Web Services and all the folders underneath

5 Select the folders as illustrated in the picture below to get your IIS server up and running

You do not need an FTP server running so you should tune that feature off for your server You definitely need the IISManagement Console as that is the easiest way to start stop restart you server as well as where you change certificateoptions and manage items like file upload size You must check the CGI box under Application Development Featuresbecause CGI is how you enable PHP on IIS

You have to turn off WebDAV publishing or the Windows WebDAV conflicts with the ownCloud WebDAV interfaceThis might already be turned off for you just make sure it stays that way The common HTTP features are the featuresyou would expect from a web server With the selections on this page IIS will now serve up a web page for you

Restart IIS by going to the IIS manager (Start ndashgt IIS Manager) Select your website and on the far right side is asection titled Manage Server Make sure that the service is started or click Start to start the services selected Oncethis is complete you should be able to go to a web browser and navigate to httplocalhostlsquo

This should open the standard IIS 7 splash page which is just a static image that says your web server is runningAssuming you were able to get the splash page it is safe to say your web server is now up and running

Windows Server 2008

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 This will bring up the Server Manager

10 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 12: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

ltredirectgtltservergt

The apache htaccess file that comes with ownCloud is configured to redirect requests to nonexistent pages Toemulate that behaviour you need a custom error handler for yaws See this github gist for further instructions on howto create and compile that error handler

234 Hiawatha Configuration

Add WebDAVapp = yes to the ownCloud virtual host Users accessing WebDAV from MacOS will also need toadd AllowDotFiles = yes

Disable access to data folder

UrlToolkit ToolkitID = denyDataMatch ^data DenyAccess

235 PageKite Configuration

You can use this PageKite how to to make your local ownCloud accessible from the internet using PageKite

24 Mac OS X

Todo

This section of the manual needs to be revised

This relies on MAMP which provides the required environment

1 Install MAMP and run it

2 Go to lsquoPreferences Apachersquo and set lsquoDocument Rootrsquo to UsersltYOUR USER NAMEgtSites so yourSites directory will be used as Apache root

3 Download ownCloud

4 Move it to ~Sites and extract it tar xfpj owncloud-45tarbz2

5 Now you can set it up by going to httplocalhost8888owncloud

25 Windows 7 and Windows Server 2008

Note You must move the data directory outside of your public root (See advanced install settings)

This section describes how to install ownCloud on Windows with IIS (Internet Information Services)

It assumes that you have a vanilla non-IIS enabled Windows machine ndash Windows 7 or Server 2008 After enablingIIS the steps are essentially identical for Windows 7 and Windows Server 2008

24 Mac OS X 9

ownCloud Administrators Manual Release 50

For installation physical access or a remote desktop connection is required You should leverage MySQL as the backend database for ownCloud If you do not want to use MySQL it is possible to use Postgres or SQLite insteadMicrosoft SQL Server is not yet support

Enabling SSL is not yet covered by this section

Note If you make your desktop machine or server available outside your LAN you must maintain it Monitor thelogs manage the access apply patches to avoid compromising the system at large

There are 4 primary steps to the installation and then a 5th step required for configuring everything to allow files largerthan the default 2MB

1 Install IIS with CGI support ndash enable IIS on your Windows machine

2 Install PHP ndash Grab download and install PHP

3 Install MySQL ndash Setup the MySQL server manager and enable ownCloud to create an instance

4 Install ownCloud ndash The whole reason we are here

5 Configure upload sizes and timeouts to enable large file uploads ndash So that you can upload larger files

251 Activate IIS with CGI Support

Windows 7

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 There is a box labeled Internet Information Services expand it

4 Expand World Wide Web Services and all the folders underneath

5 Select the folders as illustrated in the picture below to get your IIS server up and running

You do not need an FTP server running so you should tune that feature off for your server You definitely need the IISManagement Console as that is the easiest way to start stop restart you server as well as where you change certificateoptions and manage items like file upload size You must check the CGI box under Application Development Featuresbecause CGI is how you enable PHP on IIS

You have to turn off WebDAV publishing or the Windows WebDAV conflicts with the ownCloud WebDAV interfaceThis might already be turned off for you just make sure it stays that way The common HTTP features are the featuresyou would expect from a web server With the selections on this page IIS will now serve up a web page for you

Restart IIS by going to the IIS manager (Start ndashgt IIS Manager) Select your website and on the far right side is asection titled Manage Server Make sure that the service is started or click Start to start the services selected Oncethis is complete you should be able to go to a web browser and navigate to httplocalhostlsquo

This should open the standard IIS 7 splash page which is just a static image that says your web server is runningAssuming you were able to get the splash page it is safe to say your web server is now up and running

Windows Server 2008

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 This will bring up the Server Manager

10 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 13: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

For installation physical access or a remote desktop connection is required You should leverage MySQL as the backend database for ownCloud If you do not want to use MySQL it is possible to use Postgres or SQLite insteadMicrosoft SQL Server is not yet support

Enabling SSL is not yet covered by this section

Note If you make your desktop machine or server available outside your LAN you must maintain it Monitor thelogs manage the access apply patches to avoid compromising the system at large

There are 4 primary steps to the installation and then a 5th step required for configuring everything to allow files largerthan the default 2MB

1 Install IIS with CGI support ndash enable IIS on your Windows machine

2 Install PHP ndash Grab download and install PHP

3 Install MySQL ndash Setup the MySQL server manager and enable ownCloud to create an instance

4 Install ownCloud ndash The whole reason we are here

5 Configure upload sizes and timeouts to enable large file uploads ndash So that you can upload larger files

251 Activate IIS with CGI Support

Windows 7

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 There is a box labeled Internet Information Services expand it

4 Expand World Wide Web Services and all the folders underneath

5 Select the folders as illustrated in the picture below to get your IIS server up and running

You do not need an FTP server running so you should tune that feature off for your server You definitely need the IISManagement Console as that is the easiest way to start stop restart you server as well as where you change certificateoptions and manage items like file upload size You must check the CGI box under Application Development Featuresbecause CGI is how you enable PHP on IIS

You have to turn off WebDAV publishing or the Windows WebDAV conflicts with the ownCloud WebDAV interfaceThis might already be turned off for you just make sure it stays that way The common HTTP features are the featuresyou would expect from a web server With the selections on this page IIS will now serve up a web page for you

Restart IIS by going to the IIS manager (Start ndashgt IIS Manager) Select your website and on the far right side is asection titled Manage Server Make sure that the service is started or click Start to start the services selected Oncethis is complete you should be able to go to a web browser and navigate to httplocalhostlsquo

This should open the standard IIS 7 splash page which is just a static image that says your web server is runningAssuming you were able to get the splash page it is safe to say your web server is now up and running

Windows Server 2008

1 Go to Start ndashgt Control Panel ndashgt Programs

2 Under Programs and Features there is link titled Turn Windows Features on and Off Click on it

3 This will bring up the Server Manager

10 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 14: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

Figure 21 Windows Features required for ownCloud on Windows 7

25 Windows 7 and Windows Server 2008 11

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 15: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

4 In the server manager Click on Roles and then click Add Roles

5 Use the Add Roles Wizard to add the web server role

6 Make sure that at a minimum the same boxes are checked in this wizard that are checked in the Windows 7Section For example make sure that the CGI box is checked under Application Development Features and thatWebDAV Publishing is turned off With Remote Desktop Sharing turned on the detailed role service list lookslike the figure ldquoRole Servicesrdquo

7 Restart IIS by going to the IIS manager (Start ndashgt IIS Manager)

8 Select your website and on the far right side is a section titled Manage Server Make sure that the service isstarted or click ldquoStartrdquo to start the services selected

9 Once this is complete you should be able to go to a web browser and type ldquolocalhostrdquo This should open thestandard IIS 7 splash page which is just a static image that says your web server is runningAssuming you wereable to get the splash page it is safe to say your web server is now up and running The next part of this ldquohowtordquo installs PHP on the server

252 Installing PHP

This part is also straightforward but it is necessary to remind you that this is for IIS only

1 Go to the following link and grab the PHP installer for version ldquoVC9 Non Thread Saferdquo 32 or 64 bit based onyour system httpwindowsphpnetdownload

Note If you are using Apache make sure you grab VC6 instead lower on the page

2 Once through that login select the location that is closest to you geographically

3 Run that install wizard once it is downloaded Read the license agreement agree select an install directory

4 Then select IIS FastCGI as the install server

5 Take the default selections for the items to install and click next Then click install

6 And after a few minutes PHP will be installed On to MySQL

253 Installing MySQL

This part installs MySQL on your Windows machine

1 Point your browser to httpdevmysqlcomdownloads and download the latest community edition for your OSndash the 32 or 64 bit version Please download the MSI Installer as it will make life easier

2 Once downloaded install MySQL (55 at the time of writing) Select the Typical installation

3 When that finishes check the box to launch the MySQL Instance Configuration Wizard and click Finish

4 Select a standard configuration as this will be the only version of MySQL on this machine

5 Select to install as a windows service and Check the Launch the MySQL Server Automatically button

6 Select the modify security settings box on the next page and enter a password you will remember You willneed this password when you configure ownCloud

7 Uncheck enable root access from remote machinesrdquo for security reasons

8 Click execute and wait while the instance is created and launched

9 Click Finish when this is all complete

12 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 16: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

Figure 22 Server roles required for ownCloud

25 Windows 7 and Windows Server 2008 13

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 17: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

Take particular note of your MySQL password as the user name root and the password you select will be necessaryalter on in the ownCloud installation As an aside this link is an excellent resource for questions on how to configureyour MySQL instance and also to configure PHP to work with MySQL This however is not strictly necessary asmuch of this is handled when you download ownCloud

More information in this topic can be found in a tutorial on the IIS web site

254 Installing ownCloud

1 Download the latest version of ownCloud from httpowncloudorgdownload

2 It will arrive as a tarbz2 file and I recommend something like jZip for a free utility to unzip it

3 Once you have the ownCloud directory unzipped and saved locally copy it into your wwwroot directory (prob-ably cinetpubwwwroot)

Note You cannot install directly into the directory wwwroot from jzip as only the administrator can unzip into thewwwroot directory If you save it in a different folder and then move the files into wwwroot in Windows explorerit works This will install ownCloud locally in your root web directory You can use a subdirectory called owncloudor whatever you want ndash the www root or something else

4 It is now time to give write access to the ownCloud directory to the ownCloud server Navigate your windowsexplorer over to inetpubwwwrootowncloud (or your installation directory if you selected somethingdifferent)

5 Right click and select properties Click on the security tab and click the button ldquoto change permissions clickeditrdquo

6 Select the ldquousersrdquo user from the list and check the box ldquowriterdquo

7 Apply these settings and close out

8 Now open your browser and go to httplocalhostowncloud (or localhost if it is installed in the rootwww directory) This should bring up the ownCloud configuration page

9 At this page you enter your desired ownCloud user name and password for the administrator and expand thelittle arrow

10 Select MySQL as the database and enter your MySQL database user name password and desired instance namendash use the user name and password you setup for MySQL earlier in step 3 and pick any name for the databaseinstance

Note The owncloud admin password and the MySQL password CANNOT be the same in any way

11 Click next and ownCloud should have you logged in as the admin user and you can get started exploringownCloud creating other users and more

255 Configuring ownCloud PHP and IIS for Large File Uploads

Before going too nuts on ownCloud it is important to do a couple of configuration changes to make this a usefulservice for you You will probably want to increase the max upload size for example The default upload is setto 2MB which is too small for even most MP3 files

To do that simply go into your PHPini file which can be found in your CProgram Files (x86)PHPfolder In here you will find a PHPinilsquo file Open this in a text editor and look for a few key attributes to change

14 Chapter 2 Installation

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 18: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

bull upload_max_filesize ndash change this to something good like 1G and you will get to upload much largerfiles

bull post_max_size ndash also change this size and make it larger than the max upload size you chose like 1G

There are other changes you can make such as the timeout duration for uploads but for now you should be all set inthe PHPini file

Now you have to go back to IIS manager and make one last change to enable file uploads on the web server larger than30MB

1 Go to the start menu and type iis manager

2 Open IIS Manager Select the website you want enable to accept large file uploads

3 In the main window in the middle double click on the icon Request filtering

4 Once the window is opened you will see a bunch of tabs across the top of the far right

Select Edit Feature Settings and modify the Maximum allowed content length (bytes)

5 In here you can change this to up to 41 GB

Note This entry is in BYTES not KB

You should now have ownCloud configured and ready for use

26 Univention Corporate Server

Subscribers to the ownCloud Enterprise edition can also integrate with UCS (Univention Corporate Server)

261 Prerequisites

The ownCloud integration relies on the MySQL database Since ldquoPostresSQLrdquo is more in a experimental state andldquoSQLiterdquo is not very well suited for multi-user installations MySQL is the only way first of all As of UCS 30 MySQLis not part of the maintained repository Hence you you should install it first and probably deactivate the unmaintainedrepository eventually

ucr set repositoryonlineunmaintained=yes univention-install mysql-server ucr set repositoryonlineunmaintained=no

Note If MySQL is already installed andor a password for the user root is set please make sure it is saved inetcmysqlsecret otherwise you will experience problems

In case you want to install ownCloud from the repository it is already enough to enable the unmaintained repositoryfor MySQL You can skip the rest of this section and read on at Pre configuration ownCloud has further dependencieswhich all belong to the maintained repository Install them as well

univention-install php5-mysql php5-ldap php5-gd

The package manager is going to remove libgd2-noxpm which is not a problem and nothing to worry about

26 Univention Corporate Server 15

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 19: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

Pre configuration

ownCloud makes use of the UCR the Univention Configuration Registry At the moment the values are being readduring installation only So you might want to change them here but you can do it later from within ownCloud Fora later version we plan to provide an own ownCloud module for the UMC (Univention Management Console) Wethink we found sane defaults nevertheless you might have your own requirements The installation script will listento those UCR keysIn case you want to override any default setting simply add the key in question to the UCR andassign your required value

Key Default Description Introducedownclouddirectorydata varlibowncloud Specifies where the file storage will

be placed201201

ownclouddbname owncloud Name of the MySQL databaseownCloud will create an own userfor it

201201

ownclouduserquota (empty) The default quota when a user isbeing added Assign values in hu-man readable strings eg ldquo2 GBrdquoUnlimited if empty

201201

ownclouduserenabled 0 Wether a new user is allowed to useownCloud by default

201201

owncloudgroupenabled 0 Wether a new group is allowed to beused in ownCloud by default

2012404

owncloudldapbaseusers cn=users$ldap_base The users-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapbasegroups cn=groups$ldap_base The groups-subtree in the LDAP di-rectory If left blank it will fall backto the LDAP base

2012404

owncloudldapgroupMemberAssoc uniqueMember The LDAP attribute showing thegroup-member relationship Possi-ble values uniqueMember mem-berUid and member

2012404

owncloudldaptls 1 Whether to talk to the LDAP servervia TLS

201201

owncloudldaploginFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((uid=$))(amp(uid=uid) (ownCloudEn-abled=1)))

The LDAP filter that shall be usedwhen a user tries to log in

201201

Continued on next page

16 Chapter 2 Installation

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 20: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

Table 21 ndash continued from previous pageKey Default Description Introduced

owncloudldapuserlistFilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0))((uid=$))(amp(ownCloudEnabled=1)))

The LDAP filter that shall be usedwhen the user list is being retrieved(eg for sharing)

201201

owncloudldapgroupFilter (amp(objectClass=posixGroup)(ownCloudEnabled=1))

The LDAP filter that shall be usedwhen the group list is being re-trieved (eg for sharing)

2012404

owncloudldapdisplayName uid The LDAP attribute that should beused as username in ownCloud

201201

owncloudldapgroupdisplayName cn The LDAP attribute that should beused as groupname in ownCloud

2012404

owncloudjoinusersupdate yes Wether ownCloud LDAP schemashould be applied to existing users

201201

owncloudgroupenableDomainUsers 1 Wether the group ldquoDomain Usersrdquoshall be enabled for ownCloud oninstall

2012404

owncloudjoinusersfilter (amp(|(amp(objectClass=posixAccount)(objectClass=shadowAccount))(objectClass=univentionMail) (ob-jectClass=sambaSamAccount) (ob-jectClass=simpleSecurityObject)(amp(objectClass=person) (ob-jectClass=organizationalPerson)(objectClass=inetOrgPerson)))((uidNumber=0)) ((|(uid=$)(uid=owncloudsystemuser)(uid=join-backup) (uid=join-slave))) ((object-Class=ownCloudUser)))

Filters on which LDAP users theownCloud schema should be ap-plied to The default excludessystem users and already own-CloudUsers

201201

owncloudjoingroupsfilter (empty) Filters which LDAP groupswill be endisabled for own-Cloud when running the scriptusrshareowncloudupdate-groupssh

2012404

If you want to override the default settings simply create the key in question in the UCR and assign your requiredvalue for example ucr set ownclouduserenabled=1 or via UMC

26 Univention Corporate Server 17

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 21: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

Installation

Now we are ready to install ownCloud This can be either done through the ownCloud UCS repository or by down-loading the packages

Repository

To include the ownCloud UCS repository you need to configure it using the UCR To do so just use the followingcommand

ucr set updatesecure_apt=no repositoryonlinecomponentownclouddescription=ownCloud repositoryonlinecomponentowncloudserver=downloadowncloudcom repositoryonlinecomponentowncloudprefix=ucs repositoryonlinecomponentownclouddefaultpackages=owncloud repositoryonlinecomponentowncloudversion=current repositoryonlinecomponentowncloud=enabled

Subsequently install the ownCloud package It will auto-install owncloud-schema as well

univention-install owncloud

If you want to make use of commercially unsupported packages install the unsupported package

univention-install owncloud-unsupported

Manually by download

Download the integration packages (from our website or with wget as below) and install them from within yourdownload folder (note the package owncloud-unsupported is optional)

18 Chapter 2 Installation

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 22: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

wget httpdownloadowncloudcomdownloaducsowncloud_201201-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-schema_201203-0_alldeb wget httpdownloadowncloudcomdownloaducsowncloud-unsupported_201203-0_alldeb dpkg -i ownclouddeb

ownCloud will be configured to fully work with LDAP There is only one local admin user ldquoowncloudadminrdquo you canfind his password in etcowncloudadminsecret Use this account if you want to change basic ownCloudsettings

Postconfiguration (optional)

In the installation process a virtual host is set up (Apache is required therefore) If you want to modify the settings editetcapache2sites-availableowncloud and restart the web server You might want to do it to enableHTTPS connectionsBesides that you can edit the htaccess-File in varwwwowncloud In the latterfile there are also the PHP limits for file transfer specified

Using ownCloud

If you decided to enable every user by default to use ownCloud simply open uphttpmyservercomowncloud and log in with your LDAP credentials and enjoy

If you did not go to the UMC and enable the users who shall have access (see picture below) Then login athttpmyservercomowncloud with your LDAP credentials

Updating users can also be done by the script usrshareowncloudupdate-userssh Ittakes the following UCR variables as parameters ownclouduserenabled for enabling or disablingownclouduserquota as the Quota value and owncloudjoinusersfilter as LDAP filter to selectthe users to update

Groups 2012404

Since ownCloud Enterprise 2012404 group support is enabled Groups that are activated for ownCloud usage canbe used to share files to instead of single users for example It is also important to note that users can only sharewithin groups where they belong to Groups can be enabled and disabled via UCM as shown in the screen shot below

26 Univention Corporate Server 19

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 23: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

Another way to enable or disable groups is to use the script usrshareowncloudupdate-groupsshCurrently it takes an argument which can be 1=enable groups or 0=disable groups The filter applied is being takenfrom the UCR variable owncloudjoingroupsfilter In case it is empty a message will be displayed

27 Appliances

If you are looking for virtual machine images check the Software Appliances section The Hardware Appliancessection is of interest for people seeking to run ownCloud on appliance hardware (ie NAS filers routers etc)

271 Software Appliances

There are number of pre-made virtual machine-based appliances

bull SUSE Studio ownCloud on openSuSE runnable directly from an USB stick

bull Ubuntu charm ownCloud 45

bull PCLinuxOS based appliance

bull Fedora based appliance

272 ownCloud on Hardware Appliances

These are tutorials provided by the user communities of the respective appliances

bull QNAP Guide for QNAP NAS appliances

bull OpenWrt Guide for the popular embedded distribution for routers and NAS devices

Todo

Tutorials for running owncloud on Synology and Dreamplug

20 Chapter 2 Installation

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 24: Own Cloud Admin Manual

CHAPTER

THREE

UPDATING OWNCLOUD

31 Update

Update is to bring an ownCloud instance to its latest point release eg ownCloud 406 rarr 407To update an own-Cloud installation manually follow those steps

1 Do a backup

2 Unpack the release tarball in the owncloud directory ie copy all new files into the ownCloud installation

3 Make sure that the file permissions are correct

4 With the next page request the update procedures will run

5 If you installed ownCloud from a repository your package management should take care of it

32 Upgrade

Upgrade is to bring an ownCloud instance to a new major release eg ownCloud 407 rarr 450 Always do backupsanyway

To upgrade ownCloud follow those steps

1 Make sure that you ran the latest point release of the major ownCloud version eg 407 in the 40 series If notupdate to that version first (see above)

2 Do a backup

3 Deactivate all third party applications

4 Delete everything from your ownCloud installation directory except data and config

5 Unpack the release tarball in the owncloud directory (or copy the files thereto)

6 Make sure that the file permissions are correct

7 With the next page request the update procedures will run

8 If you had 3rd party applications check if they provide versions compatible with the new release

If so install and enable them update procedures will run if needed 9 If you installed ownCloud from a repositoryyour package management should take care of it Probably you will need to look for compatible third party applicationsyourself Always do backups anyway

21

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 25: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

22 Chapter 3 Updating ownCloud

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 26: Own Cloud Admin Manual

CHAPTER

FOUR

USER AUTHENTICATION WITH LDAP

ownCloud ships an LDAP backend which allows full use of ownCloud for user logging in with LDAP credentialsincluding

bull LDAP group support

bull File sharing with users and groups

bull Access via WebDAV and of course ownCloud Desktop Client

bull Versioning external Storages and all other ownCloud Goodies

To connect to an LDAP server the configuration needs to be set up properly Once the LDAP backend is activated(SettingsrarrApps choose LDAP user and group backend click on Enable) the configuration can be foundon SettingsrarrAdmin Read on for a detailed description of the configuration fields

41 Basic Settings

The basic settings are all you need However if you have a larger directory or custom requirements you want to havea look on the advanced settings afterwards The basic part allows you to set up a working connection to your LDAPserver and use it with ownCloud

Note that a hint will be shown on the right hand side when hovering with the mouse over an input field This givesyou more context information while filling out the settings

411 Settings Details

Host The host name of the LDAP server It can also be a ldaps URI for instance

bull Example directorymy-companycom

Base DN The base DN of LDAP from where all users and groups can be reached Separated Base DNs for users andgroups can be set in the Advanced tab Nevertheless this field is mandatory

bull Example dc=my-companydc=com

User DN The name as DN of a user who is able to do searches in the LDAP directory Let it empty for anonymousaccess It is recommended to have a special system user for ownCloud

bull Example uid=owncloudsystemusercn=sysusersdc=my-companydc=com

bull formerly Name in oC 40

Password The password for the user given above Empty for anonymous access

23

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 27: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

Figure 41 LDAP Basic Settings

User Login Filter The filter to use when a users tries to login Use uid as placeholder for the user name Notethat login applies this filter only but not User List Filter This may change in future

bull Example (allows login with user name and email address) (|(uid=uid)(email=$uid))

User List Filter The filter to use when a search for users will be executed

bull Example objectClass=posixAccount

Group Filter The filter to use when a search for groups will be executed In case you do not want to use LDAPgroups in ownCloud leave it empty

bull Example objectClass=posixGroup

42 Advanced Settings

In the LDAP Advanced settings section you can define options that are less common to set They are not needed fora working connection unless you use a non-standard Port eg It can also have a positive effect on the performance tospecify distinguished bases for user and group searches

421 Settings Details

Port The port LDAP server Example 389 Base User Tree The base DN of LDAP from where all users can bereached It needs to be given completely despite to the Base DN from the Basic settings

bull Example cn=usersdc=my-companydc=com

Base Group Tree The base DN of LDAP from where all groups can be reached It needs to be given completelydespite to the Base DN from the Basic settings

bull Example cn=groupsdc=my-companydc=com

24 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 28: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

Figure 42 LDAP Advanced Settings

42 Advanced Settings 25

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 29: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

Group Member association The attribute that is used to indicate group memberships ie the attribute used byLDAP groups to refer to their users

bull Example uniquemember

Use TLS Wether to use TLS encrypted connection to the LDAP server In case you use SSL connections (via theldaps scheme) do not check it it will fail

bull Example [ ]

Case insensitive LDAP server (Windows) Wether the LDAP server is running on a Windows Host

bull Example [ ]

Turn off SSL certificate validation Turns of check of valid SSL certificates Use it ndash if needed ndash for testing only

bull Example [ ]

User Display Name Field The attribute that should be used as ownCloud user name ownCloud allows a limited setof characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a user name isassigned it will not be changed ie changing this value will only have effect to new LDAP users The defaultuid does not exist in AD switch to cn for example otherwise you will not see any users

bull Example displayName

Group Display Name Field The attribute that should be used as ownCloud group name ownCloud allows a limitedset of characters (a-zA-Z0-9-_) every other character will be replaced in ownCloud Once a group name isassigned it will not be changed ie changing this value will only have effect to new LDAP groups

bull Example cn

Quota Attribute ownCloud can read an LDAP attribute and set the user quota there from Specify the attribute hereotherwise keep it empty

bull Example ownCloudQuota

bull formerly Quota Field in ownCloud 40

Quota Default Override ownCloud default quota for LDAP users who do not have a quota set in the attribute givenabove

bull Example 15 GB

Email Attribute ownCloud can read an LDAP attribute and set the user email there from Specify the attribute hereotherwise keep it empty

bull Example email

Cache Time-To-Live We introduced a cache to avoid unnecessary LDAP traffic for example lookups check whetherthe users exists on every page request or WebDAV interaction It is also supposed to speed up the Admin rarrUser page or list of users to share with once it is populated Changing this setting empties the Cache The timeis given in seconds

bull Example (10 min) 600

User Home Folder Naming Rule By default the ownCloud creates the user directory where all files and meta dataare kept according to the ownCloud user name You may want to override this setting and name it after anattributersquos value Once set for a user the user name folder will not change ie changing this value will onlyhave effect to new LDAP users Leave it empty to default behaviour

bull Example cn

26 Chapter 4 User Authentication with LDAP

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 30: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

43 Microsoft Active Directory

In case you want to connect to a Windows AD you must change some values in the Advanced tab

bull The default in User Display Name Field will not work with Active Directory

bull The Group Member association must be set to ldquomember (AD)rdquo Check Case insensitive

bull LDAP server (Windows)

44 Testing the configuration

In this version we introduced the Test Configuration button on the bottom of the LDAP settings section Itwill always check the values as currently given in the input fields You do not need to save before testing By clickingon the button ownCloud will try to bind to the ownCloud server with the settings currently given in the input fieldsThe response will look like this

Figure 43 Failure

In case the configuration fails you can see details in ownCloudrsquos log which is in the data directory and calledowncloudlog or on the bottom the Settings rarr Admin page Unfortunately it requires a reload ndash sorryfor the inconvenience

Figure 44 Success

In this case Save the settings You can check if the users and groups are fetched correctly on the Settings rarr Userspage

43 Microsoft Active Directory 27

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 31: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

45 ownCloud LDAP Internals

Some parts of how the LDAP backend works are described here May it be helpful

46 User and Group Mapping

In ownCloud the user name is automatically the user ID same applies for groups Thatrsquos why we map the DN andUUID of the LDAP object to an ownCloud name Those mappings are done in the database table ldap_user_mappingand ldap_group_mapping The user name is also used for the userrsquos folder which contains files and meta data MostownCloud applications like Sharing use the user name to refer to a user Renaming a user (or a group) is not supportedThat means that your LDAP configuration should be good and ready before putting it into production The mappingtables are filled early but as long as you are testing you empty the tables any time Do not do this in production Ifyou want to rename a user or a group be very careful

47 Caching

For performance reasons a cache has been introduced to ownCloud He we store all users and groups group mem-berships or internal userExists-requests Since ownCloud is written in PHP and each and every page request (alsodone by Ajax) loads ownCloud and would execute one or more LDAP queries again you do want to have some ofthose queries cached and save those requests and traffic It is highly recommended to have the cache filled for a smallamount of time which comes also very handy when using the sync client as it is yet another request for PHP

28 Chapter 4 User Authentication with LDAP

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 32: Own Cloud Admin Manual

CHAPTER

FIVE

SERVING STATIC FILES VIA WEBSERVER

Since ownCloud 5 it is possible to let web servers handle static file serving This should generally improve performanceof static files serving (web servers are optimized for this) and in some cases permits controlled file serving (ie pauseand resume downloads)

Note Notice that currently this feature can be activated only for local files ie files inside data directory and localmounts Controlled file serving does not work for generated zip files This is due to how temporary files are createdAlso it has never been tested under lighttpd but its configuration should be the same as Apache

51 Apache2 (X-Sendfile)

It is possible to let Apache handle static file serving via mod_xsendfile

Installation

On Debian and Ubuntu systems that is

apt-get install libapache2-mod-xsendfile

Configuration

Configuration of mod_xsendfile for ownCloud depends on its version For versions below 010 (Debian squeeze shipswith 09)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFileAllowAbove On

ltDirectorygt

For versions gt=010 (eg Ubuntu 1210)

ltDirectory varwwwowncloudgtSetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath tmpoc-nocleanXSendFilePath homevalerio

ltDirectorygt

29

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 33: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

bull SetEnv MOD_X_SENDFILE_ENABLED tells ownCloud scripts that they should add the X-Sendfile headerwhen serving files

bull XSendFile enables web server handling of X-Sendfile headers (and therefore file serving) for the specifiedDirectory

bull XSendFileAllowAbove (lt010) enables file serving through web server on path outside the specified DirectoryThis is needed for PHP temporary directory where zip files are created and for configured local mounts whichmay reside outside data directory

bull XSendFilePath (gt=010) a white list of paths that the web server is allowed to serve outside of the specifiedDirectory At least PHP temporary directory concatenated with oc-noclean must be configured Temporaryzip files will be created inside this directory when using mod_xsendfile Other paths which correspond tolocal mounts should be configured here aswell For a more in-dept documentation of this directive refer tomod_xsendfile website linked above

52 Nginx (X-Accel-Redirect)

Nginx supports handling of static files differently from Apache Documentation can be found here and here Theheader used by Nginx is X-Accel-Redirect

Intsallation

X-Accel-Redirect is supported by default in Nginx and no additional operation should be needed to install it

Configuration

Configuration is similar to Apache

location ~ php$ fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on

location ~ ^homevalerio(owncloud)data internalroot

location ~ ^tmpoc-noclean+$ internalroot

bull fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED tells ownCloud scripts that they should add theX-Accel-Redirect header when serving files

bull internal location each directory that contains local user data should correspond to an internal location In theexample I have data inside

1 homevalerioownclouddata ownCloud data directory

2 homevaleriodata a local mount

3 tmpoc-noclean PHP temporary directory concatenated with oc-noclean Temporary zip files will becreated inside this directory when using X-Accel-Redirect

30 Chapter 5 Serving static files via web server

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 34: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

53 How do I know itrsquos working

You are still able to download stuff via the web interface and single local file downloads can be paused and resumed-)

53 How do I know itrsquos working 31

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 35: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

32 Chapter 5 Serving static files via web server

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 36: Own Cloud Admin Manual

CHAPTER

SIX

CUSTOM MOUNT CONFIGURATION

Since ownCloud 40 it is possible to configure the filesystem to mount external storage providers into ownCloudrsquos vir-tual file system You can configure the file system by creating and editing configmountphp the configurationfile holds a PHP array configuring 2 types of entries

bull Group mounts each entry configures a mount for each user in group

bull User mounts each entry configures a mount for a single user or for all users

For each type there is an array with the usergroup name as key and an array of configuration entries as value Eachentry consist of the class name of the storage backend and an array of backend specific options The template $usercan be used in the mount point or backend options As of writing the following storage backends are available for use

bull Local file system

bull FTP

bull WebDAV

bull OpenStack Swift

bull SMB

61 Example

ltphpreturn array(

rsquogrouprsquo=gtarray(rsquoadminrsquo=gtarray(

rsquo$userfilesAdmin_Stuffrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray()

))

)rsquouserrsquo=gtarray(

rsquoallrsquo=gtarray(rsquo$userfilesPicturesrsquo=gtarray(

rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquorsquooptionsrsquo=gtarray()

))rsquosomeuserrsquo=gtarray(

rsquosomeuserfilesMusicrsquo=gtarray(rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquo

33

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 37: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

rsquooptionsrsquo=gtarray())

))

)

611 Backends

62 Local Filesystem

The local filesystem backend mounts a folder on the server into the virtual filesystem the class to be used isOC_Filestorage_Local and takes the following options

bull datadir the path to the local directory to be mounted

array( rsquoclassrsquo=gtrsquoOC_Filestorage_Localrsquorsquooptionsrsquo=gtarray( rsquodatadirrsquo=gtrsquomntadditional_storagersquo ))lsquolsquo

Note You must ensure that the web server has sufficient permissions on the folder

63 FTP

The FTP backend mounts a folder on a remote FTP server into the virtual filesystem and is part of the lsquoExternal storagesupportrsquo app the class to be used is OC_Filestorage_FTP and takes the following options

bull host the hostname of the ftp server

bull userthe username used to login on the ftp server

bull password the passwordt to login on the ftp server

bull secure whether to use ftps to connect to the ftp server instead of ftp (optional defaults to false)

bull root the folder inside the ftp server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_FTPrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquoftpmyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquo)

)

64 WebDAV

The WebDAV backend mounts a folder on a remote WebDAV server into the virtual filesystem and is part of thelsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_DAVand takes the following options

bull host the hostname of the webdav server

bull user the username used to login on the webdav server

34 Chapter 6 Custom Mount Configuration

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 38: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

bull password the passwordt to login on the webdav server

bull secure whether to use https to connect to the webdav server instead of http (optional defaults to false)

bull root the folder inside the webdav server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_DAVrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquomyhostcomwebdavphprsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gtrsquosecretrsquorsquosecurersquo=gttrue)

)

65 OpenStack Swift

The Swift backend mounts a container on an OpenStack Object Storage server into the virtual filesystem and is partof the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SWIFT and takes the followingoptions

bull host the hostname of the authentication server for the swift storage

bull user the username used to login on the swift server

bull token the authentication token to login on the swift server

bull secure whether to use ftps to connect to the swift server instead of ftp (optional defaults to false)

bull root the container inside the swift server to mount (optional defaults to lsquorsquo)

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SWIFTrsquooptionsrsquo=gtarray(

rsquohostrsquo=gtrsquoswiftmyhostcomauthrsquorsquouserrsquo=gtrsquojohndoersquorsquotokenrsquo=gtrsquosecretrsquorsquorootrsquo=gtrsquoVideosrsquorsquosecurersquo=gttrue )

)

66 SMB

The SMB backend mounts a folder on a remote Samba server a NAS appliance or a Windows machine into the virtualfile system It is part of the lsquoExternal storage supportrsquo app the class to be used is OC_Filestorage_SMB and takesthe following options

bull host the host name of the samba server

bull user the user name used to login on the samba server

bull password the password to login on the samba server

bull share the share on the samba server to mount

bull root the folder inside the samba share to mount (optional defaults to lsquorsquo)

Note The SMB backend requires smbclient to be installed on the server

65 OpenStack Swift 35

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 39: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

array( rsquoclassrsquo=gtrsquoOC_Filestorage_SMBrsquooptionsrsquo=gtarray (

rsquohostrsquo=gtrsquomyhostcomrsquorsquouserrsquo=gtrsquojohndoersquorsquopasswordrsquo=gt rsquosecretrsquorsquosharersquo=gtrsquotestrsquorsquoPicturesrsquo )

)

36 Chapter 6 Custom Mount Configuration

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 40: Own Cloud Admin Manual

CHAPTER

SEVEN

CUSTOM USER BACKENDCONFIGURATION

Starting with ownCloud 45 is possible to configure additional user backends in ownCloudrsquos configuration file (con-figconfigphp) using the following syntax

rsquouser_backendsrsquo=gtarray(array(

rsquoclassrsquo=gtrsquoargumentsrsquo=gtarray()

))

Currently the ldquoExternal user supportrdquo (user_external) app supports the provides the following user backends

71 IMAP

Provides authentication against IMAP servers

bull ClassOC_User_IMAP

bull Argumentsa mailbox string as defined here

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_IMAPrsquorsquoargumentsrsquo=gtarray(rsquoimapgmailcom993imapsslINBOXrsquo)

))

72 SMB

Provides authentication against Samba servers

bull ClassOC_User_SMB

bull Argumentsthe samba server to authenticate against

bull Example

37

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 41: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_SMPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

73 FTP

Provides authentication against FTP servers

bull ClassOC_User_FTP

bull Argumentsthe FTP server to authenticate against

bull Example

rsquouser_backendsrsquo=gtarray(array(rsquoclassrsquo=gtrsquoOC_User_FTPrsquorsquoargumentsrsquo=gtarray(rsquolocalhostrsquo)

))

38 Chapter 7 Custom User Backend Configuration

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 42: Own Cloud Admin Manual

CHAPTER

EIGHT

MIGRATING OWNCLOUD INSTALLS

To migrate an ownCloud install there are three things you need to retain

1 The configphp file found in configconfigphp

2 The data folder

3 The database (found in the data folder for sqlite installs)

To restore an ownCloud instance

1 Extract ownCloud to your webserver

2 Copy over your configphp to configconfigphp

3 Copy over your data folder

4 Import your database

5 Update configphp of any changes to your database connection

39

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 43: Own Cloud Admin Manual

ownCloud Administrators Manual Release 50

40 Chapter 8 Migrating ownCloud Installs

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables
Page 44: Own Cloud Admin Manual

CHAPTER

NINE

INDICES AND TABLES

bull genindex

41

  • Introduction
    • Target audience
    • Structure of this document
      • Installation
        • Manual Installation
        • Linux Distributions
        • Web server Notes
        • Mac OS X
        • Windows 7 and Windows Server 2008
        • Univention Corporate Server
        • Appliances
          • Updating ownCloud
            • Update
            • Upgrade
              • User Authentication with LDAP
                • Basic Settings
                • Advanced Settings
                • Microsoft Active Directory
                • Testing the configuration
                • ownCloud LDAP Internals
                • User and Group Mapping
                • Caching
                  • Serving static files via web server
                    • Apache2 (X-Sendfile)
                    • Nginx (X-Accel-Redirect)
                    • How do I know its working
                      • Custom Mount Configuration
                        • Example
                        • Local Filesystem
                        • FTP
                        • WebDAV
                        • OpenStack Swift
                        • SMB
                          • Custom User Backend Configuration
                            • IMAP
                            • SMB
                            • FTP
                              • Migrating ownCloud Installs
                              • Indices and tables