Install OwnCloud Server on Debian 8

Posted: April 7, 2016 in Linux

Thanks to

image

https://owncloud.org/

https://www.howtoforge.com/tutorial/owncloud-install-debian-8-jessie/

http://www.tecmint.com/install-owncloud-to-create-personal-storage-in-linux/

https://www.howtoforge.com/community/threads/enable-http-strict-transport-security.70741/

Install SSH

# apt-get install openssh-server

clip_image002

Edit

# vi /etc/ssh/sshd_config

PermitRootLogin yes

# service ssh restart

clip_image004

Repository

Add repository

# vi /etc/apt/sources.list

# apt-get update

#KAMBING-UI
deb http://kambing.ui.ac.id/debian/ jessie main contrib non-free
deb http://kambing.ui.ac.id/debian/ jessie-updates main contrib non-free
deb http://kambing.ui.ac.id/debian-security/ jessie/updates main contrib non-free

#KEBO VLSM
deb http://kebo.vlsm.org/debian/ jessie main contrib non-free
deb http://kebo.vlsm.org/debian/ jessie-updates main contrib non-free
deb http://kebo.vlsm.org/debian-security/ jessie/updates main contrib non-free

#DATA UTAMA SURABAYA
deb http://kartolo.sby.datautama.net.id/debian/ jessie main contrib non-free
deb http://kartolo.sby.datautama.net.id/debian/ jessie-updates main contrib non-free
deb http://kartolo.sby.datautama.net.id/debian-security/ jessie/updates main contrib non-free
#UNEJ
deb http://mirror.unej.ac.id/debian/ jessie main contrib non-free
deb http://mirror.unej.ac.id/debian/ jessie-updates main contrib non-free
deb http://mirror.unej.ac.id/debian-security/ jessie/updates main contrib non-free

Configure NTP Server

# apt-get install ntp

vi /etc/ntp.conf

clip_image006

# line 48: add the network range you allow to receive requests

restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap

# systemctl restart ntp

# systemctl enable ntp

clip_image007

show status

root@owncloud:/var/www# ntpq -p

remote refid st t when poll reach delay offset jitter

==============================================================================

kbrudc01.mykbru .LOCL. 1 u 14 64 1 1.280 146.674 0.000

clip_image008

clip_image009

Install Prerequisites OwnCloud

https://doc.owncloud.org/server/8.0/admin_manual/installation/source_installation.html

apt-get install apache2 mariadb-server libapache2-mod-php5

apt-get install php5-gd php5-json php5-mysql php5-curl

apt-get install php5-intl php5-mcrypt php5-imagick

Error No memory cache has been configured

# apt-get install php-apc

Configure MySQL or MariaDB

Add the ownCloud Repository

https://software.opensuse.org/download/package?project=isv:ownCloud:community:8.1&package=owncloud

echo ‘deb http://download.opensuse.org/repositories/isv:/ownCloud:/community:/8.1/Debian_8.0/ /’ >> /etc/apt/sources.list.d/owncloud.list

cd /tmp

# wget http://download.opensuse.org/repositories/isv:ownCloud:community:8.1/Debian_8.0/Release.key

# apt-key add – < Release.key

clip_image011

Install OwnCloud

# apt-get update

# apt-get instal owncloud

clip_image013

Configuration Database MariadDB

# mysql -u root -p

CREATE DATABASE owncloud;

CREATE USER owncloud@localhost IDENTIFIED BY ‘mysecurepassword’;

GRANT ALL PRIVILEGES ON owncloud.* TO owncloud@localhost;

flush privileges;

quit

clip_image015

Configuration OwnCloud use Database MariaDB

clip_image017

Open on browser http://ip-server/owncloud or http://localhost/owncloud ,click Storage & database

clip_image019

Set database to MySQL/MariaDB and finish setup

clip_image021

Configuration OwnCloud

When you click Admin like screenshot below, you found security issue

clip_image023

clip_image025

(Solved) No memory cache has been configured

# apt-get install php-apc

clip_image027

Add on config.php on owncloud

# vi /var/www/owncloud/config/config.php

‘memcache.local’ => ‘OCMemcacheAPCu’,

clip_image028

# service apache2 restart

Configuration HTTPS

# a2ensite default-ssl

# a2enmod ssl

# service apache2 restart

clip_image030

# vi /etc/apache2/ports.conf

Add NameVirtualHost *:443

clip_image031

# service apache2 restart

Open your browser and type you url site https://fikry.yourdomain.com

clip_image033

HTTPS have issue certificate, because your sertificate not same with you domain

clip_image034

Import Certificate to Apache2

Copy my certificate from windows to Debian

clip_image036

Create directory ssl and copy certificate

# mkdir /etc/apache2/ssl

clip_image037

Copy certificate with name apache

# cd /etc/apache2/ssl

# cp wildcard.crt apache.pem

# cp wildcard.key apache.key

# chmod 600 /etc/apache2/ssl/apache.key

clip_image038

Edit apache default-ssl

# vi /etc/apache2/sites-enabled/default-ssl.conf

clip_image039

Restart Service Apache2

# service apache2 restart

clip_image041

(Solved)The "Strict-Transport-Security" HTTP header is not configured to least "15768000" seconds. For enhanced security we recommend enabling HSTS as described in our

clip_image043

Enable Module Headers and add Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"

# a2enmod headers

# vi /etc/apache2/sites-enabled/default-ssl.conf

<IfModule mod_headers.c>

Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"

</IfModule>

# service apache2 restart

clip_image045

clip_image047

Add Trusted Domain on OwnCloud

clip_image049

This error because on config.php trusted domain with IP, so you must add domain name if want access with domain name.

clip_image051

# vi /var/www/owncloud/config/config.php

clip_image053

clip_image055

Configuration LDAP to Active Directory Windows

Enable feature LDAP

clip_image057

clip_image059

clip_image060

clip_image062

clip_image064

clip_image066

clip_image068

clip_image070

clip_image072

Setting Limit Upload

On version ownCloud 8.1.6 (stable) can’t setting vie GUI. So, must setting vi console

root@owncloud:/var/www/owncloud# vi .htaccess

<IfModule mod_php5.c>

#php_value upload_max_filesize 513M

#php_value post_max_size 513M

#php_value memory_limit 512M

php_value upload_max_filesize 100M

php_value post_max_size 100M

php_value memory_limit 100M

clip_image073

Setting All User Quota

By default Quota for all users free space from server

clip_image075

setting for all users space to 500MB

clip_image077

clip_image079

Upgrade OwnCloud

http://www.tecmint.com/install-owncloud-to-create-personal-storage-in-linux/

1. Update your owncloud version to latest point release of your version.

2. Not to Mention, Make a full backup before upgrading.

3. Download the latest tarball using wget command.

# wget http://download.owncloud.org/community/owncloud-latest.tar.bz2

4. Deactivate all native and third party Applications and plugins.

5. Delete Everything from the owncloud Directory except DATA and CONFIG directory.

NOTE: Don’t touch DATA and CONFIG directory.

6. Untar the tar-ball and copy everything to the root of your owncloud directory within your working directory.

7. Grant required permissions and run Upgrade from the Next page and its done!.

8. Don’t forget to install and enable Third party Application and plug-ins only after checking the compatibility with the current version.

So what are you waiting for? Install the latest owncloud project or upgrade your last version to latest and start using it.

clip_image081

Extract file

clip_image082

Remove Folder Config

clip_image084

Backup before upgrade

clip_image085

Copy new OwnCloud to Direcoty

clip_image086

Access from GUI

clip_image088

clip_image090

This can’t upgrade because .htaccess different version or when copy new owncloud .htaccess not included. So, copy manual again .htaccess

clip_image091

Try again from GUI

clip_image093

Finish upgraded, try to login and check your version now.

CMIIW, Thanks Smile

Leave a Reply

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