Lamp+nextcloud搭建的,Lamp搭建请看上篇:https://blog.csdn.net/qq_41709494/article/details/89430834
1.能ping通百度
[root@localhost ~]# ping www.baidu.com -c 4
PING www.a.shifen.com (14.215.177.38) 56(84) bytes of data.
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=128 time=10.2 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=128 time=11.0 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=3 ttl=128 time=16.7 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=4 ttl=128 time=13.2 ms
--- www.a.shifen.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3010ms
rtt min/avg/max/mdev = 10.290/12.840/16.705/2.492 ms
2.关闭防火墙和网络管理,还有关闭selinux安全
[root@localhost ~]# systemctl stop NetworkManager #关闭网络管理
[root@localhost ~]# systemctl stop firewalld #关闭防火墙
[root@localhost ~]# systemctl disable NetworkManager #关闭开机自动开启网络管理
[root@localhost ~]# systemctl disable firewalld #关闭开机自动开启防火墙
[root@localhost ~]# vi /etc/selinux/config #编辑selinux安全永久关闭
... #省略内容
SELINUX=permissive
... #省略内容
[root@localhost ~]# setenforce #设置临时关闭selinux安全
usage: setenforce [ Enforcing | Permissive | 1 | 0 ] # 1代表开启 | 0代表关闭
[root@localhost ~]# setenforce 0 #设置临时关闭seliux安全
[root@localhost ~]# getenforce #查看seliux安全的状态
Permissive #显示关闭状态
3. 挂载光盘和设置光盘,设置本地yum源,检测能否用yum源,注意:设置永久挂载光盘错误了,会导致开机崩盘;解决方法:请看上一篇:https://blog.csdn.net/qq_41709494/article/details/89071839
[root@localhost ~]# mkdir /opt/bao/ #创建目录bao
[root@localhost ~]# mount /dev/sr0 /opt/bao/ #临时挂载光盘
[root@localhost ~]# vi /etc/fstab #设置永久挂载光盘
...
/dev/sr0 /opt/bao iso9660 defaults 0 0 #在最后添加,注意:不要乱动其他的
[root@localhost ~]# vi /etc/yum.repos.d/local.repo #编辑本地yum源
[bao]
name=bao #名称
baseurl=file:///opt/bao #文件路径
gpgcheck=0 #0为不检查gpg-key,1为检查gpg-key
enabled=1 #激活开启
[root@localhost ~]# ls -lh /etc/yum.repos.d/local.repo #查看是否编辑好
-rw-r--r--. 1 root root 60 4月 24 22:19 /etc/yum.repos.d/local.repo
[root@localhost ~]# yum list #查看能否加载yum源
4. Lamp塔建请看上篇:https://blog.csdn.net/qq_41709494/article/details/89430834,为了方便就不再写一次了
5.安装旧的nextcloud为了解决依赖包的麻烦,安装前改下yum源配置,防止依赖包安装错误
[root@localhost ~]# vi /etc/yum.repos.d/local.repo
[bao]
name=bao
baseurl=file:///opt/bao
gpgcheck=0
enabled=1
[epel] #额外rpm包
name=epel
baseurl=http://mirrors.aliyun.com/epel/7/x86_64/
gpgcheck=0
enabled=1
[php73] #php7.3rpm包
name=php73
baseurl=https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/7/safe/x86_64/
gpgcheck=0
enabled=1
[php73extend] #php7.3rpm扩展包
name=php73extend
baseurl=http://mirrors.aliyun.com/remi/enterprise/7/php73/x86_64/
gpgcheck=0
enabled=1
[root@localhost ~]# yum install php
rpm -ivh epel-release-latest-7.noarch.rpm #安装epel额外包的yum配置
rpm -ivh remi-release-7.rpm #安装php的yum配置
[root@localhost 7]# yum install nextcloud
依赖关系解决
==============================================================================================================
Package 架构 版本 源 大小
==============================================================================================================
正在安装:
nextcloud noarch 10.0.4-2.el7 epel 28 M
为依赖而安装:
gd-last x86_64 2.2.5-8.el7.remi remi-safe 134 k
libicu62 x86_64 62.1-3.el7.remi remi-safe 8.8 M
libmcrypt x86_64 2.5.8-13.el7 epel 99 k
libwebp7 x86_64 1.0.2-1.el7.remi remi-safe 265 k
libzip5 x86_64 1.5.2-1.el7.remi remi-safe 56 k
nextcloud-httpd noarch 10.0.4-2.el7 epel 7.7 k
nextcloud-mysql noarch 10.0.4-2.el7 epel 5.8 k
php-PHPParser noarch 1.4.1-1.el7 epel 114 k
php-PsrLog noarch 1.1.0-1.el7 epel 13 k
php-aws-sdk noarch 2.8.31-1.el7 epel 574 k
php-bantu-ini-get-wrapper noarch 1.0.1-1.el7 epel 6.7 k
php-bcmath x86_64 7.3.4-1.el7.remi php73 71 k
php-channel-dropbox-php noarch 1.3-5.el7 epel 4.6 k
php-doctrine-annotations noarch 1.2.7-4.el7 epel 28 k
php-doctrine-cache noarch 1.5.4-1.el7 epel 23 k
php-doctrine-collections noarch 1.3.0-2.el7 epel 17 k
php-doctrine-common noarch 2.5.3-3.el7 epel 51 k
php-doctrine-dbal noarch 2.5.12-1.el7 epel 208 k
php-doctrine-inflector noarch 1.1.0-4.el7 epel 12 k
php-doctrine-lexer noarch 1.0.1-8.el7 epel 9.8 k
php-dropbox-php-Dropbox noarch 1.0.0-6.el7 epel 20 k
php-fedora-autoloader noarch 1.0.0-1.el7 epel 9.6 k
php-gd x86_64 7.3.4-1.el7.remi php73 79 k
php-gmp x86_64 7.3.4-1.el7.remi php73 70 k
php-google-apiclient noarch 2:1.1.7-2.el7 epel 521 k
php-guzzle-Guzzle noarch 3.9.3-11.el7 epel 207 k
php-guzzlehttp-guzzle noarch 5.3.2-2.el7 epel 104 k
php-guzzlehttp-ringphp noarch 1.1.0-9.el7 epel 28 k
php-guzzlehttp-streams noarch 3.0.0-9.el7 epel 25 k
php-icewind-smb noarch 1.1.2-1.el7 epel 24 k
php-icewind-streams noarch 0.5.2-1.el7 epel 13 k
php-interfasys-lognormalizer noarch 1.0-1.el7 epel 20 k
php-intl x86_64 7.3.4-1.el7.remi php73 222 k
php-jeremeamia-superclosure noarch 2.1.0-1.el7 epel 20 k
php-ldap x86_64 7.3.4-1.el7.remi php73 77 k
php-league-flysystem noarch 1.0.28-1.el7 epel 35 k
php-lukasreschke-id3parser noarch 0.0.3-1.el7 epel 56 k
php-mbstring x86_64 7.3.4-1.el7.remi php73 650 k
php-mcnetic-zipstreamer noarch 1:1.0-1.el7 epel 28 k
php-mysqlnd x86_64 7.3.4-1.el7.remi php73 231 k
php-natxet-cssmin noarch 3.0.4-1.el7 epel 27 k
php-onelogin-php-saml noarch 2.10.5-1.el7 epel 73 k
php-opencloud noarch 1.12.2-1.el7 epel 158 k
php-owncloud-tarstreamer noarch 0.1.1-1.el7 epel 9.5 k
php-paragonie-random-compat noarch 2.0.12-1.el7 epel 26 k
php-password-compat noarch 1.0.4-1.el7 epel 10 k
php-patchwork-jsqueeze noarch 2.0.5-1.el7 epel 25 k
php-patchwork-utf8 noarch 1.3.1-3.el7 epel 396 k
php-pdo x86_64 7.3.4-1.el7.remi php73 125 k
php-pear noarch 1:1.10.9-2.el7.remi php73 359 k
php-pear-Auth-SASL noarch 1.0.6-5.el7 epel 16 k
php-pear-Cache-Lite noarch 1.7.16-1.el7 epel 44 k
php-pear-DB noarch 1.7.14-6.el7 epel 106 k
php-pear-HTTP-OAuth noarch 0.3.2-1.el7 epel 68 k
php-pear-HTTP-Request2 noarch 2.2.1-1.el7 epel 112 k
php-pear-Log noarch 1.12.8-1.el7 epel 58 k
php-pear-MDB2 noarch 2.5.0-0.9.b5.el7 epel 125 k
php-pear-Mail noarch 1.3.0-1.el7 epel 30 k
php-pear-Net-SMTP noarch 1.7.3-1.el7 epel 24 k
php-pear-Net-Socket noarch 1.0.14-1.el7 epel 13 k
php-pear-Net-URL2 noarch 2.1.2-1.el7 epel 26 k
php-pecl-http x86_64 3.2.0-4.el7.remi.7.3 php73 221 k
php-pecl-mcrypt x86_64 1.0.2-2.el7.remi.7.3 php73 29 k
php-pecl-oauth x86_64 2.0.3-1.el7.remi.7.3 php73 69 k
php-pecl-propro x86_64 2.1.0-3.el7.remi.7.3 php73 31 k
php-pecl-raphf x86_64 2.0.0-7.el7.remi.7.3 php73 26 k
php-pecl-zip x86_64 1.15.4-1.el7.remi.7.3 php73 51 k
php-phpseclib noarch 2.0.15-1.el7 epel 212 k
php-pimple-lib noarch 3.0.2-1.el7 epel 11 k
php-process x86_64 7.3.4-1.el7.remi php73 80 k
php-punic noarch 1.6.5-1.el7 epel 795 k
php-react-promise noarch 2.5.0-1.el7 epel 20 k
php-robrichards-xmlseclibs1 noarch 1.4.2-1.el7 epel 23 k
php-sabre-dav noarch 3.0.9-1.el7 epel 285 k
php-sabre-event noarch 2.0.2-1.el7 epel 12 k
php-sabre-http noarch 4.2.4-1.el7 epel 37 k
php-sabre-uri noarch 1.1.1-1.el7 epel 11 k
php-sabre-vobject noarch 3.5.3-1.el7 epel 95 k
php-sabre-xml noarch 1.4.2-1.el7 epel 24 k
php-smbclient x86_64 0.9.0-7.el7.remi.7.3 php73 43 k
php-swiftmailer noarch 5.4.12-1.el7 epel 168 k
php-symfony-browser-kit noarch 2.8.12-2.el7 epel 23 k
php-symfony-class-loader noarch 2.8.12-2.el7 epel 26 k
php-symfony-common noarch 2.8.12-2.el7 epel 124 k
php-symfony-config noarch 2.8.12-2.el7 epel 51 k
php-symfony-console noarch 2.8.12-2.el7 epel 88 k
php-symfony-css-selector noarch 2.8.12-2.el7 epel 37 k
php-symfony-debug noarch 2.8.12-2.el7 epel 36 k
php-symfony-dependency-injection noarch 2.8.12-2.el7 epel 83 k
php-symfony-dom-crawler noarch 2.8.12-2.el7 epel 30 k
php-symfony-event-dispatcher noarch 2.8.12-2.el7 epel 24 k
php-symfony-expression-language noarch 2.8.12-2.el7 epel 27 k
php-symfony-filesystem noarch 2.8.12-2.el7 epel 22 k
php-symfony-finder noarch 2.8.12-2.el7 epel 38 k
php-symfony-http-foundation noarch 2.8.12-2.el7 epel 93 k
php-symfony-http-kernel noarch 2.8.12-2.el7 epel 99 k
php-symfony-polyfill noarch 1.5.0-1.el7 epel 26 k
php-symfony-process noarch 2.8.12-2.el7 epel 32 k
php-symfony-routing noarch 2.8.12-2.el7 epel 59 k
php-symfony-var-dumper noarch 2.8.12-2.el7 epel 48 k
php-symfony-yaml noarch 2.8.12-2.el7 epel 28 k
php-xml x86_64 7.3.4-1.el7.remi php73 205 k
pytalloc x86_64 2.1.9-1.el7 bao 16 k
samba-client x86_64 4.6.2-8.el7 bao 597 k
samba-common-libs x86_64 4.6.2-8.el7 bao 164 k
samba-common-tools x86_64 4.6.2-8.el7 bao 456 k
samba-libs x86_64 4.6.2-8.el7 bao 264 k
事务概要
==============================================================================================================
安装 1 软件包 (+107 依赖软件包)
6.安装新版本的nextcloud,源包nextcloud安装和移动nextcloud到apache根目录 ,赋予权限和修改目录的用户和用户组
[root@localhost ~]# yum remove nextcloud #删除nextcloud旧版本
[root@localhost ~]# rz #用Xshell的rz上传最新版本的nextcloud-15.0.7.zip
[root@localhost ~]# ls -lh nextcloud-15.0.7.zip #查看是否上传成功
-rw-r--r--. 1 root root 70M 4月 22 22:04 nextcloud-15.0.7.zip
[root@localhost ~]# yum install unzip #安装zip解包,本机带有就不必安装了
[root@localhost ~]# unzip nextcloud-15.0.7.zip #解压缩包
[root@localhost ~]# mv /root/nextcloud /var/www/html/ #移动nextcloud 到apache的根目录下/var/www/html/
[root@localhost ~]# ls -lh /var/www/html/ #查看移动是否成功
总用量 4.0K
drwxr-xr-x. 12 root root 4.0K 4月 25 00:07 nextcloud
[root@localhost ~]#chmod -R 775 /var/www/html/nextcloud #赋予权限
[root@localhost ~]#chown -R apache:apache /var/www/html/nextcloud #更改所属用户和所属用户组
6-1. 到nextcloud官网下载源包
http://nextcloud.com/install/#instructions-server
7.编辑apache配置并重启
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf #编辑apache配置
...
DocumentRoot /var/www/html 改为:DocumentRoot "/var/www/html/nextcloud"
...
#Further relax access to the default document root:
改为:
...
[root@localhost ~]# systemctl restart httpd #重新启动apache,改完配置一定要重启
8.打开浏览器输入IP地址
9.为nextcloud创建数据库,创建用户设置密码并授权
[root@localhost ~]# mysql -u root -p123456 #登录数据库
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, 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 default charset 'utf8'; #创建数据库并设置字符集为utf-8
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> show databases; #查看数据库
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| nextcloud |
| performance_schema |
+--------------------+
4 rows in set (0.07 sec)
MariaDB [(none)]> grant all on nextcloud.* to 'nextcloud'@'localhost' identified by '123456'; #创建nextcloud用户和设置密码123456并授权
Query OK, 0 rows affected (0.07 sec)
MariaDB [(none)]> flush privileges; #刷新权限
Query OK, 0 rows affected (0.00 sec)
10.创建管理员账号,输入数据库用户和密码
10-1.出现了要安装额外的php 模块的问题
[root@localhost ~]# yum install php-mysqlnd #mysql和mariadb的php额外模块
[root@localhost ~]# systemctl restart httpd #重启apache才能显示效果
10-2.如图就成功出现了mariadb
11.创建管理员账号和输入数据库用户、数据库密码、数据库名,就等待创建进入管里界面
12.可以安装客户端实行文件同步,安装客户端地址:http://nextcloud.com/install/#install-clients
12.上传文件成功,搭建nextcloud就完成了