Pages

Thursday, 17 March 2011

What to do with CSS3?

Recently, there has been a lot of activity on the CSS3 front.  W3C have only just released a new set of CSS3 specifications (http://www.css3.info/) that will already change the level of support that the newer generation of browsers can offer.  The change fundamentally means that only updates to these new browsers will enable support for these new specifications.  There aren't any massive changes in there so there aren't any nasty surprises for those learning the new specifications.

These changes are great in terms of moving forward with standardised specifications, but also potentially harmful with the lack of support currently out there. Only a couple of days ago (15th March 2011), Microsoft released their latest and greatest weapon in the browser wars, Internet Explorer 9.   

The release of IE9 is a massive roll of the dice for Microsoft.  Microsoft has seen the market share for Internet Explorer slowly erode over the past few years with the continued efforts of the likes of Firefox, Chrome and Safari, all of which have had CSS3 support for quite some time now though.  By all means, none of these browsers are perfect, and all have their own small problems supporting the CSS3 specifications.  They aren't problems as such, more like, their own interpretations of the specifications.  Personally for me, this is potentially worse than the old 'IE box model' problems that plagued earlier versions of Internet Explorer.  What I really don't want to happen is for me to suddenly have to adopt several standards of the CSS3 specifications.  For example, to have rounded borders for an element, we have to look at the following:
  • border-radius (Real CSS3 / IE9 specification)
  • -moz-border-radius (Firefox specification)
  • -webkit-border-radius (Safari / Chrome specifiction)
So now we have the situation whereby if I want to go down the route of making my site work compltely with CSS3, I have to add all of the above just to get rounded borders without having the hassle of using images to make the rounded corners.

To be fair to Microsoft on this, they have correctly followed the specification laid out by W3C.  You never thought that you would see that did you?  Early reviews and personal testing have found that IE9 is a massive improvement in many aspects such as speed, security and usability.  I actually prefer this browser to any other now.  IE8 was too buggy and would eat memory like there was no tomorrow and Firefox would crash for no apparent reason.  I do like Safari, but things sometimes look a bit odd in it, as does in Chrome.  Saying this, Microsoft have done themselves no favours by restricting the platform for IE9 to Windows 7 - probably to encourage those who are still on XP to upgrade.

What I have done so far is give in to these horrible new varied specifications.  A new site that I am working on for myself employs all of the bulleted list above.  I believe that we are currently at the turning point for moving to CSS3, although HTML5 is further away I feel.  All of the latest browsers support CSS3 whilst support for the older browsers will suddenly start to slide.  From what I have read already, IE9 already has 2% of the market.  Not a bad achievement for a product released only two days ago.

Saturday, 5 March 2011

The return of Service Unavailable HTTP Error 503

For those of you that have read my first article in this blog, one of the reasons for the migration to a new server was because I was plagued with Service Unavailable HTTP Error 503, which would forever get under my skin and just 'error' for no real reason at all.  Nothing in the error logs, no software errors, nothing.  I was aware of the IMAP PHP module being faulty, whereby if the headers of an email were over a certain length, this would result in the 'Error 503'.  I could replicate this just fine, but the server would still fall over for no reason, even if I disabled the IMAP module.

This started on Server 2003r2 with IIS6.  Some time ago, after Googling around for a little while, I eventually found that other people experiencing the same issues with some people were saying this was down to a corrupt IIS configuration.  I had never experienced this before so it eventually started to turn into a bit of a headache trying to pin this down.  It had been on the cards for some time to move the server to a new box so for me to waste time reinstalling IIS was pointless.

Moving forward a year or so, and the problem had gradually been getting more frequent.  In the end, I just made a small VB Script as a workaround that would run every few hours to restart IIS in case this had happened which always cured the problem.  This had worked fine and my hope was that a planned server upgrade would solve this issue along with an updated version of PHP.  Wrong.  A few days into the new server being in production, what happens?  Yep, you got it.  Error 503.  Great.

Only this time there was a log entry in the Windows application log.  The shortened error looked like:
Faulting application name: w3wp.exe, Faulting module name: php_imap.dll
Google again came to the rescue, with the top result pointing at this PHP bug article about IMAP headers being too long - the same bug that was present before.  It looks as though the old problem had not been cured and it seemed that the only way to fix this would be to go up a major point release of PHP to PHP 5.3.5 (current release as of now).  ISAPI was always my favourite method for PHP use on Windows, but since this has now been retired as of the last branch of 5.2, FastCGI was now my only option.

FastCGI wasn't a problem though and it does work just as well as ISAPI although it does require a bit more of a tweak to get it set up out of the box.  So far so good though.  No more 503s.  I do think that originally the 503s were the result of the faulty IMAP module, but there still must have been a massive fault with IIS6 which is now now present in 7.5.

I would just like to say thanks to everybody who has been clicking on the sponsored adverts on this page.  It's very much appreciated.

Wednesday, 23 February 2011

Moving on, onwards and upwards!

Following on where I left off really from my last post!

I briefly mentioned in my last post that I had an upgrade path in place (after testing of course!) for 'Connect'.  The time was approaching to move on with the technology, whereby Connect had been in place for three years and in that time it had only ever had a couple of PHP / MySQL point release updates.  Not that this was a problem of course, but you can never be left standing still.

Anyway, after doing a bit of research and some testing on my machine at work I ended up drawing up a plan for the migration.  Not only would I be migrating the software from the old server to a new one, I would be taking advantage of certain in-house server developments.  Our new server cluster which runs Microsoft Hyper-V, has now been patched to SP1 by Microsoft to support dynamic memory - which means lots of nice resources for any server sitting within that cluster.  Not only this, I drew up plans to upgrade the core functionality of Moodle to version 1.9.10, as well as move to 64-bit MySQL and also move to the latest PHP 5.2.x release (I don't particularly like running Fast CGI on IIS as it has odd behaviour issues sometimes, which left me with ISAPI).

Testing of all of this was done successfully, very successfully!  With nearly everything running in native 64-bit mode on the server (except PHP), the performance boost was clear to be seen.  Pages instantly loaded quicker, reports were much faster to be dynamically generated and most of all, there would be peace of mind that it should, (famous last words!) be a lot more reliable and ready for the future.

To get started with the migration, one of our library server images of Server 2008 r2 was set up, and immediately patched with the freshly released Service Pack 1 from Microsoft.  MySQL, PHP and IIS were also set up, before copying the code across, setting security permissions and restoring the database from the old server.  The Moodle upgrade and module upgrades then took place, whilst downing the old server to ensure that there would only be one database in use.

And that was it really, how to migrate your Moodle!  Downtime was minimal, and first impressions are that everything seems very fast which I think in part is a little to do with everything.  The contributing factors in my opinion are:
  • (The obvious) Much more powerful server, with lots of resources
  • Move to 64-bit MySQL
  • New PHP release
  • Newer Moodle release
  • Move to Microsoft Server 2008 r2 SP1
I'll be adding more posts soon, so please follow this blog if it will help you in your day to day duties!

Monday, 14 February 2011

From the start...

Hi everybody, just to introduce myself and my blog firstly!

I'll start by saying that this isn't my first blog, but it is my first one for quite some time - about four years to be precise.  The reason for a re-start of my blog is to work more closely with other developers in the web development field, and hopefully to help anyone in need.

Next, I'll mention what by background is.  I've been a developer in education now for about six years now, and in that time I've worked closely on new ideas, more recently working and developing a highly customised version of Moodle, which has now been branded 'Connect'.

I've worked with various different languages on different operating systems using different databases, but most of my daily work and expertise involves Windows Server 2003r2/08r2, MySQL v5.x and PHP 5.x.  For me, I would say this is now my preferred environment after working with various different combinations of the above, and for many different reasons that I won't go into just now - but I'm sure that they will be apparent in the future as this blog develops.

The current, but soon to be retired server platform that I'm running is an old HP Proliant server, with the following specification:
  • Intel Xeon 3065 2.33Ghz processor
  • 4Gb DDR2 Memory
  • Microsoft Windows Server 2003r2
  • PHP 5.2.10 (Upgraded from 5.1.9)
  • MySQL 5.1.34 (Upgraded from 5.0.37)
  • Microsoft IIS 6
  • Moodle 1.9.0+
The server was originally bought to be a 'stop-gap' but has actually performed brilliantly during the time that it has been in service.  Personally, I believe that for 2000 users, the above specification is more than adequate.  What does let the server down especially, is IIS 6 which has increasingly become unreliable which, after doing some research, I believe is down to a corrupt IIS configuration.  Since there have been plans in the pipeline to migrate Connect to a Server 2008r2 environment for quite some time, I have left this alone for the time being.  Other than this, the server is extremely fast and has been very reliable with near enough 100% server uptime (excluding restarts for Windows updates).

Some of the posts that I will be writing shortly will be looking at:
  • Move of Connect to a new Windows Server 2008r2
  • Upgrading PHP 5.x
  • Possible up/downgrade of MySQL
  • IIS 6 deep rooted problems
  • Upgrading Moodle
  • Is Moodle 2.0 worth it?
The issues above are what I believe are current issues affecting my environment, and at some point I hope to have addressed all of the above.

Anyway - thanks for taking the time to read my blog, I hope that you have found this informative.  Please take the time to click on a sponsored link for me (even if you just open it and then close it!), and even follow this blog.