JavaRush /Courses /Claude Code SELF /How the internet works: deployment

How the internet works: deployment

Claude Code SELF
Level 5, Lesson 2
Available

1. “Works on my machine” ≠ “opens for everyone”

“Look, you have the classic case.” Alex doesn’t start with terms, but with something Tommy has already lived through this morning. “You built a page, and it looks great in your browser. You send it to someone with ‘check this out’ — and they say: ‘it doesn’t open.’ Sound familiar?”

“Just today.” Tommy frowns. “I have a landing page, but for Tony it might as well not exist.”

Tommy shows Tony the finished landing page on his monitor, but the page won't open on Tony's phone; an open laptop sits on Tommy's desk beside it

“Exactly. And it’s not a glitch, it’s a law. ‘Works on my machine’ and ‘opens for everyone’ are two completely different things. Until you separate those, the phrase ‘put the site on the internet’ is just empty words, a bunch of words.”

“So where should it live so everyone can access it?” Tommy doesn’t get it. “Not on my laptop — then where?”

“That’s the right question. We’ll start from there and unpack what the internet actually is. After that, ‘put it online’ will stop being magic.”

Local and public: a file that lives only on Tommy's laptop opens only for Tommy; a copy of the file on a server opens for everyone Local — the file lives only on Tommy's laptop index.html no way into someone else's laptop Tommy — opens Tony — won't open Public — a copy of the file lives on an always-on server server copy of index.html Tommy — opens Tony — opens Client — opens

2. A server is just a computer that is always on

“The key word here is server. Tommy, forget the scary part. A server is not a mysterious box with blinking lights. It’s just a computer that is always on and keeps files available for other people.”

“Always on? Like, really always?”

“Really always. That’s the whole point. Your laptop gets closed in the evening, put in a bag, taken home — and that’s it, it sleeps, it stays with you. It can’t serve a site to anybody. A server stands somewhere in a data center, humming around the clock, and any person at any moment can reach it and take the files. That’s what it exists for — to stay available when you are not there.”

“Wait,” Tommy interrupts. “That doesn’t add up. I send a picture to a friend in a messenger, and it gets there. My phone gives it to him. Why do we need some server here too?”

“That’s where you got caught.” Alex is clearly pleased with the question. “You think the picture flies from your phone straight into his hands? No. First it gets uploaded to the messenger’s server, and only then from there — to him. That’s why you can send a picture, turn off your phone, go to sleep, and your friend can open it two hours later and still get it. If the two of you had to be online at the same time, nothing would work. That’s why the server sits in the middle: always on, always ready to hand things over.”

“So even where I thought everything worked without any server, it’s still there.”

“It’s always there. You just don’t see it. So remember the main thing: for a page to be seen by everyone, all the time, its files must live not on your laptop, but on a server — on a machine that never turns off. That’s the whole setup.”

Tommy digests that. He used to think of the internet as some kind of shared cloud where things just end up on their own. But it turns out to be just another computer that doesn’t sleep. Strange, but very down to earth.

3. Two addresses: numbers for machines, a name for people

“Since there are many servers, you need some way to reach the right one. By address,” Alex continues. “And there are, believe it or not, two kinds of addresses — but it’s the same pair as with an ordinary house.”

“Why two?” Tommy doesn’t get it. “One would be simpler.”

“Because one is for machines, the other is for people. The first one is IP. It’s a numeric address, something like 192.0.2.1. Exact, but unreadable for humans — just coordinates written in digits. Computers talk to each other exactly like that; they don’t need letters.”

“Well, numbers are numbers. So what’s the second one?”

“The second one is the domain. The server’s human-friendly name, like javarush.com. Easy to remember, easy to type. It’s like a signboard. You don’t tell a friend, ‘let’s meet at the building at coordinates fifty forty-five, thirty fifty-two.’ You say, ‘by the Chika coffee shop on the corner.’ A domain is that signboard/name instead of coordinates.”

“Hold on, how are they connected then?” Tommy hooks in. “The name and the numbers.”

“Behind the scenes, the domain automatically turns into an IP. You type an easy name, and under the hood it unfolds into those very numbers that let machines find each other. You only need to know the name — the rest happens by itself.”

Tommy checks a note with an IP address against the plates on identical buildings, while the chikacoffee.com sign hangs right behind him

4. Path — which exact file on the server

“One more word, and we’ll wrap up the addresses. A server usually stores a bunch of files. How do you say which one you need? You add a path to the address — the path.”

Alex shows three lines on the screen one after another:

192.0.2.1                      # IP — numeric address of the server
example.com                    # domain — the same place, but with a human-friendly name
example.com/home/about.html    # path — which exact file on this server

“Back to the house,” Alex continues. “The domain is the building. And the path is which exact place inside the building. example.com/home/about.html reads like this: ‘on the server example.com, open the file home/about.html.’ So a site address is not a magical string, but two understandable parts: whose place it is and where exactly to go inside.”

The address example.com/home/about.html: the domain example.com is whose place it is, the path /home/about.html is where to go inside; behind the scenes the domain turns into the IP 192.0.2.1 example.com/home/about.html domain whose place it is — the “building” path where to go inside — the “room” behind the scenes 192.0.2.1 IP — an address for machines home/about.html a file on this server

“And where does this home/about.html come from?”

“That’s literally the path to a file on the server’s disk. That’s how it was originally meant to work: on the server there is a home folder, inside it the about.html file, and by that address you land right on it. On modern sites many files are generated on the fly, but the logic is the same — a file address leads to a specific place, like a folder on your computer.”

Tommy sums it up himself, out of habit:

“So the domain is the name of the computer on the network, and the path is what exactly to take from there and where.”

“Simplified, of course, but correct.”

5. Hosting — a server on rent

“Okay, wait.” Tommy tenses up. “Server, data center… I don’t have any server in a data center. And I don’t have money for one. So how am I supposed to put it online?”

Tommy bursts in on the sysadmin shouting "I need a server, fast!", while the sysadmin calmly keeps the phone to his ear

“And here’s the good news.” Alex has clearly been waiting for this. “You don’t need one. There is hosting. It’s a service that does all the server-side work for you. See how simple it is: you give it your files — your page. It puts them on its server, that same always-on machine. And it gives you a public link. That’s it.”

“That’s it? No administration?”

“None. You don’t need to build a data center, you don’t need to become a system admin, you don’t need to configure any hardware. For a simple static page like your landing page, there are free hosting services: hand over the files — get a link — done. And that link can already be sent to anyone. Tony will open it from his phone, the client will open it from theirs, anybody can open it.”

Tommy’s shoulders visibly relax. The most unpleasant phrase — “a server in a data center” — turned out to be someone else’s problem. His job is to hand over the files and take the link.

6. Deploy — putting the files out there

“And now — the main word of the day, the reason we started all this. Deploy. From the English ‘deploy.’ In human terms, it means you copy your files to where they are available not just to you — from your laptop to the hosting server.”

“Copy them,” Tommy repeats. “So the file is literally copied somewhere into a data center?”

“A copy of the file is uploaded and saved on an always-on machine. And now let’s go back to your morning mystery. Why does it work for you, but not for Tony? Because as long as the page lives only on your laptop — it is available only to you. Tony can’t get into your computer, and thank goodness for that. But as soon as you did the deploy — copied the files to hosting — the page ended up on a server with a public address. And now anybody can open it.”

The deploy path: the files are on Tommy's laptop, deploy copies them to a hosting server, the hosting gives a public link, and the link opens on Tony's phone Deploy is the bridge between “local” and “public” Local Public — for everyone Tommy's laptop original files deploy copy the files Hosting server copy of the files Public link an address for all Tony's phone it opens! The original stays with Tommy — a copy goes public

Alex puts on the screen the very distinction that Tommy had sensed intuitively in the morning, and now sees in words:

“Works on my machine (local)”  ≠  “opens for everyone (public)”

“Remember this firmly, it’s simple but important. Local means on your machine, for you alone. Public means on the server, for everyone. And deploy is the bridge between these two states. That’s exactly what you’ll build today. You’ll put the landing page online so Tony can open the link from his phone.”

Tommy looks at the arrow between “local” and “public” and realizes that the whole morning panic was about that one little bridge he couldn’t see. “Put the site on the internet” stopped being a spell. It is a clear action: copy the files to the hosting server and get a link for everyone. All that’s left is to do it.

Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION