步驟一、安裝Seafile依賴包
yum install python-setuptools python-ldap python-memcached MySQL-python mariadb mariadb-server
步驟二、安裝pip和python庫
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py pip install requests
步驟三、配置mariadb數據庫
啟動 mariadb服務:
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
配置 mariadb:
/usr/bin/mysql_secure_installation #New password 和 Re-enter new password 字段都設置為 Password,其他字段一路回車使用默認值
步驟四、安裝Seafile網盤程序(一定要下載樹莓派版本,其他版本是沒辦法運行的)
下載Seafile網盤:
wget https://github.com/haiwen/seafile-rpi/releases/download/v6.3.2/seafile-server_6.3.2_stable_pi.tar.gz
創建Seafile網盤文件夾:
mkdir -p /data/pan mv seafile-server_* /data/pan cd /data/pan tar -xzf seafile-server_* mkdir installed mv seafile-server_* installed
這樣設計目錄的好處在於 1.和 seafile 相關的配置文件都可以放在 pan 目錄下,便於集中管理. 2.后續升級時,你只需要解壓最新的安裝包到 pan 目錄下.
安裝Seafile網盤:
cd seafile-server-*
./setup-seafile-mysql.sh
[server name] 字段輸入 Seafile,[ This server's ip or domain ] 字段輸入域名或服務器公網IP地址, [ 1 or 2 ] 字段選擇 1,mysql 的 [ root password ] 字段輸入 Password,其他字段一路回車使用默認值
啟動 Seafile 服務器:
./seafile.sh start
./seahub.sh start
修改防火牆規則:
sudo firewall-cmd --zone=public --permanent --add-port=8082/tcp sudo firewall-cmd --zone=public --permanent --add-port=8000/tcp sudo firewall-cmd --reload
大功告成!
恭喜,您的 Seafile 已經部署完成,您現在擁有專屬的網盤了,登錄的帳號密碼為您啟動 Seafile 步驟中設置的郵箱和密碼。
可以通過 IP訪問網盤:http://<您的域名>:8000
可以通過域名訪問網盤:如 http://www.yourdomain.com:8000 ,其中 www.yourdomain.com 替換為您注冊的域名
參考文獻:
騰訊雲:https://cloud.tencent.com/developer/labs/lab/10093
科技愛好者:http://blog.lxx1.com/1420
seafile官方文檔:https://manual-cn.seafile.com/deploy/using_mysql.html
