<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Simian Enterprises &#187; Server</title>
	<atom:link href="https://www.simianenterprises.co.uk/blog/tag/server/feed" rel="self" type="application/rss+xml" />
	<link>https://www.simianenterprises.co.uk/blog</link>
	<description>Web development, Coldfusion, CSS, a bit of this, a bit of that...</description>
	<lastBuildDate>Sat, 26 Apr 2014 00:42:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.7</generator>
	<item>
		<title>Tutorial: Setting up a production Windows 2008 server with IIS7 &amp; Railo</title>
		<link>https://www.simianenterprises.co.uk/blog/setting-up-a-production-windows-2008-server-with-railo-96.html</link>
		<comments>https://www.simianenterprises.co.uk/blog/setting-up-a-production-windows-2008-server-with-railo-96.html#comments</comments>
		<pubDate>Tue, 29 Jun 2010 11:14:39 +0000</pubDate>
		<dc:creator><![CDATA[Gary]]></dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Railo]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.simianenterprises.co.uk/blog/?p=96</guid>
		<description><![CDATA[A complete beginner's step by step guide to setting up a production Windows 2008 server, running the awesome Railo on multiple sites.<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/coldfusion-iis7-plesk-401-authentication-errors-66.html" rel="bookmark" title="Coldfusion, IIS7, Plesk and 401 Authentication">Coldfusion, IIS7, Plesk and 401 Authentication </a> <small>Installing CF8 on a Windows 2008 server running Plesk, seems...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Prologue:</h2>
<p><em><strong>In which Gary explains his new found appreciation for anyone who calls themselves a sysadmin.</strong></em></p>
<p>I’m not a sysadmin. I like to make websites. It’s what I do, what I’ve always done.<br />
Dealing with servers is the un-planned love child of my long term affair with website development. A horrid child that demands constant attention and gives nothing back in return.</p>
<p>In the past, I would point clients in the direction of a decent web host and let them get on with it, but as it turns out these clients would still phone me as the first point of contact when their servers went down, making me a mediator between them and their hosts. Frankly, I figured if I’m spending my time doing this anyway, I may as well get paid into the bargain.</p>
<p>Well, after four years of hosting client’s websites I can quite categorically state that sysadmins have one of the most difficult jobs imaginable. Anything can go wrong, at any time. Running a tight system involves research, dedication, and genuine enjoyment of high level tinkering.</p>
<p>If I’m ever in a position to employ a sysadmin, they will be treated well. I will make them tea. And cake. And give them sympathy.<br />
Recently, after a long and gruelling battle with the most <a title="Unreliable hosting" href="http://www.cwcs.co.uk">unreliable hosting company</a> I&#8217;ve ever used, I finally took the plunge and set up my own Windows VPS using IIS7 &amp; <a title="Open Source CFML Engine" href="http://www.getrailo.org/">Railo</a>.<span id="more-96"></span></p>
<h2>The decision making process:</h2>
<p><strong><em>In which Gary explains and attempts to defend, his reasoning.</em></strong></p>
<p><em>&#8220;Why use IIS?!&#8221;</em> I hear you scream at your monitors, which proves that I do in fact possess super-human hearing abilities&#8230; Well, as I’ve taken great pains to explain, I am not a sysadmin. Years ago I ran a linux server that was hacked to pieces because I didn’t know enough about securing said system.</p>
<p>Windows and IIS, for all its faults &#8211; and there are a great many – is a GUI based system. What this means in the real world is that there’s an icon for everything. So, as a non sysadmin trying to setup and run a server, having an icon for every conceivable thing I’d want to do, serves to actually <em>indicate</em> what I might want to do in a way that a collection of config files simply doesn’t.</p>
<p>Also, having used it for a while now, I have to say that IIS7 isn’t half bad. It’s a damn sight better than IIS5 and IIS6, both of which I’ve had the dubious pleasure of using during the course of my career. Also, Server 2008 is a lot nicer than previous incarnations. Sitting here typing this post in Word 2007, on Windows 7, talking about Server 2008, I have to say that Microsoft seem to be taking an interest in user experience. They’re a long way off Apple, but they’re finally doing something half decent. Well done them.</p>
<p><em>&#8220;So why Railo?&#8221;</em><br />
Well, initially this was an issue of cost. Frankly I can’t afford to shell out for an enterprise CF licence. I’m not a big company, I’m one man making awesome websites for very small companies. So I thought I’d give open source a go, and see how it compares.</p>
<p>I have to say I tried Railo about a year ago and found that it was lacking in too many places to be a viable solution. There were a few tags missing, a few things it just seemed to handle differently, and given that my sites generally like to nudge a few boundaries, it just wasn’t up to the task.</p>
<p>Well, all that has changed. Railo this time around was an absolute pleasure. A steeper learning curve to set up compared to Adobe ColdFusion, granted, but what you’re rewarded with is a blisteringly fast ColdFusion experience, a much higher level of control over your environment, entry into a knowledgeable and welcoming community and a general feeling of wellbeing that can only be gained from <em>not</em> giving Adobe three grand of your hard earned cash.</p>
<h2>Hacking my server 101:</h2>
<p><strong><em>In which Gary, in an attempt to offer help to others in a similar situation, provides a step by step guide to the setup of his production server, and hopes that malicious people don’t use it to bring the thing crashing to its knees.</em></strong></p>
<h3>In the beginning, there was the welcome screen and the server was without services.</h3>
<p>So, let’s assume that you’ve got yourself a nice sparkling new Windows 2008 server/vps set up.<br />
Depending on how your hosting company has set this up, you may need to install various Windows updates, so it’s best you do this before anything else. Go to Windows update. Go directly to Windows update. Do not pass go, do not collect $200.<br />
Usually I’d advocate installing Anti-Virus software next, but bitter experience tells me it’s best to install that at the end, after installing the various components we’ll need to get the server working.</p>
<h3>And the sysadmin said, “Let there be services, and let the server use them to serve pages to the masses”.</h3>
<h4><strong>Roles:</strong></h4>
<p>Firstly you&#8217;ll need to install IIS and various roles. I’m not any kind of an expert on this, so I won’t suggest which roles are right for you. Best practice as I understand it, is to only install what you need for the task at hand, thus minimising the chance of attack.</p>
<p>I’m using Windows 2008 Web Edition, which comes with literally nothing but IIS. If you’ve got a better version of 2008, you may want to install the DNS role, email, any number of others. Go wild, have fun.</p>
<p>One way or another you’ll need to install all the IIS6 roles, as well as the IIS management role.</p>
<h4><strong>Email:</strong></h4>
<p>I’m using <a title="Mail Enable" href="http://mailenable.com/default.asp">MailEnable</a>, basically because it’s free and does the job. When I spoke to my new hosting company about this, they strongly suggested trying ‘<a title="SmarterMail" href="http://www.smartertools.com/smartermail/mail-server-software.aspx">SmarterMail</a>’ as a better alternative. Give them a look and make a decision.<br />
Guides to install MailEnable are here:<br />
<a title="Mail Enable Installation Guide" href="http://www.mailenable.com/support/MailEnable_Installation_Guide.pdf">http://www.mailenable.com/support/MailEnable_Installation_Guide.pdf</a><br />
<a title="Mail Enable Quick Start Guide" href="http://www.mailenable.com/support/MailEnable_Quick_Start_Guide.pdf">http://www.mailenable.com/support/MailEnable_Quick_Start_Guide.pdf</a></p>
<p>You’ll need to open ports on your firewall to enable&#8230; umm&#8230; MailEnable&#8230; so don’t forget. This includes Windows Firewall as well as any hardware firewall you may have set up.<br />
<strong>Incoming: 110 &amp; 25</strong><br />
<strong>Outgoing: 25</strong></p>
<h4><strong>DNS:</strong></h4>
<p>If you want to use your server as a nameserver, (and frankly, if you need to read this tutorial to set up a production server, you’re unlikely to be the kind of person who’ll have a separate DNS server, so I’m talking to you!) you’ll need some kind of DNS service.</p>
<p>I’m using the cut down cheap-ass ‘Web Server Edition’ of 2008 server for which Microsoft have deemed fit to not include DNS services. So, like most of the planet, I’m using Bind.<br />
It’s fiddly to get your head around if you’re unfamiliar with the concepts of DNS, but once you get the hang of what’s happening it’s all very straight forward.<br />
Take a look at this tutorial: <a title="BIND for Windows tutorial" href="http://alex.charrett.com/bind-on-windows-mainmenu-3">http://alex.charrett.com/bind-on-windows-mainmenu-3</a></p>
<p>You’ll also need to register your domain with the nameserver authority – or more accurately you’ll need to get your domain registrar to do this. A lot of registrars have an automated section in their control panels where you can do this. Others you’ll have to email. But basically, you need to have a domain name pointing to your IP address on the main database of nameservers. This usually takes about 24 hours.</p>
<p>You’ll also need to open your firewall up for BIND services:<br />
<strong>Port 53, inbound and outbound, both TCP and UDP</strong></p>
<h4><strong>FTP:</strong></h4>
<p>Initially, I thought it best to use the IIS built in FTP 7.5&#8230; However, after much messing about I decided it wasn’t up to the task.<br />
If, like me, you like to have a ‘private’ folder outside the webroot to keep cfcs and the like, I’d recommend ditching it for FileZilla server.<br />
I’ve left instructions for FTP 7.5 here for posterity.</p>
<p><strong>FTP 7.5</strong><br />
Windows server 2008 has a new FTP module, FTP 7.5. It’s supposedly better for a million reasons, but what I like about it is you no longer have to create windows users to authenticate an FTP session. I’ve never much liked windows user permissions, gimme a username and a password and I’m happy.</p>
<p>It does take a bit of messing about to get the new user system working though. A very handy tutorial exists here:<br />
<a title="FTP with IIS7 Manager Authentication" href="http://learn.iis.net/page.aspx/321/configure-ftp-with-iis-7-manager-authentication"> http://learn.iis.net/page.aspx/321/configure-ftp-with-iis-7-manager-authentication</a></p>
<p><strong>FileZilla</strong><br />
The FileZilla server is a much nicer solution in my opinion, it works much as I’d expect an FTP server to work, and doesn’t require as much messing about with IIS users and the like.<br />
There’s not much in the way of tutorials out there, but it’s so simple to set up I’d be surprised if you need one. Nevertheless, here’s a link to one for good measure:<a title="Filezilla server on Windows" href="http://www.raymond.cc/blog/archives/2007/10/19/how-to-setup-ftp-server-on-windows/"><br />
http://www.raymond.cc/blog/archives/2007/10/19/how-to-setup-ftp-server-on-windows/</a></p>
<p>Once you’ve set that up, you’ll want to set up the firewall for FTP.<br />
That means <strong>opening up port 21</strong>, as well as enabling PASV mode with the following command:<br />
<strong>netsh advfirewall set global StatefulFtp enable.</strong></p>
<h4><strong>PHP:</strong></h4>
<p>Yeah, even though we’re coding awesomeness in CFML, there’s always going to be some client who wants to use PHP for something or other. Usually it’ll be a WordPress installation, which, I’m sorry, is just a better blogging platform than the CF offerings. There, I said it. I feel better.</p>
<p>This tutorial should guide you through the pain:<br />
<a title="Install php on IIS7 FastCGI" href="http://www.trainsignaltraining.com/iis-7-install-fastcgi-php/2008-09-04"> http://www.trainsignaltraining.com/iis-7-install-fastcgi-php/2008-09-04</a></p>
<h4><strong>IIS modules:</strong></h4>
<p>Personally, I found that I needed the IIS7 Administration Pack. I can’t for the life of me remember why, but I’d suggest you just install it and stop asking questions. ‘k? ‘k.<br />
<a title="IIS7 Administration Pack" href="http://www.iis.net/download/AdministrationPack">http://www.iis.net/download/AdministrationPack</a></p>
<p>The URL Rewrite module is a bit more obvious – you <em>want</em> this. It allows us IIS users to do what Apache bods have been doing happily &#8211; and somewhat smugly I’ll add – for years&#8230; Rewrite URLs using RegEx. Again, if you’re slapping WordPress on any of your domains, you’ll need this for friendly URLs.<br />
<a title="Using IIS URL Rewrite" href="http://learn.iis.net/page.aspx/460/using-url-rewrite-module">http://learn.iis.net/page.aspx/460/using-url-rewrite-module</a><br />
<a title="Download IIS URL Rewrite Module" href="http://www.iis.net/download/URLRewrite">http://www.iis.net/download/URLRewrite</a></p>
<h4><strong>Perl:</strong></h4>
<p>Well sure, no-one uses Perl anymore, but it comes in handy having it on your server. Especially if you intend to install a stats package like <a title="AWStats" href="http://awstats.sourceforge.net/">AWStats</a>. As it happens, AWStats is such a bitch to get working correctly that I wouldn’t bother, but still&#8230; Perl = good.<br />
<a title="Activestate Perl" href="http://www.activestate.com/activeperl/downloads/">http://www.activestate.com/activeperl/downloads/</a><br />
There are a few different things you may have to do to get this running on IIS7, including enabling a 32-bit application pool if your server is 64bit. Check out the instructions here:<br />
<a title="Running Perl on IIS7" href="http://blogs.iis.net/wadeh/archive/2009/04/13/running-perl-on-iis-7.aspx">http://blogs.iis.net/wadeh/archive/2009/04/13/running-perl-on-iis-7.aspx</a></p>
<h4><strong>AWStats:</strong></h4>
<p>Initially I had detailed instructions on installing AWStats here, but basically&#8230; just don’t bother. Get all your clients’ sites on Google Analytics. It’s a better package anyway. Honestly, you’ll thank me for that advice.</p>
<h4><strong>MySQL:</strong></h4>
<p>MySQL is fairly straightforward to install, but if you need a hand explaining the various options, there’s a tutorial here:<br />
<a title="Installing MySQL on IIS7" href="http://www.trainsignaltraining.com/install-mysql-on-iis7/2008-09-10/">http://www.trainsignaltraining.com/install-mysql-on-iis7/2008-09-10/</a></p>
<h4><strong>phpMyAdmin:</strong></h4>
<p>If you need it, now would be the time to install <a title="phpMyAdmin" href="http://www.phpmyadmin.net/">phpMyAdmin</a>.<br />
<a title="phpMyAdmin on IIS7" href="http://www.trainsignaltraining.com/install-phpmyadmin-on-iis7-and-server-2008/2008-09-16/">http://www.trainsignaltraining.com/install-phpmyadmin-on-iis7-and-server-2008/2008-09-16/</a></p>
<p>One thing this tutorial isn’t clear on, is setting up the linked-tables feature. Several comments note the error, but none show how to fix it. You need to create a database specifically for these features. Instructions here:<a title="phpMyAdmin Linked Tables" href="http://www.phpmyadmin.net/documentation/#linked-tables"><br />
http://www.phpmyadmin.net/documentation/#linked-tables</a></p>
<h3>And the sysadmin looked at the server, and saw that it was good. And the sysadmin said “Let CFML pages be served, that web developers may rapidly develop and deploy applications”.</h3>
<p>Installing <a title="Railo" href="http://www.getrailo.org/">Railo</a> on <a title="Tomcat" href="http://tomcat.apache.org/">Tomcat</a> on IIS7 with multiple sites&#8230; I could write out step by step instructions, but why re-invent the wheel? I followed an excellent tutorial by <a title="Doug Boude" href="http://www.dougboude.com">Doug Boude</a>, and you should too:<br />
<a title="Setting up Railo on IIS7" href="http://www.dougboude.com/blog/1/2009/09/Railo-31-on-Windows-Server-2008-and-IIS7--Part-2-of-3.cfm">http://www.dougboude.com/blog/1/2009/09/Railo-31-on-Windows-Server-2008-and-IIS7&#8211;Part-2-of-3.cfm</a></p>
<p>At some point, this guide will ask you to download a DLL file to connect Tomcat to Railo – the URL in the guide is out of date, but I found the DLL here: <a title="Tomcat Jakarta Binaries" href="http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/">http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/</a></p>
<p>It’s also worth noting that the guide expects you to be using version 1.2.28 of the ISAPI Redirect URL, however there is a newer version, 1.2.30 available. Do NOT use this version! It took me a while to figure out, but 1.2.30 makes everything run incredibly slowly. Don’t ask me why! I moved back down to 1.2.28 and everything worked fine.</p>
<p>One thing that this guide doesn’t mention, is how to handle default documents. You can see in the comments, a suggestion that adding ‘/*=wlb’ to the worker properties file will push all files through to Tomcat, which will indeed handle default documents. However, this will also put all static files, images, js and the like, through to Tomcat. Not only is this overkill (although I didn’t notice a performance hit), but also in my experience Tomcat has difficulty returning static files 100% of the time. I noticed certain images and JS returned as 404 errors, even though they existed.<br />
Cue a helpful bit of info supplied by the Google Railo group.<br />
<a title="Setting up default documents on IIS7 with Railo" href="http://groups.google.com/group/railo/browse_thread/thread/8706a5a4b025f393">http://groups.google.com/group/railo/browse_thread/thread/8706a5a4b025f393</a><br />
This will allow you to set up default documents the *correct* way, leaving your static files to be handled by IIS as they should be. Don’t skip this step, it’s important!</p>
<h3>And the server was able to serve CFML and the sysadmin saw that it was good. And the sysadmin said “Let there be protection, that viri may not penetrate the goodness of the server”</h3>
<p>Finally, you can install Anti Virus. I’m using McAfee, since I happen to have a copy I&#8217;m not using.<br />
Be careful to edit your preferences to ensure that not all files are being scanned – otherwise it’ll kill the server very quickly. Choose to scan files on writing to disk, and only the ‘default files plus additional’ option.<br />
You’ll also want to stop McAfee from blocking any emails sent by the server. In the access protection settings, under the rule for blocking mass email worms, add ‘Tomcat6.exe’ to the list of excluded services.</p>
<h3>And the sysadmin saw that McAfee was using way too many system resources on boot, but that it settled down after a few minutes, and the sysadmin saw that it was good enough. And the sysadmin said “Let’s make sure I don’t have to do this shit again!”.</h3>
<p>A backup system is a good idea. If you’re smart, you’re using online version control and so losing the files and files of code you’ve carefully crafted, simply isn’t an issue. If not, check out <a title="Kiln Version Control" href="http://www.fogcreek.com/kiln/">Kiln</a> or <a title="Git Hub" href="http://github.com/">Git</a>. I use Kiln and it&#8217;s an absolute pleasure. Don’t use SVN, because it’ll cause no end of hassle in the long run&#8230; and who needs a VCS subfolder in every single folder in their app anyway?</p>
<p>For MySQL, I’m using a batch script that exports every database, once a day. I built on top of the script in this guide: <a title="MySQL backup script for Windows" href="http://www.iis-aid.com/articles/how_to_guides/backing_mysql_automatically_using_batch_file">http://www.iis-aid.com/articles/how_to_guides/backing_mysql_automatically_using_batch_file</a><br />
My version only holds one backup of each database on the server per day, but FTPs them down to my dev server which holds multiple copies. Have a look here: <a title="MySQL Backup Script" href="http://www.simianenterprises.co.uk/blog/wp-content/uploads/2010/06/mysqlBackup.txt">MySQL Backup Script</a></p>
<h3>And the sysadmin looked at the server and saw that it was good. That it served CFML pages extrodinarily fast, and the sysadmin was pleased. The sysadmin rested. And was rewarded with cake.</h3>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/coldfusion-iis7-plesk-401-authentication-errors-66.html" rel="bookmark" title="Coldfusion, IIS7, Plesk and 401 Authentication">Coldfusion, IIS7, Plesk and 401 Authentication </a> <small>Installing CF8 on a Windows 2008 server running Plesk, seems...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.simianenterprises.co.uk/blog/setting-up-a-production-windows-2008-server-with-railo-96.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
