Setting up a web-server at home

Setting up a web server at home is a great way to fully understand how the internet works. How traffic communicates from the users’ browser down to the host where the website is located. Learn her how to set up your very own server.

Over the last 10 years, I’ve set-up countless web-servers for clients and friends. I’ve always used hosting companies but now decided to venture into self-hosting.

Primary because:

  • Get a real-world understanding of DNS / network management / Domain management
  • Get a real world  better understand web config files on Linux environment
  • Familiarize me with website backup solutions i.e. fail-over and data – recovery

Disclaimer to clients: Only my private project websites i.e. longato.co.uk, myswissholiday.com and tigga.org will be migrated to this server, so rest assured that your sites are under safe hands :)

Server Hardware

I wanted to find a solution that was somewhat powerful yet had a low power consumption, could be set-up in room temperature and was silent.

Therefore I decided to go with an Intel Nuc, it’s a great piece of hardware, very well built and has m.2 storage capabilities.

Detailed Web-server specs:

  • Intel NUC CANYON NUC5i5RYH (USB 3.0, Intel Core i5-5250U)
  • Kingston HyperX Impact (2x, 8GB, DDR3L-1600 (PC3-12800), SODIMM 204)
  • Samsung SM951 NVMe, bulk (256GB, M.2 2280)
  • 256 SSD Backup 2.5 Hard-drive
  • 2x 2TB hard-drives on the Mirrored RAID in a RAIDON GR3660-B3 case

I get around One thousand visits/day on my private sites so the configuration above is somewhat “overkill”, therefore I will also use the NUC as a Home media server running PLEX and no longer rely on another server I’ve got at home.

Here is what I will have as services on the NUC:

  • Proxy PPTP Server (Ubuntu)
  • PLEX Media Server (Windows)
  • VPN Server (Ubuntu)
  • Backup File Server (Windows)
  • Website crawler running daily SEO tests (Ubuntu and Windows)
  • Database server for crawling data (Ubuntu)
  • PIWIK Web Analytics (Ubuntu)
  • Remote Desktop Client for Windows 10 (Windows)

Setting everything up

Installing Windows 10 on an Intel Nuc

Setting up an Ubuntu 14.04 in Windows 10 with Hyper-V Virtual Machine

  • Download Ubuntu Server 14.04, DO NOT use the home edition as Santora will not install on that version
  • Enable Hyper-V Setting in BIOS CPU settings
  • Install Hyper V by going to “Programs and Features”, on the side panel you will see “Turn Windows features on or off”, click on that and tick the box where it mentions Hyper V
    • I would highly recommend using a physical hard-drive to install the virtual machine, the reason being that I’ve had issues in the past where the main server crashed and corrupted the virtual machine virtual hard-drive. You can do this by going to the Disk management tool within Windows, right-clicking on the desired hard drive and placing it offline.
      Use physical hard drive for hyper v ubuntu
    • Make sure that the Secure boot is not ticked as this will prevent Ubuntu from loading on boot.
      un select secure boot
    • Create a virtual network adapter so that the NUC can access the internet and have its own internal IP address
  • Once all that is done you are ready to run the Hyper-V new Virtual machine set-up
    • Reboot your system and run the Hyper-V Program, on the sidebar click on the New / Virtual machine

Installing and configuring a web-server on Linux Ubuntu 14.04

Before you install your Linux instance, take some time to familiarise yourself with what web panel you would like, this makes things easier as each one requires a certain configuration/version of Linux. Also, decide if you want to spend a few hundred bucks on a paid version with cPanel / Plesk or an open source version like http://webmin.com/index.html.

Configuring routers to forward traffic (port-forwarding)

In order for other external traffic to get to your server, you need to configure your internet router to forward all traffic that comes from TCP port 80 (for non-SSL) and 443 (for SSL) traffic. To do this you need to login to your router using a web browser. Most internet routers have the address 10.0.0.1 or 10.1.1.1 or 192.168.1.1 or 192.168.0.1. To find the exact ip address you can look at your network config. If you are using windows then simply open the Command Prompt (Windows + R and then write CMD), and type in “ipconfig”. This should give you something similar to the below. In the ipconfig, the “Default Gateway” is what you are looking for. It’s called a “gateway” because it is the main access to the internet which your computer has.

 

From there you enter this value to the browser address i.e. “http://10.1.1.0” and this should lead you to the login page. Most routers (if you have not already done so) have a default simple password like ADMIN,admin,password,user. If you don’t know your’s then do a simple google search for “default password {routerBrand}”. PS It is highly recommended that you always change the password of your router. You can read more about default passwords on the life wire article.

Once you are logged in then try to find a page which shows “port-forwarding” from there you will add the IP address of the web server you set up together with the ports you want. Again, read more about this here.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.