centos7搭建owncloud私有云

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群版 2核4GB 100GB
推荐场景:
搭建个人博客
云数据库 RDS MySQL,高可用版 2核4GB 50GB
简介: 版权声明:本文为博主原创文章,转载请标明出处。 https://blog.csdn.net/chaoyu168/article/details/78651362 1、更改yum源[1] 首先备份/etc/yum.
版权声明:本文为博主原创文章,转载请标明出处。 https://blog.csdn.net/chaoyu168/article/details/78651362

1、更改yum源

[1] 首先备份/etc/yum.repos.d/CentOS-Base.repo

[root@localhostyum.repos.d]# mv /etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.backup

[2] 进入yum源配置文件所在文件夹

[root@localhostyum.repos.d]# cd /etc/yum.repos.d/

[3] 下载阿里的yum源配置文件,放入/etc/yum.repos.d/(操作前请做好相应备份)

[root@localhostyum.repos.d]# wget -O/etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

[4] 运行yum makecache生成缓存

[root@localhostyum.repos.d]# yum makecache

2、安装php

rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm

rpm -Uvhhttps://mirror.webtatic.com/yum/el7/webtatic-release.rpm

yum install php70w.x86_64 php70w-cli.x86_64php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64 php70w-devel.x86_64gd gd-devel php70w-pear.x86_64 php70w-xmlrpc.x86_64 php70w-imap.x86_64php70w-dom.x86_64 php70w-xmlwriter.x86_64 php70w-mcrypt.x86_64php70w-pecl-imagick.x86_64 php70w-xml.x86_64 php70w-pecl-redis.x86_64

 

yum install php70w-fpm

systemctl enable php-fpm.service

配置php

 vim/etc/php.ini

在php.ini里查找
max_execution_time
默认是30秒.改为
max_execution_time = 0

查找 post_max_size .改为
post_max_size = 10240M

查找upload_max_filesize,默认为8M改为
upload_max_filesize = 10240M

max_input_time = 7200

memory_limit = 10240m

 

3、  安装Mariadb

[root@linuxprobe~]# yum -y install mariadb-server

[root@linuxprobe~]# vi /etc/my.cnf

# add follows within [mysqld] section

[mysqld]

character-set-server=utf8

[root@linuxprobe~]# systemctl start mariadb

[root@linuxprobe~]# systemctl enable mariadb

·        初始化MariaDB

[root@linuxprobe~]# mysql_secure_installation   #MySQL一样,一路y

·        1

·        连接MariaDB

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

Enter password:

Welcome to theMariaDB monitor.  Commands end with ; or\g.

Your MariaDBconnection id is 1023

Server version:5.5.50-MariaDB MariaDB Server

 

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

 

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

 

MariaDB[(none)]> select user,host,password from mysql.user;

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

| user      | host      | password                                  |

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

| root      | localhost | *F1DAE8BCDFCA7A57F246E0F834AC35830A3D640E|

| root      | 127.0.0.1 |*F1DAE8BCDFCA7A57F246E0F834AC35830A3D640E |

| root      | ::1       |*F1DAE8BCDFCA7A57F246E0F834AC35830A3D640E |

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

5 rows in set(0.00 sec)

MariaDB[(none)]> show databases;

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

| Database           |

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

|information_schema |

| mysql              |

|performance_schema |

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

5 rows in set(0.05 sec)

MariaDB[(none)]> exit;

Bye

防火墙开启端口

# 客户端设置

[root@vdevops ~]# firewall-cmd --add-service=mysql--permanent

success

[root@vdevops ~]# firewall-cmd --reload

success

#firewall-cmd --permanent --zone=public--add-service=http
#firewall-cmd --permanent --zone=public--add-service=https

#firewall-cmd –reload

 

.配置mariadb实例
#mysql_secure_installation;

Set root password?[Y/n]New password: (输入数据库密码等下需要)
Re-enter new password:
(再次确认密码)
Remove anonymous users?[Y/n]Y

Disallow root login remotely?[Y/n]Y
Remove test database and access to it?[Y/n]Y
Reload privilege tables now?[Y/n]Y

 

安装apache

[1]安装 httpd.

[root@linuxprobe ~]# yum -y install httpd

# 删除默认欢迎页面

[root@linuxprobe ~]# rm -f /etc/httpd/conf.d/welcome.conf

[2]配置httpd,将服务器名称替换为您自己的环境

[root@linuxprobe ~]# vi /etc/httpd/conf/httpd.conf

# line 86: 改变管理员的邮箱地址

ServerAdmin root@linuxprobe.org

# line 95: 改变域名信息

ServerName www.linuxprobe.org:80

# line 151: none变成All

AllowOverride All

# line 164: 添加只能使用目录名称访问的文件名

DirectoryIndex index.htmlindex.cgi index.php

# add follows to the end

# server's response header(安全性)

ServerTokens Prod

# keepalive is ON

KeepAlive On

[root@linuxprobe ~]# systemctl start httpd

[root@linuxprobe ~]# systemctl enable httpd

[3]如果Firewalld正在运行,请允许HTTP服务。,HTTP使用80 / TCP

[root@linuxprobe ~]# firewall-cmd --add-service=http--permanent

success

[root@linuxprobe ~]# firewall-cmd --reload

Success

·        安装ownCloud

# install fromEPEL

[root@linuxprobe ~]# yum --enablerepo=epel -y installphp-pear-MDB2-Driver-mysqli php-pear-Net-Curl

[root@linuxprobe ~]# wgethttp://download.owncloud.org/download/repositories/stable/CentOS_7/ce:stable.repo-P /etc/yum.repos.d

[root@linuxprobe ~]# yum -y install owncloud

[root@linuxprobe ~]# systemctl restart httpd

 

·        MariaDB中为ownCloud添加用户和数据库。

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

Enter password:

ERROR 1045 (28000): Access deniedfor user 'root'@'localhost' (using password: YES)

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

Enter password:

Welcome to the MariaDB monitor.  Commandsendwith ;or \g.

Your MariaDBconnection id is11

Server version: 5.5.52-MariaDB MariaDB Server

 

Copyright (c) 2000,2016, Oracle, MariaDB Corporation Aband others.

 

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

 

MariaDB[(none)]> create database owncloud;

Query OK, 1 row affected (0.15 sec)

 

MariaDB[(none)]> grant all privilegeson owncloud.*to owncloud@'localhost' identifiedby'password';

Query OK, 0 rows affected (0.00 sec)

 

MariaDB[(none)]> flush privileges;

Query OK, 0 rows affected (0.00 sec)

 

MariaDB [(none)]>exit

Bye

注:如果系统开启selinux,需设置以下操作:

[root@linuxprobe ~]# semanage fcontext -a -thttpd_sys_rw_content_t /var/www/html/owncloud/apps

[root@linuxprobe ~]# semanage fcontext -a -thttpd_sys_rw_content_t /var/www/html/owncloud/config

[root@linuxprobe ~]# restorecon /var/www/html/owncloud/apps

[root@linuxprobe ~]# restorecon /var/www/html/owncloud/config

相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
安全 关系型数据库 Linux
在VMware Workstation软件内,使用CentOS 7系统搭建私人云盘owncloud
在VMware Workstation软件内,使用CentOS 7系统搭建私人云盘owncloud
211 0
|
Linux Apache 数据库
centos7安装owncloud搭建个人云服务器
首先登录服务器,安装一些必要程序,因为本地源不支持一些程序的新版本,所以必须把源换一下1、下载阿里yum源并移动到yum目录中,删除其他源 wget -nc http://mirrors.
4410 1
|
JavaScript 关系型数据库 MySQL
centos 7 LAMP安装owncloud
系统: centos 7.3 内网ip: 192.168.8.116版本: owncloud-10.0.9 安装LAMP架构环境 # yum install -y httpd php php-mysql mariadb-server mariadb sqlite php-dom php.
3035 0
|
Web App开发 Oracle 关系型数据库
|
关系型数据库 Linux Apache
|
网络协议 关系型数据库 Linux
|
21天前
|
Linux 虚拟化 数据安全/隐私保护
部署05-VMwareWorkstation中安装CentOS7 Linux操作系统, VMware部署CentOS系统第一步,下载Linux系统,/不要忘, CentOS -7-x86_64-DVD
部署05-VMwareWorkstation中安装CentOS7 Linux操作系统, VMware部署CentOS系统第一步,下载Linux系统,/不要忘, CentOS -7-x86_64-DVD
|
15天前
|
存储 Linux 网络安全
Centos安装Docker的详细安装步骤,Docker相关组件:docker-ce-cli、docker-ce和containerd.io的区别
Centos安装Docker的详细安装步骤,Docker相关组件:docker-ce-cli、docker-ce和containerd.io的区别;CentOS7安装DockerCompose;Docker镜像仓库
280 11
|
20天前
|
应用服务中间件 Linux 网络安全
CentOS 7 上安装 Nginx
在 CentOS 7 上安装 Nginx 的步骤包括:添加 EPEL 仓库,安装 Nginx,启动 Nginx,配置防火墙规则,最后通过访问服务器 IP 验证安装是否成功
105 0