Website not resolving properly.

25 posts / 0 new
Last post
#1 Thu, 07/16/2009 - 23:02
Anirban1987

Website not resolving properly.

I have installed Virtualmin 3.703.gpl module in my Webmin 1.480 panel of my Ubuntu 9.04 HyperVM VPS . Now I have added 1 domain named web2dziner.com using Virtualmin virtual hosts. The problem is when I type http://web2dziner.com (wrong Apache default page ) and http://www.web2dziner.com (the desired page) , it goes to two different webpages. I haven't done any modifications as such directly to the Apache. How to fix it ?

Fri, 07/17/2009 - 02:28
ronald
ronald's picture

I have noticed that this is often due to propagation.

In your case it may be due to DNS problems.

You can check this and then correct it on your server.

http://www.intodns.com/web2dziner.com

is that company still using Hypervm? o boy.

Fri, 07/17/2009 - 05:09
Anirban1987

I have fixed it and done customery procedures like restarting bind and apache. But the problem still remains....

Fri, 07/17/2009 - 05:30
ronald
ronald's picture

Is your virtualhost container correct? In the Apache config..Directives

ServerName web2dziner.com ServerAlias www.web2dziner.com

Fri, 07/17/2009 - 05:39 (Reply to #4)
Anirban1987
Fri, 07/17/2009 - 09:10
ronald
ronald's picture

so you have in your directive < virtualhost web2dziner.com:80 > ?

that should be < virtualhost 123.123.123.123:80 >

123 should be your IP where apache runs on

Fri, 07/17/2009 - 11:49 (Reply to #6)
Anirban1987

If I change the directives to that IP address , though the previous problem is solved all my subdomains starts landing up on my main/primary domain !!! Ref : http://download.techdarpan.com/download.php?ScreenShot004.jpg P.S. : I have reverted back to my old settings.

Fri, 07/17/2009 - 15:37
ronald
ronald's picture

that's because your subservers are also not correctly setup. you need to have an IP there, not a * and not the domain name.

namebased hosting means many names on 1 IP, but Apache needs to know about that IP specifically.

Fri, 07/17/2009 - 23:35 (Reply to #8)
Anirban1987

Sorry , if you want to mean this ( http://download.techdarpan.com/download.php?ScreenShot005.jpg ) all the domains and subdomains are landing op on http://dbms.web2dziner.com/ . Also when I am restarting Apache after applying the changes the following warning crops up - - > http://pastebin.ca/1499038 . Please help.

Sat, 07/18/2009 - 03:37
ronald
ronald's picture

in your apache config file prior to the virtualhost containers you need:

Listen 74.63.221.173:80

ServerName 74.63.221.173:80

NameVirtualHost 74.63.221.173:80

then restart Apache.

Edit:

Also your hostname isn't correct.

Primary nameserver: web2dziner.com should be something like Primary nameserver: ns1.web2dziner.com

Mon, 07/20/2009 - 08:43 (Reply to #10)
Anirban1987

I had added as per your instructions in web2dziner.com.conf file ( Ref. : http://pastebin.ca/1501107 ) . But after that Apache fails to start ( Ref. : http://pastebin.ca/1501108 ) . What should be my proper hostname and how to rectify it ? It seems that my name servers are fine. ( Ref. : http://www.intodns.com/web2dziner.com ) .

Mon, 07/20/2009 - 09:44
andreychek

Unfortunately, I'm getting a 500 Error when going to your pastebin.ca links... can you paste in the error message you're receiving when attempting to start up Apache?

-Eric

Mon, 07/20/2009 - 10:00 (Reply to #12)
Anirban1987

Pastebin.ca unfortunately does not seem to load now . Check http://pastebin.com/d5df05d91 and http://pastebin.com/d576cade1

Mon, 07/20/2009 - 11:45
ronald
ronald's picture

Im not too familiar with debian way but I assume there should be an IP here instead of default < VirtualHost default:80 >

You could comment out the: ServerName 74.63.221.173:80 with an # in front of the line.

I suspect that is why apache won't restart as the line: Listen 74.63.221.173:80 is first in the config.

To change the hostname you can ssh into the server and type: hostname ns1.web2dziner.com then it'll be the same as your mentioned nameserver. In debian one should edit the hosts file I think but Eric can advice better in this.

Mon, 07/20/2009 - 20:54 (Reply to #14)
Anirban1987

Unfortunately , none of your above advice is giving results and the displayed error is same error ( Ref: http://pastebin.com/d576cade1 ) . Replacing default by ip address is throwing up the error http://pastebin.com/m50d7f32f . Please help. Do one has to go through such troubles after adding a domain using Virtualmin Server module in Usermin ?

Tue, 07/21/2009 - 02:37
ronald
ronald's picture

no one should have to go through trouble, but your system or at least a part of it hasn't been set up correctly. That is what you need to fix first and you haven't.

1 your hostname isn't correct (see SOA in the zonefile)
2 there are no A records (Glue) for your domain.
3 serialnumber should be datebased

I suggest to fix these BIND/dns issues first (as mentioned in my first reply) and then see what the sites will do.

Also it seems virtualhost_default:80 in the container is correct, like said I'm not too familiar with the debian way, it is different than centos. I thought it was worth a shot though.

Wed, 07/22/2009 - 03:39 (Reply to #16)
Anirban1987

I have sorted out all Bind/DNS issues. Still the same problem remains Ref : http://www.intodns.com/web2dziner.com

Wed, 07/22/2009 - 11:19
ronald
ronald's picture

yes the BIND part is good now so that you can rule out.

second is to look at webmin - networking - Network Configuration - Host Addresses and Network Interfaces, to make sure that is not an issue.
Compare and check it against Virtualmin - System Settings - Module Config - Networking settings.

when this is correct, then it would leave Apache, check
Virtualmin - System Settings - Server Templates and in the template you use, go to Apache website and see if nothing out of the ordinairy is in the first box. below is mine:

ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot ${HOME}/public_html
ErrorLog /var/log/virtualmin/${DOM}_error_log
CustomLog /var/log/virtualmin/${DOM}_access_log combined
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5

Options -Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All

allow from all

Now, Debian has a different way of using Apache which I am not too familiar with. It is the sites-enabled and sites-activated I think. With that part I can't help and I hope Eric will check back with you if the above doesn't fix it.

Lastly after checking and per haps reconfiguring the above, you could delete the virtual server web2dziner.com and recreate it now that bind is correct. this may help also.

To be sure, can you post your zone-file for web2dziner.com ? (Im out for 24 hours so I cant reply sooner)

Wed, 07/22/2009 - 11:47 (Reply to #18)
Anirban1987

The zone file is in http://pastebin.com/m450b2f42

webmin - networking - Network Configuration - Host Addresses and Network Interfaces : http://img16.imageshack.us/img16/8015/screenshot003gxy.jpg

Virtualmin - System Settings - Module Config - Networking settings. - http://img9.imageshack.us/img9/1121/screenshot006kgk.jpg I don't think they mismatch , not sure though ...

Virtualmin - System Settings - Server Templates - Apche - Mine is exactly same as of yours...

My luck is really bad ...

Wed, 07/22/2009 - 22:24
ronald
ronald's picture

webmin - networking - Network Configuration - Host Addresses and Network Interfaces : http://img16.imageshack.us/img16/8015/screenshot003gxy.jpg this must be ns1.web2dziner.com ns1

just change the entry and hit save. in the main screen, do not click Apply configuration.

then try the sites again.

Wed, 07/22/2009 - 22:37 (Reply to #20)
Anirban1987
Thu, 07/23/2009 - 04:52
dean1979

Paste the here to look what is happened. This should be:

<VirtualHost 123.123.123.123:80>
ServerName domain.com
ServerAlias www.domain.com
Thu, 07/23/2009 - 10:15 (Reply to #22)
Anirban1987

My paste is in http://pastebin.com/m58709344 Replacing the default with my ip address is resolving the www problem but another problem is cropping up. All my subdomains are landing up to the main home page www.web2dziner.com .... I am also pasting the of one of my subdomain like http://dbms.web2dziner.com/ --- > http://pastebin.com/m34244b2b . I tried my luck by replacing the *:80 by my ip address 74.63.221.173:80 . But then when I am restarting apache it is throwing up an error --- > http://pastebin.com/m27145ee5 . Currently I am reverting back to my settings as it was earlier to the testing ..

Thu, 07/23/2009 - 10:35
Anirban1987

After reverting back to my old settings after being unable to sort out the problem as per instructions from dean1979 i.e. replacing the ip address by "default" the problem seems to be gone now .... Subdomains are also working properly ... Magic magic ... hand of god it seems so.

Thu, 07/23/2009 - 11:27
ronald
ronald's picture

nah it was your hand by fixing several issues on your box, dns issues, hostname issues, resolve issues.

After correcting the network settings and restarting apache things started to fall in place. It's nothing magical, but it's technical.

Good that it is solved now, including the errors you didn't know about ;)

Topic locked