Webmin Problem with IP

20 posts / 0 new
Last post
#1 Tue, 10/25/2011 - 09:09
tusker

Webmin Problem with IP

Old Scenario:

I had a modem with static IP and DNS info provided by my ISP and Webmin and Virtualmin was working fine with more than one virtual hosts hosted on a single ubuntu machine.

Current Scenario:

I installed a NETGEAR wireless router WGR614v10 between my computer and modem and Webmin stopped working.

What I have concluded so far:

Code:

host domain.tld

command gives output that shows my local intranet address as the IP of the website and not the one provided by my ISP that is transferred to the Wireless router from modem during the installation.

So currently my wired connection eth2 is setup as Automatic and all the info is stored in the wireless router regarding DNS servers and Static IP.

I've forwarded ports 80 and 443 for HTTP and HTTPS in router and still get the same output for the command:

Code:

host domain.tld

When I ping my website on virtual host it goes to only one hop on LAN 10.0.0.2 that is the first address on intranet.

Additional info:

/etc/hosts file has only addresses for local host and not for any external IP addresses or hostnames.

Tue, 10/25/2011 - 10:22
andreychek

I installed a NETGEAR wireless router WGR614v10 between my computer and modem and Webmin stopped working.

Try going into System Settings -> Re-Check Config, and see what it thinks. I suspect it'll tell you about a networking issue, which is correctable by changing some of your network settings in the Virtualmin config.

But yeah, if you're using Virtualmin behind a NAT router -- you would need to tell it to use your router's IP address for the DNS records, rather than the private IP's that are on the server.

-Eric

Tue, 10/25/2011 - 14:23 (Reply to #2)
tusker

Yes I am using NAT router behind a firewall and when I uninstall and install virtualmin again it takes the IP of my router 10.0.0.2 and not the public IP but gives warning on the recheck config page about it.

In both cases it doesn't work if I keep public IP at both places in DNS settings or my router's IP. I've tried port forwarding and other settings in router but nothing worked for me. I even reboot machine after changes so that there are no errors or current settings loaded anywhere else in ubuntu.

Nothing worked.

What settings should I apply? Public IP in network config page in virtualmin or my router's private IP. With private IP it gives me some warnings, not errors, and says virtualmin is ready for use. But websites actually doesn't work. Sometimes when I do command: host domain.tld it gives me 10.0.0.2 or my DNS hosts addresses listed with google apps for mail which I have set at registrar.

Sometimes it works on intranet but not on internet. external IP settings never worked.

Tue, 10/25/2011 - 15:37
andreychek

Howdy,

Yeah, adding a NAT router into the mix does complicate things :-)

However, it should be able to work. This is normally accomplished by following the advice that you see on the Re-Check Config page.

My suggestion would be to follow the advice you get there, and then at that point when things aren't working, we can troubleshoot the problem.

I will offer that it's rare that you'll be able to access your server normally from on your intranet, when your server is on that same intranet behind a NAT router.

That brings up a special routing scenario that most routers can't handle.

My suggestion would be to get it so that you can access the server externally -- and once you have that, things are working normally... you may then need to add some static entries in the host files for the desktops on your LAN.

-Eric

Tue, 10/25/2011 - 17:52
tusker

I'm now able to get some of the domains like on internet, but some of them are not working.. strange.

Another problem is all of the domains point to the /var/www folder instead of their home/user/public_html folder. Why so?

edit: This happens only when I don't add any server to the virtualmin. All my registrar entries are pointed to the static IP I have XXX.XXX.XXX.XXX and all of them loads the default server at apache very well on /var/www but the moment I add any virtualhost to the virtual min it stops working.

This proves that atleast it is working "through" the router now. as webaddresses are actually now accessible through router but only points to one single directory.

So problem now is only one: How to configure Virtualhosts that actually load /home/user/public_html and not the apache default server.

I've tried reconfig with many various options but none worked so far.

thanks for all the help, -Tusker

Tue, 10/25/2011 - 18:37
tusker

At the recheck config it says:

Default IP address is set to 10.0.0.2, but the detected external address is actually xxx.xxx.xxx.xxx. This is typically the result of being behind a NAT firewall, and should be corrected on the module configuration page.

I corrected that on module config page to my external IP provided by my ISP.

Now when I recheck config it says virtualmin is ready to use even without any warnings. But it doesn't work actually for the virtual hosts created :(

This problem surely is related to router and not software part of the virtualmin but I don't know how to set it correctly behind the NAT firewall in router.

Tue, 10/25/2011 - 22:03
andreychek

Now when I recheck config it says virtualmin is ready to use even without any warnings. But it doesn't work actually for the virtual hosts created :(

It's good that the re-check config passes -- but when you say it doesn't work, what happens exactly?

-Eric

Wed, 10/26/2011 - 14:10 (Reply to #7)
tusker

Virtual Host created without any problems.

Out put of the code:

host domain.tld

domain.tld has address 10.0.0.2
domain.tld mail is handled by 10 ALT2.ASPMX.L.GOOGLE.COM.
domain.tld mail is handled by 20 ASPMX2.GOOGLEMAIL.COM.
domain.tld mail is handled by 20 ASPMX3.GOOGLEMAIL.COM.
domain.tld mail is handled by 0 ASPMX.L.GOOGLE.COM.
domain.tld mail is handled by 10 ALT1.ASPMX.L.GOOGLE.COM.

When I try to load website in browser it gives following standard error:

Not Found

The requested URL / was not found on this server.

Apache/2.2.14 (Ubuntu) Server at domain.tld Port 80

Wed, 10/26/2011 - 15:04
andreychek

Okay, so that looks like you may still be seeing a problem with Virtualmin's network setup -- or possibly a DNS caching issue.

Can you post a screenshot of your System Settings -> Virtualmin Config -> Network Settings screen?

Thanks!

-Eric

Wed, 10/26/2011 - 15:45 (Reply to #9)
tusker

Image attached with the comment

Wed, 10/26/2011 - 16:03
andreychek

Ah, there's the problem...

So, "Default Virtual Server IP Address" should be "From Network Interface".

And then, "Default IP Address for DNS Records" should be "Automatically Detected External Address".

The IP address of your Virtual Server should be the local IP address on your system there -- but DNS entries should be using the public IP from your router, which would be that external address.

-Eric

Wed, 10/26/2011 - 16:47
tusker

The IP address of your Virtual Server should be the local IP address on your system there -- but DNS entries should be using the public IP from your router, which would be that external address.

Where do I apply these settings?

Wed, 10/26/2011 - 17:06
andreychek

The only things you need to change are these two I mentioned above:

So, "Default Virtual Server IP Address" should be "From Network Interface".

And then, "Default IP Address for DNS Records" should be "Automatically Detected External Address".

Wed, 10/26/2011 - 18:23
tusker

Thanks for all the help, problem solved, but still have one domain not working. For all the domains on the virtual hosts command host domain.tld gives right output like my external ip address and mail addresses to google as mail is on google apps. But still one domain2.tld still gives me 10.0.0.2 when I run command

host domain2.tld

domain2.tld has address 10.0.0.2
domain2.tld mail is handled by 10 ALT2.ASPMX.L.GOOGLE.COM.
domain2.tld mail is handled by 20 ASPMX2.GOOGLEMAIL.COM.
domain2.tld mail is handled by 20 ASPMX3.GOOGLEMAIL.COM.
domain2.tld mail is handled by 0 ASPMX.L.GOOGLE.COM.
domain2.tld mail is handled by 10 ALT1.ASPMX.L.GOOGLE.COM.

this domain.tld doesn't load on internet but works on intranet. All other domains are now working fine as usual, up and running. Is this a special case where I have to change something in the config files?

under webmin > Network Configuration > Host Addresses this domain was listed with 10.0.0.2 as IP address. I removed that entry and still it doesn't work.

Wed, 10/26/2011 - 22:05
andreychek

The only reasons it wouldn't be working are that the domain could have been added prior to you making that change to the Virtualmin settings, or your DNS has cached the old IP address.

In Virtualmin, if you look at Server Configuration -> DNS Records, does it show the correct external IP's there, or are you still seeing the internal IP's?

-Eric

Thu, 10/27/2011 - 14:42 (Reply to #15)
tusker

I've tried everything.. uninstalled removing all config files etc., and than reinstalling webmin and virtualmin and configuring it. Thanks to your help everything works well except for this one domain. It never loads even doesn't give 404 or 403 errors. Browser tries to load it for sometime and then dies without any messages.

And whenever I run command host domain2.tld it gives me 10.0.0.2 as IP instead of external IP address. Everything else works well now.

Thanks

Thu, 10/27/2011 - 15:02
andreychek

So when you look at Server Configuration -> DNS Records, does it show the correct external IP's there on that screen, or are you still seeing the internal IP's?

-Eric

Fri, 10/28/2011 - 14:16 (Reply to #17)
tusker

I use http://freedns.afraid.org/ for DNS now and bind is deactivated. Still it shows same results for host domain2.tld with IP of 10.0.0.2 (internal ip)

If I go to Server configuration > Website options and tick Default website for IP address? YES the site is accessible on internet through IP address only.

for my IP the content of the folder /home/domain2.tld/public_html directly loads on internet but it is not accessible through domain2.tld in browser.

Sat, 10/29/2011 - 23:16
tusker

This is the error I get when I try to access the domain2.tld through a proxy site in my browser.

URL Error (110): An error has occured while trying to browse through the proxy. Failed to connect to the specified host. Possible problems are that the server was not found, the connection timed out, or the connection refused by the host. Try connecting again and check if the address is correct.

Tue, 11/01/2011 - 16:55
tusker

Subservers are also not working for domains.

Topic locked