1.准备工作
关闭selinux 和防火墙
[root@server ~]# systemctl stop firewalld
[root@server ~]# setenforce 0
2.搭建LAMP环境
[root@server ~]# yum install httpd -y
[root@server ~]# yum install php*
[root@server ~]# yum install mariadb-server -y
[root@server ~]# cd /
使用xftp上传nextcloud-25.0.1.zip 软件压缩包到linux 的根目录,并解压缩
[root@server /]# unzip nextcloud-25.0.1.zip
3.设置nextcloud 安装目录的权限
[root@server /]# cd ~
[root@server ~]# chmod -Rf 777 /nextcloud
4.设置数据库
#启动数据库
[root@server ~]# systemctl start mariadb.service
[root@server ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.5.16-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; #新建数据库
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> create user 'nextcloud'@'localhost' identified by '123456'; #新建用户及对应主机以及密码
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> grant all on nextcloud.* to 'nextcloud'@'localhost'; #设置权限
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> exit #退出
Bye
5.重启数据库
[root@server ~]# systemctl restart mariadb
6.配置http
[root@server ~]# vim /etc/httpd/conf/httpd.conf
#定位第124行开始如下修改:
124 DocumentRoot "/nextcloud"
125
126
127 #
128 # Relax access to content within /var/www.
129 #
130 <Directory "/nextcloud">
131 AllowOverride None
132 # Allow open access:
133 Require all granted
134 </Directory>
7.重启httpd服务
[root@server ~]# systemctl restart httpd
8.打开浏览器输入Linux服务器IP地址,完成安装向导设置
用户名自订
密码:自定 如:123456
存储与数据库:选择 Mysql/MaraiaDB,设置数据库用户、密码、数据库名,必须与第四步对应