Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jan 2001 20:05:53 -0500
From:      "Matthew Emmerton" <matt@gsicomp.on.ca>
To:        <treznor@sunflower.com>, <questions@FreeBSD.ORG>
Subject:   Re: Apache question again
Message-ID:  <011f01c087fd$4ce3b140$1200a8c0@gsicomp.on.ca>
References:  <20010127003434.75297.qmail@web10604.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> Sorry for not continuing the previous message, but I'm
> not at home at the moment. I looked into VirtualHosts
> on Apache. Has anybody any experience dealing with
> these? I set them up and now either (depending on
> which method of guessing I use): neither one works or
> they both still point to the secondary host. :( Could
> somebody jot up a sample config file for one server (1
> IP) with two domain hosts and different documentroots
> for either host. Or perhaps somebody could glance real
> quick at the config I have now? I am completely lost.

Here's what I use on my internal LAN for two webs I have:

NameVirtualHost 192.168.0.2
<VirtualHost 192.168.0.2>
  ServerName doc.mydomain.com
  ServerAdmin webmaster@mydomain.com
  CustomLog /var/log/apache-access.log combined
  ErrorLog /var/log/apache-error.log
  DocumentRoot /usr/local/www/data/docs.mydomain.com
</VirtualHost>

<VirtualHost 192.168.0.2>
  ServerName internal.mydomain.com
  ServerAdmin webmaster@mydomain.com
  CustomLog /var/log/apache-access.log combined
  ErrorLog /var/log/apache-error.log
  DocumentRoot /usr/local/www/data/internal.mydomain.com
</VirtualHost>

As you can see, the only things that really need to be different are the
ServerName and DocumentRoot.  You can use separate logs if you like, but I
just toss them all together.

--
Matt Emmerton



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?011f01c087fd$4ce3b140$1200a8c0>