本文已参与「新人创作礼」活动,一起开启掘金创作之路。
CentOS7下搭建Nextcloud13.0.5
CentOS7下搭建Nextcloud13.0.5
Centos7下搭建nextcloud 使用centos7.5 版本号是 1804 Gnome方式安装 主机名 test 注意:以下操作均在root权限下进行
待会会用到的压缩包
Nextcloud13.0.5:链接:pan.baidu.com/s/1-uR0eS4v… 提取码:we50 phpMyAdmin4.8.3:链接:pan.baidu.com/s/1Umt3B72K… 提取码:5a2f
先修改自己的ip地址 修改成为静态的,修改方法www.baidu.com 静态ip地址。根据自己的虚拟网卡更换
重启网卡 systemctl retart network.service
查看SSH rpm -qa | grep ssh 出现如下结果: openssh-server-6.6.1p1-12.el7_1.x86_64 openssh-clients-6.6.1p1-12.el7_1.x86_64 libssh2-1.4.3-8.el7.x86_64 openssh-6.6.1p1-12.el7_1.x86_64
如果有。但是未启动 启动ssh服务 #systemctl start sshd 设置开机自启 #systemctl enable sshd 如果没有,则需要安装 [root@test /]# yum -y install openssh-server 第二步
开启 SSH 服务
[root@test ~]# service sshd start 反馈如下 Redirecting to /bin/systemctl start sshd.service
设置开机启动 systemctl enable sshd
首先安装一个Apache服务器
yum -y install httpd
启动Apache服务 systemctl start httpd
#firewall-cmd --zone=public --add-port=80/tcp
关闭防火墙 systemctl disable firewalld.service
设置为开机启动 systemctl enable httpd
安装PHP
在centos7通过yum安装PHP7,首先在终端运行: 需要先安装epel-release。
1.安装epel-release 通过命令: yum -y install epel-release 成功安装。 2.安装PHP7 终端运行如下命令: rpm -Uvh mirror.webtatic.com/yum/el7/web… 成功获取PHP7的yum源,然后再执行: yum install php70w 3.验证安装 终端命令:php –v
安装apache组件 #yum -y install php70w-mbstring php70w-mysql
重启apache服务
systemctl restart httpd
安装数据库,选用Mysql #yum -y install mariadb-server.x86_64
启动MySQL #systemctl start mariadb
设置为开机自启 systemctl enable mariad
设置mariadb密码 mysql_secure_installation 出现如下信息: Enter current password for root (enter for none):回车即可 Set root password? [Y/n]: Y New password: Re-enter new password: Remove anonymous users? [Y/n]: Y Disallow root login remotely? [Y/n]: Y Remove test database and access to it? [Y/n]: Y Reload privilege tables now? [Y/n]: Y
基础的环境搭建完毕开始安装nextcloud
使用filezilla客户端将文章之前列出的2个压缩包文件,上载到你的虚拟机上的 /var/www/html/文件夹下面
上载完成后
先进入/var/www/html Cd /var/www/html 在/var/www/html中解压缩你的2个包
#unzip nextcloud13.0.2.zip #unzip phpMyAdmin-4.8.3-all-languages
更改nextcloud的组,用户 #chown apache:apache nextcloud
更改nextcloud的权限
#chmod 777 nextcloud -Rf
在上面这部分进行赋予权限时,如果是770就可能会导致内部服务器错误,使用我们需要修改为777
安装apache组件 #yum -y install php70w-dom php70w-gd
重启apache服务 #systemctl restart httpd
临时关闭SELinux。可以输入setenforce 0
永久禁用SELinux。vim /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
reboot重启
主机进入如下的链接
进入nextcloud设置界面 http://你的虚拟机IP地址/nextcloud/index.php
进入phpMyAdmin在主机浏览器中输入如下地址 http://你的虚拟机IP地址/phpMyAdmin/index.php