Accessing Apache2 localhost on windows WSL2 from mobile device (android)

Viewed 19

I have a localhost site running on apache2 within WSL2 (Debian 11).

I have tried using my network IP address (both the host computer and mobile device connected to the same wifi router) - this gives me the default Apache "It works" page which is in my root http://localhost/

However, when I try to access any of my sites (root: /var/www/html/<<site-folder>>), by using http://<<MY.IP.ADD.RES>>/<<mysite-folder>>/ the mobile says connection refused.

I've also tried adding :80 to the end of the IP address since that's the listening port defined in the virtual host config file, but no joy.

I can't help thinking there must be something I'm supposed to enable in apache2, either in the apache.conf or in the virtual host config.

Everything works fine on my local machine's browser. The mobile device is android with the usual chrome browser.

Was hoping to use my mobile for site testing purposes.

Can anyone point me in the right direction?

0 Answers
Related