部署Seafile專業版(三用戶免費)

前言:是國內團隊開發、國際領先的開源企業云存儲軟件,為企業提供私有云環境下的網盤解決方案,滿足文件集中管理、多終端訪問、共享協作等需求。普通版本的功能比較簡單,與之相比專業版的強大自然是我們的首選。Seafile的專業版本實際上不需要付費也可以使用,只是在用戶數上有所限制,三用戶滿足需求的情況下完全可以使用。

環境:CentOS 7及7.x版本,JAVA環境jdk1.7或更高版本

下載Seafile專業版server https://download.seafile.com/d/06d4ca0272/

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
yum install java-1.7.0-openjdk poppler-utils python-setuptools python-imaging MySQL-python mariadb-server python-memcached python-ldap python-urllib3
pip install boto

安裝mariadb

yum -y install mariadb mariadb-server
systemctl start mariadb

獲取專業版許可證書,放置在頂層目錄下
(Seafile專業版無許可證書的情況下允許最多創建三個用戶)

現在的目錄結構應該像如下這樣:

haiwen
├── seafile-license.txt
└── seafile-pro-server_6.1.7/

安裝NGINX(我使用了源碼安裝,可以參考這篇http://www.lxweimin.com/p/4699bcb04633

yum install -y apr* autoconf automake bison bzip2 bzip2*  cloog-ppl compat* cpp curl curl-devel fontconfig   fontconfig-devel freetype freetype* freetype-devel  gcc gcc-c++ gtk+-devel gd gettext gettext-devel   glibc kernel kernel-headers keyutils keyutils-libs-devel  krb5-devel libcom_err-devel libpng libpng-devel libjpeg*   libsepol-devel libselinux-devel libstdc++-devel libtool*   libgomp libxml2 libxml2-devel libXpm* libtiff libtiff* make  mpfr ncurses* ntp openssl openssl-devel patch pcre-devel   perl php-common php-gd policycoreutils telnet t1lib t1lib* nasm nasm* wget zlib-devel
mkdir /usr/local/src
mv * /usr/local/src
cd /usr/local/src
tar zxvf pcre-8.41.tar.gz 
mkdir /usr/local/pcre
cd pcre-8.41/
./configure --prefix=/usr/local/pcre
make
make install
cd ..
mkdir /usr/local/openssl
tar zxvf openssl-1.0.1h.tar.gz
cd openssl-1.0.1h
./config --prefix=/usr/local/openssl/
make
make install
vim /etc/profile
. /etc/profile
cd ..
mkdir /usr/local/zlib
tar zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11/
./configure --prefix=/usr/local/zlib
make
make install
cd ..
tar zxvf nginx-1.8.0.tar.gz
cd nginx-1.8.0
./configure --prefix=/usr/local/nginx --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-openssl=/usr/local/src/openssl-1.0.1h --with-zlib=/usr/local/src/zlib-1.2.11 --with-pcre=/usr/local/src/pcre-8.41
make
make install
/usr/local/nginx/sbin/nginx
groupadd www
useradd -g www www -s /bin/false
/usr/local/nginx/sbin/nginx
vim /etc/rc.d/init.d/nginx
chmod 775 /etc/rc.d/init.d/nginx
chkconfig nginx on

安裝Seafile并使用MySQL數據庫

mkdir haiwen
mv seafile-pro-server_6.1.7_x86-64.tar.gz haiwen/
cd haiwen
tar xf seafile-pro-server_6.1.7_x86-64.tar.gz
mkdir installed
mv seafile-pro-server_6.1.7_x86-64.tar.gz installed

現在,你的目錄看起來應該像這樣

├── installed
│   └── seafile-pro-server_6.1.7_x86-64.tar.gz
└── seafile-server-6.1.7
    ├── reset-admin.sh
    ├── runtime
    ├── seafile
    ├── seafile.sh
    ├── seahub
    ├── seahub.sh
    ├── setup-seafile.sh
    └── upgrade

這樣設計目錄的好處在于
和 seafile 相關的配置文件都可以放在 haiwen 目錄下,便于集中管理.
后續升級時,你只需要解壓最新的安裝包到 haiwen 目錄下.

yum install -y mariadb-server
yum install -y python-setuptools python-imaging python-ldap MySQL-python python-memcached python-urllib3
cd seafile-server-6.1.7
./setup-seafile-mysql.sh

該腳本會依次詢問你一些問題,從而一步步引導你配置 Seafile 的各項參數:

1.seafile server name
seafile 服務器的名字,目前該配置已經不再使用
3 ~ 15 個字符,可以用英文字母,數字,下劃線
2.seafile server ip or domain
seafile 服務器的 IP 地址或者域名
客戶端將通過這個 IP 或者地址來訪問你的 Seafile 服務
3.seafile data dir
seafile 數據存放的目錄,用上面的例子,默認將是 /data/haiwen/seafile-data
seafile 數據將隨著使用而逐漸增加,請把它放在一個有足夠大空閑空間的分區上
4.seafile fileserver port
seafile fileserver 使用的 TCP 端口
該端口用于文件同步,請使用默認的 8082,不能更改。

在這里, 你會被要求選擇一種創建 Seafile 數據庫的方式:

-------------------------------------------------------
Please choose a way to initialize seafile databases:
-------------------------------------------------------

[1] Create new ccnet/seafile/seahub databases
[2] Use existing ccnet/seafile/seahub databases

如果選擇1, 你需要提供根密碼. 腳本程序會創建數據庫和用戶。
如果選擇2, ccnet/seafile/seahub 數據庫應該已經被你(或者其他人)提前創建。

啟動 Seafile 服務器
./seafile.sh start #啟動 Seafile 服務
./seahub.sh start <port>  #啟動 Seahub 網站 (默認運行在8000端口上)
vim /usr/local/nginx/conf/nginx.conf
    server {
        listen       80;
        server_name  localhost;
        proxy_set_header X-Forwarded-For $remote_addr;
        location / {
        root   html;
        index  index.html index.htm;
        fastcgi_pass    127.0.0.1:8000;
        fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
        fastcgi_param   PATH_INFO           $fastcgi_script_name;

        fastcgi_param   SERVER_PROTOCOL     $server_protocol;
        fastcgi_param   QUERY_STRING        $query_string;
        fastcgi_param   REQUEST_METHOD      $request_method;
        fastcgi_param   CONTENT_TYPE        $content_type;
        fastcgi_param   CONTENT_LENGTH      $content_length;
        fastcgi_param   SERVER_ADDR         $server_addr;
        fastcgi_param   SERVER_PORT         $server_port;
        fastcgi_param   SERVER_NAME         $server_name;
        fastcgi_param   REMOTE_ADDR         $remote_addr;

        access_log      /var/log/nginx/seahub.access.log;
        error_log       /var/log/nginx/seahub.error.log;
    }

        location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        client_max_body_size 0;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_request_buffering off;
    }

    location /media {
        root /seafile/seafile-server-latest/seahub;
    }
}
/usr/local/nginx/sbin/nginx -s reload
訪問IP:8000即可
seafile

寫在結尾:非常有意思的是,Seafile支持更換logo,企業使用是非常不錯的

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 229,836評論 6 540
  • 序言:濱河連續發生了三起死亡事件,死亡現場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機,發現死者居然都...
    沈念sama閱讀 99,275評論 3 428
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 177,904評論 0 383
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,633評論 1 317
  • 正文 為了忘掉前任,我火速辦了婚禮,結果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當我...
    茶點故事閱讀 72,368評論 6 410
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發上,一...
    開封第一講書人閱讀 55,736評論 1 328
  • 那天,我揣著相機與錄音,去河邊找鬼。 笑死,一個胖子當著我的面吹牛,可吹牛的內容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,740評論 3 446
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 42,919評論 0 289
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當地人在樹林里發現了一具尸體,經...
    沈念sama閱讀 49,481評論 1 335
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 41,235評論 3 358
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發現自己被綠了。 大學時的朋友給我發了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 43,427評論 1 374
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,968評論 5 363
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質發生泄漏。R本人自食惡果不足惜,卻給世界環境...
    茶點故事閱讀 44,656評論 3 348
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 35,055評論 0 28
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 36,348評論 1 294
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個月前我還...
    沈念sama閱讀 52,160評論 3 398
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 48,380評論 2 379

推薦閱讀更多精彩內容