Suddenly I can't access seahub anymore - nginx and Plesk

server

#1

Hey everybody,

I just got an confusing error.
I’m using Seafile 6.2.2 on my VPS running 64 Bit Ubuntu 16.04 with Pleks Onyx 17.5.3 and since round about 2 weeks my nginx redirect isn’t working properly. Everytime I try to access the Webinterface on https://example.com/cloud I just get an 404 BUT when i access for example https://example.com/clouda, whyever I should do this, I get to an error page saying that the requested page couldn’t be found - the error page is displayed by seahub.
Because of that I can’t access the Library within the desktop application - well that actually makes sense…

My nginx config within plesk:

server_tokens off;
location /cloud {
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}

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 HTTPS on;
fastcgi_param HTTP_SCHEME https;
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 36000s;
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
send_timeout 36000s;
proxy_request_buffering off;
}
location /seafmedia {
rewrite ^/seafmedia(.
)$ /media$1 break;
root /opt/seafile/seafile-server-latest/seahub;
}

My ccnet.conf:

[General]
USER_NAME = Name
ID = myID
NAME = Name
SERVICE_URL = https://example.com/cloud/

[Client]
PORT = 13419

My seahub_settings.py

SECRET_KEY = “wellitsasecretisntit”
FILE_SERVER_ROOT = ‘https://example.com/seafhttp
LOGIN_URL = ‘/cloud/accounts/login/’
SERVE_STATIC = False
MEDIA_URL = ‘/seafmedia/’
COMPRESS_URL = MEDIA_URL
STATIC_URL = MEDIA_URL + ‘assets/’
SITE_ROOT = ‘/cloud/’
SITE_BASE = ‘https://example.com/cloud
SITE_NAME = ‘Name’
SITE_TITLE = ‘Name’

And finally some of my websites logs:

Error 21027#0: 144477 "/var/www/vhosts//httpdocs/cloud/api2/ping/index.html" is not found (2: No such file or directory) nginx error
Error 21027#0: 144477 "/var/www/vhosts//httpdocs/cloud/api2/account/info/index.html" is not found (2: No such file or directory) nginx error
Error 404 GET /cloud/ HTTP/1.1 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0 162 nginx SSL/TLS access
Error 21027#0: 144476 "/var/www/vhosts//httpdocs/cloud/index.html" is not found (2: No such file or directory) nginx error
Error 404 GET /cloud/api2/ping/ HTTP/1.1 Mozilla/5.0 162 nginx SSL/TLS access
Error 404 GET /cloud/api2/account/info/ HTTP/1.1 Mozilla/5.0 162 nginx SSL/TLS access
Error 21027#0: 144479 "/var/www/vhosts//httpdocs/cloud/api2/ping/index.html" is not found (2: No such file or directory) nginx error
Error 21027#0: 144479 "/var/www/vhosts//httpdocs/cloud/api2/account/info/index.html" is not found (2: No such file or directory) nginx error
Error 404 GET /cloud/api2/ping/ HTTP/1.1 Mozilla/5.0 162 nginx SSL/TLS access
Error 404 GET /cloud/api2/account/info/ HTTP/1.1 Mozilla/5.0 162 nginx SSL/TLS access
Error 21027#0: 144482 "/var/www/vhosts//httpdocs/cloud/api2/ping/index.html" is not found (2: No such file or directory) nginx error
Error 21027#0: 144482 "/var/www/vhosts//httpdocs/cloud/api2/account/info/index.html" is not found (2: No such file or directory) nginx error
Error 404 GET /cloud/api2/ping/ HTTP/1.1 Mozilla/5.0 162 nginx SSL/TLS access
Error 404 GET /cloud/api2/account/info/ HTTP/1.1 Mozilla/5.0 162 nginx SSL/TLS access

I tried some of the common fixes regarding nginx I needed to do until everything worked properly with seafile, but nothing really worked and I’m getting quite desperate about it. I hope somebody of you guys can help me!

Thanks a lot in advance!
Greetz Aimlittle


#2

Is that you actual config? Please change the domain to your actual.
You must check for everything in the config that defines the ROOT variable as that messes up the address your client opens


#3

You should change fastcgi to WSGI as WSGI is recommended for 6.2.2.

Second, take a look in seahub_settings.py and I think it’s in ccnet.conf also that you have the right domain name there.
For more information regarding that see the manual.


#4

Do yourself a favour and put Seafile on a ded server/vps. Plesk has its own libraries and sooner or later you will run into trouble.
I have been there, done that, won’t do it again.

Maybe you could at least use the seafile docker version if that works for you.


#5

Well it is on a vps…


#6

No it’s not my actual config. I changed the domain for the post^^


#8

Dedicated VPS for Seafile alone.

You may run it via docker in Plesk and forward the port via Plesk.
Also i suggest you use a subdomain rather than a subfolder. It’s just easier to handle.


#9

Okay I will try doing it with a subdomain, which I already tried and it didn’t work… But i can use the Dockers without needing a fresh server do I?


#10

This depends on your Plesk license and if your VPS is powerfull enough.
I suggest that you check how to run docker images with resource limits otherwise it might max out your server resources.


#12

Okay well now I got it somehow working on a subdomain BUT I just get the correct layout, displaying that the requested page could not be found… in seahub_django_request.log I have an error which explains why this happens

2017-11-24 00:17:23,894 [WARNING] django.request:170 get_response Not Found: /index.html

But I don’t get it why it couldn’t find index.html … I got this working after a fresh install of seafile


#13

What docker image are you using?
Which manual?


#14

I’m not using a docker image - I’m using version 6.2.3 with nginx and manual from manual.seafile.com


#15

As said before this is not recommended with Plesk.
It does not support all nginx settings and overwrites those settings randomly. (Speaking from experience)
Please try the docker image and forward the port with Plesk. SSL can be done with Plesk (LE).


#16

Can you recommend a specific docker which I could use? I mean just until I will tear down the server and redo everything from scratch without plesk…


#17

If you tear the system down…I personally would suggest to not use docker…It seems to cause problems with upgrading and various other issues. I cannont confirm those tho, since I’ve yet to use it.

What else is running on this box that requires you to run Seafile in a Docker container?

Starting from scratch, I would suggest to set up a Centos 7 box and run with it. Super simple and can be up and running with HTTPS in about 10min easy.


#18

Centos is way more complex than Ubuntu/Debian if one is not familiar with Linux/Unix.

Why is docker not stable? The DEVs release it as stable don’t they?

@Aimlittle
Did you setup Plesk entirely to run Seafile?

I can provide you the link to the new community manual later today. Not finished yet but enough to setup Seafile.
I will add the required documents for the config files today, so it contains enough info to properly setup Seafile.


#19

Well I didn’t because it’s not an unique VPS just for Seafile. For the usage which I have in mind, it is quite useless to put it on another VPS.

Yeah that would be nice. You know how I can upload the official seafile docker to plesk so i can use it?


#20

I did not have the time to work on the manual today. During this week then.

Official Docker Image Manual: https://github.com/haiwen/seafile-docker#getting-started
For whatever reason they only put it on github instead the manual page.

You can search in docker hub via Plesk.

https://hub.docker.com/r/seafileltd/seafile/
https://hub.docker.com/r/m3adow/seafile/
https://hub.docker.com/r/jenserat/seafile/

@daniel.pan Community based images are better documented and easier to use than the official one. This is sad. :frowning:


#21

Okay well it works now on my new Server with docker, but now i have a different problem… I’ll open for it a new Thread. But thanks a lot any ways