Using docker setup instruction: https://doc.owncloud.org/server/10.0/admin_manual/installation/docker/#installation-on-a-local-machine
Then run
docker ps
docker exec -it <container_id> bash
once in docker container bash, use the instruction to setup certbot https://doc.owncloud.org/server/10.0/admin_manual/installation/letsencrypt/
after it is setup and the certificate is generated, exit container
do a image commit
docker commit <container_id> newname:tag
edit the docker-compose file to use the new docker image to run owncloud
in the same directory as the docker-compose file, run vim 100-default.conf
put the following in the conf files:
<VirtualHost *:80>
ServerName example.com
Redirect permanent / https://example.com/
ServerAdmin webmaster@localhost
DocumentRoot /var/www/owncloud
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
<Directory /var/www/owncloud>
AllowOverride All
Options -Indexes +FollowSymlinks
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/owncloud
SetEnv HTTP_HOME /var/www/owncloud
</Directory>
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15768000; preload"
</IfModule>
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/owncloud
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
<Directory /var/www/owncloud>
AllowOverride All
Options -Indexes +FollowSymlinks
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/owncloud
SetEnv HTTP_HOME /var/www/owncloud
</Directory>
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15768000; preload"
</IfModule>
SSLEngine on
SSLProtocol all
SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
</VirtualHost>
</IfModule>
change example.com to your site name, then save
add the following to docker-compose
...
volumes:
- files:/mnt/data
- ./100-default.conf:/etc/apache2/sites-enabled/100-default.conf
then run docker-compose down
and docker-compose up
the site should now have ssl enabled
Be First to Comment