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

[-- Attachment #1 --]
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 ----- 
  From: Stuart Rogers 
  To: freebsd-questions@FreeBSD.ORG 
  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.

[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3401" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; First, I would recommend to use 
NameVirtualHosts in Apache (it means that you need just one IP Address to serve 
several diferent hosts &amp; pages).</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>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.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>For NameVirtualHosts to work, you just need the 
following in your "httpd.conf" file:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>NameVirtualHost a.b.c.d:80</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&lt;VirtualHost a.b.c.d&gt;<BR>&nbsp;&nbsp; 
ServerName mydomain.com</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; ServerAlias&nbsp;<A 
href="http://www.mydomain.com">www.mydomain.com</A>&nbsp;host.mydomain.com</FONT><FONT 
face=Arial size=2><BR>&nbsp;&nbsp; DocumentRoot 
/usr/local/www/data/domains/mydomain<BR>&nbsp;&nbsp; ErrorLog 
/var/log/httpd/mydomain-error.log<BR>&nbsp;&nbsp;&nbsp; TransferLog 
/var/log/httpd/mydomain-access.log<BR>&nbsp;&nbsp; ErrorDocument 404 <A 
href="http://www.mydomainob.com.mx/">http://www.mydomain.com/</A><BR>&lt;/VirtualHost&gt;</FONT></DIV>;
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&lt;VirtualHost a.b.c.d&gt;<BR>&nbsp;&nbsp; 
ServerName myotherdomain.com</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; ServerAlias&nbsp;<A 
href="http://www.myotherdomain.com">www.myotherdomain.com</A>&nbsp;host.myotherdomain.com</FONT><FONT 
face=Arial size=2><BR>&nbsp;&nbsp; DocumentRoot 
/usr/local/www/data/domains/myotherdomain<BR>&nbsp;&nbsp; ErrorLog 
/var/log/httpd/myotherdomain-error.log<BR>&nbsp;&nbsp;&nbsp; TransferLog 
/var/log/httpd/myotherdomain-access.log<BR>&nbsp;&nbsp; ErrorDocument 404 <A 
href="http://www.myotherdomain.com/">http://www.myotherdomain.com/</A><BR>&lt;/VirtualHost&gt;</FONT></DIV></FONT></DIV>;
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>and so on...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Merry Xmas</FONT></DIV>
<DIV><FONT face=Arial size=2>Ales</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A href="mailto:srogers@cableregina.com" title=srogers@cableregina.com>Stuart 
  Rogers</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A 
  href="mailto:freebsd-questions@FreeBSD.ORG" 
  title=freebsd-questions@FreeBSD.ORG>freebsd-questions@FreeBSD.ORG</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, December 23, 1999 4:27 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Apache 1.3.9 Vhosts 
Problem</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 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.</FONT></DIV></BLOCKQUOTE></BODY></HTML>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?05fe01bf4d96$e5543f00$d2630a0a>