Jump to content

local ip -> public ip


pedrodz

Recommended Posts

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

 

Internet

|

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

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

 

C:\WINDOWS\system32\drivers\etc\hosts    127.0.0.1 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:

_SERVER["SERVER_ADDR"] = 192.168.0.5

 

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.

 

Link to comment
Share on other sites

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.

 

Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.