>>2501see
>>2504but you should use nginx
the tl;dr is, install a functional operating system on a computer you have laying around that isnt doing anything (that means GNU+Linux, and not some wintoddler baby's toy that doesn't even have a command line)
i recommend debian for a web server if you dont know what youre doing, rolling release distros are generally more stable for desktop use and not a pain in the ass with outdated shit, but if youre only hosting a web server and never change shit on it debian is better, since you dont have to constantly update it every 2 days or so and have to expect minor bugs with that
debian only starts breaking if you run debian-stable on a desktop because it has packages that are probably older than your computer.
now you install nginx and make it automatically start when your machine boots up (with systemd or whatever you use, in other words systemctl enable --now nginx after configuring it)
you need to get a domain, just leech a subdomain off freedns as
>>2505 already pointed out, make it point to your IP address (you want a static one if you can get one), forward ports 80 and 443 for HTTP and HTTPS on your router (TCP), plus whatever else you might want to host (e.g. for minetest forward port 30000 (UDP), for meinkraft you forward 25565 (TCP), etc...)
now run certbot (you might want certbot-nginx) to generate HTTPS cert bullshit, so HTTPS works
make plain HTTP shit on your website automatically redirect to HTTPS because you probably dont want plain HTTP connections
(i think you do this by throwing this into your http
server
block but dont quote me on it, i havent fucked with my nginx config in half a year)
listen 80;
server_name your.domain;
now all you need to do is write some HTML and throw it into your index.html (in your webroot, which is usually /usr/share/nginx/html/, /srv/www/, or whatever else you set it to in /etc/nginx.conf)
do NOT use javascript
if you dont need to, dont use CSS, if you want to do advanced shit you should use PHP because unlike JS it isnt a fucking remote code execution JIT piece of laggy broken shit, and it actually works
now do whatever you want
oh and you can enable auto indexing for certain directories by throwing this into your nginx.conf, inside your HTTPS server block
location /someshit { autoindex on; }
location /wiki { autoindex on; }
location /blog { autoindex on; }
this will automatically generate an index.html for /someshit/, /wiki/, and /blog/ listing all the files in those dirs.
you might have to
chown http:http
some files if they dont download/open/display and give you a permission denied error, but chowning some other shit like JS garbage can break it so only do this if you have to and dont chown your entire webroot.