Table of Contents
concepts
what is http? what is an IP? what are ports?
- IP address: this is a number that identifies a specific device on the network. ISPS only see the router on the internet. The router manages a local network where each device has a local IP address to identify it.
- public IP address: this is the IP address used by the ISP to identify a home network. Generally the ISP sets these to be dynamic to avoid hackers or hobbyists exploiting them for nefarious or mundane purposes.
- private IP address: these addresses are only for the local network
- DHCP: dynamic host configuration protocol. This is when an IP address is assigned randomly each time a computer joins the network
- sticky DHCP: refers to DHCP configurations that use heuristics to try to maximize the chances of the same device getting the same address every time it joins the network.
- static IP address: this is an address assigned to a specific device that does not change.
- NAT: network address translation, this is a layer of indirectness between the local network and another network (usually the internet) that allows traffic to flow correctly from one network to the other. This is what a router provides. It has an IP address on the internet, and translates packets addressed to it to local ip addresses in order to send them to the correct computer.
- Firewall: this is a filter layer between the local network and the internet (or other network) that uses various rules and heuristics to identify packets that should not be passed on to the local network.
- 127.0.0.0: the 127 block of IP addresses is the "loop back" block. These addresses identify resources that live on the same machine as the one accessing them.
- 192.168.0.0: this is the most commonly used private block of IP addresses. These are addresses not connected to the internet but accessible locally.
- reverse DNS lookup: Normally a DNS lookup involves finding the IP address of the server associated with a certain domain name. A reverse lookup involves looking up what domain is associated with a certain IP.
- MAC address: Media Access Control address. It's a unique identifier for each machine that is set during manufacture that includes a number identifying the manufacturer. These are used for addressing data packets from your router to your computer and vice versa.
- port: once a packet makes it to a specific computer its data needs to get to the right application. Each port is an address for the computer's software, many ports have specific application, for example 80 is reserved for http.
- port forwarding: this lets us instruct our router to send all incoming traffic bound to a specific port directly to another computer.
security
Remove all default user accounts and passwords. Make sure that all file permissions are set as restrictively as possible. Don't expose to the public internet unless you need to. When you register a domain name you are required to provide contact information. This information is usually available for WHOIS lookup but many registrars provide a privacy protection option you can pay for. As for port forwarding, there's no special concern about port forwarding, the only concern is if the software listening to the forwarded port is itself able to grant someone controlling access to itself.
hosting
self hosting on the internet
To host online we need to set up port forwarding on our home router to redirect to our server, allowing requests to our router from the internet to reach our server. The server handles everything else.
hosting with an external service
each service is unique but if its a server with a specific purpose (like how neocities only hosts static sites) then it will probably have a unique interface it will explain to you. If its a more general purpose server, the common approach is to ssh into it and port in a docker image for your service.
docker
docker is a way of containerizing your application with its own virtual environment and dependencies making it more portable. It makes use of docker image files to describe that containerized virtual environment. Docker hub is an open repository of docker images that users can push to and pull from in order to transfer image between computers. Docker engine is the server software that runs all these virtual environments for you.