MENU
Connecting locally
In the previous section, you have seen how you can connect to your server by entering into the address bar of a browser local addresses such as:
0.0.0.0/phpinfo.php
http://127.0.0.1/admin
localhost
The same as 'localhost', 127.0.0.1 is called the 'loopback address' and is used to connect to your local machine only. 0.0.0.0 means 'default gateway for routing' and 'all IPv4 addresses on the local machine' (ie. a generic wildcard like *). If a server (or any service) is listening to 0.0.0.0:9000, it means that it is reachable through the port 9000 of all IPv4 addresses, including 127.0.0.1. Consequently, it can be reached from the outside of the network too.
In fact, once your server is running, you will be able to access it from any machine in the same LAN (local area network). Just enter the LAN address of the server machine on another machine nearby. For instance:
http://192.168.0.10/index.html
On a browser, for any network address, it is always optional to include 'index.html' as well as 'http://' and 'www.')
We have seen how to determine the LAN address on Linux Ubuntu. To do that on Windows:
1) enter 'ipconfig' in the command line,oror
or
2) navigate along Settings > Network & Internet > [Ethernet / WiFi] > [the network], oror
or
3) In Windows Explorer, right-click 'Network', select 'Properties', click 'Change adapter settings', right-click the connected network, select 'Properties', then double-click 'Internet Protocol Version 4 (TCP/IPv4)'.
Following 2) or 3), you can set the LAN address too. (The LAN address is automatically assigned with DHCP by default.) To set the LAN address in the Windows command-line interface:
netsh interface ipv4 set address name="Wi-Fi" static 192.168.0.10 255.255.255.0 192.168.0.1
Where 192.168.0.22 is the target LAN address, 255.255.255.0 is the subnet mask (generally the same for some), 192.168.0.1 is the gateway (router address).Another way to check the local network address on Ubuntu is to enter the 'ifconfig' command. To change the local network address:
sudo route add default gw 192.168.0.10 wifi0