Hướng dẫn cài đặt NextCloud 12 trên CentOS 7.x
Yêu cầu hệ thống
Red Hat Enterprise Linux 7 / Ubuntu 16.04 LTS
MySQL/MariaDB
PHP 7.0, 7.1 (PHP 7.2 not supported)
Apache 2.4 with mod_php
Bước 1: Cài đặt môi trường LAMP
Hướng dẫn cài đặt LAMP trên CentOS 7.x
hoặc chạy câu lệnh sau:
# yum -y install wget bzip2 mariadb-server php php-mysql php-dom php-gd php-mbstring php-posix php-xmlwriter php-zip
Bước 2: Download và cài đặt NextCloud
Download NextCloud tại link
# cd /tmp/
# wget https://download.nextcloud.com/server/releases/nextcloud-12.0.4.tar.bz2
# tar -jxvf nextcloud-12.0.4.tar.bz2
# mv nextcloud /var/www/html/
# mkdir /var/www/html/nextcloud/data
# firewall-cmd --permanent --zone=public --add-service=http
# firewall-cmd --permanent --zone=public --add-service=https
# firewall-cmd --reload
chown -R apache:apache /var/www/html/nextcloud/
# systemctl start httpd.service
# systemctl start mariadb.service
# systemctl enable httpd.service
# systemctl enable mariadb.service
Khởi tạo database cho NextCloud
Thiết lập mật khẩu cho database nếu chưa thiết lập
# mysql_secure_installation
mysql -u root -p
create database nextclouddb;
grant all on nextclouddb.* to 'nextclouduser'@'localhost' identified by 'password';
\q
Cho phép Selinux
restorecon -Rv /var/www/html/nextcloud
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/data'
restorecon '/var/www/html/nextcloud/data'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config'
restorecon '/var/www/html/nextcloud/config'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/apps'
restorecon '/var/www/html/nextcloud/apps'
Khởi tạo virtualhost
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/nextcloud
ServerName your domain
ServerAlias www.your_domain
ErrorLog /var/www/html/error.log
CustomLog /var/www/html/access.log common
</VirtualHost>
Khởi động lại Apache
# systemctl restart httpd
No comments: