Accessing WAMP Localhost on Mobile Browsers
How to access WAMP localhost on a mobile browser? Accessing Localhost applications on a mobile device.
You have installed the WAMP server on your Windows PC. You are already testing your website. Then you come across a Google forum emphasizing responsiveness more so on mobile and tablet screens. There is a sudden need for mobile versions of display and not only the PC version when developing websites. How do you run the WAMP server on a mobile browser?
Running WAMP server on Mobile Device
The bad news is that there is no mobile version of WAMP compatible with android. Remember that the WAMP server creates a local server to develop and test websites, therefore, there is absolutely no need to set up a server on a mobile device, since you will also need Web development IDEs and other programs and packages currently not supported on android devices. However, you can access your PC's WAMP server from your android devices, and devices in your local network.
Accessing the WAMP server (Localhost) on Mobile Device
To connect android to your WAMP server on your PC, there are two key requirements.
-
Start your WAMP application and ensure that it has a green icon. If the icon is orange or red, your WAMP server is turned on but not running as intended as one or more services have failed to start properly. In that case, troubleshoot the WAMP server issues first and try again as the server won't function as intended.
-
Ensure that the Windows PC and the mobile device are on the same local network. That means that the Windows PC and the mobile device are directly under the same router in your home or business's LAN (Local Area Network). Your PC can be connected to the router via a LAN Ethernet cable or through Wireless LAN using Wi-Fi. On the other hand, your mobile device is connected to the router through Wireless LAN using Wi-Fi. Get the local IPv4 of the Windows PC running the WAMP server. Your IPv4 address is most likely to follow the format 192.168.x.x.
-
Get the port number through which the Apache server is running. By default, WAMP's Apache server uses PORT 80, however, in some instances, you might have been required to set a different port. To check the port number, access WAMP default page, within the server software section, check the line
Port defined for Apache: x
x is 80 by default. If yours is different, note it down. -
Ensure that you can access your browser on the mobile device. Any browser should work including Google, Microsoft Edge, Mozilla Firefox, Opera, and others.
If you have checked the above list, lets proceed.
STEP 1:
On your mobile device, open any installed browser.
STEP 2:
In the URL box, type YOUR-WAMP-PC-IP-ADDRESS:PORT_NUMBER/.
For instance, if your Windows PC with the WAMP server running has the IPv4 address as 192.168.100.1 and the Apache server is on PORT 80, then in the browser's URL box, enter 192.168.100.1:80 and press enter. On successfully connecting, you should see a familiar page, either the default WAMP server page or your index page on the WAMP server's WWW directory.
That's it! We agree it is rather simple.
Now, can you connect another PC to your WAMP server? Here is a hint:
The procedures described above are similar when accessing the WAMP server on another PC in the same LAN as the WAMP PC. Remember to use the WAMP server PC's IP address on the guest PC.
Frequently Asked Questions on Localhost
What ports are used on localhost?
The default localhost port used is PORT 80. However, you can change the port to any other available ports. To see the current port used by your WAMP's Apache server, go to the default WAMP page or look in the httpd.conf file located in C:\{wamp_version}\bin\apache\Apache{version}\conf
How to access localhost?
To access localhost, your WAMP application must be turned on and the Apache server must be running. To know that the Apache Server is running, the WAMP icon on the taskbar is always green. If the WAMP icon is orange, either the Apache server or any other services is not running as intended.
If the icon is turned is green, go to your browser and enter either:
- http://localhost
- 127.0.0.1
- Your Windows PC IPv4 address such as 192.168.0.101
Where are localhost files stored in WAMP server?
WAMP stores all localhost files inside the www directory located in C:/{wamp_version}/. When your access http://localhost/my-project/ in your browser, the project folders and files are located inside the www directory as C:/{wamp_version}/www/my-project/.
Can localhost work without internet?
Yes it can.
Localhost creates a local web server where you access your web projects on local devices within your LAN (Local Area Network). Therefore, it can work without an internet connection. However, if your website projects use external repositories' dependencies, then an internet connection will be required unless you have a copy of the dependencies in your PC.
Localhost: Your connection is not secure.
Localhost is a local server in your LAN and can be accessed through the insecure HTTP by default and not the secure HTTPS protocol. Although some browsers can thrown an alert of "insecure website", most recognize localhost as secure and you can develop websites without the HTTPS enabled. The security of localhost is only dependent on the security of your PC.
However, ensure that your deployed projects use the HTTPS protocol for security reasons.