apache virtual host problem
Kim Briggs
patiodragon at gmail.com
Tue Feb 5 03:07:25 UTC 2008
On 2/4/08, Derek Broughton <news at pointerstop.ca> wrote:
> Ashley Benton wrote:
>
> > Sorry I have NameVirtualHost 192.168.0.105 on the first line and
> > <VirtualHost 192.168.0.105 > on the second line.
> > Meg
>
> Karl's leading you astray...
>
> One only needs NameVirtualHost to specify an IP if you have multiple
> interfaces to the Internet. For this, and almost certainly for your
> production version, you want:
>
> NameVirtualHost *
>
> <VirtualHost *>
> ServerName example.org
> ...
> </VirtualHost>
>
> <VirtualHost *>
> ServerName another.org
> ...
> </VirtualHost>
>
> From your original mail:
>
> > I tried to add the following lines in /etc/apache2/http.conf
> > ServerName localhost
> > ServerName www.example1.com
> > ServerName www.example2.com
> > ServerName www.Example.org
>
> That's bad :-) You want the ServerName directives for each virtual host
> _only_ within the <VirtualHost> definition.
>
> (and we don't ever modify http.conf! - put each virtual host config in a
> separate file in /etc/apache2/sites-enabled)
> --
> derek
>
Yes, if you are using the latest Ubuntu with apache2, you should
definitely be using "sites-enabled", but normally you put the files in
"sites-available" and then turn them on and off with soft-links. Here
is a complete "how-to" for a development machine:
http://kimbriggs.com/computers/computer-notes/linux-notes/apache2-public_html-virtual-directories.file
cheers,
--
http://kimbriggs.com
More information about the ubuntu-users
mailing list