如果需要转移 seafile 到新的位置或者恢复 seafile 备份到另外一个位置,可以参考下边的内容操作。
需要修改两个位置:
- seafile-data 的位置
- 如果启用了 https 还需要修改 nginx 配置文件中 media 的目录位置
停止服务
cd /home/haiwen/seafile-server-latest ./seahub.sh stop # 停止 Seafile 进程 ./seafile.sh stop # 停止 Seahub
移动位置
mkdir /seafile mv /home/haiwen/* /seafile/
修改配置文件
1/2. 编辑文件 /seafile/ccnet/seafile.ini,将
/home/haiwen/seafile-data
修改为
/seafile/seafile-data
2/2. 修改有关 HTTPS 的配置文件
server { listen 443; server_name file.upall.cn; ssl on; ssl_certificate /data/web/file.upall.cn/cert/file.upall.cn.chained.crt; ssl_certificate_key /data/web/file.upall.cn/cert/file.upall.cn.key; proxy_set_header X-Forwarded-For $remote_addr; location / { 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; fastcgi_param HTTPS on; fastcgi_param HTTP_SCHEME https; access_log /data/log/nginx/seahub.access.log; error_log /data/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; } }
重新启动服务
cd /seafile ./seafile.sh start ./seahub.sh start-fastcgi
<完>