Two or more webs at home

John D Jones III unixgeek1972 at
Thu Apr 23 20:18:59 MDT 2009

   Michael Torrie wrote:--

Gary Thornock wrote:

--- On Wed, 4/22/09, Jones, Scott (GE Money, consultant) [1]<Scott.1Jones at
m> wrote:

Is it possible to host/serve/run two or more web sites at one
location with one static IP?

I have my web but my three boys will soon want to set up their
own web sites and update and manage each on their own. Can
these all run from my home network? These will not likely be
commerce sites, but just fun, more or less static sites for my
boys to get their feet wet.

Am I thinking of virtual servers? What are the possibilities

Not only possible but easy.  In a stock Apache httpd.conf,
search for the keyword "NameVirtualHost".  There are pretty
good instructions right in the comments in the file.

One technique I use to provide SSL access for a couple of different
virtual hosts is to use different ports.  domain A would be
[2]https://A.domain:1443, domain B could be [3]https://B.domain:2443.  Not
super clean, but it works pretty well, especially if you're direction
traffic to SSL from a non-ssl page to begin with.

PLUG: [4], #utah on
Unsubscribe: [5]
Don't fear the penguin.

   Apache's VirtualHosts are the way to go, for sure, you can use
   multiple domain names, create sub domains, whatever, just make sure
   the DNS for the subs and/or otherdomains point to the correct IP. Some
   examples taken from a working Apache 2.2 configuration below:
   <VirtualHost *:80>
     DocumentRoot "/usr/local/www/somesub"
     ServerAdmin [6]email at address.tld
       <Directory "/usr/local/www/somesub">
       Options Indexes
       Allow from all
       Order allow,deny
       AllowOverride None
   <VirtualHost *:80>
      SetEnv RAILS_ENV development
      DocumentRoot /usr/local/www/rails/public
      ErrorLog "/var/log/rails-errors.log"
      <Directory /usr/local/www/rails/public/>
        Options ExecCGI FollowSymLinks
        AddHandler cgi-script .cgi
        AllowOverride All
        Order allow,deny
        Allow from all
   # Non Main Domains
   <VirtualHost *:80>
     ServerName [7]
     DocumentRoot "/home/othersite/public_html"
     ServerAdmin [8]email at address.tld
     ServerAlias *
     <Directory "/home/othersite/public_html">
       Options Indexes FollowSymlinks
       AllowOverride All
       Order allow,deny
       Allow from all
   Hope this helps. One thing to note, I've noticed that you want to put
   all otherdomain directives after all mainsite subdomains, Apache seems
   to freak out and just display the first VirtualHost directive if


   1. mailto:Scott.1Jones at
   2. https://A.domain:1443/
   3. https://B.domain:2443/
   6. mailto:email at address.tld
   8. mailto:email at address.tld

More information about the PLUG mailing list