April 17, 2021
If you've followed me on Youtube you will know about my Minecraft server and my Proxmox server. A couple of months ago(since those videos) I reorganized my servers, put them on a cart, and moved them into another room. I've also added more services to my servers. I now run a Nextcloud instance and two websites off of my Minecraft server.
Originally I was going to use some kind of static site generator(like Hugo), but I had some trouble with the theme I wanted to use(it wanted me to use the extended version of Hugo, which I was unable to find). Because of this, I decided to write this whole site by hand. I might regret this decision later if the amount of articles becomes too much to handle.
I was taught quite a bit of HTML by my technology teacher in the seventh grade, and ever since then I have been building my skills. In 2017 my family and I went on a trip out west and I documented the entire thing using HTML. Later on I built a website for my Minecraft server called the "Inferncraft Historical Society"(you can check it out here).
Now, onto how I am hosting both of my websites. As I said earlier, I am hosting them on my Optiplex 745 server, which is currently running Ubuntu 20.04 LTS. I am using Nginx as the web server software, which allows me to easily run two websites off one server and one IP address. I used to use Apache as my web server software when I was only hosting the IHS website. I am also using Certbot to get my certificates(so I have https), and I use NoIp for a free domain.
There are a couple options for hosting. You can either set up a server at home or have a VPS(like Amazon Web Services, Linode, Vultur, etc.). You can set up a home server for cheaper(or even free if you play your cards right). If you have an old computer at home that can be hooked up to the internet(like I did), that will work just fine when you're starting out. If you don't have a computer lying around the house, you can buy a $35 Raspberry Pi.
For this tutorial I am going to assume you have Ubuntu or Debian installed(or Raspberry Pi OS installed for a Raspberry Pi). The instructions for this tutorial should be the exact same for both. To start, you should update your OS. This can be done by putting this in the terminal:
sudo apt update
sudo apt upgrade
Next, you need to install Nginx and Certbot.
sudo apt install nginx certbot python-certbot-nginx
Before we do anything else with Nginx, we need to set up our domain and port forward the ports needed to communicate with the internet. You need to go to noip.com, make an account, and set up a free domain. The IP address it asks for can be found by googling "what is my ip". To port forward, you need to go into your router's settings which can usually be accessed by typing 192.168.1.1
into your browser's address bar. You have to check what the default login details are by either looking on the router's label or googling the model number. You also have to find out what the IP address is for your server which can be found by typing ifconfig
or ip a
into the server's terminal. The ports you need to forward are 80 and 443 and the type should be TCP and UDP.
The default server configuration should be already loaded but you need to start the Nginx service. You can do that by typing the following in the terminal:
sudo systemctl enable nginx
sudo systemctl start nginx
The skeleton of the server is now installed, you should be able to go to your domain and a default Nginx page should come up. There's a few more steps we want to do for a full website. First we want to enable SSL and we can do this simply by typing the following into the terminal:
certbot --nginx
You should be able to follow the prompts and put in the required information. It should ask for your domain, email, and whether or not you want to redirect to HTTPS(you'll want to put yes). Once this is done you should have a certificate that you'll need to renew every 6 months. Renewal can be done by typing certbot --renew
in the terminal.
The server is all configured now and ready for you to put your page in /var/www/html/
. The page you see when you visit the site will need to be named index.html
.