l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
July 21: Defensive computing: Information security for individuals
Next Installfest:
TBD
Latest News:
Jul. 4: July, August and September: Security, Photography and Programming for Kids
Page last updated:
2004 Apr 11 22:00

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] apache question: virtualhost not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] apache question: virtualhost not working



På söndag, 11 april 2004, skrev Peter Jay Salzman:
> On Sun 11 Apr 04,  9:40 AM, Henry House <hajhouse@houseag.com> said:
> > På söndag, 11 april 2004, skrev Rod Roark:
> > > On Sunday 11 April 2004 07:04 am, Peter Jay Salzman wrote:
> > > ...
> > > >    NameVirtualHost 64.142.25.39:80
> > > > 
> > > >    <VirtualHost www.liberal.ws:80>
> > > >       ServerAdmin p@dirac.org
> > > >       DocumentRoot /home/p/linux
> > > >       ServerName www.liberal.ws
> > > >       ErrorLog /var/log/apache/test_error
> > > >       LogLevel warn
> > > >       CustomLog /var/log/apache/test_access common
> > > >    </VirtualHost>
> > > 
> > > What works for me looks like this:
> > > 
> > >    NameVirtualHost 64.142.25.39
> > >    <VirtualHost 64.142.25.39:80>
> > >       etc.
> > 
> > Rod is right; you need the NameVirtualHost directive when virtual hosts share
> > the same IP address (i.e., there are multiple DNS A records for your the IP
> > address of your server, or there are CNAME records giving it additional
> > names).
>  
> i'm confused -- isn't that what i have above?

The above text from me was meant for the benefit of humanity in general, not
specifically for you, since you were already doing that part properly. Sorry for not being clear about that.

> i have two domains, www.dirac.org and www.liberal.ws.  i want:
> 
>    www.dirac.org  -> document root /www
>    www.liberal.ws -> document root /www/p/linux
> 
> www.dirac.org already works.  it's configured correctly.  in order to
> add www.liberal.ws, i tried adding this:
> 
> 
>     NameVirtualHost 64.142.25.39:80
> 
>     <VirtualHost www.liberal.ws:80>
>        ServerAdmin p@dirac.org
>        DocumentRoot /home/p/linux
>        ServerName www.liberal.ws
>        ErrorLog /var/log/apache/test_error
>        LogLevel warn
>        CustomLog /var/log/apache/test_access common
>     </VirtualHost>
> 
> is that not correct?

No, because the argument to VirtualHost need to be the same as the address
given in to NameVirtualHost, and for every distinct VirtualHost hostname you
need a corresponding NameVirtualHost directive. The correct place to put the
name of the virtual host (i.e., what clients use) is the ServerName directive
withon the VirtualHost container. Usually the arguments to VirtualHost and
ServerName within that VirtualHost container are NOT identical.

-- 
Henry House
The unintelligible text that may follow is a digital signature. 
See <http://hajhouse.org/pgp> for information.  My OpenPGP key:
<http://hajhouse.org/hajhouse.asc>.

Attachment: signature.asc
Description: Digital signature



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!