How to Build a
Home or Office Web Server
By Stuart Gregory
Learn how to....
- Configure your home network
- Assign static IP addresses
- Select & build hardware
- Build a virtual private server (VPS)
- Build a dedicated server
- Install CentOS from DVD Rom
- Create bootable USB pen drives
- Install CentOS from USB pen drives
- Use open source software
- Install & configure software
- Install & configure cPanel
- Configure & Install server security
- Assign domain names to your server
- And much more
How to build a home or office web server
ISBN: 978-1-291-90720-9
Copyright Stuart Gregory 2013
The right of Stuart Gregory to be identified as the author of this
works has been asserted in accordance with sections 77 and 78
of the Copyright Designs and Patents Act 1998.
Condition of sale
This book is sold subject to the condition that it shall not,
by way of trade or otherwise, be lent, re-sold, hired out or
otherwise circulated in any form of binding or cover other
than that in which it is published and without a similar
condition including this condition being imposed
Acknowledgements
With thanks to my loving wife and daughter for all the help and support enabling to write this book.
Table of Contents
Chapter One
In this chapter you will learn about static or dynamic IP addresses for web servers, choosing your internet service provider (ISP) and configuring your home network to run a home or web server. |
Static or Dynamic IP addresses
In order to run a web server no matter if this is from home or a datacenter the World Wide Web needs to know where that web server is. This is done with an IP address. An IP address is like the phone number of where your server can be found.
Dynamic IP address change each time your router is turned off and on again. If your were to run a web server on a dynamic IP address then each time your router was turned off and back on you would have to configure your server, name servers and domain name to the new IP address. This would then result in new DNS propagation being needed and your web site and server could be offline for up to 24 hours while new DNS propagation takes place.
There are a few services on the market that lets you use dynamic DNS management to point your domain name to your home dynamic IP address; a small monthly fee is normally required. With these each time your routers IP is changed it will update and start the processes to point your domain name to your new dynamic IP. These services still result in some down time but most of the configuration is produced automatically.
If you wish to install cPanel, which is a server interface that lets you add and manage domain names on your server, then you will require a static IP address. The cPanel licence is only granted to static IP addresses.
A static IP address means that no matter how long or how often your router is turned off, when it re-boots your IP address will always be the same.
Some internet service providers offer single or multiple IP addresses for a small monthly fee. Most virtual private servers, (VPS) use only a single IP address, whereas most dedicated servers have at least two IP addresses assigned to them.
When hosting a website it is better to use static IP addresses as this means you are not sharing your IP address. Another person or company could have been using the dynamic IP address and sending out lots of email spam causing the IP address to be on a blacklist.
For the small charge and stability I would recommend using static IP addresses. For the examples in this book I have used an internet service provider (ISP) which has assigned 5 static IP addresses to my broadband connection. This will allow me to create 3 virtual private servers each with a single IP address and a dedicated server with two IP addresses assigned to it.
Choosing your Internet Service Provider (ISP)
Choosing your internet service provider is the first part in building a home web server. Careful consideration needs to be implemented before signing up to an internet service provider. Once you have signed up you will be in a 12 or 14 month contract so choosing the right company first time is essential.
For the purpose and examples in this book I have chosen BT Business broadband. They offer fast fibre broadband and static IP addresses. BT Business broadband is happy for you to run a web or gaming server from their equipment and offer some support in configuring their router to allow this.
You dont need to have business premises or be a business to have BT Business broadband installed as these can be installed in your own home. I have changed to have this installed in my home for the purpose of writing this book.
With BT Business broadband they offer a free business hub, I have two of these for this example but only one is required. I have also opted for the 5 static IP addresses.
Configuring your home network
Once you have your broadband active and your static IP addresses assigned to your line you are ready to start configuring your hub ready for your home web servers. Their support only shows how to configure the hub to allow one web server to run with one static IP address assigned to that web server. In the examples we show in this book we are going to run multiple web servers and a dedicated server with multiple static IP addresses assigned to it; for this we will need to configure the hub and network differently to the way they show.
Networking equipment
The networking equipment I am using in these examples are listed below. You may wish to use the same our substitute with your own equipment.
- Two BT Business hubs
- Network port switch
- Multiple cat5 (Ethernet) cables
Only one BT Business hub is required for the servers but as I want to connect my home PC to this broadband line and have it protected by the routers firewall, I have the second hub configured to allow my home computers protected access.
Hub configuration
Configure hub 1
We will configure hub 1 first, this hub will act as a gateway hub for all internet traffic and access to the servers. To access your hub you will need to connect you computer to the hub via a cat5 Ethernet cable. To access the hub open a browser and type 192.168.1.254 in the browser URL address bar.
This will open your new hub for first time settings. As the hub is new it will ask you to enter the admin password and set a new admin password. The factory set password is located on the little pull out tab on the back of the hub.
Once you have set your admin password and gained access to your hub you need to select settings then advanced settings for the menu bar. Next, click continue to advanced settings.
There are only a few simple steps to configure this hub and the first step is to disable the wireless connection. The reason why we are going to disable the wireless connection is because this hub will act as a gateway only so we dont want home computers connecting to this hub directly.
Click on the wireless tab in the menu bar and follow the on screen instructions to disable the wireless connections.
Next is to allow static IP addresses. Select the static IP option on the menu bar. This will open up a new window with four options. Select on for the first option of static IP address, next you will need to enter the router IP address; this would have been sent to you in your welcome letters regarding static IP address. Next we need to select our subnet mask. As I have ordered 5 static IP addresses I select the subnet mask which ends in .248, your subnet mask will also be on the welcome letters regarding static IP addresses, finally under this section we need to make sure that allow incoming ping requests is set to yes. Click apply and your static IP addresses are now activated.
Next page