Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to point my localhost to a public ip address [closed]

Tags:

localhost

ip

I have just set up a WAMP 2.2 localhost on my computer. I have everything running properly (I can execute PHP, MYSQL, etc...) and am now wondering how I would point my localhost to a public ip-address that could be accessed outside of my network. Is this possible? If so, how would I do that?
Thanks!

EDIT:
Specs: windows, wamp 2.2.... Needed just to serve MYSQL and MYSQLI databases, php, html, js, and css files to people outside of my network. I prett much want ot create a basic website with my localhost.

like image 218
pattyd Avatar asked May 25 '13 01:05

pattyd


2 Answers

Have a look at localtunnel. Very handy for services that callback to your server (like paypal etc).

For alternatives on windows there is discussion here.

Finally you could forward a port back to your internal machine and use service like dyndns.

I couldn't tell you the best one to use without knowing more about your specific needs.

EDIT: Upon seeing what you really want to do, I would suggest forwarding a port on your router back to your webserver. There is a simple guide here that you should be able to figure out how to apply to your situation. Then you want to use something like dyndns as mentioned to register your own IP address to a name out onto the web.

like image 164
dpn Avatar answered Sep 18 '22 17:09

dpn


Apache is most likely bound to 0.0.0.0 (all IPs of system) and your VirtualHost probably uses a name-based (not IP-based) set up, and does not restrict the localhost VirtualHost to 127.0.0.1 (I'm more familiar with Wamp-Developer Pro than with WampServer, but I'd be surprised otherwise).

So any request that reaches Apache will end up at the VirtualHost that matches the domain-name under it's ServerName or ServerAlias directive, or will return the default VirtualHost.

You'll need to 1) unblock incomming port 80 and 443 in Windows Firewall, 2) port-forward Router WAN 80 and 443 to LAN IP, and 3) hope that your ISP does not block incomming port 80 requests.

You'll also need to use a registered domain-name, and will need to set it's DNS to point to your public IP address (which will be the Router's IP). Or transfer the domain-name's DNS to a Dynamic DNS service's nameservers ... that will sync the domain-name to the changing public IP address.

like image 21
rightstuff Avatar answered Sep 20 '22 17:09

rightstuff