haiwen / seahub

The web end of seafile server.
seafile.com
Other
526 stars 369 forks source link

seafdav not working #2044

Closed paapereira closed 6 years ago

paapereira commented 6 years ago

I'm having problems accessing the seafile via webdav. "Sorry, but the requested page could not be found."

It was working and for some reason it isn't working anymore and I can't figure out why.

I'm in Arch Linux with seafile-pro-server_6.2.9_x86-64.tar.gz installed mannually as in the manual. I use mysql and Apache with SSL.

Here's my logs and configuration files.

$ tail -f ccnet.log [03/20/18 21:28:07] ../common/session.c(409): Accepted a local client

$ tail -f controller.log

[03/20/18 21:28:44] seafile-controller.c(575): pid file /srv/seafile/cal/pids/seafdav.pid does not exist
[03/20/18 21:28:44] seafile-controller.c(606): seafdav need restart...
[03/20/18 21:28:44] seafile-controller.c(87): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server --log-file /srv/seafile/cal/logs/seafdav.log --pid /srv/seafile/cal/pids/seafdav.pid --port 8080 --host localhost
[03/20/18 21:28:44] seafile-controller.c(102): spawned /usr/bin/python2.7, pid 24101

$ vi ccnet.conf

[General]
USER_NAME = xxxxx
ID = XXXXXXXXXXXXXXXXXXXXXXXXXXX
NAME = xxxxx
SERVICE_URL = https://xxxxx.xxxx.xxx

[Client]
PORT = 13419

[Database]
ENGINE = mysql
HOST = 127.0.0.1
PORT = 3306
USER = seafile
PASSWD = xxxxxxxxxx
DB = ccnet-db
CONNECTION_CHARSET = utf8

$ vi seahub_settings.py

# -*- coding: utf-8 -*-
SECRET_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXX"

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'seahub-db',
        'USER': 'seafile',
        'PASSWORD': 'XXXXXXXXXX',
        'HOST': '127.0.0.1',
        'PORT': '3306'
    }
}

FILE_SERVER_ROOT = 'https://xxxxx.xxxx.xxx/seafhttp'

EMAIL_USE_TLS = True
EMAIL_HOST = 'xxxx.xxxx.xxx'
EMAIL_HOST_USER = 'xxx@xxxx.xxx'
EMAIL_HOST_PASSWORD = 'xxxxxxxxxxx'
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = "xxxx@xxxxx.xxx"
SERVER_EMAIL = "xxxx@xxxxx.xxx"

ENABLE_RESUMABLE_FILEUPLOAD = True

$ vi seafdav.conf

[WEBDAV]
host = localhost
enabled = true
port = 8080
fastcgi = false
share_name = /seafdav

$ vi /etc/httpd/conf/extra/httpd-vhosts.conf

<VirtualHost *:443>

  ServerName xxxx.xxxx.xxx
  DocumentRoot /etc/httpd

  SSLEngine On
  SSLCertificateFile /etc/httpd/conf/cacert_seafile.pem
  SSLCertificateKeyFile /etc/httpd/conf/privkey_seafile.pem

  Alias /media  /srv/seafile/cal/seafile-server-latest/seahub/media

  <Location /media>
    Require all granted
  </Location>

  RewriteEngine On

  #
  # seafile fileserver
  #
  ProxyPass /seafhttp http://127.0.0.1:8082
  ProxyPassReverse /seafhttp http://127.0.0.1:8082
  RewriteRule ^/seafhttp - [QSA,L]

  #
  # WebDAV
  # We use http proxy, since SeafDAV is incompatible with FCGI proxy in Apache 2.4.
  #
  ProxyPass /seafdav http://127.0.0.1:8080/seafdav
  ProxyPassReverse /seafdav http://127.0.0.1:8080/seafdav

  #
  # seahub
  #
  SetEnvIf Request_URI . proxy-fcgi-pathinfo=unescape
  SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
  ProxyPass / fcgi://127.0.0.1:8000/

</VirtualHost>
paapereira commented 6 years ago

Don't know if this helps:

/usr/bin/python2.7 -m wsgidav.server.run_server --log-file /srv/seafile/cal/logs/seafdav.log --pid /srv/seafile/cal/pids/seafdav.pid --port 8080 --host localhost

/usr/bin/python2.7: No module named wsgidav.server

shoeper commented 6 years ago

It is unlikely that this is a bug. Please use the forum for questions.

eifinger commented 5 years ago

@paapereira I had exactly the same issue. In my case some other process started before seafdav on the configured port. I changed the port in seafdav.conf and restarted seafile.