It was thus said that the Great [EMAIL PROTECTED] once stated:
> 
> I can put the IP of the box just under the ServerName?
> (from  /etc/httpd/conf /httpd.conf)
> 
> # If this is not set to valid DNS name for your host, server-generated
> # redirections will not work.  See also the UseCanonicalName directive.
> #
> # If your host doesn't have a registered DNS name, enter its IP address 
> here.
> # You will have to access it by its address anyway, and this will make
> # redirections work in a sensible way.
> #
> ServerName midnight.chismtrail.com
> NameVirtualHost 12.34.56.78
> 
> or I can list it in EACH
> <VirtualHost > 12.34.56.78
> like that???

  Okay, here's a stripped version of my Apache conf on my development box
(Apache 1.3---should be similar for Apache 2.x).

        ServerRoot "/usr/services/httpd"

        BindAddress 10.0.0.3
        Port 80
        User www
        Group www

        DocumentRoot "/usr/services/httpd/sites/linus.groomlake.area51/htdocs"

Top level directory I use is "/usr/services/httpd" and my default document
root is "/usr/services/httpd/sites/linus.groomlake.area51/htdocs" [1]. 
Apache binds to port 80 on address 10.0.0.3 and runs as the "www" user.

        <Directory "/usr/services/httpd/sites/linus.groomlake.area51/htdocs">
            Options             All
            AllowOverride       All
            Order               allow,deny
            Allow               from all
        </Directory>

I'm pretty liberal when it comes to the development machine.

        NameVirtualHost 10.0.0.3:80

Okay, I'm also hosting other sites on the same IP address.  

        <VirtualHost    10.0.0.3>
          ServerAdmin   [EMAIL PROTECTED]
          ServerName    linus.groomlake.area51
          DocumentRoot  /usr/services/httpd/sites/linus.groomlake.area51/htdocs
          ScriptAlias   /cgi-bin/ 
/usr/services/httpd/sites/linus.groomlake.area51/cgi-bin/
          CustomLog     logs/linus.groomlake.area51 combined
          <Directory 
/usr/services/httpd/sites/linus.groomlake.area51/htdocs/admin>
            AuthType            Digest
            AuthName            "Administration"
            AuthDigestFile      
/usr/services/httpd/sites/linus.groomlake.area51/digest-pass
            AuthDigestGroupFile 
/usr/services/httpd/sites/linus.groomlake.area51/digest-group
            Require             group admin
          </Directory>
          <Directory 
/usr/services/httpd/sites/linus.groomlake.area51/htdocs/private>
            AuthType            Basic
            AuthName            "Private Library"
            AuthDBUserFile      
/usr/services/httpd/sites/linus.groomlake.area51/dbm-pass
            AuthDBGroupFile     
/usr/services/httpd/sites/linus.groomlake.area51/dbm-group
            Require             group   admin users
          </Directory>
        </VirtualHost>

        <VirtualHost    10.0.0.3>
          ServerAdmin   [EMAIL PROTECTED]
          ServerName    boston.groomlake.area51
          DocumentRoot  /usr/services/httpd/sites/boston.groomlake.area51/htdocs
          ScriptAlias   /cgi-bin/ 
/usr/services/httpd/sites/boston.groomlake.area51/cgi-bin/
          CustomLog     logs/boston.groomlake.area51 combined
        </VirtualHost>

Two of the virtual domains.  Both are under /usr/services/httpd/sites/<domain>.
You can see that for one, I was playing around with the various
authenticiation modules.  The other virtual host is quite simple.

        <VirtualHost    10.0.0.3>
          ServerAdmin   [EMAIL PROTECTED]
          ServerName    mirror.groomlake.area51
          DocumentRoot  /home/spc/homesite/build
          ScriptAlias   /cgi-bin/ 
/usr/services/httpd/sites/mirror.groomlake.area51/cgi-bin
          CustomLog     logs/mirror.groomlake.area51 combined
          Alias         /people/spc/    "/home/spc/homepage/build/"
          <Directory "/home/spc/homepage">
                Options         All
                AllowOverride   All
          </Directory>
        </VirtualHost>

But the virtual host doesn't have to be under the ServerRoot directory. 
Here I have a mirror of my main site where most of it is stored under
"/home/spc/homesite/build", with another section of it under
"/home/spc/homepage/build".

  -spc (Hopefully this will clear up some of the confusion about virtual
        hosts)

[1]     Yes, the server name is "linus.groomlake.area51".  I was playing
        around with DNS several years ago and configured a TLD for my own
        internal use.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to