How to configure Apache Server to be publicly accessible when it is run on a laptop through Wi-Fi?
Olivia Zamora
I am trying to set up a web server on my laptop that could be accessed publicly using my public ip(ex. ), but I am stuck with port forwarding issue(or so I think).
So this is my set up:
Desktop is connect to the internet directly with LAN cable.
Laptop is connect to the internet only through Wi-Fi.
On my laptop, when I type "localhost", "127.0.0.1" or "192.168.0.6"(laptop's ip) into the browser's address bar I get directed to the webpage running on my Apache Server, so the web server is working. But when I type in my public ip I am directed to the router set-up page.
How to forward the ip so that the person typing in the address bar my public ip could access the Apache Server that runs on my laptop(which is connected to the internet through Wi-Fi)?
51 Answer
When I type in my public IP I am directed to the router set-up page.
To be clear, while hairpinning (the ability to access a public IP connected to a local machine from the local network) could be an issue, it seems more likely you simply haven't set up port forwarding properly in your router.
Regarding your exact problem, in short, it's likely your router doesn't understand that you wish to pass incoming requests on port 80 (HTTP) to your web server (e.g. 192.168.0.6). So instead, it serves up its own web-based configuration page.
Unfortunately, each router has a different interface for setting up port forwarding, so it's difficult to give exact steps. However, you need to see if you can find any (likely advanced) settings in your router which will allow you to set your laptop's IP as the destination for port 80 requests (these settings are often marked as "port forwarding" or "virtual server" settings). You may want to examine your router's manual if you can't find these easily.
It's also worth noting that any firewall present on your server can potentially interfere with running a web server, so you may need to adjust your laptop's firewall settings as well.
My laptop is connected to the Internet through Wi-Fi.
As a side note, this is likely extremely insecure. Wi-Fi presents a large number of possible ways for an attacker to gain access to your network. Other security considerations aside, it would be much better to run your web server from a wired connection.