• 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.

Mass Virtual Hosting

J

jdandrea

Guest
Greetings! I'm working with a colleague who has Plesk 8.2 (via MediaTemple) and she has an interesting situation ... but perhaps not all that uncommon.

She adds domains for various clients, the usual:

company-1.com
company-2.com
...
company-n.com

For new sites, she handles their domain/DNS so they can preview their site right away.

However, some companies _already_ have their own web sites, so the domain hasn't been transferred yet. This creates a problem. They can't preview the site on the new server yet!

Sure, we could ask the client to change their local file-based name resolution (umm, no) ... or my colleague could temporarily rename each to-be-transferred domain to be a subdomain of her main site.

(Actually, is that even possible to do cleanly? That could work nicely. But what if it's not an option?)

Then I read this: http://httpd.apache.org/docs/2.0/vhosts/mass.html

Great! So my new goal was to allow access automagically using alternate names like this:

company-1.com.myclientsite.com
company-2.com.myclientsite.com

Essentially the first and second (%1 and %2) parsed bits of the domain maps like so:

/var/www/vhosts/company-n/httpdocs
/var/www/vhosts/company-n/cgi-bin

(forgetting https for a moment).

MediaTemple does the same thing for their GridServer (gs) customers using Apache. Of course they won't tell us their exact configuration but I figure it has its roots in the Apache docs.

The nice thing about this is I can then preview any number of sites with a consistent naming convention, all on the fly.

Next, I rechecked the Plesk documentation ... and didn't see a master config in which to add this configuration.

The next best spot was in /etc/httpd/conf.d so I created zzzzz_mass_virtual.conf, linted it (passed) and restarted Apache just to see what might happen.

Alas, I must be doing something wrong 'cause it didn't give me the desired effect, so I figure I'm missing something or there's a conflict somewhere across the configs.

(For the record, I tried the "Simple Dynamic Virtual Hosts" method w/o the custom log, and then the "Separate Virtual Host Configuration File" method.)

In the end, I removed all of my new files, restarted Apache, and all's well.

Meanwhile, I've written Plesk support (but they seem to be on vacation??), so I'm turning to the forum to see if anyone can provide clues as to the following:

a) Is this sort of thing already available in Plesk or as a module of some sort?
If so, perhaps it just isn't enabled (yet).

b) Have you already done something similar for other customers, or do you have
a best practice or whitepaper that illustrates handling this scenario in Plesk?

c) [Your other feedback here.] :)

Thank you!

- Joe
 
Couldn't you just add a "Domain Alias" in Plesk for each domain? When doing this, you can add company-1.com.yoursite.com ... which is an alias to company-1.com ... but because it sets it up with the ServerAlias directive in Apache, it is viewable without changing DNS for the main domain.
 
breun: Alas, Plesk's site preview function messes with the URI path, which in turn messes up relative links (even docroot-relative ones), so it's useless for true previews.

l33tnet: Indeed, I was about to try exactly that - add a Domain Alias. I stopped short because I figured a Domain Alias is just a canonical name (CNAME) DNS entry. If that's the case, it will just point back to the original site's DNS entry, not the new one (which hasn't been transferred yet, natch).

Perhaps I'm mistaken? [ tap tap tap ... ]

Thankfully, I was! THANK YOU!
 
Back
Top