部署 Seafile 服務器(使用 MySQL)

    這個CMS部署起來還是蠻麻煩的,可做深入探究。我在此收集了一些相關方法。
    部署 Seafile 服務器(使用 MySQL)

    Seafile是一個開源、專業、可靠的云存儲平臺;解決文件集中存儲、共享和跨平臺訪問等問題,由北京海文互知網絡有限公司開發,發布于2012年10月;除了一般網盤所提供的云存儲以及共享功能外,Seafile還提供消息通信、群組討論等輔助功能,幫助更好的圍繞文件展開協同工作。---來源百度百科

    網上有相關詳細教程,鏈接如下:

    • 部署 Seafile 服務器(使用 MySQL):https://ewgo.net/2016/05/21/371
    • 官方文檔:部署 Seafile 服務器(使用 MySQL/MariaDB)

    以下文章來源于:https://ewgo.net/2016/05/21/371

    ?下載

    到下載頁面下載最新的服務器安裝包.

    部署和目錄設計

    假設你公司的名稱為 haiwen,你也已經下載 seafile-server_1.4.0_* 到你的 home 目錄下。 我們建議這樣的目錄結構:

    1. mkdir haiwen
    2. mv seafile-server_* haiwen
    3. cd haiwen
    4. #將 seafile-server_* 移動到 haiwen 目錄下后
    5. tar -xzf seafile-server_*
    6. mkdir installed
    7. mv seafile-server_* installed

    復制代碼

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

    1. #tree haiwen -L 2
    2. haiwen
    3. ├── installed
    4. │??└── seafile-server_1.8.2_x86-64.tar.gz
    5. └── seafile-server-1.8.2
    6. ??├── reset-admin.sh
    7. ??├── runtime
    8. ??├── seafile
    9. ??├── seafile.sh
    10. ??├── seahub
    11. ??├── seahub.sh
    12. ??├── setup-seafile.sh
    13. ??└── upgrade

    復制代碼

    這樣設計目錄的好處在于

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

    這樣你可以重用 haiwen 目錄下已經存在的配置文件,而不用重新配置.

    準備 MySQL 數據庫

    Seafile 服務器有三個組件需要擁有自己的數據庫:

    • ccnet server
    • seafile server
    • seahub

    Seafile 服務器組件更多信息請看[[Seafile服務器組件概覽]].

    有兩種方法可以初始化數據庫:

    • 通過setup-seafile-mysql.sh腳本創建數據庫.
    • 自己或其他人(比如數據庫管理員)創建

    我們建議采用第一種方法. 腳本會要求你提供 MySQL 數據庫的的根密碼,之后創建:

    • ccnet/seafile/seahub 數據庫
    • 一個可以連接到這些數據庫的用戶

    然而,有時你不得不使用第二種方法. 如果你沒有根密碼,你需要通過擁有這種權限的人(比如數據庫管理員)來幫助你創建三個數據庫,和一個能連接這三個數據庫的用戶. 例如,為 ccnet/seafile/seahub 分別創建如下三個數據庫: ccnet-db / seafile-db / seahub-db, 和一個可以連接這三個數據庫的 MySQL 用戶seafile:

    1. create database `ccnet-db` character set = ‘utf8’;
    2. create database `seafile-db` character set = ‘utf8’;
    3. create database `seahub-db` character set = ‘utf8’;
    4. ?
    5. create user ‘seafile’@’localhost’ identified by ‘seafile’;
    6. ?
    7. GRANT ALL PRIVILEGES ON `ccnet-db`.* to `seafile`;
    8. GRANT ALL PRIVILEGES ON `seafile-db`.* to `seafile`;
    9. GRANT ALL PRIVILEGES ON `seahub-db`.* to `seafile`;

    復制代碼

    安裝 Seafile 服務器

    安裝前的準備工作

    安裝 Seafile 服務器之前,請確認已安裝以下軟件

    • python 2.7
    • python-setuptools
    • python-imaging
    • python-mysqldb
    1. #在Debian/Ubuntu系統下
    2. apt-get update
    3. apt-get install python2.7 python-setuptools python-imaging python-mysqldb

    復制代碼

    安裝

    1. cd seafile-server-*
    2. ./setup-seafile-mysql.sh??#運行安裝腳本并回答預設問題

    復制代碼

    如果你的系統中沒有安裝上面的某個軟件,那么 Seafile初始化腳本會提醒你安裝相應的軟件包.

    部署 Seafile 服務器(使用 MySQL)

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

    參數作用說明seafile server name

    seafile 服務器的名字,將來在客戶端會顯示為這個名字

    3 ~ 15 個字符,可以用英文字母,數字,下劃線

    seafile server ip or domain

    seafile 服務器的 IP 地址或者域名

    客戶端將通過這個 IP 或者地址來訪問你的 Seafile 服務

    ccnet server port

    ccnet 使用的 TCP 端口

    一般使用默認的10001 端口,如果已經被占用,可以設置為其他的端口

    seafile data dir

    seafile 數據存放的目錄,用上面的例子,默認將是 /data/haiwen/seafile-data

    seafile 數據將隨著使用而逐漸增加,請把它放在一個有足夠大空閑空間的分區上

    seafile server port

    seafile 服務器 使用的 TCP 端口

    一般使用默認的 12001 端口,如果已經被占用,可以設置為其他的端口

    seafile fileserver port

    seafile fileserver 使用的 TCP 端口

    一般使用默認的 8082 端口,如果已經被占用,可以設置為其他的端口

    seahub admin email

    sehaub管理員的登錄帳戶名

    使用一個 email 地址

    seahub admin password

    seahub 管理員的密碼

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

    1. ——————————————————-
    2. Please choose a way to initialize seafile databases:
    3. ——————————————————-
    4. ?
    5. [1] Create new ccnet/seafile/seahub databases
    6. [2] Use existing ccnet/seafile/seahub databases

    復制代碼

    具體選擇哪項, 取決于你是否擁有根密碼.

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

    如果選擇 [1] Create new ccnet/seafile/seahub databases,你會被問三個問題:

    部署 Seafile 服務器(使用 MySQL)

    QuestionDescriptionNotemysql server host

    the host address of the mysql server

    the default is localhost

    mysql server port

    the port of the mysql server

    the default is 3306. Almost every mysql server uses this port.

    root password

    the password of mysql root account

    the root password is required to create new databases and a new user

    mysql user for seafile

    the username for seafile programs to use to access MySQL server

    if the user does not exist, it would be created

    password for seafile mysql user

    the password for the user above

    ?ccnet dabase name

    the name of the database used by ccnet, default is “ccnet-db”

    the database would be created if not existing

    seafile dabase name

    the name of the database used by seafile, default is “seafile-db”

    the database would be created if not existing

    seahub dabase name

    the name of the database used by seahub, default is “seahub-db”

    the database would be created if not existing

    如果你選擇[2] Use existing ccnet/seafile/seahub databases, 你會被問到如下三個問題:

    部署 Seafile 服務器(使用 MySQL)

    QuestionDescriptionNotemysql server host

    the host address of the mysql server

    the default is localhost

    mysql server port

    the port of the mysql server

    the default is 3306. Almost every mysql server uses this port

    mysql user for seafile

    the user for seafile programs to use to access MySQL server

    the user must already exists

    password for seafile mysql user

    the password for the user above

    ?ccnet dabase name

    the name of the database used by ccnet

    this database must already exist

    seafile dabase name

    the name of the database used by seafile, default is “seafile-db”

    this database must already exist

    seahub dabase name

    the name of the database used by seahub, default is “seahub-db”

    this database must already exist

    如果安裝正確完成,你會看到下面這樣的輸出

    部署 Seafile 服務器(使用 MySQL)

    現在你的目錄結構看起來應該是這樣:

    1. #tree haiwen -L 2
    2. haiwen
    3. ├── ccnet??????????# configuration files
    4. │??├── ccnet.conf
    5. │??├── mykey.peer
    6. │??├── PeerMgr
    7. │??└── seafile.ini
    8. ├── installed
    9. │??└── seafile-server_1.8.2_x86-64.tar.gz
    10. ├── seafile-data
    11. │??└── seafile.conf
    12. ├── seafile-server-1.8.2??# active version
    13. │??├── reset-admin.sh
    14. │??├── runtime
    15. │??├── seafile
    16. │??├── seafile.sh
    17. │??├── seahub
    18. │??├── seahub.sh
    19. │??├── setup-seafile.sh
    20. │??└── upgrade
    21. ├── seafile-server-latest??# symbolic link to seafile-server-1.8.2
    22. ├── seahub-data
    23. │??└── avatars
    24. ├── seahub_settings.py??# optional config file
    25. └── seahub_settings.pyc

    復制代碼

    seafile-server-latest文件夾為指向當前 Seafile 服務器文件夾的符號鏈接. 將來你升級到新版本后, 升級腳本會自動更新使其始終指向最新的 Seafile 服務器文件夾..

    啟動 Seafile 服務器

    啟動之前

    因為 Seafile 在客戶端和服務器之間使用持續連接,如果你的客戶端數量巨大, 你應該在啟動 Seafile 之前修改你的 Linux 文件最大打開數,如下:

    ulimit -n 30000

    啟動 Seafile 服務器和 Seahub 網站

    在 seafile-server-1.8.2 目錄下,運行如下命令

    • 啟動 Seafile:
    ./seafile.sh start # 啟動 Seafile 服務
    

    復制代碼

    • 啟動 Seahub
    ./seahub.sh start <port>??# 啟動 Seahub 網站 (默認運行在8000端口上)
    

    復制代碼

    小貼士: 你第一次啟動 seahub 時,seahub.sh 腳本會提示你創建一個 seafile 管理員帳號。

    服務啟動后, 打開瀏覽器并輸入以下地址

    http://192.168.1.111:8000/

    你會被重定向到登陸頁面. 輸入你在安裝 Seafile 時提供的用戶名和密碼后,你會進入 Myhome 頁面,新建資料庫.

    恭喜! 現在你已經成功的安裝了 Seafile 服務器.

    在另一端口上運行 Seahub

    如果你不想在默認的 8000 端口上運行 Seahub, 而是想自定義端口(比如8001)中運行,請按以下步驟操作:

    • 關閉 Seafile 服務器
    ./seahub.sh stop # 停止 Seafile 進程
    ./seafile.sh stop # 停止 Seahub
    

    復制代碼

    • 更改haiwen/ccnet/ccnet.conf文件中SERVICE_URL 的值(假設你的 ip 或者域名時192.168.1.100), 如下:
    1. SERVICE_URL = http://192.168.1.100:8001

    復制代碼

    • 重啟 Seafile 服務器
    ./seafile.sh start # 啟動 Seafile 服務
    ./seahub.sh start 8001 # 啟動 Seahub 網站 (運行在8001端口上)
    

    復制代碼

    ccnet.conf更多細節請看(server_configuration.md) .

    關閉/重啟 Seafile 和 Seahub

    關閉

    ./seahub.sh stop # 停止 Seahub
    ./seafile.sh stop # 停止 Seafile 進程
    

    復制代碼

    重啟

    ./seafile.sh restart # 停止當前的 Seafile 進程,然后重啟 Seafile
    ./seahub.sh restart??# 停止當前的 Seahub 進程,并在 8000 端口重新啟動 Seahub
    

    復制代碼

    如果停止/重啟的腳本運行失敗

    大多數情況下 seafile.sh seahub.sh 腳本可以正常工作。如果遇到問題:

    • 使用pgrep命令檢查 seafile/seahub 進程是否還在運行中
    pgrep -f seafile-controller # 查看 Seafile 進程
    pgrep -f “manage.py run_gunicorn” # 查看 Seahub 進程
    

    復制代碼

    • 使用pkill命令殺掉相關進程
    pkill -f seafile-controller # 結束 Seafile 進程
    pkill -f “manage.py run_gunicorn” # 結束 Seafile 進程
    

    復制代碼

    OK!

    網站

    NextCloud - 私有云盤

    2018-7-12 15:10:16

    網站

    DzzOffice – 云-開源辦公套件

    2018-7-12 15:20:43

    ??
    Npcink上的部份代碼及教程來源于互聯網,僅供網友學習交流,若您喜歡本文可附上原文鏈接隨意轉載。
    無意侵害您的權益,請發送郵件至 1355471563#qq.com 或點擊右側 私信:Muze 反饋,我們將盡快處理。
    0 條回復 A文章作者 M管理員
      暫無討論,說說你的看法吧
    ?
    個人中心
    購物車
    優惠劵
    今日簽到
    有新私信 私信列表
    搜索
    主站蜘蛛池模板: 天码av无码一区二区三区四区 | 亚洲韩国精品无码一区二区三区| 免费国产在线精品一区| 日韩中文字幕精品免费一区| 国产综合无码一区二区三区| 国产成人一区二区动漫精品| 老熟女高潮一区二区三区| 怡红院一区二区三区| 精品性影院一区二区三区内射| 风间由美在线亚洲一区| 日韩精品乱码AV一区二区| 影院无码人妻精品一区二区| 日韩一区二区视频| 色一乱一伦一图一区二区精品| 国产伦精品一区三区视频| 一区二区三区观看免费中文视频在线播放 | 国产婷婷色一区二区三区| 日本无码一区二区三区白峰美| 夜夜精品无码一区二区三区| 成人国产精品一区二区网站| 亚洲一区二区三区在线网站 | 日韩一区二区在线观看视频| 爱爱帝国亚洲一区二区三区| 国产亚洲自拍一区| 久久久久一区二区三区| 亚洲男女一区二区三区| 精品不卡一区二区| 无码国产精品一区二区高潮 | 中文字幕一区二区三区在线不卡 | 成人精品视频一区二区三区| 伊人精品视频一区二区三区| 亚洲色大成网站www永久一区| 国产成人无码AV一区二区| 无码av免费毛片一区二区| 日韩精品免费一区二区三区| 精品国产一区二区三区久久 | 福利一区福利二区| 久久无码AV一区二区三区| 在线观看国产一区亚洲bd| AV无码精品一区二区三区宅噜噜| 亚洲高清美女一区二区三区|