当前位置: 首页 > news >正文

基于LNMP分布式个人云存储

1.准备工作

a.关闭两台虚拟机的安全软件

客户端:

[root@master ~]# systemctl stop firewalld
[root@master ~]# systemctl disable firewalld
[root@master ~]# systemctl status firewalld
○ firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor>Active: inactive (dead)Docs: man:firewalld(1)
[root@master ~]# getenforce
Disabled

服务端:

[root@node1 ~]# systemctl stop firewalld
[root@node1 ~]# systemctl disable firewalld
[root@node1 ~]# systemctl status firewalld
○ firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor>Active: inactive (dead)Docs: man:firewalld(1)
[root@node1 ~]# getenforce
Disabled

b.两台虚拟机,一台是客户端(web),一台是服务端(nfs),修改两台主机名称为web,nfs

客户端(web):

[root@master ~]# hostnamectl set-hostname web
[root@master ~]# bash
[root@web ~]#

nfs端(nfs):

[root@node1 ~]# hostnamectl set-hostname nfs
[root@node1 ~]# bash
[root@nfs ~]#

2.服务端(nfs)配置

a.安装mariadb,mariadb-server,nfs-utils相关软件

[root@nfs /]# yum install mariadb mariadb-server nfs-utils -y

b.上传软件

使用xftp将nextcloud-25.0.1.zip软件压缩包上传到Linux的根目录,并解压缩

解压缩:

[root@nfs ~]cd /
[root@nfs /]# unzip  /nextcloud-25.0.1.zip 

c.设置nextcloud安装命令权限

[root@nfs /]# chmod -R 777 /nextcloud

d.设置数据库

#启动mariadb
[root@nfs /]# systemctl start mariadb#进入mysql以root的身份运行
[root@nfs /]# mysql -uroot -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.5.29-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.#创建数据库
MariaDB [(none)]> create  database  nextcloud;
Query OK, 1 row affected (0.001 sec)#创建用户及密码,%是允许远程连接设备
MariaDB [(none)]> create  user  'nextcloud'@'%' identified  by '123456';
Query OK, 0 rows affected (0.001 sec)#设置权限
MariaDB [(none)]>  grant all on  nextcloud.*  to  'nextcloud'@'%';
Query OK, 0 rows affected (0.001 sec)#退出数据库
MariaDB [(none)]> exit
Bye

e.重启数据库

[root@nfs /]# systemctl restart mariadb

f.编写nfs主配置文件/etc/exports

#编辑配置文件,写入共享的文件和ip地址,权限
[root@nfs ~]#vim /etc/exports
/nextcloud      192.168.75.154/24(rw,all_squash,sync)

g.先重启rpc服务,在重启nfs服务

[root@nfs /]# systemctl enable --now rpcbind
[root@nfs /]# systemctl enable --now nfs-server

3.客户端(web)配置

a.安装nginx,php,autofs,nfs-utils相关软件

[root@web ~]# yum install nginx autofs nfs-utils -y

b.查询服务端(nfs)远程共享的目录

[root@web ~]# showmount -e 192.168.75.155
Export list for 192.168.75.155:
/nextcloud 192.168.75.154/24

c.编辑autofs自动挂载服务配置文件/etc/auto.master

#编辑配置文件,定位第7行在下面写入代码
[root@web ~]# vim /etc/auto.master
/misc   /etc/auto.misc
/lei    /etc/auto.jun

d.编辑上面的目录/etc/auto.jun

#编写子目录写入代码
[root@web ~]# vim /etc/auto.jun
jun     192.168.75.155:/nextcloud

e.启动autofs服务

[root@web ~]# systemctl restart nginx

f.查看服务端共享的文件

[root@web jun]# ls
3rdparty  console.php  dist        occ           public.php  status.php
apps      COPYING      index.html  ocm-provider  remote.php  themes
AUTHORS   core         index.php   ocs           resources   updater
config    cron.php     lib         ocs-provider  robots.txt  version.

4.安装并测试

a.打开浏览器后输入服务器IP地址,进入nextcloud安装向导

b.管理员的用户名即密码自定

c.存储与数据库:选择MySQL/MariaDB,设置数据库用户为nextcloud,密码为123456,数据库名为nextcloud,主机名为服务端主机:3306

d.安装成功

http://www.dtcms.com/a/293984.html

相关文章:

  • 深入理解 Java Builder 设计模式:解决构造函数爆炸问题
  • 旧系统UI焕新陷阱:保留业务习惯与引入新交互的平衡点把控
  • JNPF组织权限,让企业权限体系更清晰高效​
  • TARA分析学习
  • 亚远景-传统功能安全VS AI安全:ISO 8800填补的标准空白与实施难点
  • Django 入门详解:从零开始构建你的第一个 Web 应用
  • YOLOv5模型剪枝实战教程
  • 从8h到40min的极致并行优化:Spark小数据集UDTF处理的深度实践与原理剖析
  • 分布式系统中的缓存设计与应用
  • 前端实现可编辑脑图的方案
  • 一洽客服系统:小程序接入功能说明
  • 关于单片机的无符号整型uint32_x
  • 代码随想录算法训练营第五十二天|图论part3
  • 使用 gh-pages 将 next.js15 静态项目部署到 github pages
  • 重磅发布:Oracle ADG 一键自动化搭建脚本
  • OceanBase数据库
  • 如何在macOS上修改iPhone的定位
  • Qt 自定义控件开发方法与实践
  • cx_Freeze python 打包详解
  • Qt 数据QByteArray与QString处理与转换全指南
  • QT的moveToThread 用法
  • Java按模板导出Excel
  • LoRA 低秩矩阵实现参数高效的权重更新
  • 2025 ACT 汽车功能安全相关PPT分享
  • 《计算机网络》实验报告七 HTTP协议分析与测量
  • 【硬件-笔试面试题】硬件/电子工程师,笔试面试题汇总版,持续更新学习,加油!!!
  • 场效应管和模电的关于、学习
  • 【盘古100Pro+开发板实验例程】FPGA | Modelsim 的使用和 do 文件编写
  • SpringBoot 使用Rabbitmq
  • rust嵌入式开发零基础入门教程(一)