From owner-freebsd-questions@FreeBSD.ORG Sun Dec 18 14:37:36 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A05E216A41F for ; Sun, 18 Dec 2005 14:37:36 +0000 (GMT) (envelope-from xmisoy@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 920F243D5F for ; Sun, 18 Dec 2005 14:37:35 +0000 (GMT) (envelope-from xmisoy@gmail.com) Received: by xproxy.gmail.com with SMTP id s9so747572wxc for ; Sun, 18 Dec 2005 06:37:35 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=fa4cbz0+Wl4+p997X/kKx8m/HRa+y5jb3i65gYm3/yAhyG7d67C5RgGkz0Jnb2pQU5VuU/5IWeODvmXaGC4Q5yXAiFAYKwTFzfvAd3Nfs4+KWUKAc+dxZ9xOaA9Zr3rQ7ldpYDs6vdYCnFAJGYgedG5nkXM3breW4LcnY3RF1+E= Received: by 10.70.110.13 with SMTP id i13mr3377875wxc; Sun, 18 Dec 2005 06:37:34 -0800 (PST) Received: by 10.70.54.9 with HTTP; Sun, 18 Dec 2005 06:37:34 -0800 (PST) Message-ID: <36f5bbba0512180637h1da3dc78qab0d9c1ad0b018f5@mail.gmail.com> Date: Sun, 18 Dec 2005 06:37:34 -0800 From: "Edwin D. Vinas" To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: FreeBSD/Apache/DNS- Problem accessing virtual hosts from external network X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2005 14:37:36 -0000 Hi, I am using DNS(Bind)/Apache(virtual hosting) in a FreeBSd machine which is connected via a static IP in a DSL provider. I want to setup mulitple websites under my domain. I have been able to get a domain from GoDaddy and was able to setup so that it will point to my IP address when my domain is accessed. I also have configured DNS and Apache virtual hosting. Questions: 1) Is it a problem of DNS, Apache virtual hosting or my domain name provider? 2) Is anyone have tried to configure multiple virtual hosting in Apache wit= h DNS in one FreeBSD machine? Can you give me your sample config for DNS, Apache, /etc/hosts/, /etc/resolv.conf etc etc that are related to this setup? ----------------------------------- Observations: 1) If the computer accessing the virtual domains is from the LAN, it works fine. I can access all the virtual domains (i.e., www.mydomain.com, vhost1.mydomain.com, vhost2.mydomain.com, vhost3.mydomain.com) 2) But if the virtual domain was accessed from outside (Internet or at my office), it doesn't work and all virtual domains resolve to www.mydomain.com. All I can see is the main default page for www.mydomain.com. For example, when I access www.mydomain.com, it works fine. But when I access the virtual hosts such as vhost1.mydomain.com, vhost2.mydomain.com, vhost3.mydomain.com; it only display the main website www.mydomain.com. Here are my configurations: ---- * httpd.conf & virtual hosts #-- Listen 80 BindAddress 203.xxx.xxx.xxx Port 80 #ServerName www.mydomain.com (commented it out but doesn't have any effect when uncommented) DocumentRoot "/usr/local/apache/www" NameVirtualHost 203.xxx.xxx.xxx:80 ServerAdmin mymail@gmail.com DocumentRoot /usr/local/apache/www/ ServerName www.mydomain.com ErrorLog logs/virtual_host.www.com-error_log CustomLog logs/virtual_host.www.com-access_log common ServerAdmin mymail@gmail.com ServerName vhost1.mydomain.com DocumentRoot /usr/local/apache/www_virtual/vhost1/ ErrorLog logs/virtual_host.vhost1.com-error_log CustomLog logs/virtual_host.vhost1.com-access_log common ServerAdmin mymail@gmail.com ServerName vhost2.mydomain.com DocumentRoot /usr/local/apache/www_virtual/vhost2/ ErrorLog logs/virtual_host.vhost2.com-error_log CustomLog logs/virtual_host.vhost2.com-access_log common #--- * DNS configs #--- ; Machine Names localhost IN A 127.0.0.1 dns IN A 203.xxx.xxx.xxx @ IN A 203.xxx.xxx.xxx ; Aliases www IN CNAME @ vhost1 IN CNAME @ vhost2 IN CNAME @ vhost3 IN CNAME @ vhost4 IN CNAME @ #--- * Traceroutes from external network I can traceroute www.mydomain.com and resolves to 203.xxx.xxx.xxx I can also traceroute vhost1.mydomain.com and resolves to 203.xxx.xxx.xxx I can also traceroute all vhosts and they find my IP address 203.xxx.xxx.xx= x . * GoDaddy COnfig - I have set Custom Name Servers and added my IP address/hostname as the DN= S server Thanks! Edwin