[vox-tech] apache question: virtualhost not working

Henry House vox-tech@lists.lugod.org
Sun, 11 Apr 2004 21:50:43 -0700


--UugvWAfsgieZRqgk
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

P=E5 s=F6ndag, 11 april 2004, skrev Peter Jay Salzman:
> On Sun 11 Apr 04,  9:40 AM, Henry House <hajhouse@houseag.com> said:
> > P=E5 s=F6ndag, 11 april 2004, skrev Rod Roark:
> > > On Sunday 11 April 2004 07:04 am, Peter Jay Salzman wrote:
> > > ...
> > > >    NameVirtualHost 64.142.25.39:80
> > > >=20
> > > >    <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>
> > >=20
> > > What works for me looks like this:
> > >=20
> > >    NameVirtualHost 64.142.25.39
> > >    <VirtualHost 64.142.25.39:80>
> > >       etc.
> >=20
> > 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 th=
e IP
> > address of your server, or there are CNAME records giving it additional
> > names).
> =20
> 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. Sorr=
y for not being clear about that.

> i have two domains, www.dirac.org and www.liberal.ws.  i want:
>=20
>    www.dirac.org  -> document root /www
>    www.liberal.ws -> document root /www/p/linux
>=20
> www.dirac.org already works.  it's configured correctly.  in order to
> add www.liberal.ws, i tried adding this:
>=20
>=20
>     NameVirtualHost 64.142.25.39:80
>=20
>     <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>
>=20
> 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 directi=
ve
withon the VirtualHost container. Usually the arguments to VirtualHost and
ServerName within that VirtualHost container are NOT identical.

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


--UugvWAfsgieZRqgk
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAeiAji3lu92AVGcIRAqcgAJ0RL00AODhC6zH+x9LInvjF3KFzjQCffGje
2jTS9zwYrKnYupKK2vXTkDE=
=AZ8p
-----END PGP SIGNATURE-----

--UugvWAfsgieZRqgk--