Kamis, 22 Oktober 2020

Install Nextcloud 15 PHP 7.3 MariaDB 10.3 CentOS 7

Install Nextcloud 15 PHP 7.3 MariaDB 10.3 CentOS 7 dengan mudah dilakukkan dengan menerapkan tutorial berikut. Nextcloud bisa di kolaborasikan dengan zimbra 8.7 keatas. Untuk menyimpan file besar bisa langsung dilakukkan melalui webclient zimbra tanpa harus membuka nextcloud. Pada nextcloud ini sudah bisa diakses melalui Mobile App dan Desktop Komputer. Zimbra dan Nextcloud harus di install pada server yang berbeda. Tidak bisa dilakukkan dalam satu server. Berikut tutorial saadwebid untuk melakukkan instalasi nextcloud di centOS 7.

1. Install Paket yang dibutuhkan

1
2
yum install -y epel-release yum-utils unzip curl wget nano bash-completion policycoreutils-python mlocate bzip2 screen firewalld telnet httpd

2. Set Hostname dan TimeZone

1
2
hostnamectl set-hostname cloud.saad.my.id
timedatectl set-timezone Asia/Jakarta

3. Update Centos

1
yum update -y

4. Disable php 5.4 dan enable php 7.3

1
2
sudo yum-config-manager --disable remi-php54
sudo yum-config-manager --enable remi-php73

5. Jalankan service httpd

1
2
systemctl enable httpd.service
systemctl start httpd.service

6. Install php 7.3

1
yum install -y php php-gd php-mbstring php-intl php-pecl-apcu php-mysqlnd php-pecl-redis php-opcache php-imagick php-pecl-zip php-xml php-process

7. Install MariaDB 10.3

1
nano /etc/yum.repos.d/maria10-3.repo

Masukkan line berikut

1
2
3
4
5
6
7
# MariaDB 10.3 CentOS repository list - created 2018-11-19 23:14 UTC
[mariadb]
name = MariaDB
gpgcheck=1

Install mariaDB

1
yum install -y mariadb mariadb-server

8. Buat direktori baru untuk file nextcloud

1
2
mkdir -p /var/www/html/cloud.saad.my.id/public_html
chown apache.apache -R /var/www/html/cloud.saad.my.id

9. Download nextcloud dan ekstrak

1
2
3
4
5
6
7
8
cd /var/www/html/cloud.saad.my.id/public_html
mkdir data
unzip nextcloud-*.zip
cd nextcloud/
mv * /var/www/html/cloud.saad.my.id/public_html/
mv .htaccess /var/www/html/cloud.saad.my.id/public_html/
chown -R apache.apache /var/www/html/cloud.saad.my.id/public_html/*

10. Buat virtualhost

1
vi /etc/httpd/conf.d/nextcloud.conf

Masukkan line berikut

01
02
03
04
05
06
07
08
09
10
11
12
<VirtualHost *:80>
  DocumentRoot /var/www/html/cloud.saad.my.id/public_html/
  ServerName  cloud.saad.my.id
 
<Directory "/var/www/html/cloud.saad.my.id/public_html/">
  Require all granted
  AllowOverride All
  Options FollowSymLinks MultiViews
  SetEnv HOME /var/www/html/cloud.saad.my.id/public_html
  SetEnv HTTP_HOME /var/www/html/cloud.saad.my.id/public_html
</Directory>
</VirtualHost>

11. Beri akses http dan https di firewall

1
2
3
4
5
systemctl start firewalld
systemctl enable firewalld
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --zone=public --add-service=https --permanent
firewall-cmd --reload

12. Beri akses nextcloud pada selinux

01
02
03
04
05
06
07
08
09
10
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/cloud.saad.my.id/public_html/data(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/cloud.saad.my.id/public_html/config(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/cloud.saad.my.id/public_html/apps(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/cloud.saad.my.id/public_html/.htaccess'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/cloud.saad.my.id/public_html/.user.ini'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/cloud.saad.my.id/public_html/3rdparty/aws/aws-sdk-php/src/data/logs(/.*)?'
 
restorecon -Rv '/var/www/html/cloud.saad.my.id/public_html/'
 
setsebool -P httpd_can_network_connect on

13. Buat database nextcloud

Jalankan database mariadb

1
systemctl start mariadb

Enable database mariadb

1
systemctl enable mariadb

Jalankan konfigurasi awal

1
mysql_secure_installation

login mariadb dengan user root

1
mysql -uroot -p

Buat database dengan nama nextcloud

1
CREATE DATABASE `nextcloud`;

Buat user dan password untuk database nextcloud

1
CREATE USER 'nextcloud' IDENTIFIED BY 'Password';

Beri permission user nextcloud untuk akses dan menggunakan mariaDB Server

1
GRANT USAGE ON *.* TO 'nextcloud'@localhost IDENTIFIED BY 'Password';

Beri privileges user nextcloud untuk database nextcloud

1
GRANT ALL privileges ON `nextcloud`.* TO 'nextcloud'@localhost;

Terapkan perubahan konfigurasi

1
FLUSH PRIVILEGES;

Verifikasi user nextcloud sudah benar diberikan permission

1
SHOW GRANTS FOR 'nextcloud'@localhost;

14. Install Nextcloud 15

Buka http://cloud.saad.my.id/

Selesai

sumber : https://saad.web.id/2019/07/install-nextcloud-15-php-7-3-mariadb-10-3-di-centos-7-x/