User Tools

Site Tools


computing:storage:owncloud_server

This is an old revision of the document!


OwnCloud - Server

See also OwnCloud - Client

http://owncloud.org

http://owncloud.com

  • Synchronized cloud storage on your hardware
  • Virtualmin Pro has install script

Server Side

Upgrading

:!: We use the apt package manager to install and maintain OwnCloud.

https://doc.owncloud.org/server/9.1/admin_manual/maintenance/package_upgrade.html

https://doc.owncloud.org/server/9.0/admin_manual/maintenance/update.html

Using the OwnCloud web interface, make a backup before upgrading!

as root:

apt-get update
apt-get dist-upgrade
reboot

:!: Upgrading OwnCloud will leave the installation in Maintenance Mode.

Then, after logging back in as root:

cd /var/www/owncloud/
sudo -u www-data php occ upgrade
sudo -u www-data php occ maintenance:mode --off

Installation

Virtualmin

Virtualmin → <domain> → Install Scripts → Available Scripts → OwnCloud

  1. Browse to the OwnCloud URL
  2. When prompted to create an admin user, enter your virtual server admin username and password

Official Package Repositories

Ubuntu 16.04

:!: Smaller installations should just use SQLite database for simplicity.

Install updates:

apt-get update
apt-get upgrade
reboot

Configure the package repository:

wget -nv https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/Release.key -O Release.key
apt-key add - < Release.key

Install OwnCloud:

sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/ /' > /etc/apt/sources.list.d/owncloud.list"
apt-get update
apt-get install owncloud

Configure the MySQL database:

:!: Use your own password!

mysql_secure_installation

Configure the database:

#mysql -u root -p
Enter password:

mysql> CREATE USER 'ownclouduser'@'localhost' IDENTIFIED BY 'YOURPASSWORD';
mysql> CREATE DATABASE ownclouddb;
mysql> GRANT ALL ON ownclouddb.* TO 'ownclouduser'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> exit

CentOS 7

See also Minimal CentOS Install

yum install mod_ssl openssl php-pdo php-gd php-mysql mariadb-server mariadb php5-mcrypt

Secure the fresh MySQL (MariaDB) installation and configure for auto-start (initial MySQL password is blank):

systemctl start mariadb && systemctl enable mariadb

mysql_secure_installation

Prepare the MySQL database:

mysql -u root -p
CREATE USER 'owncloud'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE IF NOT EXISTS owncloud;
GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
quit

Firewall

Open ports in the firewall:

firewall-cmd --permanent --zone=public --add-service=http --add-service=https
# Use the next line if you change SSH to the non-standard port ''2222''
firewall-cmd --permanent --zone=public --zone=internal --zone=work --zone=external --zone=dmz --add-port=2222/tcp
firewall-cmd --reload

Install

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

Enable the repository and install OwnCloud:

cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/isv:ownCloud:community/RedHat_RHEL-7/isv:ownCloud:community.repo
yum install owncloud

Enable the web server startup and reboot:

systemctl enable httpd
reboot

Reset permissions for better security:

find /var/www/html/owncloud -type d -exec chmod 775 {} \;
find /var/www/html/owncloud -type f -exec chmod 664 {} \;
chown -R root:root /var/www/html/owncloud
chown -R apache.apache /var/www/html/owncloud/config
chown -R apache.apache /var/www/html/owncloud/data
chown -R apache.apache /var/www/html/owncloud/apps
chown root.root /var/www/html/owncloud/.htaccess
chown root.root /var/www/html/owncloud/config/.htaccess
chown root.root /var/www/html/owncloud/data/.htaccess
chcon -R -t httpd_sys_rw_content_t /var/www/html/owncloud/config
chcon -R -t httpd_sys_rw_content_t /var/www/html/owncloud/data
chcon -R -t httpd_sys_rw_content_t /var/www/html/owncloud/apps

NFS Storage

Here we mount an NFS share as the OwnCloud data store:

mount -t nfs ip.of.nfs.svr:/path/to/owncloud /mnt/

rsync -avr /var/www/html/owncloud/data/* /mnt/

umount /mnt/

Make it survive a reboot:

vim /etc/fstab

# Mount the NFS data store
ip.of.nfs.svr:/path/to/owncloud        /var/www/html/owncloud/data/  nfs  _netdev,context="system_u:object_r:httpd_sys_rw_content_t:s0"  0 0

mount -a
mount

:!: Verify and/or reset the permissions on the data folder as above.

Force SSL (HTTPS)

  1. Log into OwnCloud as the administrator using HTTPS
  2. Click adminusername → Admin
  3. Scroll down to Security → Enforce HTTPS

Client Side

Sync Folder Location

https://doc.owncloud.org/desktop/1.8/navigating.html#adding-a-folder

The default local sync folder is ownCloud, in your home directory.

computing/storage/owncloud_server.1502315668.txt.gz · Last modified: 2017/08/09 15:54 by gcooper