Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Dec 1999 16:41:47 -0600
From:      "Alejandro Ramirez" <ales@megared.net.mx>
To:        "Stuart Rogers" <srogers@cableregina.com>, <freebsd-questions@FreeBSD.ORG>
Subject:   RE: Apache 1.3.9 Vhosts Problem
Message-ID:  <05fe01bf4d96$e5543f00$d2630a0a@megared.net.mx>
References:  <007501bf4d94$df267000$23144818@cableregina.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

------=_NextPart_000_05FB_01BF4D64.9AA16500
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

    First, I would recommend to use NameVirtualHosts in Apache (it means =
that you need just one IP Address to serve several diferent hosts & =
pages).

The aliasing thing in the NIC, it works like this, if your aliased IP =
address that you are going to use, its in the same subnet that the one =
that you have already, you need the 255.255.255.255 netmask, which will =
tell the system that this IP address its in the same subnet, and it =
wouldnt need any more routing information. But if your new IP Address, =
its not in the same subnet that the first one, you will have to use the =
right netmask for it.

For NameVirtualHosts to work, you just need the following in your =
"httpd.conf" file:

NameVirtualHost a.b.c.d:80

<VirtualHost a.b.c.d>
   ServerName mydomain.com
    ServerAlias www.mydomain.com host.mydomain.com
   DocumentRoot /usr/local/www/data/domains/mydomain
   ErrorLog /var/log/httpd/mydomain-error.log
    TransferLog /var/log/httpd/mydomain-access.log
   ErrorDocument 404 http://www.mydomain.com/
</VirtualHost>

<VirtualHost a.b.c.d>
   ServerName myotherdomain.com
    ServerAlias www.myotherdomain.com host.myotherdomain.com
   DocumentRoot /usr/local/www/data/domains/myotherdomain
   ErrorLog /var/log/httpd/myotherdomain-error.log
    TransferLog /var/log/httpd/myotherdomain-access.log
   ErrorDocument 404 http://www.myotherdomain.com/
</VirtualHost>

and so on...

Merry Xmas
Ales

  ----- Original Message -----=20
  From: Stuart Rogers=20
  To: freebsd-questions@FreeBSD.ORG=20
  Sent: Thursday, December 23, 1999 4:27 PM
  Subject: Apache 1.3.9 Vhosts Problem


      I was wondering if anyone has a complete Apache 1.3.9 httpd.conf =
file that would show me how to set up Virtual Hosts in Apache. I'm new =
to Apache and FreeBSD and have received very good help from this mailing =
list but nothing seems to want to get Virtual Hosts working in Apache. I =
have had people say you have to have your netmask set to 255.255.255.255 =
but nobody has said why. When I set my netmask to that My internet =
doesn't work so unfortantly I can set it to that. But if anyone has a =
httpd.conf file they know works with Apache to get Virtual Hosts going =
could you please HELP. I am running freeBSD 3.3. Thank you for anyhelp =
you can give me.

------=_NextPart_000_05FB_01BF4D64.9AA16500
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3401" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; First, I would =
recommend to use=20
NameVirtualHosts in Apache (it means that you need just one IP Address =
to serve=20
several diferent hosts &amp; pages).</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The aliasing thing in the NIC, it works =
like this,=20
if your aliased IP address that you are going to use, its in the same =
subnet=20
that the one that you have already, you need the 255.255.255.255 =
netmask, which=20
will tell the system that this IP address its in the same subnet, and it =
wouldnt=20
need any more routing information. But if your new IP Address, its not =
in the=20
same subnet that the first one, you will have to use the right netmask =
for=20
it.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>For NameVirtualHosts to work, you just =
need the=20
following in your "httpd.conf" file:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>NameVirtualHost a.b.c.d:80</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;VirtualHost =
a.b.c.d&gt;<BR>&nbsp;&nbsp;=20
ServerName mydomain.com</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; ServerAlias&nbsp;<A=20
href=3D"http://www.mydomain.com">www.mydomain.com</A>&nbsp;host.mydomain.=
com</FONT><FONT=20
face=3DArial size=3D2><BR>&nbsp;&nbsp; DocumentRoot=20
/usr/local/www/data/domains/mydomain<BR>&nbsp;&nbsp; ErrorLog=20
/var/log/httpd/mydomain-error.log<BR>&nbsp;&nbsp;&nbsp; TransferLog=20
/var/log/httpd/mydomain-access.log<BR>&nbsp;&nbsp; ErrorDocument 404 <A=20
href=3D"http://www.mydomainob.com.mx/">http://www.mydomain.com/</A><BR>&l=
t;/VirtualHost&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;VirtualHost =
a.b.c.d&gt;<BR>&nbsp;&nbsp;=20
ServerName myotherdomain.com</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; ServerAlias&nbsp;<A=20
href=3D"http://www.myotherdomain.com">www.myotherdomain.com</A>&nbsp;host=
.myotherdomain.com</FONT><FONT=20
face=3DArial size=3D2><BR>&nbsp;&nbsp; DocumentRoot=20
/usr/local/www/data/domains/myotherdomain<BR>&nbsp;&nbsp; ErrorLog=20
/var/log/httpd/myotherdomain-error.log<BR>&nbsp;&nbsp;&nbsp; TransferLog =

/var/log/httpd/myotherdomain-access.log<BR>&nbsp;&nbsp; ErrorDocument =
404 <A=20
href=3D"http://www.myotherdomain.com/">http://www.myotherdomain.com/</A><=
BR>&lt;/VirtualHost&gt;</FONT></DIV></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and so on...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Merry Xmas</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Ales</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A href=3D"mailto:srogers@cableregina.com" =
title=3Dsrogers@cableregina.com>Stuart=20
  Rogers</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
  href=3D"mailto:freebsd-questions@FreeBSD.ORG"=20
  =
title=3Dfreebsd-questions@FreeBSD.ORG>freebsd-questions@FreeBSD.ORG</A> =
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, December 23, =
1999 4:27=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Apache 1.3.9 Vhosts=20
Problem</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; I was wondering if =
anyone has=20
  a complete Apache 1.3.9 httpd.conf file that would show me how to set =
up=20
  Virtual Hosts in Apache. I'm new to Apache and FreeBSD and have =
received very=20
  good help from this mailing list but nothing seems to want to get =
Virtual=20
  Hosts working in Apache. I have had people say you have to have your =
netmask=20
  set to 255.255.255.255 but nobody has said why. When I set my netmask =
to that=20
  My internet doesn't work so unfortantly I can set it to that. But if =
anyone=20
  has a httpd.conf file they know works with Apache to get Virtual Hosts =
going=20
  could you please HELP. I am running freeBSD 3.3. Thank you for anyhelp =
you can=20
  give me.</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_05FB_01BF4D64.9AA16500--



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?05fe01bf4d96$e5543f00$d2630a0a>