Nextcloud的班级网盘

Nextcloud的班级网盘

条件:

​ 1.服务器为64位Centos7的系统

​ 2.获取系统的root权限

1.关闭Centos7的防火墙和selinux

[root@antong ~]#systemctl stop firewalld && systemctl disable firewalld
[root@antong ~]#vim /etc/selinux/config
SELINUX=disabled

2.配置基础环境

[root@antong ~]#yum install -y epel-release yum-utils unzip curl wget bash-completion policycoreutils-python mlocate bzip2
[root@antong ~]#yum update -y
[root@antong ~]#yum install -y httpd

3.编辑nextcloud配置文件,重启并自启httpd服务

[root@antong ~]#vim /etc/httpd/conf.d/nextcloud.conf
将下面内容写入文件:
<VirtualHost :80>
  DocumentRoot /var/www/html/
  ServerName  127.0.0.1
<Directory "/var/www/html/">
  Require all granted
  AllowOverride All
  Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>
[root@antong ~]#systemctl enable httpd.service
[root@antong ~]#systemctl start httpd.service

4.安装scl软件集,并安装php7.2

[root@antong ~]#yum install -y centos-release-scl
[root@antong ~]#yum install -y rh-php72 rh-php72-php rh-php72-php-gd rh-php72-php-mbstring rh-php72-php-intl rh-php72-php-pecl-apcu rh-php72-php-mysqlnd rh-php72-php-pecl-redis rh-php72-php-opcache rh-php72-php-imagick

5.建立php配置文件链接

[root@antong ~]#ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/
[root@antong ~]#ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php72-php.conf /etc/httpd/conf.modules.d/
[root@antong ~]#ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php72-php7.so /etc/httpd/modules/
[root@antong ~]#ln -s /opt/rh/rh-php72/root/bin/php /usr/bin/php

6.安装数据库并创建数据库

[root@antong ~]#yum install -y mariadb mariadb-server
[root@antong ~]#systemctl enable mariadb.service
[root@antong ~]#systemctl start mariadb.service
[root@antong ~]#mysql -u root -p
CREATE DATABASE nextcloud;
create user nextcloud@localhost identified by '改成自己的密码';
grant all on *.* to 'nextcloud'@'localhost' identified by '上面设置的密码' with grant option;
FLUSH PRIVILEGES;
EXIT
systemctl restart mariadb.service

7.安装nextcloud

[root@antong ~]#wget https://download.nextcloud.com/server/releases/nextcloud-20.0.2.zip
[root@antong ~]#unzip /root/nextcloud-20.0.1.zip -d /var/www/html
[root@antong ~]#mkdir /var/www/html/data
[root@antong ~]#chown -R apache:apache /var/www/html/
[root@antong ~]#systemctl restart httpd.service

8.使用web来使用nextcloud网盘

打开web页面.http://安装这台电脑的IP地址
设置自己的用户名,密码;设置数据库需要点开,选择MySQL/MariaDB.
数据库:nextcloud
用户名:nextcloud
密码:上面设置的密码
安装推荐的应用的勾去掉,国内的网可能安装不上.
点击安装
posted @ 2021-08-26 16:51  殇黯瞳  阅读(110)  评论(0编辑  收藏  举报