2

I set up locally Apache2 server for django project, and it worked perfectly well. The problem is that after one day off i got back to it and tried getting on server, and somehow i couldn't connect to it, even after checking if apache service is running, and reloading configuration just to be sure. I couldn't access it from localhost, and any other local tag.

So after that i tried with django runserver command. Server was running, but i couldn't get on it as well. 2 days before, it worked without any issues. I'm using Ubuntu on WSL 3, and on windows i can run server without any problems. Tried pinging localhost and got 100% package loss.

What i did then was restarting whole Ubuntu service with wiping all data. After setting up system everything worked again. The thing is that this is second time that this problem is occuring, and last time i get rid of it the same way, just restarting whole Ubuntu with removing all data. Second time after setting everything up and running server i tried restarting my computer to check if this problemm occurs, after windows restart, but it worked.

EDIT: I just discovered something really strange. I tried turning off my computer, and then turning it on. I could not connect to server, but after rebooting it i can connect like nothing happens. Tried it few times and literally every time after reboot i can connect, but after turning it off, and turning on i can't connect.

NotTheDr01ds
  • 15,620
  • 5
  • 44
  • 70
jokonoo
  • 83
  • 1
  • 7

1 Answers1

4

See this answer for more details. Some more details, however:

A shortcut to recovery should be running:

wsl --shutdown

After that, WSL's localhost port auto-mapping should be back to normal.

But for a more permanent fix, try disabling Windows Fast Startup. This setting is causing Windows to pseudo-hibernate, which seems to be the biggest culprit in the localhost breakdown.

halfer
  • 19,824
  • 17
  • 99
  • 186
NotTheDr01ds
  • 15,620
  • 5
  • 44
  • 70