centos7上owncloud搭建私有云

 

首先介绍一下ownCloud,ownCloud是一个自由且开源的个人云存储解决方案。注意一下这是一个开源的,最早由KDE开发者Frank Karlitschek于2010年一月创建,目标是成为商业云服务提供商的替代。与商业云存储服务不同,ownCloud可以自由获取无需付费;它可以被安装在个人服务器上,用户拥有控制和修改的权利。

 

首先我们还是做服务之前先把奇葩的防火墙给关掉

iptables -F

iptables -X

iptables -Z

setenforce 0

owncloud主要是由用php进行开发的,所以当然我们需要在linux上先搭建LAMP了,也就是linux+apache+mysql+php。(不得不说php和mysql是最合适的一对了...)

在shell下用下面语句即可一条语句安装全部:

我们首先部署一下LZMP架构(此应用要跑在LMAP架构或LNMP架构)

 

 (默认CentOS 7 的yum 是安装5.4,如需其他版本的另外下载安装即可)

 ownCloud所用PHP须5.6或以上才行,先安装非官方源。

[root@1 ~]# yum -y install epel-release

[root@1 ~]#  rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

[root@1 ~]#  yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php56-php-gd php56-php-fpm php-gd

安装apache服务

[root@1 ~]# yum install httpd*

安装Mariadb 数据库。

[root@1 ~]# yum  install mariadb*

然后我们启动一下服务

使用下面的命令启动Apache:

[root@1 ~]# systemctl start httpd
通过此命令启动MariaDB:

[root@1 ~]# systemctl start mariadb

 

在搭建好的lamp上部署owncloud环境,由于我在本地已经这个是已经下好的包owncloud-10.0.4,所以我通过Xshell上面的Xftp把压缩包直接放进去。

然后我们用unzip把包给解压

[root@1 ~]# unzip owncloud-10.0.4.zip

我们需要拷贝包内的软件到指定网页目录下

[root@1 ~]# cp -r owncloud/* /var/www/html/


为Web服务器上文件目录设置读写权限:修改权限为Apache用户

[root@1 ~]# chown -R apache.apache /var/www/html/

 

或者我们可以从官方网站下载owncloud。运行以下命令(也可以下载其他版本):

wgethttps://download.owncloud.org/community/ owncloud-10.0.9.tar.bz2

解压文件:

tar -jxvf owncloud-7.0.0.tar.bz2 -C/var/www/html/

 

创建一个数据库

root@1 ~]# mysqladmin -u root password "000000"

登陆数据库

[root@1 ~]# mysql -u root -p

Enter password:

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 3

Server version: 5.5.60-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> creat database owncloud;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'creat database owncloud' at line 1

MariaDB [(none)]> exit

Bye

最后重启一下机器。

[root@1 ~]# reboot

 

猜你喜欢

转载自blog.csdn.net/VickHUC/article/details/82709729
今日推荐