Help with apache https configuration?


I have installed seafile with SQLite and it works like a charm.
However, I not able to set it up https with Apache correctly.
Following the manual, I have:

In seafile.conf

<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/
SSLCertificateKeyFile /etc/letsencrypt/live/
SSLCertificateChainFile /etc/letsencrypt/live/
Alias /media /home/xavier/myseafile/seafile-server-latest/seahub/media
<Location /media>
ProxyPass !
Require all granted

RewriteEngine On
ProxyPass /seafhttp htt://
ProxyPassReverse /seafhttp htt://
RewriteRule ^/seafhttp - [QSA,L]

SetEnvIf Request_URI . proxy-fcgi-pathinfo=unescape
SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1
ProxyPass / fcgi://

Yes, I use letsencrypt for all the other pages of the website. It could be part of the problem. I don’t know.

Apache seem happy with the syntax, a2ensite is fine and I have restarted the Apache service : It looks ok.

In ccnet.conf
Should it be with or without the “/media”??

In I added
Same question about the /media. Moreover, I have a seahub_settings.pyc therefore I’m not sure if this modification is taken into account.

./ start
./ start-fastcgi
both look fine.

but htts:// returns 404
“The requested URL /media was not found on this server”.

http → htt to make the forum happy. As a new user I’m not allowed to have more than 2 links in the same post!

I don’t know how to debug that…I would appreciate any ideas.


Missing some lines in apache config. This works for me, replace the beginning sign of location:


Alias /media  /opt/seafile/haiwen/seafile-server-latest/seahub/media
RewriteEngine On
%Location /media> 
    Require all granted
#seafile httpserver
ProxyPass /seafhttp
ProxyPassReverse /seafhttp
RewriteRule ^/seafhttp - [QSA,L]
RewriteRule ^/(media.*)$ /$1 [QSA,L,PT]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/(seafile/.*)$ /seahub.fcgi/$1 [QSA,L,E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# WebDAV
# We use http proxy, since SeafDAV is incompatible with FCGI proxy in Apache 2.4.
#ProxyPass /seafdav
#ProxyPassReverse /seafdav
### Seafile end

In ccnet conf it’s:

SERVICE_URL = https://domain.url/seafile

Letsencrypt certs also working with no problem

Hope it helps