Why can’t I add an extra subdomain to Apache Server

I run an Apache VPS and successfully created about eight subdomains.

I’m trying to add an extra subdomain but the new URL opens the “default” subdomain?

If there is not a subdomain limit then I would be grateful for any suggestions on how to overcome this limit?

A wild guess is that a new domain takes a while to propagate. Test if this is the case: https://dnschecker.org

I tried and waited without success well over the maximum of about 48 hours.

Can you share the full configuration please?

Hopefully these configuration details will suffice:

Problem

https://jasper.anetizer.com - the new subdomain opens the default https://bill.anetizer.com

The same happens for all the other newly created subdomains :frowning:

an-jasper.conf

[sumnary]an-jasper.conf[/summary]
#<VirtualHost *:443>
<VirtualHost *:80>
ServerName jasper.anetizer.com
DocumentRoot /var/www/anetizer.com/jasper/public_html
# VirtualDocumentRoot /var/www/anetizer.com/jasper/public_html
<Directory /var/www/anetizer.com/jasper/public_html>
Options +Indexes +FollowSymlinks +MultiViews
AllowOverride all
Require all granted

ErrorLog ${APACHE_LOG_DIR}/error-an-jasper.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

Certbot

[summary] Certbot --apache [/summary]
Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter ‘c’ to cancel): 5
Certificate not yet due for renewal

You have an existing certificate that has exactly the same domains or certificate name you requested and isn’t close to expiry.
(ref: /etc/letsencrypt/renewal/jasper.anetizer.com.conf)

What would you like to do?


1: Attempt to reinstall this existing certificate
2: Renew & replace the certificate (may be subject to CA rate limits)


Select the appropriate number [1-2] then [enter] (press ‘c’ to cancel): 2
Renewing an existing certificate for jasper.anetizer.com

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/jasper.anetizer.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/jasper.anetizer.com/privkey.pem
This certificate expires on 2022-07-19.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for jasper.anetizer.com to /etc/apache2/sites-available/an-jasper-le-ssl.conf
Your existing certificate has been successfully renewed, and the new certificate has been installed.

If this line really is commented then that’s the problem, the site isn’t configured to use SSL, so it will be skipped when SSL is requested and the default site will be used instead.

Normally all the configuration files are set to <VirtualHost *:80>. and the sites work using plain HTTP.

Certbot is used to add the HTTPS certificate and this is fine for dozens of domains.

I read somewhere and tried <VirtualHost *:443> and the problem was not solved.

You did reload apache after changing that I assume?

Yes “systemctl reload apache2” was called.

I decided to try :443 on all subdomains and TLDs and was not able to open the URLS in the browser so started again from scratch.

Fortunately the first subdomain reported an error something about cross-linking which was cleared and subsequent subdomains and TLDs worked no problem I am delighted to say.

I’m curious to know why the error did not previously occur?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.