Seafile的配置


如果部署在apache或nginx后面,就是訪問默認80或443。反向代理會幫你轉到8000和8082上。

我使用443,我在路由器上設定了轉發,比如 對外網12323這個端口會轉到內網地址443上

我使用seafile就會是 https://外網ip:12323 9 , 客戶端也是配置使用這個地址。

然后在SERVICE_URL 是 https://外網ip:12323 9 FILE_SERVER_ROOT 是 https://外網ip:12323/seafhttp 1

如果你只在內網中使用,使用apache或ngix,就是訪問https://內網ip
SERVICE_URL 是 https://內網ip:12323 FILE_SERVER_ROOT 是 https://內網ip:12323/seafhttp 1

如果你沒使用apache和ngix,在外面訪問, 那么要在路由器上對8000和8082都做映射。 比如4XXXX,5XXXX
SERVICE_URL 和 FILE_SERVER_ROOT 要寫外網ip和映射的端口。

如果你8000 和 8082不做映射,對外也是用8000和8082 ,那么就是最普通配置,但是寫外網ip。

 

https://bbs.seafile.com/t/seafile/731/2

 

https://atjason.com/412.html

 

https://manual-cn-origin.seafile.com/deploy/qi-ta-bu-shu-shuo-ming/deploy_seafile_behind_nat

 

 

 

腳本安裝的信息文檔在

/opt/seafile/aio_seafile-server

數據庫用戶名和密碼存儲在

/opt/seafile.my.cnf

根用戶存儲在

/root/.my.cnf

 

https://blog.51cto.com/7309656/2420009

Seahub 是 Seafile 服務器的網站界面. SeafServer 用來處理瀏覽器端文件的上傳與下載. 默認情況下, 它在 8082 端口上監聽 HTTP 請求
而平時我們訪問IP地址或域名的時候都不喜歡帶端口號進入訪問,故使用nginx來做反向代理
1.在安裝好的seafile服務器上安裝nginx或者單獨配置一台新的機器來安裝nginx,為了方便,nginx和seafile就安裝在同一台機器上。
命令:
yum -y install nginx
Nginx組合seafile
2.為seafile單獨創建一個配置文件(此配置文件只是http訪問的,如果需要https的,請參考seafile的官網操作)
命令:
vi /etc/nginx/conf.d/seafile.conf
內容如下:
server {
listen 80;
server_name 192.168.80.120;
proxy_set_header X-Forwarded-For $remote_addr;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_read_timeout 1200s;
client_max_body_size 0;
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_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_connect_timeout 36000s; proxy_read_timeout 36000s; proxy_send_timeout 36000s; send_timeout 36000s; proxy_request_buffering off; } location /media { root /usr/local/seafile/seafile-server-latest/seahub; }

}
Nginx組合seafile

3.修改文件gunicorn.conf
命令
/usr/local/seafile/conf/gunicorn.conf #修改/usr/local/seafile/conf/gunicorn.conf文件,把里面的bind="0.0.0.0:8001"修改為bind="127.0.0.1:8000"
Nginx組合seafile
4.修改文件seahub_settings.py
命令:vi /usr/local/seafile/conf/seahub_settings.py
在此文件中添加如下一個內容:
FILE_SERVER_ROOT = 'http://192.168.80.120/seafhttp'
Nginx組合seafile
5.重啟啟動seahub,並開啟nginx服務
命令:
#進入seafile目錄
cd /usr/local/seafile/seafile-server
#重新啟動seahub服務
./seahub.sh restart
#檢測下nginx的配置文件是否有語法錯誤
nginx -t
#開啟nginx服務
systemctl start nginx
#設置nginx開機自動啟動
systemctl enable nginx
Nginx組合seafile
6.打開網頁輸入http://192.168.80.120是否能訪問
Nginx組合seafile

 

 

/etc/nginx/conf.d/seafile.conf監聽本地80端口,然后反向代理至8000-seahub,8082-seafhttp,8080-seafdav

路由器轉發端口10000:80即可。

external-url 填入域名:10000

如果想修改某個內部端口

關掉服務

systemctl stop seahub

systemctl stop  seafile

首先修改seafile.conf的監聽端口如 8080-》8081

然后修改對應文件 /opt/seafile/conf/seafdav.conf 中的端口8080-》8081

重啟 systemctl restart nginx

systemctl start seahub

systemctl start  seafile


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM