Forum Discussion

Jason_Peery_467's avatar
Jason_Peery_467
Icon for Nimbostratus rankNimbostratus
Apr 30, 2012

Guidelines for pointing to one web server with many Virtual Sites

Hi all, am looking for advice, suggestions, or reference to best practice for fronting a single web server, with many virtual sites with a BigIP LTM. Do I just set up a virtual server for each site and point it and let the apache instance funnel the request based on the url?

Thanks!

 

Jason

 

 

 

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    Software virtual servers? As in multiplexed by name? If so, it's one VS...

     

     

    If your VS's are differentiated by IP or port, I'd use multiple VS's myself... Until at some point it gets onerous with too many VS's (And your threshold will vary here) and replace it with one VS again that uses either port 0 or a network VS for multiple IP's and use an iRule to dispatch to the correct pool.

     

     

    Or did you mean a single physical web server and it's running multiple copies of apache on different IP's or ports... In which case I'd go with option 2 above again...

     

     

    Sorry to be unclear, but the question was a bit wide open as to what you mean by 'virtual sites'.

     

     

    H
  • Ah, sorry to be so vague, what I mean is an Apache instance (one only) that has a number of virtual server definitions on it, basically it's a "content" server with a number of marketing websites. I was just wondering how best to configure the F5, in that should I use an iRule, or anything, or just set up a virtual server on the F5 for each instance on the web server...

     

    Thanks!

     

    JP

     

  • Hi guys Jason & Hamish,

     

    Can you share an iRule to achieve this task... as I am testing a similar environment before I take it live.

     

     

    Regards,
  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    1 more bit... Virtual servers configured on same ip:port (i.e software virtual servers using the host: header) or separate ip/port for each?

     

     

    H
  • Here's a paste from the httpd.conf:

     

     

     

    ServerAdmin webmaster@grantham.edu

     

    VirtualDocumentRoot /var/www/hosts/%1

     

    ServerAlias *.grantham.edu

     

    LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon

     

    ErrorLog logs/wildcard.grantham.edu.log

     

    CustomLog logs/access_log vcommon

     

    RewriteEngine On

     

    RewriteOptions Inherit

     

     

    AllowOverride All

     

    Allow from all

     

     

     

    AllowOverride All

     

     

     

    AllowOverride All

     

    Order allow,deny

     

    Allow from 172.16.0.0/16

     

     

     

     

    AllowOverride All

     

     

     

     

    AllowOverride All

     

     

     

     

    AllowOverride All

     

     

     

     

    AllowOverride All

     

     

     

     

     

    So I'm guessing I need a virtual server on the BigIP for each site?
  • I'm a windows guy, but if Apache will handle the requests properly based on the host header you should only need one VIP and the apache server should provide the content for that url. Hope I'm understanding the question properly.

     

     

    John
  • That's kinda what I was thinking, that basically the BigIP will just flow traffic as normal with one VS, but our architecture typically (for logical reasons) separates on a one-to-one basis of BigIP Virtual Server to each individual instance on the web server. I just wasn't sure if this is standard, best practice, etc? Perhaps it would be better to go and create a unique port for each site and make a VS on the BigIP to each port...?
  • Honestly, I don't think there's a need to overcomplicate the architecture unless there are requirements I'm missing. A config like the following should work, and I've seen this done with sharepoint farms:

     

     

    1. Single VIP on the F5

     

    2. A single pool with your apache server(s)

     

    3. If SSL is required, you'll want a wildcard cert for *.grantham.edu. If you're licensed for it you might consider offloading the SSL at the F5.

     

     

    No iRule is required for this configuration, it's pretty basic.

     

     

    Hope that helps,

     

    John