Apache redirecting all new vhosts to a default website

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.5
Usermin version 2.302
Virtualmin version 7.30.8
Theme version 24.02
Apache version 2.4.52
Package updates All installed packages are up to date

I don’t know what has gone wrong with my settings, but when I create a new vhost, it is being redirected to the default vhost. All the old vhosts work fine. I have checked the directives of the new vhost, both non-ssl and ssl, everything looks normal. I have gone through all possible options, as much as I could. Do you have any idea what might have gone wrong?

The webserver should have been restarted to pick up the changes. I’d start with reloading that.

This is the command on my Debian 11 machine.

service apache2 reload

Though, it does seem to reload periodically anyhow.

service apache2 status
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2025-05-22 23:21:44 EDT; 2 months 20 days ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 1051936 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
   Main PID: 983 (apache2)
      Tasks: 106 (limit: 19031)
     Memory: 51.2M
        CPU: 57min 6.104s
     CGroup: /system.slice/apache2.service
             ├─    983 /usr/sbin/apache2 -k start
             ├─1051942 /usr/sbin/apache2 -k start
             ├─1051944 /usr/sbin/apache2 -k start
             └─1051945 /usr/sbin/apache2 -k start

Aug 10 00:01:53 main.cisnetadmin.com systemd[1]: Reloading The Apache HTTP Server.
Aug 10 00:01:53 main.cisnetadmin.com systemd[1]: Reloaded The Apache HTTP Server.
Aug 11 00:01:32 main.cisnetadmin.com systemd[1]: Reloading The Apache HTTP Server.
Aug 11 00:01:32 main.cisnetadmin.com systemd[1]: Reloaded The Apache HTTP Server.
Aug 11 14:30:12 main.cisnetadmin.com systemd[1]: Reloading The Apache HTTP Server.
Aug 11 14:30:12 main.cisnetadmin.com systemd[1]: Reloaded The Apache HTTP Server.
Aug 12 00:00:35 main.cisnetadmin.com systemd[1]: Reloading The Apache HTTP Server.
Aug 12 00:00:35 main.cisnetadmin.com systemd[1]: Reloaded The Apache HTTP Server.
Aug 12 12:45:18 main.cisnetadmin.com systemd[1]: Reloading The Apache HTTP Server.
Aug 12 12:45:18 main.cisnetadmin.com systemd[1]: Reloaded The Apache HTTP Server.

Does Ubuntu use the /etc/apache2/sites-enabled/ format?

But there is a FAQ entry that might help.

This is pretty much always some variant of “the wrong site shows up” from the troubleshooting websites doc.

You’ve got mix-and-match use of * and IP VirtualHosts, or you’ve got misconfigured IPv6, or you’ve got some other variant. The logic Apache uses to determine what to serve is wildly unintuitive (but consistent).

So, look at the VirtualHost definitions, and if it’s not clear what’s wrong, show us your VirtualHost definitions. You can anonymize the hostnames if you want, they usually don’t matter.

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