1. 程式人生 > >建立自己的私有云儲存服務【ownCloud】

建立自己的私有云儲存服務【ownCloud】

前言
ownCloud 是一個開源免費專業的私有云儲存專案,它能幫你快速在個人電腦或伺服器上架設一套專屬的私有云檔案同步網盤,可以像 Dropbox 那樣實現檔案跨平臺同步、共享、版本控制、團隊協作等等。ownCloud 能讓你將所有的檔案掌握在自己的手中,只要你的裝置效能和空間充足,那麼用其來幾乎沒有任何限制。
owncloud不僅有windows客戶端,還有手機端
這裡寫圖片描述
手機端:

這裡寫圖片描述
windows客戶端

這裡寫圖片描述
一、安裝http
1、安裝軟體包

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

2、刪除歡迎詞

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

3、修改配置檔案

[[email protected] ~]# vi /etc/httpd/conf/httpd.conf
# line 86: change to admin's email address
ServerAdmin [email protected]
# line 95: change to your server's name
ServerName www.srv.world:80
# line 151: change
AllowOverride All
# line 164: add file name that it can access only with directory's name
DirectoryIndex index.html index.cgi index.php # 在後面新增 # server's response header ServerTokens Prod # keepalive is ON KeepAlive On

4、啟動服務並設定開機啟動

[root@owncloud ~]# systemctl start httpd 
[root@owncloud ~]# systemctl enable httpd 

5、設定防火牆

[root@owncloud ~]# firewall-cmd --add-service=http --permanent 
success [root@owncloud ~]# firewall-cmd --reload Success

6、寫入測試檔案
[[email protected] ~]# vi /var/www/html/index.html

 <html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
Test Page
</div>
</body>
</html>

測試
這裡寫圖片描述

二、安裝PHP
1、安裝軟體包

[root@owncloud ~]# yum -y install php php-mbstring php-pear

修改配置檔案

[[email protected] ~]# vi /etc/php.ini
# line 878: 修改時區
date.timezone = "Asia/Shanghai" 

2、重啟http服務

[root@owncloud ~]# systemctl restart httpd 

3、建立測試檔案

[[email protected] ~]# vi /var/www/html/index.php
 <html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
<?php
   print Date("Y/m/d");
?>
</div>
</body>
</html>

4、測試
這裡寫圖片描述

三、安裝資料庫
1、安裝軟體包

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

2、修改配置檔案

[[email protected] ~]# vi /etc/my.cnf
# add follows within [mysqld] section
[mysqld]
character-set-server=utf8

3、啟動服務並設定開機啟動

[root@owncloud ~]# systemctl start mariadb 
[root@owncloud ~]# systemctl enable mariadb 

4、初始化資料庫

[[email protected] ~]# mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

# set root password
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
# remove anonymous users
Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

# disallow root login remotely
Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

# remove test database
Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

# reload privilege tables
Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

5、連線資料庫

[[email protected] ~]# mysql -u root -p 
Enter password:     # MariaDB root password you set
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.37-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

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

6、檢視使用者

MariaDB [(none)]> select user,host,password from mysql.user; 
+------+-----------+-------------------------------------------+
| user | host      | password                                  |
+------+-----------+-------------------------------------------+
| root | localhost | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| root | 127.0.0.1 | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| root | ::1       | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
+------+-----------+-------------------------------------------+
3 rows in set (0.00 sec)

7、顯示資料庫

MariaDB [(none)]> show databases; 
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

MariaDB [(none)]> exit
Bye

8、配置防火牆

[root@owncloud ~]# firewall-cmd --add-service=mysql --permanent 
success
[root@owncloud ~]# firewall-cmd --reload 
Success

四、安裝owncloud
1、安裝軟體包

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

2、下載網路源

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

3、安裝owncloud

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

4、重啟http

[root@owncloud ~]# systemctl restart httpd

5、建立ownclou資料庫及使用者

[[email protected] ~]# mysql -u root -p 
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.47-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and 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.00 sec)
MariaDB [(none)]> grant all privileges on owncloud.* to [email protected]'localhost' identified by 'Changeme_123';  #建立使用者
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges; 
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit 
Bye

6、配selinux

[root@owncloud ~]# semanage fcontext -a -t httpd_sys_rw_content_t /var/www/html/owncloud/apps 
[root@owncloud ~]# semanage fcontext -a -t httpd_sys_rw_content_t /var/www/html/owncloud/config 
[root@owncloud ~]# restorecon /var/www/html/owncloud/apps 
[root@owncloud ~]# restorecon /var/www/html/owncloud/config

9、登入介面

http://IP/owncloud

建立admin使用者,配置資料資料夾及資料庫資訊
這裡寫圖片描述
登入
這裡寫圖片描述

相關推薦

建立自己私有儲存服務ownCloud

前言 ownCloud 是一個開源免費專業的私有云儲存專案,它能幫你快速在個人電腦或伺服器上架設一套專屬的私有云檔案同步網盤,可以像 Dropbox 那樣實現檔案跨平臺同步、共享、版本控制、團隊協作等等。ownCloud 能讓你將所有的檔案掌握在自己的手中

CentOS 7 使用kodexplorer建立私有儲存網盤

免費網盤用久了,總是被各種限速,功能不開放等噁心到,在經過幾天的輾轉於網路上,終於摸索出自己搭建一個私有云儲存網盤,我找到的免費開源程式有owncloud,可道雲kodexplorer,seafile。每一種都搭建使用過,體驗和搭建簡易程度上個人較喜歡可道雲kodexplorer。話不多說直

kodexplorer建立家庭私有實現上傳下載

個人電腦一般都是內網,要實現外網訪問費用是很高的,一般個人很難支付的起,但也有廉價的實現方法,相對個人來說能承受的了,記住一點免費的要不是不穩定,要不就是太慢,用樹莓派加內網版花生殼就可以輕鬆實現 工具/原料 樹莓派一臺 花生殼賬號內網版的 1.用vnc

Jhipster建立服務0——踩坑

Jhipster與微服務 什麼是Jhipster? JHipster is a development platform to generate, develop and deploy Spring Boot + Angular/React Web a

OpenWrt路由器安裝Seafile私有儲存系統

在Y1S上安裝Seafile,使用OpenWrt Truck版本,該版本內集中了Seafile的相關元件。 在安裝之前需要完成U盤啟動配置,之前的部落格中已經介紹了U盤配置事項,接下來就安裝Seafile ①進入OpenWrt Terminal介面,輸入命令: opkg i

資料安全存放,全民搭建kodexplorer私有儲存

資料安全存放可以說越來的重要,新聞上也經常報道出關於個人資訊洩露的事件,不僅洩露,還有一些進行個人隱私買賣,之前報道出facebook便是如此。數字資訊存放好比存錢一樣,存在別人那裡總會不放心。不如自己修建一個金庫,放在自己家中,更安心!網路上也應該有這樣一個空間,存放自己的東西。之前的做法大部分都是把資料存

建立自己的OAuth2.0服務端(一)

原文: 建立自己的OAuth2.0服務端(一)   如果對OAuth2.0有任何的疑問,請先熟悉OAuth2.0基礎的文章:http://www.cnblogs.com/alunchen/p/6956016.html 1. 前言 本篇文章時對 客戶端的授權模式-授權碼模式 的建立

如何利用 BTSync 在VPS上搭建私有儲存

本文只是geek瞎折騰,如需真正完整功能的雲端儲存服務,推薦使用 和 。畢竟術業有專攻。 如果你不能流暢使用GoogleDrive 和 DropBox,點這裡。 BTSync(BitTorrent Sync)其實是一個點對點的檔案傳輸服務,把它搭建在 VPS 上作為檔案

不多花一分錢利用VMwareworkstation和nat123建立自己的小型遠端服務網站

最近有個做屬於自己遠端服務網站的打算,正好3年前家裡買的品牌主機被淘汰閒置了,這貨雖然配置不行了,但卻異常的靜音省電,家中24小時開機完全感應不到它的存在,所以就興致盎然開始準備搭一套可以外網訪問的服務。 說幹就幹,下圖是我所需要用到的工具包,大家可以找合適自己用或者夠用的

Docker Registry建立自己私有倉庫

docker run -d -p 5000:5000 --name registry registry:2 建立自己映象,或隨便pull一個,用來測試 docker pull centos tag這個映象目的是讓其指向你的倉庫 docke

Android自己定義組件系列6——進階實踐(3)

err ack XML @+ layout apk get ast edi 上一篇《Android自己定義組件系列【5】——進階實踐(2)》繼續對任老師的《可下拉的PinnedHeaderExpandableListView的實現》進行了分析,這一篇計劃中間插一段“知識點

Android自己定義組件系列5——進階實踐(2)

col fonts tle 適配 pack tom ica void log 上一篇《Android自己定義組件系列【5】——進階實踐(1)》中對任老師的《可下拉的PinnedHeaderExpandableListView的實現》前一部分進行了實現,這一篇我們來看看Ex

Android自己定義組件系列1——自己定義View及ViewGroup

全部 int ++ btn -i pre 剪切 final 界面 View類是ViewGroup的父類,ViewGroup具有View的全部特性。ViewGroup主要用來充當View的容器。將當中的View作為自己孩子,並對其進行管理。當然孩子也能夠是ViewGrou

linux支持FTP和SFTP服務2

In blog linu any tp服務器 默認端口 clas file image 【問題】 不管是FileZilla還是本地cmd窗口都連接不上ftp服務器,因為這個,還把默認端口從21改成了2121試驗,最後發現是防火墻的問題。 【關閉防火墻】 https://

ownCloud添加信任域

png logs 安全 圖片 代碼段 src 我們 owncloud 服務 如果在安裝ownCloud後,更換了訪問方式,比如剛開始是http://127.0.0.1/owncloud,變成了http://1.1.1.1/owncloud,那麽在訪問時可能得到這樣的頁面:您

基於SpringBoot的微服務Jenkins自動化部署

基於【SpringBoot】的微服務【Jenkins】自動化部署   一、關於自動化部署   關於自動化部署的優點,我就不在這裡贅述了;只要想想手工打包、上傳、部署、重啟的種種,就會有很多場景歷歷在目,相信經歷過的朋友都能體會其中的酸甜苦辣; 而一旦到了大型專案,比如所微服務化之後的

如何清晰的、高質量的給面試官介紹自己的電商專案借鑑

面試有兩點:1、技術過硬。2、能說會道。   如果自己的技術還過的去,但是表述的不盡人意,其實是吃了很大虧的,下面我來介紹一個大神的面試過程:   面試官:請介紹一下你的電商專案。   大神:該商城是一個綜合性的B2C電商平臺,類似於京東商城,主要針對廣大消費者。   在整個專案中,我們

Mysql(增刪改查)+檢視+儲存過程常用

一,MySQL(一般): 1,建立資料庫: SET FOREIGN_KEY_CHECKS=0; // 修改外來鍵約束( Mysql中如果表和表之間建立的外來鍵約束,則無法刪除表及修改表結構 ) DROP TABLE IF EXISTS `user`; // DROP

Android Handler 非同步訊息處理機制的妙用 建立強大的圖片載入類

上一篇部落格介紹了Android非同步訊息處理機制,如果你還不瞭解,可以看:Android 非同步訊息處理機制 讓你深入理解 Looper、Handler、Message三者關係 。那篇部落格的最後,提出可以把非同步訊息處理機制不僅僅是在MainActiv

Spring攔截服務(SpringBoot使用切片Aspect)完結

Spring最重要的有個知識點就是切面程式設計AOP @Aspect註解將表示它是一個切面 @Component表示它是一個Spring的元件 切面有很多種寫法,可以在Spring的官網的11章點選檢視Spring官網官方文件 本文將用@Around進行切