Problem Description
I’m trying to set up a static website on my Freedombox not by going the user-based way, but by leveraging a custom Apache config file with a domain name (let’s call it custom.com) that’s not the one used for Plinth (let’s call it main.com)
I also got a SSL certificate via Let’s Encrypt, so I’m all good here.
Details
Here’s my config at /etc/apache2/sites-available/01-custom.com (I used 01 as a prefix to prioritize it over the freedombox config files).
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName custom.com
ServerAlias www.custom.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/custom
DirectoryIndex index.html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/custom.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/custom.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
Then:
- I place
index.htmlin/var/www/html/custom. - I create the symlink in
/etc/apache2/sites-enabledand reload Apache.
Expected Results
I should see the content of that index.html at https://custom.com.
Actual results
When trying to reach my website at https://custom.com, I get redirected to https://custom.com/plinth - even though this is not the domain name I use for that effect - and my Freedombox home page shows up.
What’s the Apache directive I need to add so that https://custom.com shows the content of /var/www/html/custom/index.html?
Interestingly, when going to https://custom.com/category, it shows correctly the content of /var/www/html/custom/category/index.html.
Alternatively…
If I choose to go the user-based way, is it possible to have https://custom.com to show the content of https://main.com/~myuser? I tried to play with a CNAME DNS record, but without success.