赞
踩
最小化安装的centos7
这里首先是进入/etc/sysconfig/network-scripts中查看现有的配置文件:
# cd /etc/sysconfig/network-scripts
找到需要修改的网卡,改成静态IP,作为服务器要使用静态IP,测试用DHCP即可
这里说一下需要修改的位置:
#修改
BOOTPROTO=static #这里讲dhcp换成static
ONBOOT=yes #将no换成yes
#新增
IPADDR=xxx.xxx.xxx.xxx #静态IP
GATEWAY=xxx.xxx.xxx.xxx#默认网关
NETMASK=255.255.255.0 #子网掩码
DNS1=xxx.xxx.xxx.xxx
DNS2=xxx.xxx.xxx.xxx
systemctl retart network.service
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
[root@localhost /]# yum install openssh-server
第二步
[root@localhost ~]# service sshd start
Redirecting to /bin/systemctl start sshd.service
设置开机启动
systemctl enable sshd
然后跟着我一起输入命令吧 首先我们要安装一个Apache服务器
yum install httpd
# systemctl start httpd 然后输入 来启动Apache服务
# firewall-cmd --zone=public --add-port=80/tcp刷新浏览器,可以看到页面,证明成功
关闭防火墙systemctl disable firewalld.service
systemctl enable httpd开机启动
安装PHP
在centos7通过yum安装PHP7,首先在终端运行:
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
提示错误:
error: Failed dependencies:
epel-release >= 7 is needed by webtatic-release-7-3.noarch
需要先安装epel-release。
1.安装epel-release
通过命令:
yum -y install epel-release
成功安装。
2.安装PHP7
终端再次运行如下命令:
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
成功获取PHP7的yum源,然后再执行:
yum install php70w
这样就大功告成了。
3.验证安装
终端命令:php –v
如果还是显示不出来的话
安装yum install php70w-mbstring php70w-mysql
systemctl restart httpd
接着我们安装数据库,数据库当然选用Mysql了
# yum install mariadb-server.x86_64
# systemctl start mariadb
systemctl enable mariadb开机启动
现在基础的环境搭建完毕了可以安装nextcloud了
上传程序包到服务器 我这里使用FIleZilla这个软件
打开FileZilla,点击 “文件-》站点管理器-》新站点 然后里面输入你的外网IP 端口是22 协议是SFTP 账号是 root 密码是你的root密码 点击连接
然后把下载下来的ZIP文件放到/var/www/html/文件夹下面
yum install -y unzip zip
unzip 进行解压
mv phpMyAdmin-4.6.3-all-languages phpMyAdmin
进入
http://10.0.0.3/nextcloud/index.php
如果什么都不显示
# cd /var/www/html
# chown apache nextcloud -Rf
# chmod 770 nextcloud -Rf
# yum install php70w-dom php70w-gd
# systemctl restart httpd
依然解决不了,使用nextcloud-11.0.7.zip
放弃使用nextcloud-12.0.10.zip
出现
httpd 没有写权限
临时关闭SELinux。如果你仅仅只是想临时关闭,可以输入setenforce 0
永久禁用SELinux。vi /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
mysqladmin -u root password '你的密码'
创建
admin
你的密码
修改默认存储位置,这里存储用到了另一块磁盘,所以需要修改下,还要挂载新的磁盘
查看磁盘fdisk –l
进入根目录cd /
mkdir nextcloudFile
根据盘符进行修改
mount -t ext4 /dev/sdc /nextcloudFile/
也可以把磁盘格式化
mkfs -t ext4 /dev/sdb
vi /etc/fstab
/dev/sdc /nextcloudFile ext4 defaults 0 0
mount -a
vi /var/www/nextcloud/config/config.php
修改文件目录
/nextcloudFile
移动文件
mv /var/www/html/nextcloud/data/{.,}* /nextcloudFile
加权限
chown apache /nextcloudFile -Rf
chmod 0770 /nextcloudFile/
重启服务
systemctl restart httpd
是因为之间加权限加错了文件夹,改正即可
chown apache /nextcloudFile -Rf
安装Nextcloud-2.3.3.1-setup
一直下一步,安装完运行
修改默认域名
重启服务
systemctl restart httpd
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。