P
PMR
I have a FC4 box running as a web server with an internal IP
192.168.1.5 running behind an ADSL router connected to the 'net via a
dynamic IP. I have a domain which is hosted by a company and any
requests to that domain name get sent to a Perl script running on those
machines, which looks up its most recent record of my server's IP in a
text file and redirects to my machine.
The router receives the request, and my FC4/Apache box is set up as a
DMZ host so it receives the requests.
Problem is I have a cron script running on my local server which
updates my local server/router's IP on my hosted website every 2minutes
and the IP is determined based on the REMOTE_ADDR environment variable
set when I make a HTTP request to the update script - this is hogging
resources.
I need a script to run on my local server that only updates my IP on my
remote server when it detects my local IP changes. Problem is how do I
find the IP address of my server - as it would appear to 'the world'
(i.e. actually the external IP of the router) from a script run on the
server itself?
Any hints would be appreciated!
Cheers
Pete
192.168.1.5 running behind an ADSL router connected to the 'net via a
dynamic IP. I have a domain which is hosted by a company and any
requests to that domain name get sent to a Perl script running on those
machines, which looks up its most recent record of my server's IP in a
text file and redirects to my machine.
The router receives the request, and my FC4/Apache box is set up as a
DMZ host so it receives the requests.
Problem is I have a cron script running on my local server which
updates my local server/router's IP on my hosted website every 2minutes
and the IP is determined based on the REMOTE_ADDR environment variable
set when I make a HTTP request to the update script - this is hogging
resources.
I need a script to run on my local server that only updates my IP on my
remote server when it detects my local IP changes. Problem is how do I
find the IP address of my server - as it would appear to 'the world'
(i.e. actually the external IP of the router) from a script run on the
server itself?
Any hints would be appreciated!
Cheers
Pete