Help with apache https configuration?

Hi,

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>
ServerName XXX.eu
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/XXX.eu/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/XXX.eu/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/XXX.eu/chain.pem
Alias /media /home/xavier/myseafile/seafile-server-latest/seahub/media
<Location /media>
ProxyPass !
Require all granted

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

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

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
SERVICE_URL = https://XXX.eu/media
Should it be with or without the “/media”??

In seahub_settings.py I added
FILE_SERVER_ROOT = ‘https://XXX.eu/media/seafhttp
Same question about the /media. Moreover, I have a seahub_settings.pyc therefore I’m not sure if this modification is taken into account.

./seafile.sh start
./seahub.sh start-fastcgi
both look fine.

but htts://XXX.eu/media 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.

Xavier

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

Seafile

Alias /media  /opt/seafile/haiwen/seafile-server-latest/seahub/media
RewriteEngine On
%Location /media> 
    Require all granted
%Location>
#seafile httpserver
ProxyPass /seafhttp http://127.0.0.1:8082
ProxyPassReverse /seafhttp http://127.0.0.1:8082
RewriteRule ^/seafhttp - [QSA,L]
#seahub
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 http://127.0.0.1:8080/seafdav
#ProxyPassReverse /seafdav http://127.0.0.1:8080/seafdav
### Seafile end

In ccnet conf it’s:

SERVICE_URL = https://domain.url/seafile

Letsencrypt certs also working with no problem

Hope it helps
Tom