关闭防火墙

    1. [root@localhost ~]# systemctl stop firewalld
    2. [root@localhost ~]# systemctl disable firewalld
    3. [root@localhost ~]#

    安装软件

    1. [root@localhost ~]# yum install -y unzip curl wget bash-completion bzip2

    设置Selinux

    1. [root@localhost ~]# cat /etc/selinux/config
    2. # This file controls the state of SELinux on the system.
    3. # SELINUX= can take one of these three values:
    4. # enforcing - SELinux security policy is enforced.
    5. # permissive - SELinux prints warnings instead of enforcing.
    6. # disabled - No SELinux policy is loaded.
    7. SELINUX=permissive
    8. # SELINUXTYPE= can take one of three values:
    9. # targeted - Targeted processes are protected,
    10. # minimum - Modification of targeted policy. Only selected processes are protected.
    11. # mls - Multi Level Security protection.
    12. SELINUXTYPE=targeted
    13. [root@localhost ~]#

    安装httpd并设置

    1. [root@localhost ~]# yum install httpd -y
    2. [root@localhost ~]# yum update -y
    1. [root@localhost ~]# cat /etc/httpd/conf.d/nextcloud.conf
    2. <VirtualHost *:80>
    3. DocumentRoot /var/www/html/
    4. ServerName 127.0.0.1
    5. <Directory "/var/www/html/">
    6. Require all granted
    7. AllowOverride All
    8. Options FollowSymLinks MultiViews
    9. </Directory>
    10. </VirtualHost>
    11. [root@localhost ~]#
    1. [root@localhost ~]# systemctl start httpd.service
    2. [root@localhost ~]# systemctl enable httpd.service
    3. Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
    4. [root@localhost ~]#

    安装软件并创建链接

    1. [root@localhost ~]# yum install -y centos-release-scl
    1. [root@localhost ~]# yum install -y rh-php72 rh-php72-php rh-php72-php-gd rh-php72-php-mbstring rh-php72-php-intl rh-php72-php-pecl-apcu rh-php72-php-mysqlnd rh-php72-php-pecl-redis rh-php72-php-opcache rh-php72-php-imagick
    1. [root@localhost ~]# ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/
    2. [root@localhost ~]# ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php72-php.conf /etc/httpd/conf.modules.d/
    3. [root@localhost ~]# ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php72-php7.so /etc/httpd/modules/
    4. [root@localhost ~]# ln -s /opt/rh/rh-php72/root/bin/php /usr/bin/php
    5. [root@localhost ~]#

    安装mariadb并设置

    1. [root@localhost ~]# yum install -y mariadb mariadb-server
    1. [root@localhost ~]# systemctl start mariadb.service
    2. [root@localhost ~]# systemctl enable mariadb.service
    3. Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
    4. [root@localhost ~]#
    1. [root@localhost ~]# mysql -u root
    2. Welcome to the MariaDB monitor. Commands end with ; or \g.
    3. Your MariaDB connection id is 2
    4. Server version: 5.5.68-MariaDB MariaDB Server
    5. Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    6. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    7. MariaDB [(none)]> CREATE DATABASE nextcloud;
    8. Query OK, 1 row affected (0.00 sec)
    9. MariaDB [(none)]> create user nextcloud@localhost identified by '123456';
    10. Query OK, 0 rows affected (0.00 sec)
    11. MariaDB [(none)]> grant all on *.* to 'nextcloud'@'localhost' identified by '123456' with grant option;
    12. Query OK, 0 rows affected (0.00 sec)
    13. MariaDB [(none)]> FLUSH PRIVILEGES;
    14. Query OK, 0 rows affected (0.00 sec)
    15. MariaDB [(none)]> exit
    16. Bye
    17. [root@localhost ~]# systemctl restart mariadb.service
    18. [root@localhost ~]#

    下载nextcloud并设置

    1. [root@localhost ~]# yum install wget -y
    1. [root@localhost ~]# wget https://download.nextcloud.com/server/releases/nextcloud-20.0.2.zip
    2. --2021-09-03 10:49:53-- https://download.nextcloud.com/server/releases/nextcloud-20.0.2.zip
    3. 正在解析主机 download.nextcloud.com (download.nextcloud.com)... 95.217.64.181
    4. 正在连接 download.nextcloud.com (download.nextcloud.com)|95.217.64.181|:443... 已连接。
    5. 已发出 HTTP 请求,正在等待回应... 200 OK
    6. 长度:141988942 (135M) [application/zip]
    7. 正在保存至: nextcloud-20.0.2.zip
    8. 100%[=============================================>] 141,988,942 228KB/s 用时 6m 51s
    9. 2021-09-03 10:56:45 (337 KB/s) - 已保存 nextcloud-20.0.2.zip [141988942/141988942])
    10. [root@localhost ~]#

    解压

    1. [root@localhost ~]# unzip nextcloud-20.0.2.zip
    1. [root@localhost ~]# ls
    2. anaconda-ks.cfg nextcloud nextcloud-20.0.2.zip
    1. [root@localhost ~]# cp -r nextcloud /var/www/html/
    2. [root@localhost ~]# mkdir /var/www/html/data
    3. [root@localhost ~]# chown -R apache:apache /var/www/html
    4. [root@localhost ~]# systemctl restart httpd.service
    5. [root@localhost ~]#

    WEB网页

    1. 打开web页面 http://192.168.100.10/nextcloud

    image.png
    image.png
    image.png