Virtual web servers
It's got to the stage where I am running quite a lot of websites for myself and other people. Matters came to a head when I wanted to create a Riverside Church website which ran in a subfolder of the main St John's website, and the web hosting company couldn't configure it for me because they are just buying a reseller package from Fasthosts.
Also, Fasthosts had a really horrible outage in December 2014 where the servers were offline for nearly a week, and they didn't seem to care all that much.
So I began looking for alternatives... at church we have now got fibre internet which has an upload speed of 10MBps (actually it measures at 18 at the moment) so I thought of hosting the sites on a machine stuck in a cupboard at church. But... this is KC we are talking about here, the internet is bound to stop working unpredictably. Plus there is a power problem at church where the local substation shuts down when it rains hard.
Another idea which came to me was to rent my own web server, but this is quite expensive for anything decent at about £50 per month.
Then I found out about virtual servers. This is basically a slice of a bigger machine, but you have complete control over it. It's based in a datacentre so no internet or power problems. After some scanning around I settled on Bytemark who are based in York and offer a basic virtual server for £10 per month, with a month free to play about to start with. You can make it bigger or faster any time you want.
So... first thing is to configure a virtual server and install Windows Web Server 2008 on it (the sites all use ASP quite heavily, so I am stuck with Windows). BigV make this very easy with a preloaded image of W2008 which is up and running in about 4 minutes.
This helpful blog post
gives some hints on setting up the server as a web server. By this point we have a basic website up and running. Next we need to add FTP-ability. To do this you go to the IIS manager (in Administrative tools), select Default Web Site and click Add FTP Publishing in the right hand pane.
But this doesn't work, because Microsoft helpfully block FTP in the Windows Firewall.
First you need to go to FTP Firewall Support in the IIS manager and add in the external IP of the site.
Then this page
tells you how to set up the main Windows firewall. See Step 3, there is some exciting command line stuff to do.
You then need to restart the server (the guide doesn't tell you this) to get FTP fully working.
http://blog.pluralsight.com/windows-server-2008-ftp-user-authentication tells you how to set up usernames for FTP
Still permission problems though... can read by FTP but can't write. Need to give Write permissions fo the wwwroot folder for "Users" (not sure if this is the most secure thing to do...)
...IIS FTP is a bit rubbish for multiple websites. You have to set up IIS users and muck around a lot to get logged in. So I've installed Filezilla FTP server instead. This is very simple and works very well, you define users in Filezilla and for each user you just set their root folder.
...To get the JET database provider working, you have to enable 32 bit apps in the Application pool advanced settings. One to remember. You have to do this for every site, or do it at the top of the tree to get all "child sites" working.
Dimac Jmail is now installed and working, which allows webpages to send emails out (contact forms or newsletters). It's a bit different to the version on the existing webserver though, so the pages need rewriting slightly to use the ,message object.
hmailserver is installed for pop3 boxes. This was fairly simple to get working.
Then I installed Roundcube to give webmail access to the pop3 boxes. This was fun and games and required me to install MySql (which needed .NET4) and php, which took some time to get going. But it all needed doing anyway if the webserver is to run Wordpress, which is another goal.
Expanding disk space
All this used up more disk space and there isn't going to be room for the SJN website's 10GB now, so I added another 20GB disk space to the server using the BigV control panel. Then I needed to shut down the server, and start it up again watching for the Ctrl-N prompt in the VNC window. Then you run GParted to expand the partition to use the new disk space. Then reboot back to Windows - Windows will run Diskchk to sort out the new space. (The Bytemark help suggests you should be able to do this directly using Windows Disk Management but I could not get it to see the extra space - maybe try a complete shut down and start up next time as I did not try this)
In July15 I moved the Identity Course site to the server and found that mp4 videos would not play. This required setting the mimetype for .mp4 to video/mpeg. And I ran out of space again and needed another 20GB - had some problems using Gparted to allocate the new disk space - you need to restart the server using the Restart button on the BigV control panel rather than just restarting the server software in the VNC window, otherwise the new space does not appear.
To do still:
Show the correct logo on Roundcube webmail skin depending on the login.
Set up logging for sites
Bytemark will provide 50GB of backup disk (not SSD) for £2 so off we go... very simple to add the extra disk, but then I cannot get it to show up in Windows. The answer of course (thanks to Bytemark support for spotting my error here) is that you need to go into the Disk Management window (what Fdisk has turned into) and allocate a partition to the new space. Then it magically appears. So I have set up WIndows Server Backup (basic built in thing) to copy the state to the backup disk every night.
I would also like to keep a local copy of the backup from time to time, the backup utility produces a VHD (virtual hard disk) which is not visible normally in Windows, but you can mount it using Disk Management. So I am hoping that I will be able to mount this as a disk then FTP it down to my local disk.