Post AiOx5tGUGfStsQabOS by cammerman@mstdn.social
 (DIR) More posts by cammerman@mstdn.social
 (DIR) Post #AiOerC2mMrWYbG1Hn6 by futurebird@sauropods.win
       2024-05-29T22:05:57Z
       
       0 likes, 0 repeats
       
       Is there a good resource or book for learning about some of the details of how webservers work?For example if I want an IP address on a intranet to be a webpage that people on that intranet can go to... how would I set that up from scratch. Let's say I have a machine with a static IP on the local net... (but what I really also need to understand is how a static IP is established locally, a DNS?)Maybe the dream book or resource doesn't exist. But I ask anyway.(it's macs if that matters)
       
 (DIR) Post #AiOfSpxquIPB7rfJ9U by adriano@lile.cl
       2024-05-29T22:12:08Z
       
       0 likes, 0 repeats
       
       @futurebird Depending on what exactly you want to do, you could get a book on web servers specifically (the two most popular open source webservers are Apache and Nginx, and there are plenty of books at every level) or an entry book that teaches the LAMP stack (Linux, Apache webserver, mysql databases, PHP/Python/Perl) or your equivalents, e.g. the MAMP stack.
       
 (DIR) Post #AiOfeaFPAT0hr7TbaC by futurebird@sauropods.win
       2024-05-29T22:14:48Z
       
       0 likes, 0 repeats
       
       @adriano Isn't Apache just one kind of program you can run on a machine to serve webpages? Maybe I'm being to purist and ambitious, but I want to understand just what such programs *are* ... like if I wanted to write one (I don't, not really good god) but I want to know how they work. How are they open and able to know that a page is requested to be served? Does that make any sense?
       
 (DIR) Post #AiOflv95rpJahJ1UPo by alexandria@mastodon.gamedev.place
       2024-05-29T22:15:58Z
       
       0 likes, 0 repeats
       
       @futurebird TCP/IP Illustrated might be useful? Not sure if it's too low level or too high level lol
       
 (DIR) Post #AiOfsf8VmvDZ4XxvXc by adriano@lile.cl
       2024-05-29T22:17:15Z
       
       0 likes, 0 repeats
       
       @futurebird Oh, yeah, it does. Apache is a web server program, and you set it up on a machine to serve webpages. For Apache there's at the very least Apache: The Definitive Guide, published by O'Reilly. In general, O'Reilly's books were of very high quality.
       
 (DIR) Post #AiOg7sKqzqP8LtzbCS by davekonopka@jawns.club
       2024-05-29T22:20:07Z
       
       0 likes, 0 repeats
       
       @futurebird It’s not an all-in-one book or macOS specific but @b0rk has made some nice zines that cover networking and dns basics.https://wizardzines.com/
       
 (DIR) Post #AiOgEM4RM28WJPPAQa by sgillies@mastodon.social
       2024-05-29T22:21:10Z
       
       0 likes, 0 repeats
       
       @futurebird have you seen Julia Evans' blog post on DNS? https://jvns.ca/blog/2023/05/12/introducing-implement-dns-in-a-weekend/ There's a zine, too.
       
 (DIR) Post #AiOgP2YoEVmGzIhlfk by tuban_muzuru@ohai.social
       2024-05-29T22:23:14Z
       
       0 likes, 0 repeats
       
       @futurebird @adriano The simplest metaphor is a telephone call.  So you're going to call someone.  $ ping www.cnn.comPinging cnn-tls.map.fastly.net [151.101.3.5] with 32 bytes of data:There's a big directory, kept up to date when people create new domains.   That's Domain Name Service.  Sorta like speed dial, if I have "Work" on speed dial.That's Concept One.
       
 (DIR) Post #AiOgYIcXtHpLP6rrBg by wizzwizz4@fosstodon.org
       2024-05-29T22:24:45Z
       
       0 likes, 0 repeats
       
       @futurebird I'd start with a high-level overview [RFC 9110] (start at section 1, read until bored, then skip to section 3), then go for the nitty-gritty in [RFC 9112].The contents of [RFC 9111] is important once you've got more than a couple dozen users, or if any of them have to pay for bandwidth, but I'd wait to read that until your head stops spinning from [RFC 9112].[RFC 9110]: https://www.rfc-editor.org/rfc/rfc9110[RFC 9111]: https://www.rfc-editor.org/rfc/rfc9111[RFC 9112]: https://www.rfc-editor.org/rfc/rfc9112
       
 (DIR) Post #AiOgk16Qqd6sY2QyZ6 by lampsofgold@veoh.social
       2024-05-29T22:27:01Z
       
       0 likes, 0 repeats
       
       @futurebird Seconding Julia Evan's zines, specifically start with Networking! ACK! (https://wizardzines.com/zines/networking/)
       
 (DIR) Post #AiOgo28UwpiKuYJdr6 by webmariner@mastodon.me.uk
       2024-05-29T22:27:00Z
       
       0 likes, 0 repeats
       
       @futurebird hey! a web server is just a program that binds to tcp port 80 and listens for requests coming in. macos used to have apache built in and you just had to switch it on, may have changed a bit tho since I last checked... but it's common for web servers to be configurable to look in a particular folder for files that match the rest of the path of the request (does that make any sense?)
       
 (DIR) Post #AiOh2I5uPctsSVu3Y8 by webmariner@mastodon.me.uk
       2024-05-29T22:30:20Z
       
       0 likes, 0 repeats
       
       @futurebird as for static IP, doesn't have to be the case if the machine acting as DHCP server on your network is set up to give your web server machine thr same IP each time it asks for one, or if you have an internal DNS server set up to resolve queries for your local hostnames (dnsmasq is a nice fit for this)
       
 (DIR) Post #AiOhFqiF0ufxaeIWv2 by futurebird@sauropods.win
       2024-05-29T22:32:51Z
       
       0 likes, 0 repeats
       
       @webmariner Yeah I understand that part mostly. I just don't know how IPs or DNS work exactly, particularly on a intranet.
       
 (DIR) Post #AiOhVB6XTmaLB6yLgW by futurebird@sauropods.win
       2024-05-29T22:35:33Z
       
       0 likes, 0 repeats
       
       @munin I think the thing I need to study is DHCP. That's what I've just always ignored and chalked up to magic. I've set up many servers, but most just ran defaults or used a service. But, I want to pay more attention to the bits I've ignored.
       
 (DIR) Post #AiOhhZQGtGhY4i6x4C by scerruti@csed.social
       2024-05-29T22:37:46Z
       
       0 likes, 0 repeats
       
       @futurebird A book? Hmm, how about Unit 4, Lab 1 of Beauty and Joy of Computing which covers the AP Principles details on this. Code.org has similar material (slides and simulators) I'm a bit at a loss for what you are looking for because it covers a very broad range of technologies.
       
 (DIR) Post #AiOi2ki47Y63A7XCam by futurebird@sauropods.win
       2024-05-29T22:40:37Z
       
       0 likes, 0 repeats
       
       @scerruti Basically I worked making webpages like 10 years ago, and I want to do a better job with my HS students breaking down how networks worked never having paid more attention than strictly needed to the details. I know to tell the admin to "open port 80" and can put up a webpage wherever. But it's backed by instinct not... any theory. LOL. I don't want unleash more people like me into the world.
       
 (DIR) Post #AiOi98wGwyl02rE8iO by jason@logoff.website
       2024-05-29T22:42:31Z
       
       0 likes, 0 repeats
       
       @futurebird @munin I think DHCP is a rabbit hole here, your questions is entirely about routing and DNS
       
 (DIR) Post #AiOiVjAAwxjYlOV0kq by scerruti@csed.social
       2024-05-29T22:46:43Z
       
       0 likes, 0 repeats
       
       @futurebird I am going to recommend Code.org's CS Principles curriculum, specifically Unit 2 - The Internet ('24-'25)This unit reveals how the Internet was designed to connect billions of devices and people to one another. Learn how the different protocols of the Internet work and actually build them yourself using the Internet Simulator. Then consider the impacts the Internet has had, both good and bad, on modern life. Also @zamansky for a local resource.
       
 (DIR) Post #AiOidkL0SyhqiuOB8a by foolishowl@social.coop
       2024-05-29T22:48:20Z
       
       0 likes, 0 repeats
       
       @futurebird There are a couple of ways a static IP could be assigned in an Intranet.Usually you get a dynamic IP address from DHCP, a service running on the router you connect to. It identifies a network interface (your network card or wifi) by its MAC address, then assigns an IP address for a certain period of time.The most reliable way to assign a static IP address is for it to be reserved on the DHCP server, so that MAC always gets the same IP.
       
 (DIR) Post #AiOjDKTo5EVox1TM7k by wizzwizz4@fosstodon.org
       2024-05-29T22:38:18Z
       
       0 likes, 0 repeats
       
       @futurebird If you have a web browser, install ncat from https://nmap.org/download.html, and have a little play around with https://nmap.org/ncat/guide/ncat-usage.html#ncat-listen.(Watch the Network tab in your browser's F12 developer tools, probably with the "persist logs" setting enabled. Also watch the terminal output.)
       
 (DIR) Post #AiOjDLqX0EHfBn71BQ by wizzwizz4@fosstodon.org
       2024-05-29T22:52:05Z
       
       0 likes, 0 repeats
       
       @futurebird For getting a static IP address: your IP address is whatever you say your IP address is, if you can get the traffic routed to you. On local networks, that's handled by ARP. (ARP's RFC is incomprehensible, but you can get the gist from [RFC 5227].)Basic idea of ARP: traffic on the network is sent to MAC addresses. When you want to send to an IP, you shout "hey, who's 192.168.1.1?", and some device replies "hey that's me", then you use that MAC.[RFC 5227]: https://www.rfc-editor.org/rfc/rfc5227
       
 (DIR) Post #AiOjDMvB0RasWUIF3w by futurebird@sauropods.win
       2024-05-29T22:54:47Z
       
       0 likes, 0 repeats
       
       @wizzwizz4 This is super helpful. Thank you!
       
 (DIR) Post #AiOjjS0bcslXZJ8AAS by austinwillis@sfba.social
       2024-05-29T23:00:13Z
       
       0 likes, 0 repeats
       
       @futurebird @munin I think the broader topic you might be looking for is service discovery. DNS and DHCP are some of the many protocols that solve this problem
       
 (DIR) Post #AiOjrXBEHbwtvKxDma by knowuh@mastodon.social
       2024-05-29T23:02:00Z
       
       0 likes, 0 repeats
       
       @futurebird There are a *lot* of resources that go deep on what a web server is. The question is what is the correct level of detail for where you are now.Maybe this is a good place to start:https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_web_server
       
 (DIR) Post #AiOkBucsoxWQQqbdjc by catselbow@fosstodon.org
       2024-05-29T23:05:42Z
       
       0 likes, 0 repeats
       
       @futurebird You asked for a book, but I'm going to stretch that a little and offer some lecture notes from a short course I gave years ago. This is a lecture on how web servers work. Maybe there's still some useful information? (Apologies in advance for the terrible presentation.)https://discovery.phys.virginia.edu/compfac/courses/sysadmin1/12-web/presentation-notes.pdf
       
 (DIR) Post #AiOkkS2R6N6fu61mJE by mtrigo@mastodon.social
       2024-05-29T23:12:00Z
       
       0 likes, 0 repeats
       
       @futurebird I've been trying to figure that out too!How do we make the new internet in the infrastructure of the old?I got as far as "I think I gotta call my ISP to pay bang for a commercial package upgrade for a static IP"
       
 (DIR) Post #AiOl9gf9rhNkV6Amno by vruz@mastodon.social
       2024-05-29T23:16:17Z
       
       0 likes, 0 repeats
       
       @futurebird Hope this helps:https://drive.google.com/file/d/1iDsE9_ojtqMbU_MsqKdukII6DeBJ79em/view?usp=sharing
       
 (DIR) Post #AiOlKHMQHJm1DFSbJY by knowuh@mastodon.social
       2024-05-29T23:10:08Z
       
       0 likes, 0 repeats
       
       @futurebird I am assuming this is all because you are curious and want to learn the nitty gritty details, or want to teach about it.If on the other hand, you are just trying to setup a private web server on your LAN to share data, you can probably download a specific Raspberry PI distribution and follow a few page README. Something like Internet in a box maybe:https://internet-in-a-box.org/
       
 (DIR) Post #AiOlKIrIi04DrIum5A by futurebird@sauropods.win
       2024-05-29T23:18:28Z
       
       0 likes, 0 repeats
       
       @knowuh I've been doing the later for too long without knowing enough of the former.
       
 (DIR) Post #AiOm8jvKM8ISHJqdzk by ef4@better.boston
       2024-05-29T23:27:34Z
       
       0 likes, 0 repeats
       
       @futurebird maybe https://wizardzines.com/zines/http/. They also have one for DNS.
       
 (DIR) Post #AiOmN91DqkcKACTSfA by rubinlinux@mastodon.sdf.org
       2024-05-29T23:30:01Z
       
       0 likes, 0 repeats
       
       @futurebird @adriano It is surprisingly simple at it's core. Apache is written in the C programming language. It runs in the background as a 'daemon' process or 'service' usually on #linux servers.In the C language, a call is made to "open a tcp port" using the berkley socket system listen() function. https://man7.org/linux/man-pages/man2/listen.2.htmlselect(), accept(), read(), write(), and close() are also called. Over this port, they speak using the HTTP protocol.https://tinyurl.com/yc6xaf6r
       
 (DIR) Post #AiOnV6B6OYUPclS5gm by webmariner@mastodon.me.uk
       2024-05-29T23:42:42Z
       
       0 likes, 0 repeats
       
       @futurebird when a machine's network interface starts up, it can either broadcast a request for an IP (optionally giving a name too) and wait for a reply from a local DHCP server, or it can be set up to use specific details manually (the static IP option). The DHCP server would tell the machine which IP address it can use, along with the IP of the DNS server to use for looking up the IPs of other hosts.
       
 (DIR) Post #AiOoHVouMUTL3G9ksS by dushman@hollow.raccoon.quest
       2024-05-29T23:49:06.216Z
       
       0 likes, 0 repeats
       
       @futurebird@sauropods.win IPs on LAN are allotted automatically by  DHCP server running on the router usually. This can also be done manually. You can also assign a static IP to a machine while having DHCP enabled. You do this in the router configuration, and that IP will be tied to the MAC address of said machine.
       
 (DIR) Post #AiOoHWyW4FkgdLewUa by sun@shitposter.world
       2024-05-29T23:51:41.031548Z
       
       0 likes, 0 repeats
       
       @dushman @futurebird run mdns on your machines and you don't need to maintain a central dns server, it will just present the hostname dot local of every machine
       
 (DIR) Post #AiOoRAhriTkoSsT5Yu by Old_IT_geek@techhub.social
       2024-05-29T23:53:19Z
       
       0 likes, 0 repeats
       
       @futurebird Grab a copy of the Internet guide for dummies. It’s a great read and clearly explains all the concepts. Note internet/intranet use the same technology.
       
 (DIR) Post #AiOoWfD9jCo0WNisXQ by dushman@hollow.raccoon.quest
       2024-05-29T23:53:17.551Z
       
       0 likes, 0 repeats
       
       @sun@shitposter.world @futurebird@sauropods.win Just realized that instance defederates yours and ours lol
       
 (DIR) Post #AiOoWgRN9pluKlNkKu by sun@shitposter.world
       2024-05-29T23:54:25.377448Z
       
       1 likes, 1 repeats
       
       @dushman @futurebird that's okay, the guy we're replying to is an NPC
       
 (DIR) Post #AiOokPYCkZt00O7idM by dushman@hollow.raccoon.quest
       2024-05-29T23:55:41.024Z
       
       0 likes, 0 repeats
       
       @sun@shitposter.world @futurebird@sauropods.win computer scienceThey don't even know basic networking principles ​:light:​
       
 (DIR) Post #AiOokR4r4fb6jwPJAG by sun@shitposter.world
       2024-05-29T23:56:54.119563Z
       
       1 likes, 0 repeats
       
       @dushman well, not everybody knows everything but if they're _teaching_ they should be able to figure things out.
       
 (DIR) Post #AiOoqYFFL26YhvBSTo by dushman@hollow.raccoon.quest
       2024-05-29T23:57:48.644Z
       
       1 likes, 0 repeats
       
       @sun@shitposter.world Oh wait they actually don't defed us at least
       
 (DIR) Post #AiOouF8QKZiOb4kk8e by sun@shitposter.world
       2024-05-29T23:58:41.815075Z
       
       0 likes, 0 repeats
       
       @dushman lmaoI haven't been paying attention to defeds on this new server. I really only care if someone says we're block evading or something
       
 (DIR) Post #AiOpNwx6Uv90tNciEC by dushman@hollow.raccoon.quest
       2024-05-29T23:58:51.917Z
       
       0 likes, 0 repeats
       
       @futurebird@sauropods.win Also DNS has nothing to do with the allotment of IP addresses.
       
 (DIR) Post #AiOpNxphDwoTchAJJw by futurebird@sauropods.win
       2024-05-30T00:03:50Z
       
       0 likes, 0 repeats
       
       @dushman Can you have a DNS server that works just on an intranet?That is, give names to the IPs that just work locally?
       
 (DIR) Post #AiOqZGWiA3BcjyEpEX by kirby@lab.nyanide.com
       2024-05-30T00:16:57.714322Z
       
       0 likes, 0 repeats
       
       @sun @dushman this is kind of funny, they actually don't defederate mine this time around
       
 (DIR) Post #AiOqbZvoz7ExVG5Oj2 by parsingphase@m.phase.org
       2024-05-30T00:17:29Z
       
       0 likes, 0 repeats
       
       @futurebird There's a "to create anything from scratch, first create the universe" answer to that (and I'll see if I can think of any books that provide that), but for an overview of the mechanics, this page isn't bad: https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
       
 (DIR) Post #AiOqfNSDJlmfxm35LE by kirby@lab.nyanide.com
       2024-05-30T00:18:12.952490Z
       
       0 likes, 0 repeats
       
       @futurebird You'd just set up a web server and you wouldn't port forward itAlso DHCP on your router assigns IP addresses to machines automatically.
       
 (DIR) Post #AiOqhSRdjWyU1LlwrA by sun@shitposter.world
       2024-05-30T00:18:47.936599Z
       
       1 likes, 1 repeats
       
       @kirby @dushman I noticed a recent dropoff in replies so I figured we finally got on the The List.
       
 (DIR) Post #AiOrP8wnaMweIBB4O8 by specter@eattherich.club
       2024-05-30T00:26:32Z
       
       0 likes, 0 repeats
       
       @futurebird I cut my teeth on all that when our internal firewall failed and I had to replace it, pfsense and opnsense are stack solutions that accomplish what you're thinking usually off a lil heat-sync box... Local DHCP server + "unbound" for DNS server. From unbound (there are probably alternatives) you can assign domain names to IP addresses (or block requests to certain domain names) DNS middle-person is very powerful
       
 (DIR) Post #AiOrfHBEkAg0SXcijA by futurebird@sauropods.win
       2024-05-30T00:29:17Z
       
       0 likes, 0 repeats
       
       @specter OK That's interesting, so the same software that does DNS blocking might be able to assign local names? Part of what I'm dealing with is the sysadmin, who is a nice guy, but kind of irritated that I want the CS club playing with all this stuff. So, the more I know about what exactly is "easy" the better.
       
 (DIR) Post #AiOsDd0a5rlI0J1Hpw by specter@eattherich.club
       2024-05-30T00:35:40Z
       
       0 likes, 0 repeats
       
       @futurebird what I thought was maybe kinda easy (playing in my homelab after the firewall fire) is assigning an intranet domain name in pf/opnsense and then configuring unbound to save/serve local devices as <hostname>.<intranet>... Since it's local DNS server it doesn't have to be a purchased TLD for the intranet part
       
 (DIR) Post #AiOsnE1yR9Eixje3uq by GeePawHill@mastodon.social
       2024-05-30T00:42:01Z
       
       0 likes, 0 repeats
       
       @futurebird Do you want to do this yourself? Do you want to start from scratch? Do you want teaching material?An http1.1 server is actually a ridiculously easy program to write. One needs only to know a dab of multi-threading for the sockets, and lots of String manipulation. Won't be fancy, will work.Of course, most programming languages have deluxe cool libraries, and they're even simpler to use.
       
 (DIR) Post #AiOsyqikvdGm8vCOYq by gkrnours@mastodon.gamedev.place
       2024-05-30T00:44:12Z
       
       0 likes, 0 repeats
       
       @futurebird static IP live in the router. Each wifi / ethernet adapter have a mac address, router have a list of mac address and IP it should be attributed. From there, either the server request an IP using dhcp and it will happen to be the static one or the server just use the static IP and hope things will be fine.A DNS let you map a human readable name to an IP. Like "phonebook.local => 10.10.144.37".for a read only intranet, I would start darkhttpd
       
 (DIR) Post #AiOt9to5nLYMtpxpTs by futurebird@sauropods.win
       2024-05-30T00:46:10Z
       
       0 likes, 0 repeats
       
       @GeePawHill I want to understand it with more depth. For example I had a great time playing with Django and getting little webpages running with python, but there were a lot of details I didn't understand. Or even is Django like a small basic version of Apache? I assume it is I had to turn off one to run the other or else put them on different sockets. There is a big difference between blundering around making things happen and really understanding what's happening.
       
 (DIR) Post #AiOtGJ0uzOheoa1B5c by futurebird@sauropods.win
       2024-05-30T00:46:42Z
       
       0 likes, 0 repeats
       
       @gkrnours Why read only?
       
 (DIR) Post #AiOtjNBAa7cW8CfoFU by GeePawHill@mastodon.social
       2024-05-30T00:52:35Z
       
       0 likes, 0 repeats
       
       @futurebird Gotcha. I wrote a crude http server (kotlin) from scratch a couple of years back. Didn't get terribly far, but I learned a *lot*. There's a guy who wrote one from scratch, and had just  couple of blog articles, and they really helped me. I'm looking for them, but not luck, yet.I will keep looking. The kotlin aspect is irrelevant, really.
       
 (DIR) Post #AiOuMGaj0bdUzeAlJQ by f_dion@mastodon.online
       2024-05-30T00:59:38Z
       
       0 likes, 0 repeats
       
       @futurebird@sauropods.internetworking with tcpip vol 1 is the book most of us started with. It is one of my recommended book as part of my ex-libris list "ex-libris"​ of a Data Scientist, part III: Technologyhttps://www.linkedin.com/pulse/ex-libris-data-scientist-part-iii-technology-francois-dion?utm_source=share
       
 (DIR) Post #AiOuhKZ7QcLzOrSv7w by gkrnours@mastodon.gamedev.place
       2024-05-30T01:03:22Z
       
       0 likes, 0 repeats
       
       @futurebird darkhttpd is a very simple app. It take one folder and serve everything in it. No upload, no calling other code.when I started learning, I used wamp. It
       
 (DIR) Post #AiOvF9W70qwuynBd4q by swelljoe@mas.to
       2024-05-30T01:09:32Z
       
       0 likes, 0 repeats
       
       @futurebird @adriano in the old days there were materials that would introduce you to HTTP (and several other protocols), but writing an inetd activated version in a few lines of code. HTTP used to be simple enough to do that. I don't know what the equivalent would be today, as most systemd don't even have inetd, anymore...Linux systems have socket-activated units in systemd, but that's one of the few things that harder and much more confusing under systemd than doing it the old way.
       
 (DIR) Post #AiOx5tGUGfStsQabOS by cammerman@mstdn.social
       2024-05-30T01:30:16Z
       
       0 likes, 0 repeats
       
       @futurebird I don't have a resource for you, but want to give you a heads up of something you'll run into, if you haven't already: there is a whole "stack" of technologies that take us from cables to networks to IPs to the web. They are made to layer and be isolated, but also to build on each other. Getting a computer to serve a webpage on a local network involves knowing a little bit about somewhere between a few and several of these layers.
       
 (DIR) Post #AiOynqnwsOPqwTla3U by sabik@rants.au
       2024-05-30T01:49:03Z
       
       0 likes, 0 repeats
       
       @futurebird @GeePawHill Django does have a little web server built in; when you run "django-admin runserver", that's what it doesIt's written in Python, and it's deliberately kept simple, being intended for local testing only
       
 (DIR) Post #AiOypsNjz0JqPgTQhM by bcdavid@hachyderm.io
       2024-05-30T01:49:05Z
       
       0 likes, 0 repeats
       
       @futurebird I honestly don't remember where I learned this stuff from because I'm old. It wasn't a book. When I was younger I managed to finagle my way into a small shop IT job and Googled my way from there. Which apparently is not so easy anymore. The short answer to your question is you need to point devices on your intranet to an internal DNS server that resolves domain names it knows and boots up names it doesn't know to external DNS servers. Which I guess is not really a short answer.
       
 (DIR) Post #AiOzRwdyaNZodSDiee by sabik@rants.au
       2024-05-30T01:56:40Z
       
       0 likes, 0 repeats
       
       @futurebird @dushman Yeah, a typical DNS server will do that — give names to IPs that work locally, while forwarding requests for anything else upstream (either to the ISP DNS server, or directly to the DNS servers across the Internet)It's up to the person setting up the DNS server to make sure that those IP addresses correspond; there isn't any magic matching it with the addresses DHCP hands out
       
 (DIR) Post #AiP1akRxUWSjKbvO5Y by futurebird@sauropods.win
       2024-05-30T02:20:42Z
       
       0 likes, 0 repeats
       
       @bob_zim What do you mean by making your own processors? I assume you don't mean an IC. (But I have to ask because in my course we build gates and adders from transistors. And even make a transistor or two.)I'm assuming this is some kind of processor for processing packets?
       
 (DIR) Post #AiPH37PzBjc9zEzJwG by isotopp@chaos.social
       2024-05-30T05:13:49Z
       
       0 likes, 0 repeats
       
       @futurebird If you want to just understand what a web server does, people have dropped pointers here already.One person that I deeply admire is W. Richard Stevens, who unfortunately died much too early.He wrote https://www.amazon.com/-/de/dp/0321336313. I do not have that edition, I only have the first edition, and I hope they did not mess with his clarity in later editions.Specifically the first volume of TCP/IP Illustrated takes the spec of TCP/IP and a packet monitor, and then compares the spec …
       
 (DIR) Post #AiPt8qbuO8Vpr1ivBY by kellogh@hachyderm.io
       2024-05-30T12:20:45Z
       
       0 likes, 0 repeats
       
       @futurebird you’re probably buried in suggestions at this point but @GeePawHill’s suggestion is great — you can write an HTTP server on bare TCP sockets, e.g. via python, and that might demystify it.the parts of django that are confusing you are features for building complex web apps, and aren’t really fundamental to how the web works. you can build a HTTP server with basically just print statements, at the lowest level
       
 (DIR) Post #AiPuRMQqulpNiKwa12 by kellogh@hachyderm.io
       2024-05-30T12:23:14Z
       
       0 likes, 0 repeats
       
       @futurebird @GeePawHill something else — maybe use wireshark to capture network packets and see what’s actually transferred. it really illustrates how the TCP/IP protocol suite plugs together. some other people mentioned TCP ports and how they route traffic to the app. to complement learning about that, wireshark can help you see how that’s happening, to all network traffic going through your computer
       
 (DIR) Post #AiPuRNV8wIr11vxWLI by futurebird@sauropods.win
       2024-05-30T12:35:18Z
       
       0 likes, 0 repeats
       
       @kellogh @GeePawHill  I’m excited to try wireshark later today.
       
 (DIR) Post #AiQ3dFU3TPdjE7BXxQ by conniptions@mastodon.social
       2024-05-30T14:18:18Z
       
       0 likes, 0 repeats
       
       @futurebird Thank you for this great thread. Apologies if this has already been posted (looked, didn't see it) but there's a great list of one-liner mini-webservers here: https://gist.github.com/willurd/5720255 - any one of these may be a good jumping off point for your own further explorations in the language of your choice, plus it's a useful tool to have around when you just want to serve a local directory quickly and temporarily without faffing around in nginx or or Apache.
       
 (DIR) Post #AiQEnlx0iQcaJSww6K by Wraithe@mastodon.social
       2024-05-30T16:23:26Z
       
       0 likes, 0 repeats
       
       @futurebird Just noting that I’m glad you asked this, cos this is a fascinating thread with people posting a lot of interesting sources and comments*. I hope you get a good answer out of it!MacOS used to have a built-in web server but Apple took that out a bunch of versions back.*a lot answers covering anything I would have said and more breadth, thus just the above. 😃
       
 (DIR) Post #AiRlRZG2icDoDkpbma by light@noc.social
       2024-05-31T10:03:55Z
       
       0 likes, 0 repeats
       
       @futurebird @adriano This might be helpful to you: https://www.youtube.com/watch?v=7GBlCinu9yg
       
 (DIR) Post #AiRqBVJM7jFn7OXa4W by cholling@social.sdf.org
       2024-05-31T10:57:01Z
       
       0 likes, 0 repeats
       
       @futurebird I found this helpful many years ago, but, full disclosure, the Internet has changed a lot since then and I haven't read more recent editions:  https://www.oreilly.com/library/view/internet-core-protocols/1565925726/
       
 (DIR) Post #AiRudt0O1TzWWrSOZs by light@noc.social
       2024-05-31T11:46:54Z
       
       0 likes, 0 repeats
       
       @futurebird The replies to this thread seem to be glossing over how DNS works, so I'll explain to the best of my knowledge:Your computer contacts a recursive resolver, which in turn contacts authoritative resolvers, also known as nameservers.1/?
       
 (DIR) Post #AiTCLzMDKc0Iux8Yy0 by alec@perkins.pub
       2024-06-01T02:39:59Z
       
       0 likes, 0 repeats
       
       @futurebird if it’s only intranet and only Macs, you might be able to get away with not doing anything for the domains thanks to Bonjour (self-assigned computer-name.local domain names, I use this regularly to test mobile web stuff running on my laptop).Alternatively, you can configure a public domain to point to the internal IP, assuming it’s static (I also have this locally for services running on non-Macs.) if the domain/IPs must stay secret, it requires an internal DNS server as well.
       
 (DIR) Post #AiTUxroTcwQZhOZIGG by Garsal@c.im
       2024-06-01T06:08:39Z
       
       0 likes, 0 repeats
       
       @futurebird For setting up a local website on an Intranet I can't think of a networking book that wouldn't be massively overkill, though I can still recommend something if you want. Zimmy's descriptions of IP/Ethernet/DNS are all correct but also largely concerned with serving pages over the Internet (although still more concisely explained than I could manage, and definitely worth the read).I personally would break down the problem into three parts, the web "server" itself, the content you're hosting, and then how it's reached by other users. For the web server as mentioned this will be software running on your computer, I would recommend Apache. Reason being it uses directories and .htaccess files to serve content, which I find easier to grok. Nginx would be a likely 2nd choice if you were curious. Through the .htaccess configuration you can share a directory to your intranet. Apache itself will also need to be configured, essentially your device needs to say that there's a web page to be hosted, and Apache needs to know to host it where your device says. Mac is not my area of expertise but I found this overview that touches on the important points: https://discussions.apple.com/docs/DOC-250004361The content itself will need to set up in such a way that is readable by the web server. For a static website this would likely just be an HTML file, CSS file, and possibly a JavaScript file in a folder with the .htaccess file for the web server. Lastly is how you share it with others. If you have configured your virtual host in Apache correctly (from the guide above) then those local to you should be able to see it. The only issue you may find is that you get a warning that the site is considered unsafe, because there's no SSL certificate in order to serve the web page over an encrypted connection. You could generate your own certificate to bypass this but for personal projects I never bother, personally I've found that Firefox trusts me to continue whereas Chrome just forbids it.
       
 (DIR) Post #AiU1NDa71kC2z7yuuW by viq@social.hackerspace.pl
       2024-06-01T12:08:52Z
       
       0 likes, 1 repeats
       
       @bob_zim @futurebird @webmariner Since the basics were so nicely explained, I'll dive into some interesting tangents ;)When you have control over DNS, many interesting tricks are possible:If more than one record gets returned for an address, clients will try them in random order.[1/N]
       
 (DIR) Post #AiU1NGKcnmaTVxl5ge by viq@social.hackerspace.pl
       2024-06-01T12:09:34Z
       
       0 likes, 1 repeats
       
       @bob_zim @futurebird @webmariner There's a concept called Split Horizon, and easiest way about it is your DNS server returning different answers depending from which network interface the query comes. Thus for example my phone or laptop connect to a different address for same server depending whether I'm at home, somewhere else, or connected to my VPN.[2/N]
       
 (DIR) Post #AiU1NLXDSOd7eSgiVU by viq@social.hackerspace.pl
       2024-06-01T12:09:59Z
       
       0 likes, 0 repeats
       
       @bob_zim @futurebird @webmariner DNS servers may receive information about IP address of client querying them. This lets them return address of the server they believe to be closest to the client. This is usually called GeoDNS.[3/N]
       
 (DIR) Post #AiU1TtssexCJvDwkds by futurebird@sauropods.win
       2024-06-01T12:13:04Z
       
       0 likes, 0 repeats
       
       @viq @bob_zim @webmariner Sort of like how different pages are served to mobile vs. desktop browsers? (which I kinda hate, but I can think of some fun things to try with this)
       
 (DIR) Post #AiU2JgAwsAyaSp5VSq by viq@social.hackerspace.pl
       2024-06-01T12:22:24Z
       
       0 likes, 0 repeats
       
       @futurebird @bob_zim @webmariner no, this is much "lower" level. It's "your IP seems to be from Loisville, I should tell you to connect to server in Atlanta rather than Las Vegas".If we were to slice "how you see web page" it would be (simplified) IP-TLS-HTTP-JavaScript, and "you should see mobile page" happens somewhere between HTTP and JavaScript (I'd bet on the latter), whereas DNS is at the IP layer.
       
 (DIR) Post #AiU4m5AziKRY1EmSsy by viq@social.hackerspace.pl
       2024-06-01T12:15:29Z
       
       0 likes, 0 repeats
       
       @bob_zim @futurebird @webmariner Since DNS is generally visible in the same way from everywhere, it's often used as a quick and easy way to prove you have control over said domain name (say, `example.com`), by way of "put this specific text in this specific record so we can verify it".[4/N]
       
 (DIR) Post #AiU4m6ValEVu9PQQd6 by viq@social.hackerspace.pl
       2024-06-01T12:17:40Z
       
       0 likes, 1 repeats
       
       @bob_zim @futurebird @webmariner There's a bunch of extra records that can be put in DNS, for example to automatically discover services, or for various security features. DNS is *heavily* used with email.[5/N] (though I think I am out of ideas for the moment)
       
 (DIR) Post #AiU62e67kDoIugxr3g by martin_piper@mastodon.social
       2024-06-01T13:04:01Z
       
       0 likes, 0 repeats
       
       @futurebird @webmariner in the old days it used to be one website for one IP.Then the HTTP request was changed to include the domain you're requesting for, so one IP can be the host for many domains.
       
 (DIR) Post #AiUwjQu9rnYa445ie8 by robinadams@mathstodon.xyz
       2024-06-01T22:54:31Z
       
       0 likes, 1 repeats
       
       @futurebird @adriano A Web server is a program that takes HTTP requests as inputs and returns HTTP responses. Requests and responses are just text strings (*) of a certain formatFor the bare minimum "Hello World" server, write a program such that when it receives this stringGET /index.html HTTP/1.1It returns this string:HTTP/1.1 200 OK<html><head><title>Hello World</title></head><body><p>Hello World!</p></body></html>A browser is a program that takes a URL from the user, send a GET request to that location, and if it gets a 200 response whose body is valid HTML, then it renders it on the screen.For lower level than that - what does it mean for a machine to send or receive a string to or from a given IP address - then you want to start looking into the TCP/IP model.Hope I understood what you're asking. Sorry if this was patronising.(*) The body of a request or response need not be text, it could be a sequence of bytes representing an image, say.
       
 (DIR) Post #AiUy5xsy1diMg4qGvI by Mumonkan@mastodon.online
       2024-06-01T23:09:49Z
       
       0 likes, 1 repeats
       
       @futurebird maybe this page might be instructive on just how simple a "web server" can be. its a single-line shell script (serving out some html). but also explores some other examples.https://funprojects.blog/2021/04/11/a-web-server-in-1-line-of-bash/
       
 (DIR) Post #AiV4vXXjoJ9blGt8ue by jfrench@cupoftea.social
       2024-06-02T00:26:22Z
       
       0 likes, 0 repeats
       
       @futurebird @viq @bob_zim @webmariner this isn't done so much nowadays but one of the HTTP headers (have they been covered yet) sent in the request is 'user-agent' this can be used to customise the response to a particular browser.  It was used a lot in the early mobile web as some browsers were very limited.
       
 (DIR) Post #AiV66c0ldc1Ol7JI5A by jfrench@cupoftea.social
       2024-06-02T00:39:34Z
       
       0 likes, 0 repeats
       
       @futurebird you've had some great responses here. One bit that I don't think you've been told about is 'nat port forwarding'If you have a computer that you want to be a web server on your local network it will have a local IP address. Your router/modem will have* a public IP address. That means that the internet won't be able to talk to the computer on your local network. You can't set up DNS to your local address (or at least not for people outside your network) and if you set up DNS to point to your router the request won't automatically go to your web server.But you can set up a forwarding rule on the router to take any traffic on particular ports and forward it to your server and it will work.You can kind of think of NAT as a mailroom in a big office block. External post goes to the mail room and it then delivers the mail to the correct place internally. The postal service only needs to know about the physical location of the mail room. * Carrier NAT stops this
       
 (DIR) Post #AiV8A2soNzIGsRM07E by complexmath@hachyderm.io
       2024-06-02T01:02:36Z
       
       0 likes, 0 repeats
       
       @futurebird @adriano It’s a TCP-based server using a pretty straightforward plaintext protocol. There’s a command line (or a response line) and then a message that looks a whole lot like an email message. So a client connects, sends a request, and (always) gets a response. You can use telnet to send client commands if you want to play with it at the protocol level. This is for HTTP/1.x anyway. HTTP/2.x is a new and much more complicated binary protocol. Not a fan of HTTP/2, for nuanced reasons.