Installing owncloud and pydio on Debian 8

4 minute read

Update: I was asked for a list of Canadian hosting providers where one can try the steps below, so I created this list of Canadian VPS providers. If you want someone to just do this all for you, email [email protected] and I can have it all running in one business day for you.

These are the step by step instructions for installing owncloud and pydio on Debian 8. It assumes you know how to navigate the GNU/Linux file system, and use an editor like vi.

You can consider this a more private replacement for tools like Google Drive, as the files and data are all stored on a server that is in your control. For everyone outside of the US, and many inside the US, this is ideal.

I got my information from this installing owncloud on debian 8 guide and the official owncloud 8 guide, and this pydio guide. I installed these on a fresh version of Debian 8, with the goal of having pydio as default for hosting images, and having /owncloud for owncloud (mostly caldav, for sharing calendars and reminders)

I leave out the SSL certificate generation from this document. You can create a self-signed certificate using OpenSSL, or if it's for personal use, you can get a free one from startssl.com. Before starting this guide, you should have an SSL certificate file (likely ends in .crt) and an SSL certificate key file (likely ends in .pem).

We'll start with pydio (6.0.7):

You’ll have to manually append the following lines to the bottom of your /etc/apt/sources.list file :

deb http://dl.ajaxplorer.info/repos/apt stable main
deb-src http://dl.ajaxplorer.info/repos/apt stable main
deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_8.0/ /

Then you have to install the public keys using the following command :

wget -O- http://dl.ajaxplorer.info/repos/[email protected] | sudo apt-key add -
wget -O- http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_8.0/Release.key  | sudo apt-key add -

Finally, update the apt-get database and install pydio and owncloud:

sudo apt-get update 
sudo apt-get install pydio owncloud

 

SSL

In /etc/apache2/sites-available/ I created a default.conf and deleted the 000-default.conf and default-ssl.conf as in my case I was setting up a dedicated machine. Replace default.conf with your servername.conf if this is on a shared webserver. Copy and paste this into default.conf, following the instructions in any line that start with a pound sign):

<IfModule mod_ssl.c>
# replace 1.2.3.4 with your IP which can be found by running /sbin/ifconfig:
    <VirtualHost 1.2.3.4:443>
# replace with your server name and email address
        ServerName mycloud.example.com
        ServerAdmin [email protected]
        DocumentRoot /usr/share/pydio
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        SSLEngine on
# Remember those two SSL files you created at the beginning? Place in them in these directories and make sure the path and file names are correct:
        SSLCertificateFile      /etc/ssl/certs/mycloud.example.com.crt
        SSLCertificateKeyFile /etc/ssl/private/mycloud.example.com.key
        <FilesMatch "\.(cgi|shtml|phtml|php)$">
            SSLOptions +StdEnvVars
        </FilesMatch>
        alias    /pydio    /usr/share/pydio
        alias   /owncloud  /usr/share/owncloud
      <Directory "/usr/share/pydio">
    Options FollowSymLinks
    AllowOverride Limit FileInfo
    Order allow,deny
    Allow from all
      </Directory>
      <Directory /usr/lib/cgi-bin>
            SSLOptions +StdEnvVars
      </Directory>
        BrowserMatch "MSIE [2-6]" \
            nokeepalive ssl-unclean-shutdown \
            downgrade-1.0 force-response-1.0
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
    </VirtualHost>
</IfModule>

Now we can enable this new site, and then restart apache with ssl:

sudo a2ensite default
sudo a2enmod ssl
sudo a2enmod rewrite

Edit /etc/php5/apache2/php.ini and change the 'output_buffering = 4096' to 'output_buffering = Off'
In /etc/apache/ports.conf comment out Listen 80 by putting a pound symbol in front of it, we only want SSL.

When I went to check in /etc/apache2/sites-enabled/ I noticed the symlink to 000-default.conf was still there so I deleted it. I only wanted symlinks to default.conf.

sudo service apache2 restart

# if your SSL key has a password, you will have to enter it now, when you want to start the web server.

then open http://mycloud.example.com/ in your browser. You should get the 'Pydio Diagnostic Tool' with everything listed as OK except for Server Charset Encoding which will be resolved later. If there are any other issues, please resolve these before going to the mysql section. If you do see this screen, you're on the right path, scroll down the next section, setting up mysql:

For debugging:

sudo lsof -i:443 # will show you if apache 2 is listening

All your logs are in /var/log. The apache2 logs should be in /var/log/apache2 and you will likely need to use sudo to view them.

Mysql:

sudo mysql_secure_installation

Hit enter several times, accepting all the defaults.

mysql -u root -p

Enter your mysql root password.

mysql> create database mycloud;
Query OK, 1 row affected (0.00 sec)

mysql> create database pydio;
Query OK, 1 row affected (0.00 sec)

# Replace passwords and usernames below:

mysql> create user 'webuser'@'localhost' identified by 'AReallyStrongPassword&^*$1999';
Query OK, 0 rows affected (0.00 sec)
mysql> create user 'clouduser'@'localhost' identified by 'AReallyStrongPassword&^*$54321';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL on mycloud.* to 'clouduser'@'localhost' identified by 'AReallyStrongPassword&^*$54321'; 
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL on pydio.* to 'webuser'@'localhost' identified by 'AReallyStrongPassword&^*$1999'; 
Query OK, 0 rows affected (0.00 sec)
mysql> exit Bye

Pydio Web wizard

Now let's go back to our browser and begin the web wizard at https://myfiles.example.com (replace with your domain name). Click on 'click here to continue to Pydio' link at the top of the webpage. Now click on "Start wizard".
Admin Access: Fill out the four text boxes.
Global options: should be fine to leave defaults