How to setup Owncloud, Apache, MariaDB, PHP7.0, and Redis on Debian 8 “Jessie”

This is just a rough outline, but here goes:

1. Enable both the Dotdeb and Owncloud repositories for apt and run apt-get update

Note: Some people have claimed to have had reliability issues with some packages from Dotdeb. I personally never have. You could also try using jessie-backports or just stick with plain vanilla Jessie and use php5 instead.

Here is some info from Owncloud about their readiness for PHP7.

2. Install: mariadb-server mariadb-client redis-server redis-tools owncloud-files php7.0 libapache2-mod-php7.0 php7.0-redis php7.0-mysql php7.0-gd php7.0-curl php7.0-dev

3. cp /usr/share/doc/owncloud-files/owncloud-config-apache.conf.default /etc/apache2/conf-available/owncloud.conf

4. See wiki.debian.org: Self-Signed_Certificate

5. See techandme.se: How to configure Redis Cache in Ubuntu 14.04 with ownCloud
(Basically add some lines to Owncloud’s config.php)
(As of this writing PEAR is not packaged by Dotdeb for PHP7.0 so you have to install the pre-built php7.0-redis module)
phpenmod -v 7.0 redis
service apache2 restart
php --ri redis

6. Apache:
a2enconf owncloud
a2enmod php7.0 ssl
a2ensite ssl
service apache2 restart

7. Log in to mysql (as root):
create database owncloud;
create user owncloud@localhost identified by 'password';
grant all privileges on owncloud.* to owncloud@localhost identified by 'password';
flush privileges;

8. Create /var/www/html/phpinfo.php with following contents:
<?php phpinfo(); ?>

9. Visit https://yourserver/phpinfo.php to see if its working

10. Visit https://yourserver/owncloud and input information to complete setup

11. Very important: ownCloud 9.0 Server Administration Manual


If you need to wipe everything out and start over:

apt-get remove --purge owncloud-files apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.0 php7.0-cgi php7.0-fpm
apt-get autoremove
rm -rf /var/www/owncloud

mysql (as root):
drop database owncloud;
delete from mysql.user where User="owncloud";
flush privileges;


Here are some other sites with good info:

linuxbabe.com: Setup OwnCloud 9 Server with Nginx, MariaDB and PHP7 on Debian

squarecone.com: ownCloud and PHP7 update on Debian Jessie


Tip for making administration of Owncloud easier:

Create a BASH alias for the occ command:

alias occ='sudo sudo -u www-data php /var/www/owncloud/occ'


Further reading:

linux-mag.com: Redis: Lightweight key/value Store That Goes the Extra Mile


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *