CentOS6下通过OwnCloud搭建个人云盘

OwnCloud简介

OwnCloud是一个开源的个人云储存方案,我们利用这一套解决方案可以在自己的服务器上搭建属于自己的云盘系统。
OwnCloud具有配套的网站客户端,PC客户端以及手机客户端可以让用户方便的管理云盘文件

环境

1.服务器CentOS 6.5,且处于公网内
2.OwnCloud版本为9.1.4

搭建步骤

1.下载与ownCloud软件相关联的发布密钥

#cd /etc/yum.repos.d/
#wget http://download.opensuse.org/repositories/isv:ownCloud:community/CentOS_CentOS-6/isv:ownCloud:community.repo

2.安装epel 存储库

#rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

3.安装PHP7

在安装OwnCloud9前,由于其要求的PHP版本为7.0以上,而CentOS6.5中yum的php只有5.3版本,所以需要手动下载PHP7.0
php的版本通过
#php -v
查看

3.1

#wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
#wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
#rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm

3.2

#yum-config-manager --enable remi-php70

得到结果

[remi-php70]
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/6
baseurl =
cache = 0
cachedir = /var/cache/yum/x86_64/6/remi-php70
cost = 1000
enabled = True
enablegroups = True
exclude =
failovermethod = priority
gpgcadir = /var/lib/yum/repos/x86_64/6/remi-php70/gpgcadir
gpgcakey =

3.3

#yum update

3.4

#remi-php70 

再次查看版本可发现已安装php7

4.安装OwnCloud

#yum install owncloud

5.安装依赖库httpd

#yum install httpd

6.配置自启动

#chkconfig --levels 235 httpd on
#/etc/init.d/httpd start

7.网络配置

#setup

选择FireWall Configuration
CentOS6下通过OwnCloud搭建个人云盘_第1张图片

若选择失败并弹出错误
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
则通过

# service messagebus start
# chkconfig messagebus on

解决

成功进入后如图配置
CentOS6下通过OwnCloud搭建个人云盘_第2张图片

CentOS6下通过OwnCloud搭建个人云盘_第3张图片

8.mysql配置

8.1下载并设置自启动,启动服务,配置安全设置

#yum install mysql-server
#chkconfig --levels 235 mysqld on
#/etc/init.d/mysqld start
#mysql_secure_installation

8.2创建owncloud数据库

在登录后

CREATE DATABASE owncloud;
GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'database_password';

9.在浏览器中访问owncloud

访问地址为

服务器IP/owncloud

此时若无法访问并提示错误类似

Forbidden

You don't have permission to access / on this server.
Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.6 with Suhosin-Patch Server at xxx.xx.xxx..x Port 80

则是因为不在本地没有访问权限,需要到httpd配置文件中修改权限
移动到配置文件夹

#cd /etc/httpd/conf.d/owncloud.conf

对owncloud-auth-local.inc文件进行修改

#vi owncloud-auth-local.inc

owncloud-auth-local.inc文件,只要在对应版本的位置修改规则为Allow 则可在远程登录此服务器的owncloud


# Apache 2.4
Require local
#Allow from all


# Apache 2.2
Order Deny,Allow
Deny from all
#Allow from 127.0.0.1
#Allow from ::1
Allow from all

最后重新启动httpd

#service httpd restart

10.成功浏览
CentOS6下通过OwnCloud搭建个人云盘_第4张图片

引用
1.How To Install ownCloud 7 on CentOS 6.5
https://www.howtoforge.com/how-to-install-owncloud_7-on-centos_6.5
2.Upgrading to PHP 7
https://www.centos.org/forums/viewtopic.php?t=57338
3.CentOS 6 安装setup 工具包
https://idoseek.com/1890

你可能感兴趣的:(CentOS6下通过OwnCloud搭建个人云盘)