ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

在CentOS8.2上搭建Nextcloud私人网盘

2020-09-24 14:35:08  阅读:866  来源: 互联网

标签:none MariaDB CentOS8.2 nextcloud 网盘 php root localhost 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压缩包

访问Nextcloud官网:https://nextcloud.com/install/#instructions-server

点击下载到本地

也可以使用: 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

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有