当前位置: 首页 > 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.lryc.cn/news/596899.html

相关文章:

  • Docker 容器中的 HEAD 请求缺失 header?从 Content-MD5 缺失聊起
  • BitDistiller:通过自蒸馏释放 Sub-4-Bit 大语言模型的潜力
  • BiLLM:突破大语言模型后训练量化的极限
  • AI安全“面壁计划”:我们如何对抗算法时代的“智子”封锁?
  • 主要分布在背侧海马体(dHPC)CA1区域(dCA1)的时间细胞对NLP中的深层语义分析的积极影响和启示
  • 使用 QLExpress 构建灵活可扩展的业务规则引擎
  • 糖尿病数据分析:血压与年龄关系可视化
  • OpenAI发布ChatGPT Agent,AI智能体迎来关键变革
  • Linux网络-------1.socket编程基础---(UDP-socket)
  • 基于数据挖掘的短视频点赞影响因素分析【LightGBM、XGBoost、随机森林、smote】
  • 应用层自定义协议【序列化+反序列化】
  • 2025暑期—06神经网络-常见网络
  • ChatGPT桌面版深度解析
  • 华为7月23日机考真题
  • TDengine 的 HISTOGRAM() 函数用户手册
  • 解决Spring事务中RPC调用无法回滚的问题
  • 解构未来金融:深入剖析DeFi与去中心化交易所(DEX)的技术架构
  • 【音视频学习】五、深入解析视频技术中的像素格式:颜色空间、位深度、存储布局
  • LoRA 低秩矩阵实现参数高效的权重更新
  • 新手向:Pycharm的使用技巧
  • python3写一个异步http接口服务调用大模型(async, sanic)---6.1
  • Hexo - 免费搭建个人博客04 - 创建另一个私人仓库,对Hexo项目进行版本管理
  • Log4j CVE-2021-44228 漏洞复现详细教程
  • Sklearn 机器学习 线性回归
  • 20250704-基于强化学习在云计算环境中的虚拟机资源调度研究
  • OpenCV 零基础到项目实战 | DAY 2:图像预处理全解析
  • 基于Seata的微服务分布式事务实战经验分享
  • 7月23号打卡
  • 四、cv::Mat的介绍和使用
  • 【趣味解读】淘宝登录的前后端交互机制:Cookie-Session 如何保障你的账户安全?