centos7搭建owncloud私有云
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 ; org.
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
相關文章
- 搭建私有云:OwnCloudCloud
- 使用 seafile搭建私有云盤
- 使用Leanote搭建私有云筆記筆記
- 如何搭建自己的私有云盤
- 私有云盤Owncloud_v9.1+Nginx_v1.1(支援16G大檔案上傳)CloudNginx
- 快速搭建私有云服務 go-btfsGo
- 乾貨 | 4步帶你完成私有云盤搭建
- 建立私有云(Seafile)
- 使用OSS搭建私有云內網yum倉庫的方法內網
- 公有云高手UCloud如何玩轉私有云?Cloud
- 私有云能降低成本嗎?私有云有哪些優勢呢?
- 私有云究竟有什麼優勢?為什麼要了解私有云呢?
- 極光筆記丨搭建UMS私有云檔案伺服器筆記伺服器
- 視訊私有云實戰:基於Docker構建點播私有云平臺Docker
- 雲端計算、公有云、私有云、混合雲等
- 私有云化證件識別
- 混合雲、公有云、私有云具體是指什麼?
- 基於VMWare構建私有云2019
- 虛擬私有云(Virtual Private Cloud,VPC)Cloud
- 華為關閉私有云?從華為內部的公有云私有云紛爭,到雲端計算市場的分水嶺
- SAP公有云和私有云解決方案概述
- 企業為什麼要建立私有云
- 什麼是IaaS、PaaS、SaaS,什麼是公有云、私有云、混合雲?
- 企業私有云規劃資源設計
- 蘋果推出“私有云計算”新系統蘋果
- 公共雲和私有云之間的區別
- 什麼是公有云?什麼是私有云?它們之間有何不同?
- Geth搭建私有鏈
- Verdaccio 搭建私有 NPMNPM
- 區域網資料夾共享,透過搭建私有云盤替換FTP過程詳解FTP
- 2020私有云系統平臺報告,首次定義新一代私有云
- 實戰-將MySQL備份上傳到私有云(3)MySql
- 杉巖資料私有云儲存解決方案
- 部隊自建私有云盤專案解決方案
- 雲端計算教程學習入門影片課件:私有云計算平臺怎麼搭建?
- docker 私有倉庫搭建Docker
- 搭建python私有倉庫Python
- gitlab私有倉庫搭建Gitlab
- docker搭建私有倉庫Docker