DevOps and Deployment is almost a subfield of computer science.
Taking your code that you have written in some environment for some purpose and making it available for others to use.
Person receiving the disk can't reproduce it themselves
Goal in deployment:
Deploying websites in a professional environment on the web.
It is very, very complicated
Networking: Deep field with a lot of theory and research
You getting your code to the internet somehow is DevOps
The internet and how your code is on the internet is the use of servers is part of DevOps
The delivery of your code from those servers on the internet to the customer is DevOps.
Configure an operating system on a computer
Connect a computer to the internet
Write software that opens a socket and listens for connections
Usually when you make a web server for the internet, it's not actually your code that connects to the customer.
Accepts multiple connections by listening as a web server on a specific port. On a public web server, that's almost always port 80.
The trick is that your OS only has one port 8 (why you have to use nginx)
When you open up Express, it can only accept as many connections on that port as your OS can finish traffic on that port.
It depends on your operating system, your connection, etc. how many that is, but it definitely can't handle 2,000 connections per second (most likely far fewer)
If your website takes one second to do the job you designed it to do, nobody can connect to your server for a minute until the job is finished.
A connection comes in to your OS.
Your OS hands the connection to nginx.
It spawns a completely new process and runs your webserver or makes a connection to your webserver inside of that process. - Then it renames the socket (frees up port 80 again) and it gives the socket a different port ID.
Has 50,000 sockets to choose from.
When it's finished, nginx is finished and starts listening for traffic again.
Caching - it's keeping a list of all the files it has read and a copy of them.
If a client asks for static content (something that has a cache policy that makes it legal to cache the data), nginix will simply copy the file and stick it in its memory.
It doesn't run your server or ask the server for the file, it already has it.
Connects to the internet
Google.com is a domain name.
But that's not how you get to google.com.
The internet works via IP addresses.
When I ping Google.com in my terminal, it says Google.com's IP address is 216.58.194.142.
That's for one specific computer somewhere in the world that's going to get that traffic when you try to contact Google.
Google has hundreds of thousands of servers.
When you type in Google.com, before it even tries to figure out what the IP of the address is, it looks to see what kind of traffic it's receiving.
This is an HTTP request and that's on port 80.
The domain name, Google.com is just an entry in a table somewhere that says that Google.com goes to 216.58.194, etc.
The machine that keeps that table is called a domain name server which is a very complicated network protocol with a huge request for comments that specifies exactly how it works and it's recursive.
When I type in Google.com, my web browser asks a domain name server what the IP address of Google.com is.
And the first domain name server to ansewr is my router on the wall.
And if my router has that domain name, it gives it to my browser and doesn't talk to anyone else.
But if it has never been to Google.com or if the domain name has timed out (and should be uncached), my router will ask my ISP's domain name server what's the IP address.
And it will recursively walk up a step of domain name servers through tiers of ISPs all the way up to ICANN - Internet Corporation for Assigned Names and Number
When you buy a domain name, you're buying it from ICANN.
After you purchase a domain name, you have to set its A record to point to your IP address of your server that's in the basic DevOps model.
Where you buy your domain name is a matter of fad and popularity and marketing. Namecheap is/was hot.
.com is one of the most expensive top-level domains
Have to register your website every year and tell it who you are because on ICANN's whois page, we can find out who owns a website - they're legally required to give that information.
Where you get HTTPS certificates is also a matter of fad and popularity SSL - secure sockets layer. HTTPS, TLS, and SSL are similar things.
Man in the middle means someone in the middle between the data that the server's sending to the customer gets the data, takes off the HTTPS certificate that came with it, puts its own on, and can change the data and do whatever it wants with it.
When you use a central cert authority, not theoretically possible to take the HTTPS wrapper off the data because only the central authority knows how to do that and if anyone else does it, it'll show and it will no longer be valid.
Use for development, can't deploy with it.
Can't use for development because your server that you want to host that's validated with Verisgn is the only one that Verisign will validate and if you try to do it locally, it will say you're not actually the server and it won't validate you at all.
Generally all of us are behind a firewall
Run ngrok on your local machine and tell you where your web server is located based on its port
Ngrok runs, opens a connection with your local web server and then creates a tunnel to their web server located at ngrok.com
Ngrok opens websocket connection over HTTPS with their server and whenever their server gets traffic with a specific domain name, it's going to forward the traffic through the ngrok tunnel down to your server which will respond to your ngrok application and will send the traffic back up the tunnel
Can run a web server on your local machine and can share whatever you want.
Free tier