OwnCloud

From SME Server
Jump to navigation Jump to search
PythonIcon.png Skill level: Medium
The instructions on this page require a basic knowledge of linux.


About

"ownCloud ( http://owncloud.org ) gives you universal access to your files through a web interface or WebDAV. It also provides a platform to easily view & sync your contacts, calendars and bookmarks across all your devices and enables basic editing right on the web. Installation has minimal server requirements, doesn’t need special permissions and is quick. ownCloud is extendable via a simple but powerful API for applications and plugins." Version 4.5.4. works out of the box on SME8

Forum discussion

This how-to can be discussed on the forums here


Quick install

Download the latest version from here http://owncloud.org/releases/ Latest version tested: 4.5.4

  1. Create an iBay following the standard procedure for creating an iBay
  2. Extract ownCloud into the html directory of the new iBay (in this example called 'owncloud' )==
  3. Set proper iBay settings through console:==
db accounts setprop owncloud \
AllowOverride All \
FollowSymLinks enabled \
Group www \
PHPBaseDir /home/e-smith/files/ibays/owncloud/:/tmp/ \
PublicAccess global \
UserAccess wr-group-rd-everyone

signal-event ibay-modify owncloud
 
  • you also need to allow the "allow_url_fopen"
 mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
 nano /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/99allow_url_fopen
 
  • and paste the following and save this
 <Directory /home/e-smith/files/ibays/owncloud/html>
 php_admin_flag allow_url_fopen on
 </Directory>
 
  • then enter on the console:
 expand-template /etc/httpd/conf/httpd.conf
 /etc/init.d/httpd-e-smith restart
 

4. Create a new database in MySQL, grant permissions, set password and flush (Again, in this example the database name is owncloud). It is a good idea to create a separate admin-user for owncloud with a strong password, because you will only need this owncloud-admin for administrative tasks.

Create database and owncloud-admin. Replace "put ... usernamehere" with name of owncloud-admin (e.g. oc-admin) and choose strong password. So (on server-console) issue:

 
myUser="put owncloud-admin usernamehere"
myPass="put password here"
mysql --execute="create database owncloud"
mysql --execute="grant all privileges on owncloud.* to $myUser@localhost identified by $myPass"
mysql --execute="flush privileges"
  

5. Browse to http://yourserver/owncloud and follow install script

Optional

User login and permissions

owncloud provides several ways for users to login/authenticate. Next to the internal user authentication of owncloud, you can authenticate SME users:


LDAP Authentication

Configure owncloud to authenticate against the internal SME OpenLDAP server (all SME users)

  • log into your owncloud webapp as admin who installed owncloud
  • go to apps and enable ldap authentication backend
  • go to admin, ldap section and use below settings
Host: localhost
Base DN: dc=[yourdomain],dc=[com] (as seen in the 'domains' section in SME server manager)
User DN: uid=admin,ou=Users,dc=[yourdomain],dc=[com]
Password: [SME admin password]
User Login Filter: uid=%uid
User List Filter: objectClass=person

For the variables between brackets [], use your specific settings. Test creating a specific user and use that username password opposed to using the admin's credentials. For more info on using SME OpenLDAP for authentication please see: http://wiki.contribs.org/LDAP_Authentication


LDAP Tweaks

It seems when creating a user in SME, and ownCloud integrated via LDAP, it takes a while before the new user can log into ownCloud. Also, the error "Can't get cache storage, user not logged in" begins to log in the ownCloud Warning Log. To fix this, and allow the new user to log in immediately, go to Settings -> Admin -> LDAP/Advanced Tab Change the Cache Time To Live + or -1. This forces the cache to update, and the new user will be able to log in to ownCloud straight away.


IMAP Authentication

Configure owncloud to authenticate against an IMAP server


Enable and Configure IMAP Authentication
  1. Login to your running owncloud configuration as an administrator
  2. Enable the app named "External user support"
    Note: "External user support" is included with owncloud as an "Internal app". There is an older add-on app named "IMAP user backend" that did not work for me.
  3. Edit <owncloud>/config/config.php and insert the text below inside the $CONFIG array
    • in front of the last closing parenthesis in the file (make sure there's a comma at the end of the preceding entry)
    • Replace [mail.yourdomain.com] with your mail server name or IP address
    • Remove "/novalidate-cert" if your chosen mail server uses a signed SSL certificate):
  'user_backends' => 
  array (
    0 => 
    array (
      'class' => 'OC_User_IMAP',
      'arguments' => 
      array (
        0 => '{[mail.yourdomain.com]:993/imap/ssl/novalidate-cert}',
      ),
    ),
  ),

When done, users will be able to login to your owncloud web interface using their mail server username and password. More information can be found here: http://owncloud.org/support/custom-user-configuration/


Problems
  • Users who login using IMAP Authentication are not automatically added to the owncloud "oc_users" table. Consequently, they are not offered as options when other users want to share files with them.
  • IMAP authenticated users will be unable to connect using the owncloud client sync program.
  • If your IMAP server allows alternative username syntax, owncloud will create a separate account for each username format that allows successful authentication. That is, if your IMAP server allows users to optionally include or omit the domain name, you might create a user account entry for "xyzuser@mail.yourdomain.com", then find that the user always logs in using simply "xyzuser", which succeeds during the IMAP authentication, but is a different account within owncloud.


Allow Sharing with IMAP Users

To allow sharing with your IMAP users, you need to manually add each IMAP user account to the oc_users table using commands like those below at a shell prompt on your SME server:

mysql owncloud
insert into oc_users (uid,password) values ('[xyzuser@mail.yourdomain.com]','*');
  • owncloud: replace with the name of the database you created for owncloud
  • [xyzuser@mail.yourdomain.com]: replace with the exact login string used by the user when they login


Using the Owncloud Client

In order for an IMAP-authenticated user to configure the owncloud client sync program:

  • The system administrator must add the username to the oc_users table manually as described above

Then the user must:

  • login to the web interface
  • open his/her personal settings
  • "change" the password in owncloud to match the password on the IMAP server.


References

Interesting relations to other Contribs or How-to's