Trying to set up Seafile on /seafile/ directory instead of root, having issues


#1

I set up Seafile on my Raspberry Pi server yesterday, and was successful, but then decided I wanted to move it from the server root to /seafile/. So I changed some settings following the guide, … which I can’t link, but it’s the official guide. Anyway, below the Seafile header bar, it now shows “Sorry, but the requested page could not be found.” Part of the problem may have been to me following this guide from DigitalOcean for Debian 9 during initial setup, rather than the offical docs.

Here’s my Apache config. Wish I could link the pastes I made on Debian’s Pastezone I made but whatever, here we go.

<IfModule mod_ssl.c>
<VirtualHost *:443>
        # The ServerName directive sets the request scheme, hostname and port 
        # that the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        ServerName cwhymedia.com
        ServerAlias www.cwhymedia.com
        ServerAdmin admin@cwhymedia.com
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
        SSLCertificateFile /etc/letsencrypt/live/cwhymedia.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/cwhymedia.com/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf

        Alias /seafmedia /home/chris/seafile-server-latest/seahub/media
        <Location /seafmedia>
            Require all granted
        </Location>

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

        # seahub web interface
        SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
        ProxyPass /seafile http://127.0.0.1:8000/
        ProxyPassReverse /seafile http://127.0.0.1:8000/
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
</IfModule>

Here’s my ccnet.conf:

[General]
USER_NAME = SeafileRPi
ID = 4abef6400a3a779e6470239e2b4c64d6e25bd0e0
NAME = SeafileRPi
SERVICE_URL = https://cwhymedia.com/seafile

[Client]
PORT = 13419

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

Here’s my seahub_settings.py:

# -*- coding: utf-8 -*-
SECRET_KEY = "[redacted]"
FILE_SERVER_ROOT = 'https://cwhymedia.com/seafhttp'
SERVE_STATIC = False
MEDIA_URL = '/seafmedia/'
COMPRESS_URL = MEDIA_URL
STATIC_URL = MEDIA_URL + 'assets/'
SITE_ROOT = '/seafile/'
LOGIN_URL = '/seafile/accounts/login/'

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'seahub-db',
        'USER': 'chris',
        'PASSWORD': '[redacted]',
        'HOST': '127.0.0.1',
        'PORT': '3306'
    }
}

Also, on a Raspberry Pi, do I need to have systemd start them as user, instead of being system services? The latter doesn’t seem to work.


#2

Is there more information that I should include here? I’d really like to try Seafile but I need to get it working at all, first.


#3

you want to change this to the new location

otherwise it seems fine to me. What’s the error in the Apache log?


#4

I don’t if this is your error, but try to delete the trailing slashes here. I.e.:

ProxyPass /seafile http://127.0.0.1:8000
ProxyPassReverse /seafile http://127.0.0.1:8000

It’s a tiny detail to miss in the manual.


#5

Thanks for the tips, melkor0. Sorry for taking so long in responding.

Here’s the documentation I followed (remove spaces, since I can’t post links for some reason):

manual . seafile . com /deploy/deploy_seahub_at_non-root_domain.html

I deleted the trailing slashes, but that hasn’t made a difference, unfortunately. And the linked guide says: “MEDIA_URL can be anything you like, just make sure a trailing slash is appended at the end.” So if I’m reading it right it means I could use seafmedia, or I could use porkchopsandwiches, so long as I use the same thing in the Apache config that I use in seahub_settings.py