網(wǎng)盤的大規(guī)模關停,將導致用戶數(shù)據(jù)信息的全面停用,并增加用戶保存現(xiàn)有數(shù)據(jù)的難度及負擔,甚至面臨丟失風險。事實上,這是一個大數(shù)據(jù)時代,我們生活在一個每天產(chǎn)生大量數(shù)據(jù)的世界中,照片、視頻、電影、音樂、工作文檔、商業(yè)PPT……因此,隨著網(wǎng)盤的流行,我們的大數(shù)據(jù)在網(wǎng)盤上的使用頻率非常高,網(wǎng)盤真正解決了我們的數(shù)據(jù)存儲“痛點”;資料顯示,六家關停網(wǎng)盤的服務用戶預估高達2.37億,存儲數(shù)據(jù)量之大可想而知;但是現(xiàn)今,隨著網(wǎng)盤服務紛紛倒下,私人數(shù)據(jù)如何安放已成為用戶關注的話題。
這一輪的網(wǎng)盤關停潮,可說是集體宣告這種免費商業(yè)模式的失敗。但也不必悲觀的是,在一個成熟的市場環(huán)境中,只要用戶有充分的需求,慢慢一定會有新的服務來填補。在這幾年網(wǎng)盤的“培養(yǎng)”下,用戶已經(jīng)習慣了在線存儲,而且很多人越來越意識到,更穩(wěn)定的服務、更安全的數(shù)據(jù)保障,比免費的大空間更為重要,所以更多人愿意嘗試付費的存儲服務,只要用戶付費能夠分擔服務商的監(jiān)管成本,那網(wǎng)盤就會繼續(xù)發(fā)展;還有更多懂技術的人或者公司會搭建自己的私有云存儲。
通過用戶調查發(fā)現(xiàn),在網(wǎng)盤關停的影響下,許多用戶“被迫”購買付費網(wǎng)盤,被關停的服務大多是免費服務項目,而付費會員,在功能使用上并未受到大影響;但是,付費網(wǎng)盤的持續(xù)繳費性質,將給用戶帶來更多的經(jīng)濟壓力和心理負擔。調查得知,目前大部分付費網(wǎng)盤的收費都是階段性收費,如新浪微盤僅100G空間的微盤VIP,年度收費是118元;這就意味著,如果購買付費網(wǎng)盤,一年之后,用戶必須續(xù)交費用;同時,年度繳費用戶還面臨著收費隨時上漲的可能性,這給用戶造成了巨大的經(jīng)濟壓力和心理負擔。
除了“被迫”選擇付費網(wǎng)盤之外,很多用戶表示,他們更傾向于建立個人私有云存儲。網(wǎng)盤的陸續(xù)關停,將迫使他們建立個人的永久云存儲平臺,并拋棄存在隨時關閉風險的傳統(tǒng)網(wǎng)盤存儲商。
OwnCloud是一個開源免費專業(yè)的私有云存儲項目,它能幫你快速在個人電腦或服務器上架設一套專屬的私有云文件同步網(wǎng)盤,可以像Dropbox那樣實現(xiàn)文件跨平臺同步、共享、版本控制、團隊協(xié)作等等。ownCloud能讓你將所有的文件掌握在自己的手中,只要你的設備性能和空間充足,那么用其來幾乎沒有任何限制。本項目是基于 PHP和 SQLite,MySQL,Oracle或PostgreSQL數(shù)據(jù)庫,所以它可以運行在所有的平臺上,下面將教大家如何在CentOS 7上安裝OwnCloud 8。
1.初始設置,根據(jù)自己的需求配置對應的服務器(電腦) 連接互聯(lián)網(wǎng)
安裝CentOS 7默認最小配置然后安裝目前所有的更新:
# yum -y update
2.我們需要安裝PHP,Apache Web服務器和MySQL服務器和PHP擴展:
#yum install httpd php php-mysql mariadbserver mariadb sqlite php-dom php-mbstring php-gd php-pdo wget vim
3.設置SELinux允許owncloud寫數(shù)據(jù)(目標文件/etc/selinux/config):
#set sebool -P httpd_unified 1
4.防火墻設置(確保防火墻啟動):
#systemctl start firewalld.service 啟動防火墻
#f i r e w a l l-c m d--permanent --zone=public--add-service=http
#f i r e w a l l-c m d--permanent --zone=public--add-service=https
#f i r e w a l l-c m d--reload
5.使用下面的命令啟動Apache:set
#systemctl start httpd.service
6.通過此命令啟動MariaDB:
#systemctl start mariadb.service
自動啟動的服務在系統(tǒng)啟動:
#systemctl enable httpd.service
#systemctl enable mariadb.service
7.安裝owncloud
首先,我們需要從官方網(wǎng)站下載owncloud。運行以下命令:
# wget https://download.owncloud.o r g/c o m m u n i t y/owncloud-8.2.11.tar.bz2
解壓文件:
#t a r -j x v f owncloud-8.2.11.tar.bz2-C/var/www/html/
接下來我們需要為Web服務器上文件目錄設置讀寫權限:
#chown-R apache.apache/var/www/html/owncloud/
數(shù)據(jù)庫配置
配置MariaDB實例:
#m y s q l_s e c u r e_installation
在設置過程這都輸入Y并回車(中間會涉及輸入root密碼)。
創(chuàng)建owncloud數(shù)據(jù)庫和用戶。
登錄到MySQL服務器,使用以下命令:
#mysql -u root -p
接下來,我們需要創(chuàng)建owncloud用戶和權限:
mysql>create database owncloud;
mysql>create user‘owncloud’@’localhost’identified by’密碼';
m y s q l>g r a n t a l l o n o w n c l o u d.* t o‘owncloud’@’localhost';
m y s q l>f l u s h privileges;
mysql>quit;
8.Apache服務器配置
編輯owncloud外部配置文件:
#vim/etc/httpd/conf.d/owncloud.conf
在配置文件中添加以下行:
Alias/owncloud/var/www/html/owncloud
O p t i o n s I n d e x e s FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
9.啟 動Apache和MariaDB服務:
#systemctl start httpd.service
#systemctl start mariadb.service
10.owncloud配置
打開你喜歡的瀏覽器訪問http://你的ip地址/owncloud或者http://你的域名/owncloud。它將顯示初始owncloud設置頁。必須要激活再配置。
1.先檢查是否安裝了iptables
#service iptables status
2.安裝iptables
#y u m i n s t a l l -y iptables
3.升級iptables
#yum update iptables
4.安 裝iptablesservices
#y u m i n s t a l l iptables-services
5.禁用/停止自帶的firewalld服務
停止firewalld服務
#s y s t e m c t l s t o p firewalld
禁用firewalld服務
#s y s t e m c t l m a s k firewalld
1.查看iptables現(xiàn)有規(guī)則
#iptables -L -n
2.先 允 許 所 有#iptables -P INPUT ACCEPT
3.清空所有默認規(guī)則#iptables -F
4.清空所有自定義規(guī)則#iptables -X
5.所有計數(shù)器歸0#iptables -Z
6.允許來自于lo接口的數(shù)據(jù)包(本地訪問)
#iptables -A INPUT -i lo -j ACCEPT
7.開放22端口
#iptables -A INPUT -p tcp --dport 22 -j ACCEPT
8.開放21端口(FTP)
#iptables -A INPUT -p tcp --dport 21 -j ACCEPT
9.開放80端口(HTTP)
#iptables -A INPUT -p tcp --dport 80 -j ACCEPT
10.開 放443端 口(HTTPS)
#iptables -A INPUT-p tcp --dport 443 -j ACCEPT
11.允許ping
#iptables -A INPUT-p icmp --icmp-type 8 -j ACCEPT
12.允許接受本機請求之后的返回數(shù)據(jù) RELATED,是為FTP設置的
#iptables -A INPUT-m s t a t e --s t a t e RELATED,ESTABLISHED -j ACCEPT
13其他入站一律丟棄
#iptables -P INPUT DROP
14.所有出站一律綠燈
#iptables -P OUTPUT ACCEPT
15.所有轉發(fā)一律丟棄
#iptables -P FORWARD DROP 保存規(guī)則設定
16.保存上述規(guī)則
#service iptables save
1.如果要添加內網(wǎng)ip信任(接受其所有TCP請求)
#iptables -A INPUT -p tcp -s 45.96.174.68 -j ACCEPT
2.過濾所有非以上規(guī)則的請求
#iptables -P INPUT DROP
3.要封停一個IP,使用下面這條命令:
#iptables -I INPUT -s***.***.***.*** -j DROP
4.要解封一個IP,使用下面這條命令:
#iptables -D INPUT -s***.***.***.*** -j DROP
5.保存上述規(guī)則
#service iptables save
1.保存上述規(guī)則
#service iptables save
2.注冊iptables服務相當于以前的chkconfig iptables on
#systemctl enable iptables.service
3.開啟服務
#systemctl start iptables.service
4.查看狀態(tài)
#systemctl status iptables.service
解 決v s f t p d在iptables開啟后,無法使用被動模式的問題。
1.首 先 在/etc/sysconfig/iptablesconfig中修改或者添加以下內容
[html] view plain copy
添加以下內容,注意順序不能調換
IPTABLES_MODULES="ip_conntrack_ftp"
IPTABLES_MODULES="ip_nat_ftp"
2.重新設置iptables設置
iptables -A INPUT-m s t a t e --s t a t e RELATED,ESTABLISHED -j ACCEPT
以下為完整設置腳本
1.#!/bin/sh
2.iptables -P INPUT ACCEPT
3.iptables -F
4.iptables -X
5.iptables-Z
6.iptables -A INPUT-i lo -j ACCEPT
7.iptables -A INPUT-p tcp --dport 22 -j ACCEPT
8.iptables -A INPUT-p tcp --dport 21 -j ACCEPT
9.iptables -A INPUT-p tcp --dport 80 -j ACCEPT
1 0.iptables -A INPUT -p tcp --dport 443 -j ACCEPT
1 1.iptables -A INPUT -p icmp --icmptype 8 -j ACCEPT
1 2.iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
1 3.iptables -P INPUT DROP
1 4.iptables -P OUTPUT ACCEPT
1 5.iptables -P FORWARD DROP
16.service iptables save
1 7.systemctl restart iptables.service