How can I see a website running on Apache installed on my PC from another device connected to the same ADSL router?
I am not so into networking and I have the following problem.
On my Ubuntu system I have installed Apache web server on which run some web sites.
So now to access to these web site I need to open an URL like this into my browser:
The problem is that I want to test this website also on my smartphone (I have to check if it is correctly responsive), so the previous URL is not good !!!
My computer is connected to Internet by a standard ADSL router. Can I obtain the URL of my PC in some way and so connect to it by my smartphone?
1 Answer
first, you should make sure if your apache server listens on 0.0.0.0 as its bind address. Here's a simple command to know what IP and port is your server is listening to.
netstat -nap | grep apache | moreand look for listening address of your apache server.
Apache's official documentation on bind address
after that, you must know your IP address and port of your machine. ifconfig command shows your IP addresses.if you're connecting your machine to your ADSL router via an Ethernet cable, ifconfig will show it as eth0.
Now you can browse your Apache server from the other machine by typing:
IP address]:[Apache Port number]