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.