User Tools

Site Tools


apache_dokuwiki_ssl_certbot

apache2 + dokuwiki + ssl + letsencrypt (certbot) + virtual hosts (2020)

  • Install stuff
apt-get install letsencrypt python3-certbot-apache dokuwiki apache2
  • Configure ssl for main webpage
a2ensite 000-default-le-ssl.conf
sudo certbot --apache -d www.memelabs.net --post-hook "/usr/sbin/service apache2 restart"
  • Create ssl for dokuwiki webpage:
    • Copy 000-default-le-ssl.conf to dokuwiki-ssl.conf. Edit DocumentRoot to point to /usr/share/dokuwiki
    • Create ssl certificate for dokuwiki:
sudo certbot --apache -d wiki.memelabs.net --post-hook "/usr/sbin/service apache2 restart"
  • Redirect non-ssl (port 80) webpages to ssl ones:
  • Edit 000-default.conf, add:
Redirect permanent / https://www.memelabs.net
  • Do the same with the dokuwiki weppage. Create dokuwiki_ssl.conf:
<VirtualHost *:80>
ServerName wiki.memelabs.net
DocumentRoot /usr/share/dokuwiki
Redirect permanent / https://wiki.memelabs.net
RewriteEngine on
RewriteCond %{SERVER_NAME} =wiki.memelabs.net
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>
apache_dokuwiki_ssl_certbot.txt · Last modified: 2021/02/01 05:55 by 127.0.0.1