linux部署来源网盘,在CentOS8.2上搭建Nextcloud私人网盘

前言

Nextcloudd是一个开源的、基于本地的文件共享和协作平台,它允许您保存文件并通过多个设备(如PC、智能手机和平板电脑)访问它们。

同样的我们可以自己购买一个云服务器,部署一个属于自己的私人网盘,用来存储一些图片,文件等东西,以后需要可以从私人网盘上下载,就会比其他的例如百度网盘快很多

首先是关闭防火墙和selinux

[root@localhost ~]# systemctl enable --now firewalld

[root@localhost ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

# enforcing - SELinux security policy is enforced.

# permissive - SELinux prints warnings instead of enforcing.

# disabled - No SELinux policy is loaded.

SELINUX=disabled //改成disabled

# SELINUXTYPE= can take one of these three values:

# targeted - Targeted processes are protected,

# minimum - Modification of targeted policy. Only selected processes are protected.

# mls - Multi Level Security protection.

SELINUXTYPE=targeted

改完后重启机器

[root@localhost ~]# reboot

一条命令部署LAMP架构

[root@localhost ~]# yum install -y httpd mariadb-server php

NextCloud需要一些必需的PHP模块才能正常工作,接着安装PHP拓展包

[root@localhost ~]# yum install -y php-mysqlnd php-xml php-zip php-curl php-gd php-intl php-json php-ldap php-mbstring php-opcache

这里不需要启动php-fpm

启动httpd、mariadb服务,并设置开机自启

[root@localhost ~]# systemctl enable --now httpd

[root@localhost ~]# systemctl enable --now mariadb

设置数据库管理员密码

[root@localhost ~]# mysqladmin -u root password 'your_password'

your_password是需要自己设置的密码

进入数据库,给Nextcloud创建数据库,并授权

[root@localhost ~]# mysql -u root -p

Enter password:

Welcome to the MariaDB monitor. Commands end with ; or \g.

Your MariaDB connection id is 246

Server version: 10.3.17-MariaDB MariaDB Server

Copyright (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;

MariaDB [(none)]> creant all privileges on nextcloud.* to 'root'@'localhost';

MariaDB [(none)]> flush privileges;

MariaDB [(none)]> show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| mysql |

| nextcloud |

| performance_schema |

+--------------------+

4 rows in set (0.003 sec)

MariaDB [(none)]> exit

Bye

上传nextcloud压缩包

6dc4a046de1280b6c96a126b421650d5.png

点击下载到本地

也可以使用: wget https://download.nextcloud.com/server/releases/nextcloud-19.0.3.zip 但是这种方式很慢,推荐先下载到本地,再上传到机器上

上传完成后,将文件解压缩到/var/www/html/目录下

[root@localhost ~]# unzip nextcloud-16.0.3.zip -d /var/www/html/

接着,创建一个目录来存储管理用户数据

[root@localhost ~]# mkdir -p /var/www/html/nextcloud/data

修改NextCloud的目录权限,以便Apache用户可以向其中添加数据

[root@localhost ~]# chown -R apache:apache /var/www/html/nextcloud/

到这个人网盘就搭建完成,接着访问:ip/nextcloud完成安装即可

标签:none,MariaDB,CentOS8.2,nextcloud,网盘,php,root,localhost,Nextcloud

来源: https://www.cnblogs.com/itwangqiang/p/13723874.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值