先安裝 apache 、 php 、 mariaDB
安裝 PHP
Add Remi Repository
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
List the available PHP module stream.
dnf module list php 輸出如下 [root@nextcloud yum.repos.d]# dnf module list php Last metadata expiration check: 0:02:47 ago on Sun 26 Jan 2020 06:28:30 PM CST. CentOS-8 - AppStream Name Stream Profiles Summary php 7.2 [d] common [d], devel, minimal PHP scripting language php 7.3 common, devel, minimal PHP scripting language Remi's Modular repository for Enterprise Linux 8 - x86_64 Name Stream Profiles Summary php remi-7.2 common [d], devel, minimal PHP scripting language php remi-7.3 common [d], devel, minimal PHP scripting language php remi-7.4 common [d], devel, minimal PHP scripting language
選擇 7.3
dnf module enable php:remi-7.3 -y
安裝其他相依套件
dnf install -y unzip curl wget bash-completion policycoreutils-python-utils mlocate bzip2 dnf install -y httpd php php-gd php-mbstring php-intl php-pecl-apcu php-mysqlnd php-opcache php-json php-zip systemctl enable httpd
設定 mariaDB
nano /etc/my.cnf.d/server.cnf [mysqld] ... transaction_isolation = READ-COMMITTED binlog_format = ROW ... systemctl restart mariadb mysql -u root -p CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'nextcloudPW'; CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; GRANT ALL PRIVILEGES on nextcloud.* to 'nextcloud'@'localhost'; FLUSH privileges;
安裝 NextCloud
下載 nextcloud web-installer
cd /var/www/html/ && wget https://download.nextcloud.com/server/installer/setup-nextcloud.php cd /var/www/ && chown apache: -R html
使用瀏覽器進行後續設定
http://{server-ip}/setup-nextcloud.php