一、恢复快照后,检查安全性(查看selinux 以及防火墙)

二、搭建LNMP环境
[root@server ~]# yum -y install nginx mariadb-server php*
三、上传软件
1、将nextcloud-25.0.1.zip压缩包传递到根目录下


2、解压缩nextcloud-25.0.1.zip
(1)解压缩指令
[root@server /]# unzip nextcloud-25.0.1.zip
(2)查看

四、设置nextcloud安装命令权限

五、设置数据库
1、先启动数据库
[root@server /]# systemctl start mariadb
[root@server /]#
2、配置数据库,进入初始界面myspl

(1)创建云存储数据库
MariaDB [(none)]> create database nextcloud;
Query OK, 1 row affected (0.001 sec)MariaDB [(none)]>
(2)创建一个账户及密码,可以远程登录
MariaDB [(none)]> create user 'nextcloud'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.011 sec)MariaDB [(none)]>
(3)给该用户授权
MariaDB [(none)]> grant all on nextcloud.* to 'nextcloud'@'localhost';
Query OK, 0 rows affected (0.002 sec)MariaDB [(none)]>
(4)退出
MariaDB [(none)]> exit
Bye
[root@server /]#
3、再次重新启动数据库
[root@server /]# systemctl restart mariadb
六、配置nginx的主配置文件
1、进入nginx
[root@server /]# vim /etc/nginx/nginx.conf
2、修改文件

3、查看并重启nginx

七、在浏览器中搜索IP地址

八、cpolar内网穿透
1、传输cpolar-stable-linux-amd64.zip文件

2、解压缩cpolar-stable-linux-amd64.zip

3、连接账户
[root@server /]# ./cpolar authtoken YTU2YTk3YTQtYTNlZC00NDcyLTk4MDQtNzM5NDUyY2ZiOWIw
Authtoken saved to configuration file: /root/.cpolar/cpolar.yml
[root@server /]#
4、在浏览器复制http://1d23dad3.r29.cpolar.top


5、更改config.php权限
[root@server /]# find / -name config.php
/nextcloud/config/config.php
[root@server /]# vim /nextcloud/config/config.php

6、重启nginx后,再次访问就可以打开了
[root@server /]# systemctl restart nginx