In reality you probably don’t want to host you websites on your local computer unless you have a very good computer, a very good internet connection and you are an expert system administrator, but this is very useful to learn how the internet works.
In this case I am doing this because I want to be able to develop on my computer no matter where I am. So I want to be able to SSH to my machine, modify my files and view my changes from a web browser. Here are the things that need to be done:
- Setup a local HTTP server
- Allow inbound traffic on port 80
- Setup a free DNS service
- Setup an SSH server
- Forward requests to port 22 on your router to your computer