有的公有云不靠谱,那就搭建一个私有云
目前来说, ownCloud 是私有云的最佳解决方案。它不仅是开源的,而且个人用户全免费,
1.安装http和数据库
yum install -y httpd mariadb-server mariadb
2.启动http和数据库
systemctl start httpd.service
systemctl enable httpd.service
systemctl start mariadb.service
systemctl enable mariadb.service
3.查看是否安装PHP(最小安装的centos7是没安装PHP的)
rpm -qa|grep php
4.在线升级
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
5.安装包
yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring php56w-gd php56w-pdo php56w-posix
6.看PHP版本
php -v
7.安装bzip2 (因为一会要解压包)
yum -y install bzip2
8.上传owncloud包(我是用Windows自带的cmd,前面文章详细讲解过)
(链接:https://pan.baidu.com/s/1j5PR22tbTlST5FKTWjts5Q
提取码:mlhx
复制这段内容后打开百度网盘手机App,操作更方便哦)
pscp owncloud-10.0.3.tar.bz2 [email protected]:/root
9.解压
tar jxf owncloud-10.0.3.tar.bz2
10.把解压的复制到/var/www/html/
cp -r owncloud/* /var/www/html/
11.给/var/www/html/修改用户和组
chown -R apache:apache /var/www/html/
12.给数据库添加密码
mysqladmin -u root password "yegoo@123"
13.数据库操作
登数据库
mysql -uroot -pyegoo@123
创建owncloud库
create database owncloud;
为用户授权限
CREATE USER 'own'@'localhost' IDENTIFIED BY 'yegoo@123';
让连接软件能登录
grant all privileges on *.* to 'root'@'%' identified by 'yegoo@123' with grant option;
更新配置
flush privileges;
14.创建存储目录
mkdir -p /opt/owncloud/data
15.改用户和组
chown -R apache:apache /opt/owncloud/data
16.关闭防火墙以selinux
systemctl stop firewalld.service
systemctl disable firewalld.service
vi /etc/sysconfig/selinux
SELINUX=enforcing改成SELINUX=disabled
source /etc/sysconfig/selinux
可以重启一下系统reboot
之后在谷歌或火狐里输入ip
点击存储---数据目录改为/opt/owncloud/data-----My SQL/MaeiaDB
上面点击安装完成,会让你登录,就会出现下图
上传的都在下面目录里
/opt/owncloud/data/yzy/files/owncloud