10

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.

pattyd
  • 5,927
  • 11
  • 38
  • 57

2 Answers2

10

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.

Community
  • 1
  • 1
dpn
  • 592
  • 3
  • 9
  • will that set an ip for my server though? – pattyd May 25 '13 at 01:10
  • i dont use ruby btw, is there a better way? – pattyd May 25 '13 at 01:12
  • It essentially forwards your local IP:PORT to a third party server which proxies requests back to you through a tunnel. I just noticed you are on windows. have edited my answer to give windows information too. – dpn May 25 '13 at 01:13
  • I don't regularly write in C/C++ yet I use plenty of apps written in them. Same goes for Ruby. The tool is useful regardless of what you are choosing to build your own application in. – dpn May 25 '13 at 01:15
  • check edit for specs, thx – pattyd May 25 '13 at 01:16
  • so i dont need ruby to do this? – pattyd May 25 '13 at 01:17
  • just found this: http://stackoverflow.com/questions/3271441/something-compareable-to-localtunnel-for-windows?lq=1 will it work for me? (the link to the program i'm talking about is posted in the accepted answer) – pattyd May 25 '13 at 01:19
  • just read your edit. thanks! – pattyd May 25 '13 at 01:21
  • which ports would i forward? – pattyd May 25 '13 at 01:22
  • If you want people to be able to browse to your server without a post number you want to forward port 80 back to whatever port your server is running on locally. – dpn May 25 '13 at 01:25
  • my server auto runs on 80 already, so what now? – pattyd May 25 '13 at 01:33
3

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.

rightstuff
  • 6,412
  • 31
  • 20
  • Thanks for the info! I believe I have everything open now. I have my server set to port 1314, and forwarded 1314 to make it accessible. I will now download no-ip's DUC which syncs your ip with a no-ip domain name. Then type the domain in the browser, and my website opens! Thanks for the help! +1!! – pattyd May 26 '13 at 16:01