大家好。我是在全新的ubuntu16.04上按照seafile官方指南安装了seafile6.0.9。
在没有启动nginx的情况下,访问ip:8000正常,但在根据指南配置nginx后,发现不能访问,提示504 Gateway Time-out。
var/log/nginx/seahub.error.log错误信息如下:
2017/05/06 10:02:41 [error] 7157#7157: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.142.1, server: 192.168.142.157, request: “GET / HTTP/1.1”, upstream: “fastcgi://127.0.0.1:8000”, host: “192.168.142.157”
/etc/nginx/site-enabled/seafile.conf的内容如下:
server {
listen 80;
server_name 192.168.142.157;
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;
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_connect_timeout 36000;
proxy_read_timeout 36000;
}
location /media {
root /opt/seafile/seafile-server-latest/seahub;
}
}
Ccnet.conf的配置:
[General]
USER_NAME = SEAFILETEST
ID = c2c0df82cdb1f329f5f468b7cfd091d927ec9feb
NAME = SEAFILETEST
SERVICE_URL = http://192.168.142.157
[Client]
PORT = 13419
[Database]
ENGINE = mysql
HOST = 127.0.0.1
PORT = 3306
USER = seafile
PASSWD = 123456
DB = ccnet-db
CONNECTION_CHARSET = utf8
seahub_settings.py的配置:
SECRET_KEY = “o9xb@jl7#hqh1i7m_!flgy4^!!h4^!h!eo2zgqfu-&1^$ypi(5”
FILE_SERVER_ROOT = ‘http://192.168.142.157/seafhttp’
DATABASES = {
‘default’: {
‘ENGINE’: ‘django.db.backends.mysql’,
‘NAME’: ‘seahub-db’,
‘USER’: ‘seafile’,
‘PASSWORD’: ‘123456’,
‘HOST’: ‘127.0.0.1’,
‘PORT’: ‘3306’