Running Virtualmin Pro behind a NAT with port forwarding

9 posts / 0 new
Last post
#1 Fri, 02/26/2010 - 16:20
jflesher

Running Virtualmin Pro behind a NAT with port forwarding

I have a public static IP address and run behind a router doing port forwarding on a private IP address.

I tried changing all the Default shared address to the private IP address and then I tried to change the External IP address to the Public IP address; this still dosn't work

I get this error if I Re-Check Config I get this Default IP address is set to 192.168.0.12, but the detected external addresss is actually 69.88.x.x. This is typically the result of being behind a NAT firewall, and should be corrected on the module configuration page.

It seems that if you changed the virtual host to use * instead of IP address, this would work; is there a down side to this?

Update: Part of the problem seems to be the Joomla sites; with virtualhost set to *; I can pull up Drupal sites with no problem.

What is the solution?

Thanks

Fri, 02/26/2010 - 17:54
andreychek

Yeah, Apache should be setup so that the internal address is used in the VirtualHost definition in the Apache config, but with the external IP address listed in the DNS.

You'd typically set that up in System Settings -> Module Config -> Network Settings... you'd want "Default virtual server IP address" to tbe the internal address, and "Default IP address for DNS records" the external address.

If that doesn't work, something else is awry :-) At that point, you'd probably need to let us know what problems you're seeing so we can work through the issues.

-Eric

Fri, 02/26/2010 - 19:02 (Reply to #2)
jflesher

That worked and I can pull up my Drupal Sites; any idea why Joomla still crashes with an end of script error?

I did some searches and found no mention of this odd behavior.

This is on a development machine luckily; I'd never have a production machine behind a NAT; but I still need to bring it up so I know I have a backup if the other server goes down.

Thanks

Jeffrey Scott Flesher
Medically Retired Gulf War Vet

Fri, 02/26/2010 - 19:19
andreychek

Hmm, well, I'd be kind of surprised if what you're seeing is purely because of the IP address. The wrong IP address in there should cause the wrong site to show up -- not cause an Internal Server error.

What I'd do is take a peek in the Apache log for that domain -- in $HOME/logs/error_log. In there, Joomla should be detailing why exactly it's erroring.

-Eric

Fri, 02/26/2010 - 20:36 (Reply to #4)
jflesher

[Fri Feb 26 14:20:45 2010] [warn] mod_fcgid: read data timeout in 40 seconds [Fri Feb 26 14:20:45 2010] [error] [client 98.142.x.x] Premature end of script headers: index.php

Nothing else; not much help; seems like it went into a loop; maybe trying to resolve the IP; just a guess; without being able to step through this with a php debugger, that is all I can do is guess. This was an old production machine; now just a backup server; I don't have any tools on it; and my php debugger (nusphere) is a Windows App; maybe I can do a remote debug session; it would be a first for me. I have never had much luck with Linux Debuggers; and Nuspheres debugger is the only reason I even have Windows loaded on a machine.

This is only on my Joomla sites; all 39 of them; same error; Drupal, phpmyadmin and others work fine.

I did searches for these errors and nothing; this worked on this machine prior to switching to a router, also I did this from a restore, with the same results; if it wasn't for the fact I can use localhost and pull up the same Joomla site with going thru VM; I'd just think it was a Joomla problem; but as it is, VM seems to be causing this issue.

Jeffrey Scott Flesher
Medically Retired Gulf War Vet

Fri, 02/26/2010 - 22:01
andreychek

That particular error sounds like for some reason, PHP isn't responding in time for fcgid to deliver it's response.

The first thing I might try doing is disabling fcgid for this particular domain, and switch it to CGI. I'm curious if it begins working after that.

To make that change, choose Server Configuration -> Website Options, and change "PHP script execution mode" to "CGI" in order to move that particular domain to CGI.

-Eric

Sat, 02/27/2010 - 15:24 (Reply to #6)
jflesher

CGI pulls up page without Style sheets; but at least it didn't time out.

I'm getting lots of errors; but most look like failure to load third party apps; Nusphere PHP-Express for one; but I'm sure it will not work in CGI mode.

Update: I pulled php-express out to make sure that's not the problem; it behaves the same without it, but now I don't get those errors.

After I changed the time out to unlimited it started coming up; so the Joomla issue is solved.

I still think its joomla trying to resolve the IP or something; I don't care as long as it works now; but I think its causing the site to pull up slower.

I still can't pull up the sites from within the network and have to use a proxy.

An example of what I'm doing is this:

I have two servers; one production and one backup; the backup server is just to see what the site looked like a week ago and nothing more; its not a fail over server.

Prior to going behind a NAT, everything worked fine; now I can't pull up sites from within my network; in other words; I can't pull up these sites at all from my computer, since its in the same network.

I have a router; which connects to a switch and to my internet gateway, I port forwarded 80 to my backup server; on the switch I have all my computers; some use DHCP from the router; most have a static IP in the same range as the DHCP server.

Currently I pointed http://aspiremortgage.org/ to my backup server; but normally I would have it pointed to my production server; but for testing I re-pointed it. I would use a sub domain of 52 to point to my backup server as so: http://52.aspiremortgage.org/

Right now I can't pull up either site without going through a proxy

Jeffrey Scott Flesher
Medically Retired Gulf War Vet

Mon, 05/30/2016 - 08:04
chiareu

Hi, I'm in a similar situation and I'm stuck :(

Installed a fresh Debian server with Virtualmin that run behind a Router.
Configured Port Forwarding on router to the local IP (192.168.100.100)
On Virtualmin > System Settings > Virtualmin Configuration > Networking settings I have:
Default virtual server IP address : From network interface (192.168.100.100)
Default IP address for DNS records : External address (92.82.73.xxx)

created domain.tld that have IP address: 192.168.100.100 and DNS records external address 92.82.73.xxx
Mention: the domain is NS for itself with ns1.domain.tld and ns2.domain.tld who are responding at ping on external IP
the domain.tld itself return at ping 192.168.100.100 and request timeout.

Seams that the Apache not delivery the website and can't find the problem.

Mention. On Linux Firewall tried even with Network address translation

Mon, 05/30/2016 - 08:23
chiareu

Using network interface eth0 for virtual IPs.
Default IPv4 address for virtual servers is 192.168.100.100.
External IP address for DNS records is set to 92.82.73.xxx, which matches the detected external address.

Topic locked