OwnCloud是一个开源的个人云储存方案,我们利用这一套解决方案可以在自己的服务器上搭建属于自己的云盘系统。
OwnCloud具有配套的网站客户端,PC客户端以及手机客户端可以让用户方便的管理云盘文件
1.服务器CentOS 6.5,且处于公网内
2.OwnCloud版本为9.1.4
#cd /etc/yum.repos.d/#wget http://download.opensuse.org/repositories/isv:ownCloud:community/CentOS_CentOS-6/isv:ownCloud:community.repo
#rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
在安装OwnCloud9前,由于其要求的PHP版本为7.0以上,而CentOS6.5中yum的php只有5.3版本,所以需要手动下载PHP7.0
php的版本通过 #php -v
查看
#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
#yum-config-manager --enable remi-php70
得到结果
[remi-php70]bandwidth = 0base_persistdir = /var/lib/yum/repos/x86_64/6baseurl =cache = 0cachedir = /var/cache/yum/x86_64/6/remi-php70cost = 1000enabled = Trueenablegroups = Trueexclude =failovermethod = prioritygpgcadir = /var/lib/yum/repos/x86_64/6/remi-php70/gpgcadirgpgcakey =
#yum update
#remi-php70
再次查看版本可发现已安装php7
#yum install owncloud
#yum install httpd
#chkconfig --levels 235 httpd on#/etc/init.d/httpd start
#setup
选择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
解决
成功进入后如图配置
#yum install mysql-server#chkconfig --levels 235 mysqld on#/etc/init.d/mysqld start#mysql_secure_installation
在登录后
CREATE DATABASE owncloud;GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'database_password';
访问地址为
服务器IP/owncloud
此时若无法访问并提示错误类似
ForbiddenYou 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
<IfModule mod_authz_core.c># Apache 2.4Require local#Allow from all</IfModule><IfModule !mod_authz_core.c># Apache 2.2Order Deny,AllowDeny from all#Allow from 127.0.0.1#Allow from ::1Allow from all</IfModule>
最后重新启动httpd
#service httpd restart
10.成功浏览
引用
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
联系客服