I have an Ubuntu 22.04.1 web server running Apache2 Server hosting 2 sites [Django website & other File hosting Site]. What I'm trying to achieve: Set the server to sleep all the time it is not in use. when it receives an HTTP request, It wakes for 20 min. (To give clients some time to use the website) then go to sleep.
I've dealt with the 2nd part by setting the ubuntu auto sleep timer to 20min. and it worked (it sleeps after 20 min. of waking)
My Problem is with the 1st part. After days of research and trying, I can't find a way to make the server wake on HTTP requests only. I have Tried ethtool's wol, all the 'pumbg' options but the server Wakes on random times without sending any requests to the server.