apache virtual host problem

Karl Auer kauer at biplane.com.au
Mon Feb 4 01:22:59 UTC 2008


On Sun, 2008-02-03 at 19:48 -0500, Ashley Benton wrote:
> Ok I tried and changed NameVirtualHost 192.168.0.105  for all virtual
> hosts and I still got the same result. You can see only the first
>                                  <NameVirtualHost 192.168.0.105> 

Well, you need the NameVirtualHost directive; that specifies the address
of your server. All your named virtual hosts will then specify this
address. Inside the virtualhost you need to specify the name of the
specific site. Something like this:

NameVirtualHost 1.2.3.4

<VirtualHost 1.2.3.4>
   DocumentRoot "/path/to/site/data"
   ServerName www.mydomain.com
   <Directory "/path/to/site/data">
      ...
   </Directory>
</VirtualHost>

>  I have to put a different internal address and how do I tell the
> computer to add another internal address?

No, you don't need additional addresses - that is the point of named
virtual hosts. You only need separate addresses if you will be doing
SSL.

> I tried to put the first with my public IP and the others with
> 192.168.0.105 but it didn't change the result.

Not all virtual hosts have to be on the same address. You can have more
than one NameVirtualHost directive and group sites together. In your
case, however, just use one until you have the basics worked out :-)

BTW, next time post your entire config file.

Regards, K.
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)                   +61-2-64957160 (h)
http://www.biplane.com.au/~kauer/                  +61-428-957160 (mob)

GPG fingerprint: DD23 0DF3 2260 3060 7FEC 5CA8 1AF6 D9E3 CFEE 6B28
Public key at  : random.sks.keyserver.penguin.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080204/10720045/attachment.sig>


More information about the ubuntu-users mailing list