User Tools

Site Tools


computing:storage:owncloud_server

This is an old revision of the document!


OwnCloud - Server

See also OwnCloud - Client

Ubuntu Server Howto: https://www.marksei.com/install-owncloud-10-server-ubuntu/

OSS: http://owncloud.org

Enterprise: http://owncloud.com

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

Upgrade

:!: 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 -y update && apt-get -y dist-upgrade && apt-get -y autoremove && 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

Install

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

Using Virtualmin Install Script

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

Using Official Package Repositories

Ubuntu 16.04

Install updates:

apt-get -y update && apt-get -y dist-upgrade && apt-get -y autoremove && reboot

Configure the package repository:

curl https://download.owncloud.org/download/repositories/10.0/Ubuntu_16.04/Release.key | apt-key add -

Install OwnCloud:

sh -c "echo 'deb https://download.owncloud.org/download/repositories/10.0/Ubuntu_16.04/ /' > \
  /etc/apt/sources.list.d/owncloud.list"
apt-get update
apt-get install owncloud-files apache2 libapache2-mod-php7.0 php7.0-gd php7.0-json php7.0-mysql \
  php7.0-curl php7.0-mbstring php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip \
  mysql-server

Configure the database:

mysql -u root -p
CREATE USER 'ownclouduser'@'localhost' IDENTIFIED BY 'YOURPASSWORD';
CREATE DATABASE ownclouddb;
GRANT ALL ON ownclouddb.* TO 'ownclouduser'@'localhost';
FLUSH PRIVILEGES;
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/owncloud -type d -exec chmod 775 {} \;
find /var/www/owncloud -type f -exec chmod 664 {} \;
chown -R root:root /var/www/owncloud
chown -R www-data.www-data /var/www/owncloud/config
chown -R www-data.www-data /var/www/owncloud/data
chown -R www-data.www-data /var/www/owncloud/apps
chown root.root /var/www/owncloud/.htaccess
chown root.root /var/www/owncloud/config/.htaccess
chown root.root /var/www/owncloud/data/.htaccess
chcon -R -t httpd_sys_rw_content_t /var/www/owncloud/config
chcon -R -t httpd_sys_rw_content_t /var/www/owncloud/data
chcon -R -t httpd_sys_rw_content_t /var/www/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
computing/storage/owncloud_server.1521053186.txt.gz · Last modified: 2018/03/14 12:46 by gcooper