wget http://seafile-downloads.oss-cn-shanghai.aliyuncs.com/seafile-server_7.1.3_x86-64.tar.gz
mkdir /opt/seafile
mv seafile-server_7.1.3_x86-64.tar.gz /opt/seafile
tar -xzf seafile-server_7.1.3_x86-64.tar.gz
原本的安装包移动到 installed :
mkdir installed
mv seafile-server_7.1.3_x86-64.tar.gz installed
yum install python3 python3-setuptools python3-pip python3-ldap -ypip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy psd-tools \ django-pylibmc django-simple-captcha
cd seafile-server-7.1.3/
./setup-seafile-mysql.sh .
该脚本会依次询问你一些问题,从而一步步引导你配置 Seafile 的各项参数:
在这里, 你会被要求选择一种创建 Seafile 数据库的方式:
-------------------------------------------------------Please choose a way to initialize seafile databases:-------------------------------------------------------
[1] Create new ccnet/seafile/seahub databases
[2] Use existing ccnet/seafile/seahub databasesTextHTMLCSSJavascriptCC++C#JavaPythonSqlSwift
1
, 你需要提供根密码. 脚本程序会创建数据库和用户。2
, ccnet/seafile/seahub 数据库应该已经被你(或者其他人)提前创建。如果安装正确完成,你会看到下面这样的输出
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-rKYkkA7u-1588938675052)(https://cloud.seafile.com/view-image-via-public-wiki/?slug=seafile-manual-cn&path=images/Server-setup-successfully.png)]
./seafile.sh start
./seahub.sh start
当你第一次启动seahub时,seahub.sh会让你创建管理员账号。
./seahub.sh stop # 停止 Seahub./seafile.sh stop # 停止 Seafile 进程
./seafile.sh restart # 停止当前的 Seafile 进程,然后重启 Seafile./seahub.sh restart # 停止当前的 Seahub 进程,并在 8000 端口重新启动 Seahub
切换到nginx的conf目录
/usr/local/nginx/conf
在nginx.conf中加入下面这行代码
include /usr/local/nginx/conf/conf.d/*.conf;
这样的好处是可以直接加入conf.d下面的所有配置文件
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7fiXkTkk-1588938675056)(C:\Users\wlw\AppData\Roaming\Typora\typora-user-images\1588905360777.png)]
在conf下创建conf.d文件夹,然后创建seafile.conf,、
mkdir conf.d
vim seafile.conf
复制以下内容,server_name需修改
server {
listen 80;
server_name 192.168.10.85;
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;
# used for view/edit office file via Office Online Server
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;
}
location /media {
root /opt/seafile/installed/seafile-server-7.1.3/seahub;
}
}
~
然后启动seafile和seahub即可使用seafile。
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-kTOQeWM0-1588938675059)(C:\Users\wlw\AppData\Roaming\Typora\typora-user-images\1588905777939.png)]