Page 1 of 1
Changing "localhost" to real "WAN" IP or DNS Name
Posted: Sat Jan 21, 2006 10:48 pm
by Ken Synder
Hi,
i found out, that i cant access a big part of my cmsms from outside my pc (from Internet).
I took a closer look at the html output and i found out, that most of the links start with
"
http://localhost" and of course this cant work that way, but how can i change "dynamically"
the localhost to my real-world wan ip address, or even my dns name, when accessing my pc
from outside?
Running on WinXP with Apache/2.0.55 (Win32) DAV/2 PHP/5.1.2
Best Regards
Ken Snyder
Re: Changing "localhost" to real "WAN" IP or DNS Name
Posted: Sat Jan 21, 2006 11:42 pm
by westis
You should be able to set all the paths in config.php in the root folder. Change localhost to your IP address.
Re: Changing "localhost" to real "WAN" IP or DNS Name
Posted: Sun Jan 22, 2006 12:05 am
by Ken Synder
Hi,
thanks for the answer, but my system is behind two firewalls and a proxy server connected
to a adsl firewall-router that redirects http request to a locally installed win32 apache service.
I need a way, to determine, whether the referer comes from inside my lan(localhost,subnet etc.)
or from outside(WAN, Internet) so i can dynamically change php output for the links and set the
right server address or the dns name. There most be some way to do this, because e.g phpmyadmin
is able to handle local and remote invocations...
Best Regards
Ken Snyder
Re: Changing "localhost" to real "WAN" IP or DNS Name
Posted: Fri Feb 03, 2006 11:14 pm
by jelle
you will need to do some tricks with dns, or edit a host file on all workstations within the lan (but only if your adsl router is as halfassed as mine and can't redirect traffic back in)
solution: get some dynamic dns name e.g. at dyndns.com. they will give you a subdomain like yourname.theirname.org coupled to your ip as seen from the outside. You set your router to redirect traffic at port 80 (http) to the computer running cmsms.
Problem. Your router may not be able to redirect traffic that is coming from the lan to the outside ip back in to the lan to your cmsms server. That means that your domain only works outside the lan (not what you want)
Some routers allow you to add extra names to their caching dns. If your does, add yourname.theirname.org to it pointing to the lan ip. If your router is not that smart, add a line with "yourname.theirname.org 10.0.0.5" to your computers hosts file (/etc/hosts on linux/unix, don't know where to find it on windos). This will override the answer it get from dns wich is incorrect inside your lan (in fact dns will not be asked at all).
offcourse you will also have to edit config.php to use the new domain name.
HTH
Re: Changing "localhost" to real "WAN" IP or DNS Name
Posted: Sat Feb 04, 2006 5:04 pm
by Ted
I just tried an experiment that might be worth looking into.
I removed all of the hostname from my url fields in config.php (
http://localhost/cms becomes /cms) and it "seems" to work correctly. Might be worth trying for your situation. Make sure the path is absolute, though, or it'll cause problems in the admin (I think).