FreeBSD/Apache/DNS- Problem accessing virtual hosts from external network



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 with
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"

<Directory "/usr/local/apache/www">

NameVirtualHost 203.xxx.xxx.xxx:80

<VirtualHost 203.xxx.xxx.xxx:80>
ServerAdmin mymail@xxxxxxxxx
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
</VirtualHost>


<VirtualHost 203.xxx.xxx.xxx:80>
ServerAdmin mymail@xxxxxxxxx
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
</VirtualHost>

<VirtualHost 203.xxx.xxx.xxx:80>
ServerAdmin mymail@xxxxxxxxx
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
</VirtualHost>
#---

* 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.xxx
..

* GoDaddy COnfig
- I have set Custom Name Servers and added my IP address/hostname as the DNS
server
Thanks!
Edwin
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: two problems of two trusted ad domains
    ... Kevin D. Goodknecht Sr. ... >> So I changed the dns search list to the following ... >> then I searched for a servername at somerealdomainname.com ...
    (microsoft.public.windows.server.dns)
  • Re: Urgent! New router and big disaster
    ... Click Start, point to Administrative Tools, and then click DNS. ... Expand ServerName, where ServerName is the name of the server, ... Les Connor [SBS Community Member - SBS MVP] ...
    (microsoft.public.windows.server.sbs)
  • Re: [Apache] Vhost with mod_rewrite
    ... > ServerName www.domaine.tld ... If you want the new domain config created automatically, ... best writing a bash script that uses sed, ... Apache 2.0: http://httpd.apache.org/docs-2.0/mod/mod_vhost_alias.html ...
    (Debian-User)
  • [SLE] DNS Problem
    ... I'm having a problem with DNS name resolution, and I need help resolving it. ... I'm running a 2-subnet LAN with a 3d NIC facing the Internet; the 2 subnets must go through the 3d NIC to get access to the Net. ... When I run host <FQDN ServerName> I get back "host ServerName not found: ...
    (SuSE)
  • Re: httpd.conf
    ... One that is hosting 2 sites in vhosts. ... DocumentRoot /var/www/patway/ ... ServerName patway.mtntop.home ... The best book on programming for the layman is "Alice in Wonderland"; ...
    (Debian-User)