1. 程式人生 > >Centos7 - ownCloud 私有雲盤搭建 (LAMP環境)

Centos7 - ownCloud 私有雲盤搭建 (LAMP環境)

-- common 技術分享 databases 搭建lamp環境 inf set sql 進行

1、首先搭建LAMP環境
使用YUM安裝LAMP環境,具體參數如下:
.
.
[root@910 ~]# yum install httpd php php-mysql mariadb-server mariadb sqlite php-dom php-mbstring php-gd php-pdo
.
.
.
技術分享圖片
.
.
關閉selinux,清空iptables,firewalld防火墻放行相關服務
技術分享圖片
.
.
技術分享圖片
.
.
.
默認安裝的PHP是5.4版本,需要升級到5.6版本
技術分享圖片
.
.
.
升級PHP:
1)首先添加PHP5.6倉庫源
如果倉庫源添加失敗,使用以下方式:
卸載epel-release-latest-7.noarch.rpm
yum remove epel-release
清空epel目錄 : rm -rf /var/cache/yum/x86_64/6/epel/*
重新安裝源:rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
**添加源****
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
.
.
2)刪除舊版php
yum remove php-common
.
.
3)安裝5.6版本php
[root@910 yum.repos.d]# yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring
技術分享圖片

技術分享圖片

2、安裝owncloud
1)導入owncloud rpm包的密鑰
rpm --import https://download.owncloud.org/download/repositories/stable/CentOS_7/repodata/repomd.xml.key
2)添加owncloud 倉庫源
curl -L https://download.owncloud.org/download/repositories/stable/CentOS_7/ce:stable.repo -o /etc/yum.repos.d/ownCloud.repo
3)清空本地源緩存,使添加的源生效
yum clean expire-cache

4)安裝owncloud
yum install -y owncloud

3、數據庫配置
[root@910 yum.repos.d]# mysql
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+

將所有空密碼的用戶刪除,重新添加用戶和密碼

MariaDB [mysql]> select user,password from mysql.user;
+------+----------+
user password
+------+----------+
root
root
root
root

+------+----------+
6 rows in set (0.00 sec)

MariaDB [mysql]> select user,password from mysql.user;
+------+----------+
user password
+------+----------+

+------+----------+

MariaDB [mysql]> grant all on . to ‘root‘@‘localhost‘ identified by ‘密碼‘;
MariaDB [mysql]> grant all on . to ‘owncloud‘@‘localhost‘ identified by ‘密碼‘;
MariaDB [mysql]> flush privileges;

創建owncloud數據庫
MariaDB [(none)]> create database owncloud;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| owncloud |
| performance_schema |
+--------------------+

MariaDB [(none)]> exit;

4、訪問owncloud在web端進行owncloud配置 http://localhost/owncloud/index.php
技術分享圖片

技術分享圖片

Centos7 - ownCloud 私有雲盤搭建 (LAMP環境)