Web Hosting
Using the power of the shell, you can put files in your public_html
folder and have them be served over the World Wide Web.
what exactly is a website
When you type in a URL and hit enter, your computer (the client) talks to another computer (the server) and asks it if it has that URL. The server could be running special software, or it could just be serving files out of a folder. In our case, we're doing the latter. When you ask the server for yourwebsite/hello.html
, it looks in your public_html
folder for a file called hello.html
. If the server finds the file, it's sent over to the client, otherwise, you get an error 404. You can also put folders inside of folders and serve things out of there.
index.html
While exploring, you might notice a special file called index.html
. When you add a file with this name into a folder, it tells the server that this file can be shown to anyone who asks to see just the folder. Think of it like a home page for that whole folder. For example, if you've got a folder at public_html/hello
and you put a file called index.html
inside, then anyone who goes to yourwebsite/hello
will see the contents of hello/index.html
. Sometimes other special files can serve a similar purpose to this like the special index.php
file used by PHP.