don't understand results of NS setup

9 posts / 0 new
Last post
#1 Wed, 07/02/2008 - 15:42
midol

don't understand results of NS setup

Hi,

I have a box with Centos 5.2 and Virtualmin GPL in a near default configuration. I have added one hosted site, www.choked.ca. The nameservers are ns1.bcwebinc.com and ns2.bcwebinc.com. After a conversation today with my registrar the appropriate records for web pages and email were set to ip address 142.179.54.37.

Before this was done keying that ip into the address line of a browser gave the default page at /var/www/html. Since the change was made the url www.choked.ca doesn't resolve, but the ip address gives the html at /home/choked/public_html.

I don't understand why this takes place. I've copied out the virtualhosts section of httpd.conf below in the hopes that someone with sharper eyes than mine may see a problem. It looks ok to me.

Ideas?

Dave

<VirtualHost 192.168.0.253:80> SuexecUserGroup #501 #502 ServerName choked.ca ServerAlias www.choked.ca ServerAlias lists.choked.ca DocumentRoot /home/choked/public_html ErrorLog /home/choked/logs/error_log CustomLog /home/choked/logs/access_log combined ScriptAlias /cgi-bin/ /home/choked/cgi-bin/ ScriptAlias /awstats /home/choked/cgi-bin DirectoryIndex index.html index.htm index.php index.php4 index.php5 <Directory /home/choked/public_html> Options Indexes IncludesNOEXEC FollowSymLinks allow from all AllowOverride All </Directory> <Directory /home/choked/cgi-bin> allow from all </Directory> Alias /dav /home/choked/public_html Alias /pipermail /var/lib/mailman/archives/public <Location /dav> DAV On AuthType Basic AuthName choked.cabcwebinc.com AuthUserFile /home/choked/etc/dav.digest.passwd Require valid-user ForceType text/plain Satisfy All </Location> <Files awstats.pl> AuthName "choked.ca statistics" AuthType Basic AuthUserFile /home/choked/.awstats-htpasswd require valid-user </Files> RedirectMatch /cgi-bin/mailman/([^/])(.) https://choked.ca:10000/virtualmin-mailman/unauthenticated/$1.cgi$2 RedirectMatch /mailman/([^/])(.) https://choked.ca:10000/virtualmin-mailman/unauthenticated/$1.cgi$2 PerlRequire /etc/webmin/virtualmin-google-analytics/apachemod.pl PerlOutputFilterHandler Virtualmin::GoogleAnalytics PerlSetVar AnalyticsID root </VirtualHost>

Wed, 07/02/2008 - 15:46
Joe
Joe's picture

You're conflating two different concepts, and it's confusing you. I know that's the case, because I read your description, and I look at your configuration file, and I think, &quot;Yes, that's exactly how things ought to be behaving. I wonder what he believes it ought to be doing instead?&quot; ;-)

So, let's cover the basics:

DNS takes a little while to propagate. choked.ca is resolving to 142.179.54.37 for me, which I believe is correct.

Apache has either a &quot;one website&quot; mode, or a &quot;virtual hosting&quot; mode. The two cannot co-exist (if you understand how IP-binding in UNIX works, this becomes an obvious truth...but it's not wholly intuitive if you don't have such pre-existing knowledge). So, Apache is either answering requests in a &quot;one website, no matter what&quot; way or in a &quot;best-first match&quot; way. Since you've created a VirtualHost, it is now operating in &quot;best-first match&quot;. This means that any request to IP 192.168.0.253 (which I assume is NAT'ed from public IP 142.179.54.37) will run through the list of available VirtualHost entries, and the first one it finds is the &quot;best-first match&quot;. That's choked.ca.

Working as designed.

So, now, the question remains: What are you trying to accomplish that we can help with? (Since, again, I don't see a problem in your description.)

Oh, yeah, choked.ca is bringing up results for me. I'm guessing they are correct. Perhaps DNS just hadn't propagated when you tried earlier?

You may also be running into a problem very common to consumer level routers: they don't actually route (the router makers incorrectly call this &quot;loopback&quot; or &quot;reverse routing&quot;). So you can't go out from the private network, and then back in on a public IP. You'll always have to hit private addresses from inside the network. But this is yet another orthogonal issue, and easy to conflate with DNS and web server problems. But they're all independent of one another, and need to be dealt with independently.

--

Check out the forum guidelines!

Wed, 07/02/2008 - 16:00 (Reply to #2)
sgrayban

$ host www.choked.ca
www.choked.ca is an alias for choked.ca.
choked.ca has address 142.179.54.37
choked.ca mail is handled by 0 choked.ca.

$ host choked.ca
choked.ca has address 142.179.54.37
choked.ca mail is handled by 0 choked.ca.

Looks good to me as well.
You must have been using old cache.

Wed, 07/02/2008 - 16:03 (Reply to #3)
midol

OK, I am looking at the site from inside the subnet where the server lives, maybe that's complicating matters. I'll go off-site and try again. Thanks very much for the responses.

Dave

Wed, 07/02/2008 - 19:04 (Reply to #4)
midol

yes it works fine from off-site. thanks for the comments, the facility works just as advertised, very nice.

dave

Sun, 06/07/2009 - 07:26 (Reply to #5)
ronald
ronald's picture

if you want to see your site inside the lan environment , you can add it to your hosts file on the machine with the browser (just like the old days)

192.168.0.253 choked.ca
192.168.0.253 www.choked.ca

on a windoze machine it's in c:\windows\system32\drivers\etc\hosts

Sat, 07/05/2008 - 14:23 (Reply to #6)
midol

I think I was not allowing for propagation time, and also may well have one of the routers you describe, it's a no-name.

Can I raise another issue here or should I start a new thread? I want to get email for this domain under way. I've ticked what I think are the appropriate boxes but when I try a test mail I get bounced after a delay. what is the appropriate documentation for email setup and use (user settings, any other pertinent configuration info)?

Dave

Sat, 07/05/2008 - 15:28 (Reply to #7)
Joe
Joe's picture

<div class='quote'>Can I raise another issue here or should I start a new thread?</div>

New thread. It's hard enough to keep up with stuff when it's divided out into nicely titled threads, with one thread per problem. It's impossible if there are multiple issues in each thread. ;-)

It's also easier for others to search successfully within the forums.

You'll want to start with the troubleshooting email guide, which will help you ask good questions about your problem, and provide the log details we need in order to help you:

http://www.virtualmin.com/documentation/id,email_troubleshooting/

--

Check out the forum guidelines!

Mon, 07/07/2008 - 08:36 (Reply to #8)
midol

Merci!

Topic locked