Setting up OwnCloud on Slackware 14.0 (part 3 – Encryption using SSL)

Originally posted on on 02/12/2013. Original Post.

Information in this post may be out of date or inaccurate due to the age of the original posted content this is posted here for my historical record only.  Original post continues below.

This is a follow on post from Setting up ownCloud on Slackware 14.0 (part 1 – the server) and Setting up ownCloud on Slackware 14.0 (part 2 – the client). If you have completed these first two then you have a fully functional ownCloud install that allows you to synchronise your files across multiple devices.

In this 3rd part I am setting up SSL to allow secured connections using an HTTPS URL.

First thing to do is to get the SSL certificate for use. If you are doing this on a professional site/server you will probably need to purchase an official certificate from a CA (certificate Authority) , but as I am doing this on my own computer I am using a self signed certificate.

These instructions are taken from

Step one – create the key and request:

openssl req -new > new.cert.csr

Step two – remove the passphrase from the key (optional):

openssl rsa -in privkey.pem -out new.cert.key

Step three – convert request into signed cert:

openssl x509 -in new.cert.csr -out new.cert.cert -req -signkey new.cert.key -days 365

You now have three certificate files new.cert.key, new.cert.csr and new.cert.cert. These can be placed wherever is appropriate but I placed then in the /etc/httpd/ directory so the path to these is /etc/httpd/new.cert.key and so on, these paths are needed later on when they are added to the webserver configuration.

Once you have the certificates you need to make sure that your webserver can use ssl, this is done by uncommenting the mod_ssl module line in /etc/httpd/httpd.conf by removing the hash at the beginning of the line

#LoadModule ssl_module lib/httpd/modules/

to give

LoadModule ssl_module lib/httpd/modules/

The server needs to be restarted before changes will take place, I find it is usually a good idea to restart after a single change rather than do a lot of changes this way you can know which change causes errors if any. So restart apache by issuing the command

apachectl restart

If all is well the server will restart without issue, you can check the logs at /var/log/httpd/ to troubleshoot.

Now we need to tell the server where to find our SSL certificates and sedtup the correct port of 443, this is done in the /etc/httpd/extra/https-ssl.conf file.

The Apache-SSL directives that you need to use the resulting cert are SSLCertificateFile and SSLCertificateKeyFile directives. Search the httpd-ssl.conf file and edit it to add the paths to your previously made certificates. The required lines are:

SSLCertificateFile /etc/httpd/new.cert.cert


SSLCertificateKeyFile /etc/httpd/new.cert.key

Add these details to the VirtualHost section along with the ServerName, ServerAdmin, error logs etc and turn on the ssl engine, your VirtualHost section should start similar to this (parts removed for clarity)

<VirtualHost _default_:443>
DocumentRoot "/srv/httpd/htdocs"
ServerAdmin your_email_address_here
ErrorLog "/var/log/httpd/error_log"
TransferLog "/var/log/httpd/access_log"

SSLEngine on

SSLCertificateFile "/etc/httpd/new.cert.cert"
SSLCertificateKeyFile "/etc/httpd/new.cert.key"

This part sets up the server to respond to secure (https) traffic by using the created certificates. Again once this done you need to restart the server as done previously.

If all has gone well you now need to setup the ownCloud client to connect using https. This is done through the client setup as in the previous post (Setting up ownCloud on Slackware 14.0 (part 2 – the client)). Make sure you use https:// in front of the url or you will not be able to access ownCloud (I forgot to change from http to https and it took me a while to work out why my previously working install was no longer working).

Setting up ownCloud on Slackware 14.0 (part 2 – the client)

Originally posted on on 02/12/2013. Original Post.

Information in this post may be out of date due to age of original post content this is posted here for my historical record only. Original post continues below.

This a follow up article to Setting up ownCloud on Slackware 14.0 (part 1 – the server) and a prelude to Setting up ownCloud on Slackware 14.0 (part 3 – Encryption using SSL) although you could setup the SSL/HTTPS on the server before setting up the client.

Once the server is setup and you can login to ownCloud through the web browser the next thing to do is to install the ownCloud client application on any required user machines (there is also an ownCloud app available for use on Windows, MacOS and tablets/phones running Android and IOS). Installing the client application allows for users to sync their data/documents/media across all machines or devices they own.

The clients for Windows, Mac and Linux(CentOS/RHEL, Fedora, openSUSE, Ubuntu, Debian) and the source can be downloaded from

Because there is not package provided for Slackware we can install the client from source. There are two packages required to build and install the client they are ocsync and mirall. If you are using Slackpkg+ (and you should be!!!) and have alienbobs repositories you can install through slackpkg using:

# slackpkg install ocsync


# slackpkg install mirall

These versions are out of date, ocsync-0.80 and mirall-1.3.0 whereas the latest versions are ocsync-0.90.4 and mirall-1.4.2, but these old version still work fine.

I tried to build the newest sources both changing and using the slackbuilds and using the build instructions but both times it failed with an error (missing a header file) and I haven’t had time to investigate more.

Using the client.

The client is accessed by entering owncloud on the command line, this brings up dialogs that allows you to enter the login details for the server and the user credentials and to choose where you want the sync folder to be.

ownCloud client setup 1

Setting up ownCloud on Slackware 14.0 (part 1 – the server)

Originally posted on on 02/12/2013. Original Post

This information may be out of date due to the age of the original post and the new versions of ownCloud now available, I am posting this here for my own historical record.  The rest of this post is from the original post.

Disclaimer: Most of the information in this post is taken from the ownCloud website ( but is tweaked for use on Slackware since the ownCloud site generally only gives distro specific instructions for Debian, Fedora, CentOS, Ubuntu, openSUSE, ArchLinux, Gentoo and PCLinuxOS.

ownCloud is a Dropbox type application which is entirely under your control, it can be installed on any webserver providing it meets the requirements (ownCloud requirements)

I was talking with a friend who said he was having problems keeping all his devices (2 desktop computers, 2 laptop computers, tablet and 2 phones) in sync as the applications he used only allowed syncing to 2 or 3 devices without paying for extra licences, he uses computers a lot as tools for work but does not have the technical skills (or time) required to deal with any installation/configuration of anything not “click to install”. This got me thinking and I remembered reading about ownCloud so I decided to look into this to see if it could help.

My home system is running Slackware 14.0 with Apache and PHP5.

There are two elements to the ownCloud system the server application and the optional ownCloud client installed on the users computer(s). The server application is a single zipped download from the ownCloud website and for a Slackware installation the client application consists of two packages ocsync and mirall (these are discussed and installed in Part 2 – the client)

The Server

The ownCloud server application can be downloaded from the ownCloud website and consists of the PHP files and associated content required to run the application. All that is required to install it is to extract the downloaded files and copy them to the webserver (probably need to do this as root).

$ tar -xjf owncloud-5.0.13.tar.bz2

Change to root and copy to webserver:

# cp -r owncloud/ /var/www/htdocs/

User files are stored under the data directory which does not exist at this point so it needs to be created. (The ownCloud instructions say that the data directory will be automatically created during the post install configuration but when I tried it complained that the data directory did not exist and should be created before continuing.)

# mkdir /var/www/htdocs/owncloud/data

Once this is done you need to change the ownership of the apps, config and data directories to the webserver user, in this case apache.

# chown -R apache:apache /var/www/htdocs/owncloud/apps
# chown -R apache:apache /var/www/htdocs/owncloud/config
# chown -R apache:apache /var/www/htdocs/owncloud/data

This should result in a similir setup as below for the /var/www/htdocs/ownCloud directory.

ownCloud directlry listing

.htaccess and AllowOverride

ownCloud uses .htaccessfiles and the mod_rewrite module so these need to be configured since we are using the Apache server. This is done by editing the Apache configuration file /etc/httpd/httpd.conf . This is done by making sure that the mod_rewrite module line is uncommented and that the AllowOveride is set to All. Once these changes are done the server needs restarted to allow the changes to take effect

# apachectl restart

Provided there are no error messages you are now ready to do the first configuration through the web browser.

The install is finished by going through the installation setup through your web browser at your_server_IP/owncloud. If this on your local machine it usually is localhost/owncloud

Here you can enter the admin account details and set up the database in use by entering the database user details. Once this is done you can login to your new ownCloud installation and customise the setup and add users etc.

Once you have got this installed and setup using the web interface you can go ahead and install the client for any users. The instructions for this are in the second part here Setting up ownCloud on Slackware 14.0 (part 2 – the client)