Access XAMPP Localhost from Internet
Asked Answered
M

4

67

I have XAMPP installed in local laptop. And I have a almost static ip. I would like to give the ip to other to run it from their browser. I configured apache httpd-vhosts.conf to listen my ip address:80 and added the virtual server with the ip address and domain root to local httdocs directory and the servername as localhost. Apache doesn't start. what should I do to access my website from external computer.

Missilery answered 5/5, 2009 at 1:20 Comment(1)
Just as a general warning to all who find this going forward, you need to be careful using tools like these to host a live website. In many cases they come configured to do development work, and thus expose your computer to a lot more security risk.Obellia
H
114

First, you need to configure your computer to get a static IP from your router. Instructions for how to do this can be found: here

For example, let's say you picked the IP address 192.168.1.102. After the above step is completed, you should be able to get to the website on your local machine by going to both http://localhost and http://192.168.1.102, since your computer will now always have that IP address on your network.

If you look up your IP address (such as http://www.ip-adress.com/), the IP you see is actually the IP of your router. When your friend accesses your website, you'll give him this IP. However, you need to tell your router that when it gets a request for a webpage, forward that request to your server. This is done through port forwarding.

Two examples of how to do this can be found here and here, although the exact screens you see will vary depending on the manufacturer of your router (Google for exact instructions, if needed).

For the Linksys router I have, I enter http://192.168.1.1/, enter my username/password, Applications & Gaming tab > Port Range Forward. Enter the application name (whatever you want to call it), start port (80), end port (80), protocol (TCP), ip address (using the above example, you would enter 192.168.1.102, which is the static IP you assigned your server), and be sure to check to enable the forwarding. Restart your router and the changes should take effect.

Having done all that, your friend should now be able to access your webpage by going to his web browser on his machine and entering http://IP.address.of.your.computer (the same one you see when you go here ).

As mentioned earlier, the IP address assigned to you by your ISP will eventually change whether you sign offline or not. I strongly recommend using DynDns, which is absolutely free. You can choose a hostname at their domain (such as cuga.kicks-ass.net) and your friend can then always access your website by simply going to http://cuga.kicks-ass.net in his browser. Here is their site again: DynDns

Hephzipa answered 5/5, 2009 at 3:2 Comment(7)
Yes it worked!!! I have n't changed my ip to static as lose my internet all together. Also need to check the DynDns. Appreciate your HELP.THnksMissilery
so with the DynDns you don't have to make your IP static? You just put it to your IP and bang you've got it?Banded
DynDns gives you functionality like a static IP address. My IP address on my home router will still change... but DynDns gives me a free hostname that they keep updated to always point to whatever my dynamic IP address is. I.e. my home router (which then port forwards on to my desktop) is always reachable at "myname.doesntexist.org"Hephzipa
are there free alternatives to DynDns?Brambly
DynDns used to be free (and was at the time this question was asked). However, they've done away with their free tier now.Hephzipa
Hey! I did setup a static ip address but I'm unable to get to my localhost website on my pc....What is wrong here??Skijoring
Why return 503 for me? when I want access it from local machine (In same network is OK) but outside my network return 503 errorSputter
D
24

I guess you can do this in 5 minute without any further IP/port forwarding, for presenting your local websites temporary.

All you need to do it, go to http://ngrok.com Download small tool extract and run that tool as administrator enter image description here

Enter command
ngrok http 80

You will see it will connect to server and will create a temporary URL for you which you can share to your friend and let him browse localhost or any of its folder.

You can see detailed process here.
How do I access/share xampp or localhost website from another computer

Dense answered 29/2, 2016 at 18:50 Comment(2)
How safe is this process?Expatriate
Its same as http, your account data is being redirected using tunnel through ngrok server, however, https can be a safer option!Dense
M
0

I know this very old but for future's sake:

I also used a dynamic dns provider. Wanted to test the website (IIS) BEHIND my (home) router. So i thought i use something like this:

my.dynamic.dnss.ip:8080 (because my router's port 80 was used to admin it).

So this seemed to be the only solution.
But: Paypal seemed to not like port 8080: only port 80 and 443 are allowed (don't know why!!)

Merline answered 24/5, 2012 at 17:15 Comment(0)
B
0

you have to open a port of the service in you router then try you puplic ip out of your all network cause if you try it from your network , the puplic ip will always redirect you to your router but from the outside it will redirect to the server you have

Bryner answered 29/6, 2015 at 12:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.