OwnCloud

From belajarwiki
Jump to navigation Jump to search

OwnCloud terbaru hanya bisa menggunakan PHP 7.2 atau sebelumnya.

Install Apache

sudo apt install apache2

Tambahkan

sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/apache2/apache2.conf
sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl enable apache2.service

MariaDB

sudo apt -y install mariadb-server mariadb-client
sudo mysql_secure_installation

sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
sudo systemctl restart mariadb.service

Konfigurasi

sudo mysql -u root -p123456
CREATE DATABASE owncloud;
CREATE USER 'ownclouduser'@'localhost' IDENTIFIED BY 'owncloud';
GRANT ALL ON owncloud.* TO 'root'@'localhost' IDENTIFIED BY '123456' WITH GRANT OPTION;
GRANT ALL ON owncloud.* TO 'ownclouduser'@'localhost' IDENTIFIED BY 'owncloud' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;

PHP

sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt -y install php7.1 libapache2-mod-php7.1 php7.1-common php7.1-mbstring \
php7.1-xmlrpc php7.1-soap php7.1-apcu php7.1-smbclient php7.1-ldap php7.1-redis php7.1-gd \
php7.1-xml php7.1-intl php7.1-json php7.1-imagick php7.1-mysql php7.1-cli php7.1-mcrypt \
php7.1-ldap php7.1-zip php7.1-curl unzip

Edit

sudo nano /etc/php/7.1/apache2/php.ini

Isi dengan

memory_limit = 256M //sesuaikan
upload_max_filesize = 200M //sesuaikan

Download OwnCloud

cd /tmp && wget https://download.owncloud.org/community/owncloud-10.2.0.zip
unzip owncloud-10.2.0.zip
sudo mv owncloud /var/www/html/owncloud/

Atur hak akses

mkdir /var/www/html/owncloud/data
chown -Rf nobody: /var/www/html/owncloud/data/
chmod -Rf 777 /var/www/html/owncloud/data
sudo chown -R www-data:www-data /var/www/html/owncloud/
sudo chmod -R 755 /var/www/html/owncloud/

Konfigurasi apache pada

sudo nano /etc/apache2/sites-available/owncloud.conf

Isi dengan

<VirtualHost *:80>
     ServerAdmin admin@example.com
     DocumentRoot /var/www/html/owncloud/
     ServerName example.com
     ServerAlias www.example.com
  
     Alias /owncloud "/var/www/html/owncloud/"  

     <Directory /var/www/html/owncloud/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
          <IfModule mod_dav.c>
            Dav off
          </IfModule>
        SetEnv HOME /var/www/html/owncloud
        SetEnv HTTP_HOME /var/www/html/owncloud
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>


Aktifkan

sudo a2ensite owncloud.conf
sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod env
sudo a2enmod dir
sudo a2enmod mime

Pranala Terkait

Referensi