I have just stumbled onto THIS article on how to change the logos on Owncloud. Will try this later and document it.
Month: March 2015
Backing up an Owncloud Installation
Found THIS blog which explains how to backup OwnCloud with Rsnapshot which is a linux based backup solution that I love to use as it is really efficient and simple to install and configure.
The article is below:
First, I installed rsnapshot:
sudo apt-get update
sudo apt-get install rsnapshot
sudo mkdir /media/owncloud/backups
sudo chmod 755 /media/owncloud/backups
sudo chown root:root /media/owncloud/backups
sudo cp /etc/rsnapshot.conf /etc/rsnapshot.conf.old
sudo nano /etc/rsnapshot.conf
snapshot_root /media/owncloud/backups/
logfile /var/log/rsnapshot.log
# Owncloud – note: no data backup configured
#Backup Config
backup /var/www/ owncloud/
backup_script /usr/local/bin/backup_mysql.sh owncloud/database_dump
sudo cp /usr/share/doc/rsnapshot/examples/utils/backup_mysql.sh /usr/local/bin/
sudo cp /usr/share/doc/rsnapshot/examples/utils/mysqlbackup.pl /usr/local/bin/
sudo chown root:root /usr/local/bin/backup_mysql.sh
sudo chown root:root /usr/local/bin/mysqlbackup.pl
sudo chmod 754 /usr/local/bin/backup_mysql.sh
sudo chmod 754 /usr/local/bin/mysqlbackup.pl
sudo nano /usr/local/bin/backup_mysql.sh
# backup Owncloud database and make readable only by root
/usr/bin/mysqldump -uowncloud -ppassword owncloud > owncloud_db.sql
/bin/chmod 600 owncloud_db.sql
sudo rsnapshot configtest
sudo rsnapshot daily
sudo crontab -e
30 01 * * * /usr/bin/rsnapshot daily
rsync -avr --delete /media/owncloud/backups/daily.0/owncloud/var/www/config /var/www/
rsync -avr --delete /media/owncloud/backups/daily.0/owncloud/var/www/apps /var/www/
rsync -avr --delete /media/owncloud/backups/daily.0/owncloud/var/www/themes /var/www/
mysql -u owncloud -powncloud owncloud < /media/owncloud/backups/daily.0/owncloud/database_dump/owncloud_db.sql
Ubuntu – Removing old Network Cards
I a server hardware fail today and had to swap the hard drive into another server. When I booted up the server it did not have an ip address as eth0 wasnt found.
This was a simple fix all I did was delete /etc/udev/rules.d/70-persistent-net.rules
I then rebooted the server and it greated a new file with the installed network card configured as eth0. This got the networking working as it should be.
Finding Zentyal Mysql root password
This morning I was trying to install OwnCloud on a Zentyal 4.0 server. The only problem that I found was with finding the root password for mysql to create the OwnCloud database.
I found the solution on THIS site.
The solution was way too simple it was literally to run the comand below which displays the password on screen.
echo $(sudo cat /var/lib/zentyal/conf/zentyal-mysql.passwd)
Increaing maximum file size for OwnCloud
Today we had to raise the size limit of owncloud to allow for files over 2mb to be uploaded.
It is a really easy process:
Under Debian or SUSE and their derivatives this file resides at /etc/php5/apache2/php.ini
On Windows, you can find this file within C:Program Files (x86)PHPPHP.ini
Set the following two parameters inside the php.ini to the same value as chosen inside the admin-section one step before:
upload_max_filesize = 16G (e.g., to stay consistent with the example value above)
post_max_size = 16G (e.g., to stay consistent with the example value above)
Restart Apache2
/etc/init.d/apache2 restart
These details were taken from this documentation.
Ubuntu Installing Java 7 from apt-get
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
Oracle JDK 7
sudo apt-get install oracle-java7-installer
OwnCloud Adding SSL encryption
I followed the directions from here, except that I had to make one very important addition before creating the certificate.
sudo apt-get install openssl
sudo a2enmod ssl
sudo a2enmod rewrite
export CN="owncloud" ## This is the important environment variable
sudo mkdir -p /etc/apache2/ssl
sudo openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/owncloud.pem -keyout /etc/apache2/ssl/owncloud.key
sudo /etc/init.d/apache2 restart
/etc/apache2/conf-enabled/owncloud.conf
:<VirtualHost IP-address-of-server:80>
ServerName myowndomain.com
ServerAlias www.myowndomain.com
#### Redirect to port 443 ###
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
#### End of Redirection configuration ###
Alias /owncloud /usr/share/owncloud
<Directory /usr/share/owncloud/>
Options +FollowSymLinks
AllowOverride All
<IfVersion < 2.3>
order allow,deny
allow from all
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>
</Directory>
</VirtualHost>
<VirtualHost IP-address-of-server:443>
ServerName myowndomain.com
ServerAlias www.myowndomain.com
####Configuration for SSL #####
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/owncloud.pem
SSLCertificateKeyFile /etc/apache2/ssl/owncloud.key
#### End of SSL Configuration ####
Alias /owncloud /usr/share/owncloud
<Directory /usr/share/owncloud/>
Options +FollowSymLinks
AllowOverride All
<IfVersion < 2.3>
order allow,deny
allow from all
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>
</Directory>
</VirtualHost>
sudo /etc/init.d/apache2 restart
and checked to see if the OwnCloud login was now accessible via https
and not http
.https://myowndomain.com/owncloud
.Backing up Mikrotik using export and import
Today I was shown the export and import comands on mikrotik. The export command exports all the settings of the router into a editable test file.
The command for the terminal is:
export file=name of file.
This creates the file in the files folder on the router.
If you then copy the file to files on a new router and run the import comand you will restore the router to the same config as the original one.
OwnCload User Authentication with LDAP
I used the documentation below from the OwnCload site to configure the AD authentication.
User Authentication with LDAP¶
php5-ldap
on Debian/Ubuntu, and php-ldap
on CentOS/Red Hat/Fedora.- LDAP group support
- File sharing with ownCloud users and groups
- Access via WebDAV and ownCloud Desktop Client
- Versioning, external Storage and all other ownCloud features
- Seamless connectivity to Active Directory, with no extra configuration required
- Support for primary groups in Active Directory
- Auto-detection of LDAP attributes such as base DN, email, and the LDAP server port number
WebDAV user backend
app. You cannot use both of them at the same time.Configuration
LDAP user and group backend
app on the Apps page in ownCloud. Then go to your Admin page to configure it.Server Tab

- Server configuration:
- Configure one or more LDAP servers. Click the Delete Configuration button to remove the active configuration.
- Host:
-
The host name or IP address of the LDAP server. It can also be a ldaps:// URI. If you enter the port number, it speeds up server detection.Examples:
- directory.my-company.com
- ldaps://directory.my-company.com
- directory.my-company.com:9876
- Port:
-
The port on which to connect to the LDAP server. The field is disabled in the beginning of a new configuration. If the LDAP server is running on a standard port, the port will be detected automatically. If you are using a non-standard port, ownCloud will attempt to detect it. If this fails you must enter the port number manually.Example:
- 389
- User DN:
-
The name as DN of a user who has permissions to do searches in the LDAP directory. Leave it empty for anonymous access. We recommend that you have a special LDAP system user for this.Example:
- uid=owncloudsystemuser,cn=sysusers,dc=my-company,dc=com
- Password:
- The password for the user given above. Empty for anonymous access.
- Base DN:
-
The base DN of LDAP, from where all users and groups can be reached. You may enter multiple base DNs, one per line. (Base DNs for users and groups can be set in the Advanced tab.) This field is mandatory. ownCloud attempts to determine the Base DN according to the provided User DN or the provided Host, and you must enter it manually if ownCloud does not detect it.Example:
- dc=my-company,dc=com
User Filter

- only those object classes:
- ownCloud will determine the object classes that are typically available for user objects in your LDAP. ownCloud will automatically select the object class that returns the highest amount of users. You may select multiple object classes.
- only from those groups:
-
If your LDAP server supports the
member-of-overlay
in LDAP filters, you can define that only users from one or more certain groups are allowed to appear and log in into ownCloud. By default, no value will be selected. You may select multiple groups.If your LDAP server does not support the member-of-overlay in LDAP filters, the input field is disabled. Please contact your LDAP administrator. - Edit raw filter instead:
-
Clicking on this text toggles the filter mode and you can enter the raw LDAP filter directly.Example:
- objectClass=inetOrgPerson
- x users found:
- This is an indicator that tells you approximately how many users will be allowed to access ownCloud. The number updates automatically after any changes.
Login Filter

- LDAP Username:
- If this value is checked, the login value will be compared to the username in the LDAP directory. The corresponding attribute, usually uid or samaccountname will be detected automatically by ownCloud.
- LDAP Email Address:
- If this value is checked, the login value will be compared to an email address in the LDAP directory; specifically, themailPrimaryAddress and mail attributes.
- Other Attributes:
- This multi-select box allows you to select other attributes for the comparison. The list is generated automatically from the user object attributes in your LDAP server.
- Edit raw filter instead:
-
Clicking on this text toggles the filter mode and you can enter the raw LDAP filter directly.The %uid placeholder is replaced with the login name entered by the user upon login.Examples:
- only username: uid=%uid
- username or email address: (|(uid=%uid)(mail=$uid))
Group Filter

- only those object classes:
- ownCloud will determine the object classes that are typically available for group objects in your LDAP server. ownCloud will only list object classes that return at least one group object. You can select multiple object classes. A typical object class is “group”, or “posixGroup”.
- only from those groups:
- ownCloud will generate a list of available groups found in your LDAP server. and then you select the group or groups that get access to your ownCloud server.
- Edit raw filter instead:
-
Clicking on this text toggles the filter mode and you can enter the raw LDAP filter directly.Example:
- objectClass=group
- objectClass=posixGroup
- y groups found:
- This tells you approximately how many groups will be available in ownCloud. The number updates automatically after any change.
Advanced Settings
- Connection Settings
- Directory Settings
- Special Attributes
Connection Settings

- Configuration Active:
- Enables or Disables the current configuration. By default, it is turned off. When ownCloud makes a successful test connection it is automatically turned on.
- Backup (Replica) Host:
-
If you have a backup LDAP server, enter the connection settings here. ownCloud will then automatically connect to the backup when the main server cannot be reached. The backup server must be a replica of the main server so that the object UUIDs match.Example:
- directory2.my-company.com
- Backup (Replica) Port:
-
The connection port of the backup LDAP server. If no port is given, but only a host, then the main port (as specified above) will be used.Example:
- 389
- Disable Main Server:
- You can manually override the main server and make ownCloud only connect to the backup server. This is useful for planned downtimes.
- Case insensitive LDAP server (Windows):
- When the LDAP server is running on a Windows Host.
- Turn off SSL certificate validation:
- Turns off SSL certificate checking. Use it for testing only!
- Cache Time-To-Live:
-
A cache is introduced to avoid unnecessary LDAP traffic, for example caching usernames so they don’t have to be looked up for every page, and speeding up loading of the Users page. Saving the configuration empties the cache. The time is given in seconds.Note that almost every PHP request requires a new connection to the LDAP server. If you require fresh PHP requests we recommend defining a minimum lifetime of 15s or so, rather than completely eliminating the cache.Examples:
- ten minutes: 600
- one hour: 3600
Directory Settings

- User Display Name Field:
-
The attribute that should be used as display name in ownCloud.
- Example: displayName
- Base User Tree:
-
The base DN of LDAP, from where all users can be reached. This must be a complete DN, regardless of what you have entered for your Base DN in the Basic setting. You can specify multiple base trees, one on each line.
-
Example:cn=programmers,dc=my-company,dc=comcn=designers,dc=my-company,dc=com
-
- User Search Attributes:
-
These attributes are used when searches for users are performed, for example in the in the share dialogue. The user display name attribute is the default. You may list multiple attributes, one per line.If an attribute is not available on a user object, the user will not be listed, and will be unable to login. This also affects the display name attribute. If you override the default you must specify the display name attribute here.
-
Example:displayNamemail
-
- Group Display Name Field:
-
The attribute that should be used as ownCloud group name. ownCloud allows a limited set of characters (a-zA-Z0-9.-_@). Once a group name is assigned it cannot be changed.
- Example: cn
- Base Group Tree:
-
The base DN of LDAP, from where all groups can be reached. This must be a complete DN, regardless of what you have entered for your Base DN in the Basic setting. You can specify multiple base trees, one in each line.
-
Example:cn=barcelona,dc=my-company,dc=comcn=madrid,dc=my-company,dc=com
-
- Group Search Attributes:
-
These attributes are used when a search for groups is done, for example in the share dialogue. By default the group display name attribute as specified above is being used. Multiple attributes can be given, one in each line.If you override the default, the group display name attribute will not be taken into account, unless you specify it as well.
-
Example:cndescription
-
- Group Member association:
-
The attribute that is used to indicate group memberships, i.e. the attribute used by LDAP groups to refer to their users.ownCloud detects the value automatically. You should only change it if you have a very valid reason and know what you are doing.
- Example: uniquemember
Special Attributes

- Quota Field:
-
ownCloud can read an LDAP attribute and set the user quota according to its value. Specify the attribute here, and it will return human-readable values, e.g. “2 GB”.
- Example: ownCloudQuota
- Quota Default:
-
Override ownCloud default quota for LDAP users who do not have a quota set in the Quota Field.
- Example: 15 GB
- Email Field:
-
Set the user’s email from their LDAP attribute. Leave it empty for default behavior.
- Example: mail
- User Home Folder Naming Rule:
-
By default, the ownCloud server creates the user directory in your ownCloud data directory. You may want to override this setting and name it after an attribute value. The attribute given can also return an absolute path, e.g.
/mnt/storage43/alice
. Leave it empty for default behavior.- Example: cn
Expert Settings

- Internal Username:
-
The internal username is the identifier in ownCloud for LDAP users. By default it will be created from the UUID attribute. The UUID attribute ensures that the username is unique, and that characters do not need to be converted. Only these characters are allowed: [a-zA-Z0-9_.@-]. Other characters are replaced with their ASCII equivalents, or are simply omitted.The LDAP backend ensures that there are no duplicate internal usernames in ownCloud, i.e. that it is checking all other activated user backends (including local ownCloud users). On collisions a random number (between 1000 and 9999) will be attached to the retrieved value. For example, if “alice” exists, the next username may be “alice_1337”.The internal username is the default name for the user home folder in ownCloud. It is also a part of remote URLs, for instance for all *DAV services.You can override all of this with the Internal Username setting. Leave it empty for default behaviour. Changes will affect only newly mapped LDAP users.
- Example: uid
- Override UUID detection
-
By default, ownCloud auto-detects the UUID attribute. The UUID attribute is used to uniquely identify LDAP users and groups. The internal username will be created based on the UUID, if not specified otherwise.You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behaviour. Changes will have effect only on newly mapped LDAP users and groups. It also will have effect when a user’s or group’s DN changes and an old UUID was cached, which will result in a new user. Because of this, the setting should be applied before putting ownCloud in production use and clearing the bindings (see the
User and Group Mapping
section below).- Example: cn
- Username-LDAP User Mapping
-
ownCloud uses usernames as keys to store and assign data. In order to precisely identify and recognize users, each LDAP user will have a internal username in ownCloud. This requires a mapping from ownCloud username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the change will be detected by ownCloud by checking the UUID value.The same is valid for groups.The internal ownCloud name is used all over in ownCloud. Clearing the Mappings will have leftovers everywhere. Never clear the mappings in a production environment, but only in a testing or experimental server.Clearing the Mappings is not configuration sensitive, it affects all LDAP configurations!
Testing the configuration


ownCloud Avatar integration

Troubleshooting, Tips and Tricks
SSL Certificate Verification (LDAPS, TLS)
- You have the certificate of the server installed on the ownCloud server
- The certificate is announced in the system’s LDAP configuration file (usually /etc/ldap/ldap.conf on Linux,C:openldapsysconfldap.conf or C:ldap.conf on Windows) using a TLS_CACERT /path/to/cert line.
- Using LDAPS, also make sure that the port is correctly configured (by default 636)
Microsoft Active Directory
Duplicating Server Configurations
- Go to the Server tab
- On Server Configuration choose Add Server Configuration
- Answer the question Take over settings from recent server configuration? with yes.
- (optional) Switch to Advanced tab and uncheck Configuration Active in the Connection Settings, so the new configuration is not used on Save
- Click on Save
ownCloud LDAP Internals
User and Group Mapping
ldap_user_mapping
and ldap_group_mapping
. The user name is also used for the user’s folder (except something else is specified in User Home Folder Naming Rule), which contains files and meta data.Caching
user-group-mappings
up-to-date, and always in cache.Handling with Backup Server
Connecting to OwnCload with a web browser
The documentation below is from This Link!
The ownCloud Web Interface¶
Accessing the ownCloud Web Interface
-
Enter your valid username and password.The username and password combination can be those that you set up yourself when creating your ownCloud server setup or those provided by your company or your service provider.If you have set up the server yourself or are administering the server, you can add additional users by configuring a user backend (for example, LDAP).
-
Click the Log in button.The ownCloud main interface opens.ownCloud main user interface
Navigating the Main User Interface

- Apps Selection Menu: Located in the upper left corner of the user interface, this bar contains apps that are configured on the ownCloud server. The icons in this bar enable you to launch the different apps available and navigate between them within the ownCloud user interface.
- Apps Information field: Located in the left side bar, this field provides filters and tasks associated with the chosen app. For example, using the Files app, you can use the filters in the apps information field to view only files that have been shared with you, files that you have shared with others, files that you have shared through the use of a link, or an option to delete files. Other app-specific information fields might provide tasks for creating new documents or modifying calendar entries.
- Application View: The main, central field in the ownCloud user interface. This field displays the contents or user features of the app selected in the Navigation Bar. By default, this field shows the files and directory (“Files” view) of your user account.
- Navigation Bar: Located over the main viewing window (the Application View), this bar provides a type of breadcrumbs navigation that enables you to migrate to higher levels of the folder hierarchy up to the root level (home) of your ownCloud instance.
- New button: Located in the Navigation Bar, the New button enables you to create new files, new folders, or upload existing files from a specified link.
-
Upload button: Located next to the New button in the Navigation Bar, the Upload button enables you to upload files from your system to the ownCloud server. Clicking this button launches a file picker (e.g. Windows Explorer or Mac OS X Finder) window with which you can choose files for uploading.
-
Search field: Residing in the upper right hand corner of the Main User Interface window, the Search field enables you to search for files and folders stored in ownCloud. The ownCloud search function provides a full text search. However, for searching to function, administrators must enable the app in the search app settings.
-
Personal Settings menu: Located to the right of the Search field, the Personal Settings dropdown menu provides access to your personal settings page and the ability to log out of your ownCloud user session. The personal settings page provides access to the following:
- Activity notifications
- Server usage and space availability
- Password management
- Name, email, and profile picture settings
- Interface language settings
- WebDAV URL for receiving files using WebDAV (see next chapter).
- Mozilla Sync information for creating a synchronization to a Mozilla (Firefox) account.
- ownCloud Version information
You can see Setting Your Preferences section to learn more about those settings.