How to keep MBP from sleeping and wifi connected

MacBook Pro 2010, 16 GB RAM, 1 TB SSD, OCLP 2.2, Monterey 12.7.6 that I want to use as a PLEX server with the MacBook Pro closed. However, after a period of time, the MacBook Pro will either go to sleep of shut off wifi. How to I keep the Macbook Pro from sleeping and keep the wifi on with the lid closed?

submitted by /u/jkostyo
[link] [comments]