[vox-tech] apache question: virtualhost not working

Henry House vox-tech@lists.lugod.org
Sun, 11 Apr 2004 09:40:18 -0700


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

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.

Rod is right; you need the NameVirtualHost directive when virtual hosts sha=
re
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 have DNS names, not IP addresses, in my declarations of NameVirtualHost a=
nd
VirtualHost. It seems to work fine either way.

There is another technique for virtual hosts, now little used, involving a
different IP address for each virtual host. For example, bar.foo.org might =
be
served via eth0, while baz.foo.org via eth0:1. In this case you do not need
the NameVirtualHost directive. I have used this method; it was useful back
when some browsers did not support virtual hosts and when static IP address=
es
were not so scarce.

--=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>.


--Dxnq1zWXvFF0Q93v
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)

iD8DBQFAeXTyi3lu92AVGcIRAh+ZAJ9rxY+CqTkekO8S65hEGRhFeY5iLwCfVBAt
LVTdv+dWGVk6VX7HJ9zblow=
=ROCL
-----END PGP SIGNATURE-----

--Dxnq1zWXvFF0Q93v--