Hosting your own web site
Can't find the right host for your web site? Do it yourself!
Whilst there is no denying web site hosting is very cheap these days, typically around £5 per month for most people's needs, sometimes it's useful to have full control over your web site.
What if you need more space for all those family photos? PHP? SQL Server? a shopping basket system? ASP.NET? You'll have to spend a lot of time hunting around to find any hosting firm that provides just the facilities you need at any sensible sort of price.
You can solve all these problems by hosting your site at home on your own PC. Let's look at what is needed.
- Your PC needs to be on and available 24/7
- Your PC needs a web server
- Your PC needs to be fully secured against attack
- You need to be able to find your PC by entering a web address
- You need an ISP who is happy for you to run a web server at home
If you're going to be hosting your web site on your PC at home, it will need to be available 24 hours a day, 7 days a week, which means switched on and ready. You could use your normal PC or you may want to use a second PC for this job. It doesn't need to be anything special so an old PC with a Pentium II 200 and 128Mb RAM could be pressed in to action. You may also want to consider buying a UPS (Uninterruptible Power Supply). These sit between the mains and your PC and contain enough battery storage to keep your PC going through any short power cuts.
A Web Server
There are a few options here. Some versions of Windows such as XP Professional have a built in web server called IIS. You can also use Apache which is available for both Windows and Linux. If you intend using Active Server Pages (ASP) you're better off using Microsoft's IIS Internet Server. If not, Apache would be a good (and free) option. See www.apache.org for details.
Safe and Secure
This is one area you can't afford to skimp on. If your PC is going to be online all the time, especially if it hosts a web site, it will soon start to attract the attention of hackers. You should start by installing a firewall and anti-virus program. We like AVG and Zonelabs' free offerings which are available from www.grisoft.com and www.zonelabs.com respectively. Assuming you are on a Microsoft based platform, your next step is to download the Microsoft Baseline Security Analyser from www.microsoft.com/technet/security/tools/mbsahome.mspx This program analyses your PC for any security holes and advises you on what to do to harden your machine up. This may include downloading and running other tools and utilities that modify the way your web server works.
Good security isn't just a matter of setting things up properly. You should also pay attention to the logs generated by your web server as well as the firewall and Window's own logs via the event viewer applet (eventvwr.exe). Anything suspicious will need acting on immediately.
Finding your PC Online
Most ISPs, whether cable or ADSL based, provide a dynamic IP address. This means every time you reboot, you may be given a new IP address. This is a problem as the web assumes that if someone types 'www.practicalpc.co.uk' in to a web browser, it will always map to the same IP address otherwise the browser will never be able to find your web site.
You may be lucky and have a fixed IP in which case all is well. If not, you'll need to register with someone like DynDNS (www.dyndns.org) who provide a service that fixes this problem. DynDNS gives you a web site address such as 'mysite.dyndns.org'. They also provide a list of programs you can download which monitor your PCs real IP address and if it changes, automatically update DynDNS with the new one. You can also update DynDNS manually via their web interface.
All well and good but what if you want a 'proper' web address? No problem. You can register a web address as per usual via firms such as www.123-reg.co.uk. Part of this involves setting up the location for web requests to be forwarded to. Simply enter the one you have created using DynDNS. What happens is that a user enters a web address such as www.mymadwebsite.co.uk which is then forwarded to mymadwebsite.dyndns.org and then forward it to your PC at home. To the user, all this is quick and transparent. Should you need to reboot, DynDNS will know your new IP address immediately and everything will start working again.
If your PC is behind a router, as are many these days, you'll need to configure your router to forward any incoming HTTP requests to the PC hosting the web site. If you have say 2 or 3 PCs at home, the router will then send the web page requests to the right one which will respond accordingly.
This may be the showstopper. Not all ISPs like you running a web server at home. Many do allow it if you're sensible - Blueyonder are more than happy as long as you limit it to 10 concurrent connections at once which should be fine unless you have a busy site. They do frown on business sites being hosted this way though. Others may be less keen so it's best to check your ISP's Acceptable Use Policy first.
Whilst this has been more of an overview than an in-depth how-to, you should at least have a feel for the issues involved and where to go to get more information. Once up and running you'll find it liberating to have almost unlimited space and technologies available to you to work with as a web site developer.