分享

CentOS6下通过OwnCloud搭建个人云盘

 zugexin 2017-09-28

OwnCloud简介

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

环境

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

搭建步骤

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

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

2.安装epel 存储库

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

3.安装PHP7

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

3.1

#wget https://dl./pub/epel/epel-release-latest-6.noarch.rpm
#wget http://rpms./enterprise/remi-release-6.rpm
#rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm
  • 1
  • 2
  • 3

3.2

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

得到结果

[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 =
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

3.3

#yum update
  • 1

3.4

#remi-php70 
  • 1

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

4.安装OwnCloud

#yum install owncloud
  • 1

5.安装依赖库httpd

#yum install httpd
  • 1

6.配置自启动

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

7.网络配置

#setup
  • 1

选择FireWall Configuration
这里写图片描述

若选择失败并弹出错误
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
  • 1
  • 2

解决

成功进入后如图配置
这里写图片描述

这里写图片描述

8.mysql配置

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

#yum install mysql-server
#chkconfig --levels 235 mysqld on
#/etc/init.d/mysqld start
#mysql_secure_installation
  • 1
  • 2
  • 3
  • 4

8.2创建owncloud数据库

在登录后

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

9.在浏览器中访问owncloud

访问地址为

服务器IP/owncloud
  • 1

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

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
  • 1
  • 2
  • 3
  • 4

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

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

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

#vi owncloud-auth-local.inc
  • 1

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

<IfModule mod_authz_core.c>
# Apache 2.4
Require local
#Allow from all
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from all
#Allow from 127.0.0.1
#Allow from ::1
Allow from all
</IfModule>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

最后重新启动httpd

#service httpd restart
  • 1

10.成功浏览
这里写图片描述

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

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多