Jump to content


local ip -> public ip

  • Please log in to reply
3 replies to this topic

#1 pedrodz

  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 16 August 2007 - 04:22 PM

I have my apache server running perfectly with the following configuration.

Router – xxx.xxx.xxx.xxx [public ip]… DMZ to

Server – [local ip] … apache 2.0.x with <virtualhost domain.com >

C:\WINDOWS\system32\drivers\etc\hosts domain.com

… It is running perfectly but I would like to ask this
When I run www.domain.com/phpinfo.php [phpinfo() command] I get the following:

It is correct because it is the local ip of the server but…
Is there any chance to emulate in apache the public ip like
_SERVER["SERVER_ADDR"] = xxx.xxx.xxx.xxx [public server]
I am only testing this and my router is a Webstar with a home internet connection, but if it would possible to emulate the server address to a public ip it would be interesting.

#2 uhmcastillo

  • Members
  • PipPip
  • Member
  • 18 posts
  • LocationHouston - TX

Posted 16 August 2007 - 10:52 PM

I don't think so.

But, why would you want to do that anyway?

#3 NArc0t1c

  • Members
  • PipPipPip
  • Advanced Member
  • 299 posts
  • LocationSouth-Africa

Posted 17 August 2007 - 02:16 PM

Well, the goal of the router is to give each machine their own ip right?
well you won't be able to change it.

You will have to put the connection after the router to be able to get the internet IP.

Take a picture.. It'll last longer..
Quantum Theory - Damn Interesting
Albino Blacksheep - GameGum
W3Schools - Localhost

#4 pedrodz

  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 17 August 2007 - 03:53 PM

Thanks for your support.
I thought it would difficult to do it, possibly with some sort of proxy emulation but not easy to emulate it.

In fact it was just a discussing question, I do not need to do it. I already figured it if I need to have the apache/php server with the public ip I have to connect directly the modem to the server.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users