Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 07:37 am EST

Geeklog Forums

Geeklog Through VPN


Himanshu Joshi

Anonymous
determined
Hi! I have a geeklog site running in my intranet at an ip address say aa.aa.aa.aa Now one of my colleague want to access the same from outside the LAN and thus we need to resort to VPN for the same. Now the problem is that while using VPN, the ip aa.aa.aa.aa has been mapped as bb.bb.bb.bb and he uses the second ip. Thus Geeklog crashes. Is there a way to handle it by making some changes in the config file?? Please help me as I need to close the issue as soon as possible. Regards, Himanshu
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
You could, in your config.php, check the $_SERVER['remote_addr'] var and if it is on the VPN network, alter the $_CONF['site_url'] and similar variables.

For example, where I work the entire network is on the 10.x.x.x network. But any user using VPN is put on the 10.1.9.x subnetwork. So I could check that

if (substr($_SERVER['remote_addr'], 7) == '10.1.9.'Wink { // don't forget the trailing '.'
$internal_ip = '10.1.1.2'; // whatever the internal address of the server is
$_CONF['site_url'] = "http://$internal_ip/cms/";
} else {
$_CONF['site_url'] = "http://www.example.com/cms/";
}

Alternatively, perhaps you can put an entry in his /etc/hosts file if the machine he is using is always connecting via VPN.
 Quote

All times are EST. The time is now 07:37 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content