1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Mass Virtual Hosting

Discussion in 'Plesk for Linux - 8.x and Older' started by jdandrea, Jul 18, 2007.

  1. jdandrea

    jdandrea Guest

    0
     
    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
     
  2. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
    Plesk has a Site Preview button for domains.
     
  3. l33tnet

    l33tnet Guest

    0
     
    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.
     
  4. jdandrea

    jdandrea Guest

    0
     
    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!
     
Loading...