Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.
My domain is: whiki.online
I ran this command:
It produced this output:
My web server is (include version): Apache/2.4.41
The operating system my web server runs on is (include version): 20.04.5
My hosting provider, if applicable, is: Digital Ocean
I can login to a root shell on my machine (yes or no, or I don't know): Yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): No
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot): 1.29.0
I'm currently running several MediaWiki sites on my sever (located at /var/www/html/mediawiki), and also an Wordpress site (located at /var/www/html/whiki.online). I'm using several Virtual Host files to point each wiki (i.e. wiki1.whiki.online, wiki2.whiki.online) to the MediaWiki install, and a separate Virtual Host file for the Wordpress install.
I want to combine all of the Virtual Hosts under one wildcard Virtual Host, but this also means I need a wildcard SSL set up. I've done some research and come up with this, which I believe may work?
<VirtualHost *:80>
DocumentRoot /var/www/html/mediawiki
ServerAlias *.whiki.online
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/html/whiki.online
ServerName whiki.online
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/html/mediawiki
ServerAlias *.whiki.online
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/whiki.online-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/whiki.online-0001/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/whiki.online
ServerName whiki.online
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/whiki.online/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/whiki.online/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
(I've already generated the Lets Encrypt wildcard cert, which lives at the /live/whiki.online-001 location). I'm a little unsure if the above VH file is correct, though, and what the process for swapping them over would be — if the file is correct, can all of the VH go in one file, or do the HTTP and the HTTPS ones have to go in separate VH files?
I assume then (if the code is correct), I can just enable the file (or files) via Apache, and then disable the other ones? Is it as easy as just disabling them through a2dissite *
, or do I have to do something more?
Any help would be appreciated!