This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
computing:storage:owncloud_server [2018/03/14 12:46] gcooper |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== OwnCloud - Server ====== | ||
- | |||
- | See also **[[computing: | ||
- | |||
- | **Ubuntu Server Howto**: https:// | ||
- | |||
- | **OSS**: http:// | ||
- | |||
- | **Enterprise**: | ||
- | |||
- | * Synchronized cloud storage on your hardware | ||
- | * Virtualmin Pro has install script | ||
- | |||
- | ===== Upgrade ===== | ||
- | |||
- | :!: We use the '' | ||
- | |||
- | https:// | ||
- | |||
- | https:// | ||
- | |||
- | <note warning> | ||
- | |||
- | as '' | ||
- | |||
- | < | ||
- | 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 '' | ||
- | |||
- | < | ||
- | cd / | ||
- | sudo -u www-data php occ upgrade | ||
- | sudo -u www-data php occ maintenance: | ||
- | </ | ||
- | |||
- | ===== Install ===== | ||
- | |||
- | :!: Smaller installations can just use **SQLite database for simplicity**. | ||
- | |||
- | ==== Using Virtualmin Install Script ==== | ||
- | |||
- | **Virtualmin -> < | ||
- | |||
- | - Browse to the OwnCloud URL | ||
- | - When prompted to create an admin user, enter your virtual server admin username and password | ||
- | |||
- | ==== Using Official Package Repositories ==== | ||
- | |||
- | https:// | ||
- | |||
- | === 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:// | ||
- | </ | ||
- | |||
- | Install OwnCloud: | ||
- | |||
- | < | ||
- | sh -c "echo 'deb https:// | ||
- | / | ||
- | 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 ' | ||
- | CREATE DATABASE ownclouddb; | ||
- | GRANT ALL ON ownclouddb.* TO ' | ||
- | FLUSH PRIVILEGES; | ||
- | exit | ||
- | </ | ||
- | |||
- | === CentOS 7 === | ||
- | |||
- | See also **[[computing: | ||
- | |||
- | < | ||
- | 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 ' | ||
- | CREATE DATABASE IF NOT EXISTS owncloud; | ||
- | GRANT ALL PRIVILEGES ON owncloud.* TO ' | ||
- | 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 '' | ||
- | firewall-cmd --permanent --zone=public --zone=internal --zone=work --zone=external --zone=dmz --add-port=2222/ | ||
- | firewall-cmd --reload | ||
- | </ | ||
- | |||
- | == Install == | ||
- | |||
- | http:// | ||
- | |||
- | Enable the repository and install OwnCloud: | ||
- | |||
- | < | ||
- | cd / | ||
- | wget http:// | ||
- | yum install owncloud | ||
- | </ | ||
- | |||
- | Enable the web server startup and reboot: | ||
- | |||
- | < | ||
- | systemctl enable httpd | ||
- | reboot | ||
- | </ | ||
- | |||
- | Reset permissions for better security: | ||
- | |||
- | < | ||
- | find / | ||
- | find / | ||
- | chown -R root:root / | ||
- | chown -R www-data.www-data / | ||
- | chown -R www-data.www-data / | ||
- | chown -R www-data.www-data / | ||
- | chown root.root / | ||
- | chown root.root / | ||
- | chown root.root / | ||
- | chcon -R -t httpd_sys_rw_content_t / | ||
- | chcon -R -t httpd_sys_rw_content_t / | ||
- | chcon -R -t httpd_sys_rw_content_t / | ||
- | </ | ||
- | |||
- | ===== NFS Storage ===== | ||
- | |||
- | Here we mount an NFS share as the OwnCloud data store: | ||
- | |||
- | < | ||
- | mount -t nfs ip.of.nfs.svr:/ | ||
- | |||
- | rsync -avr / | ||
- | |||
- | umount /mnt/ | ||
- | </ | ||
- | |||
- | Make it survive a reboot: | ||
- | < | ||
- | |||
- | vim /etc/fstab | ||
- | |||
- | # Mount the NFS data store | ||
- | ip.of.nfs.svr:/ | ||
- | |||
- | mount -a | ||
- | mount | ||
- | </ | ||
- | |||
- | :!: Verify and/or reset the permissions on the '' | ||
- | |||
- | ===== Force SSL (HTTPS) ===== | ||
- | |||
- | - Log into OwnCloud as the administrator using HTTPS | ||
- | - Click **'' | ||
- | - Scroll down to **Security -> Enforce HTTPS** | ||