• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

www and wildcard subdomain as seperate domains

J

Johand

Guest
I've got a small (read: big) problem with a wildcard; here's the setup:

There's a client with 2 domains configured: www.example.com and example.com (without www)
These domains have their own hosting, since they have different sites.

example.com is configured with a wildcard subdomain;
"*.example.com CNAME example.com" in DNS
"ServerAlias *.example.com" in vhost.conf
www.example.com is standard, except that it only accepts www (or subsubdomains like test.www.example.com)

The problem is, after I configured the DNS and vhost.conf, I can't access the WWW site, but it goes to the wildcard site.

Is there a simple solution to fix this like excluding www from the wildcard or doing a query on the psa database, or do I have to rethink/rebuild the configuration?

I did find some possible reasons due the order of the domains at the psa database (wildcard is before www) which means that apache first sees the wildcard and stops instead of checking for the www part.

Some help will be very usefull.
 
Problems

John,

You need to tell what distribution you are using. Are you using Windows 2000X or Linux? It makes it easier to give you an answer.

Windows allows for multi-domain usage on SSL where as Linux only allows for single SSL usage per domain.

So in your case we need to know your distribution for an exact answer
 
Hi Chris,

The problem is not related to SSL, the problem is that the order of domains is fixed by the order of creation date/time.
Therefor the httpd.conf for the wildcard domain is loaded before the www domain, so www isn't seen by Apache, since it stops at the wildcard configuration.

If I first create the fixed subdomains (like www) and then the wildcard everything works as expected.
When I add a new fixed subdomain (eg. admin.example.com) it won't work and goes to the wildcard setup.

It's very annoying, because I do need the wildcard, but in the meantime I do need to add extra subdomains dynamicly, so I can't delete and recreate the wildcard everytime I've got a new (fixed) subdomain.

But, in case does help:
Plesk: 9.3.0
OS: Red Hat 4.1.2
 
Back
Top