环境
| Nextcloud安装包 | https://download.nextcloud.com/server/releases/nextcloud-20.0.2.zip | |
|---|---|---|
1,关闭防火墙
//临时关闭防火墙#systemctl stop firewalld#systemctl disable firewalld//#setenforce 0//sed -i '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config
2.解决一些依赖问题
//安装依赖# yum install -y epel-release yum-utils unzip curl wget bash-completion policycoreutils-python mlocate bzip2# yum update -y# yum install -y httpd
3,安装Apache Web服务并配置
//安装Apache Web服务# yum install -y httpd编写Nextcloud的配置文件#vim /etc/httpd/conf.d/nextcloud.conf将下面内容写入文件:<VirtualHost *:80>DocumentRoot /var/www/html/ServerName 127.0.0.1<Directory "/var/www/html/">Require all grantedAllowOverride AllOptions FollowSymLinks MultiViews</Directory></VirtualHost>//设置web服务器开机自启并手动运行#systemctl enable httpd.service#systemctl start httpd.service
4,安装PHP
//安装PHP模块1、# yum install -y centos-release-scl2、# 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//创建一些必要的链接3、# ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/4、# ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php72-php.conf /etc/httpd/conf.modules.d/5、# ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php72-php7.so /etc/httpd/modules/6、# ln -s /opt/rh/rh-php72/root/bin/php /usr/bin/php
5,安装数据库并创库
//安装数据库1、# yum install -y mariadb mariadb-server设置数据库开机自启并手动运行2、# systemctl enable mariadb.service3、# systemctl start mariadb.servicemysql_secure_installation//进入MySQL4、# 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//重启MySQL服务5、systemctl restart mariadb.service
6.下载NextCloud并配置
1、# wget https://download.nextcloud.com/server/releases/nextcloud-20.0.2.zip// 如果上面的失效了就下载源码包https://download.nextcloud.com/server/releases/nextcloud-20.0.2.zip2、# unzip /root/nextcloud-20.0.1.zip -d /var/www/html7、# mkdir /var/www/html/data8、# chown -R apache:apache /var/www/html/9、# systemctl restart httpd.service
7.在物理机上打开搭建好的NextCloud云盘。
1、打开web页面.http://安装这台电脑的IP地址/nextcloud
2、设置自己的用户名,密码;设置数据库需要点开,选择MySQL/MariaDB.
3、数据库:nextcloud
4、用户名:nextcloud
5、密码:上面设置的密码
6、安装推荐的应用的勾去掉,国内的网可能安装不上.
7、点击安装
