From owner-freebsd-questions Tue Sep 28 10:30:51 1999 Delivered-To: freebsd-questions@freebsd.org Received: from mailhost.criterion.canon.co.uk (mailhost.criterion.canon.co.uk [194.223.249.254]) by hub.freebsd.org (Postfix) with ESMTP id 1BD91154D3 for ; Tue, 28 Sep 1999 10:30:48 -0700 (PDT) (envelope-from adamn@csl.com) Received: from csl.com (hermes.criterion.canon.co.uk [194.223.249.13]) by mailhost.criterion.canon.co.uk (8.8.8/8.7.3) with ESMTP id SAA29103; Tue, 28 Sep 1999 18:20:26 +0100 (BST) Message-ID: <37F0FB43.2D4FDD3C@csl.com> Date: Tue, 28 Sep 1999 18:30:43 +0100 From: Adam Nealis Organization: Criterion Software, Ltd. X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.0.34 i686) X-Accept-Language: en MIME-Version: 1.0 To: Langa Kentane Cc: FreeBSD Subject: Re: apache & virtual servers question References: <06f001bf0989$dd3b16f0$36a8ef9b@sunnet.co.za> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Langa Kentane wrote: > > Hi y'all. I have an alias address for my ed1 (e .g 192.168.1.3) to which > apache is bound. All my virtual servers run off this address. Now the > problem that I have is that there are two vitural servers (non IP intensive) > that I want to create that will be listen only on port 8080 coz I don't was > and when apache answers, only those two virtual servers must answer. The > reason for this is coz the one is running MRTG and the web server is sitting > behind a firewall and I don't want anyone to be able to view this and at the > same time port 8080 is hiding behind the firewall. > > Any suggestion? > > I was thinking if creating another alias address of my servers and bind > apache to 8080 on that address then dns must poing to that address for those > two servers. But then again the thing is that I was to do this without > using another IP address. Can this be done. The number of IP's I have is > limited. You don't need to use up IP addresses in order to get multiple virtual hosts. You can have as many httpds as you wish running off the same IP address. You need to construct your apache.conf on the following lines: ... Port 80 Listen 80 Listen 8080 ... NameVirtualHost 120.121.122.123 ... ServerAdmin webmaster@my.domain DocumentRoot /webbery/www1.my.domain UseCanonicalName off ServerName www1.my.domain ErrorLog /var/log/httpd/error1-.log TransferLog /var/log/httpd/web1.log ServerAdmin webmaster@my.domain DocumentRoot /webbery/www2.my.domain UseCanonicalName off ServerName www2.my.domain ErrorLog /var/log/httpd/error2-log TransferLog /var/log/httpd/web2-log For this to work, make sure you don't have _any_ web server definitions that are not contained within pairs. The Port 80 is the default port, the Listen lines allow >1 port to run of the same machine. Thus, to get more than one server running off the same IP address, use the IP address in your NameVirtualHost directive, and refer to IP-address:Port in your VirtualHost definitions. NB: The ServerName directive must be a known DNS host. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message