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.
Just enter the IP address of the XAMPP server in the browser. If you haven't already, you need to configure XAMPP for remote access. If you mean another network, then you need to turn on port forwarding in your router. Send your query to the WAN (public) IP address of your router.
You can put your XAMPP server online without buying a hosting plan from web hosting provider, all you have to do is, get these followings. Allow external connections to Apache HTTP server through the firewall on port 80. Get a Static IP from your Internet Service Provider (ISP) (contact your ISP).
Assuming your router has a valid IP itself (say x.x.x.x) you can access your Apache server on: http://x.x.x.x/. You can use any other port instead of 80 and access your Apache through http://x.x.x.x:PORT/ of course.
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
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With