Make sure you have the right hosting

10th June 2010

At Zoomba, we do a lot of work for other website design companies and specialise in custom content management systems. In the past week we have seen another two issues with well known hosting companies, and one which took quite a while to debug.

When your website is being developed, it is usually done in-house on the developers own servers or somewhere online that is password protected. The servers that are hosting your site during this development stage are owned/rented and run by developers, which means that 99% of the time they are configured correctly.

While many people know that they need Linux vs. Windows Hosting and that PHP, Apache and mySQL should be "features" of their hosting package, these features will be listed by nearly every hosting company you look at. So what's the problem?

Here are three examples of sub-features that may not be enabled (Linux Hosting);

1. The mod_rewrite module for apache.

The mod_rewrite module is often used by many developers to "re-write" the URL or Link. This is done for many reasons, the most common is to make the links more user friendly which also has an impact on SEO (Search Engine Optimisation).

For example the link to this page;

http://www.zoomba.co.uk/news/make-sure-you-have-the-right-hosting.html

is actually seen by the server as something similar to

http://www.zoomba.co.uk/shownews.php?id=xx (xx being a number)

but as you can see, the top link is much more readable and user friendly. It also contains all the relevant keywords for the search engines to index.

2. The use of htaccess files for apache.

The htaccess file is used to configure aspects of your hosting server on-the-fly. All of the redirects and rewrites will be configured here.

3. The GD Library for PHP.

The GD library is used to manipulate images. You can imagine logging in to your content management system and posting a new news post (such like this one here) and you select your image. When that image is uploaded to the server the GD library may be used to create 3 or 4 different sizes of the image to use throughout the website. This library is quite often disabled by some hosts.

There are many reasons why a host may choose to disable some of these sub-features and two of the most common are;

1. Security. Many hosts have a generic configuration for their hosting servers which is applicable in all scenarios. The downside of this is that it cannot be configured on an individual basis, or can but involves more work and therefore cost. Rather than configure the servers properly the host might choose to make a single setup image and deploy this image to a new server in a matter of minutes.

2. Your website is most probably on a shared server. This means that your host might limit resources to make sure that your website and code does not slow down the server for other customers. This is often the case with larger and cheaper companies that pack hundreds of websites onto the same server.

Limiting resources is actually quite a big problem and we have came across this many times. One example of this is here;

http://faq.1and1.com/scripting_languages_supported/php/index.html and the article "Can the memory usage limit be increased on shared hosting with a php.ini file?".

If you imagine the scenario presented earlier where a user logs into their content management system to create a new news post, and go on to select the image they want to associate with it.

When this image is uploaded the 3 or 4 different sizes are created (thumbnails etc) using the GD library. In order to do this the image is represented in memory many times its file size. (for e.g. a PNG file that is 2mb may expand to 50mb of server memory).

With the limit of 40mb applied, posting the news item which included an image over 1.5mb in size would just hang with no error message (under PHP4), enabling PHP5 for this host allowed us to see the error message that there was not enough memory. Then, after many hours of debugging and attempting to set the memory limit via the php.ini file, htaccess and cpanel (hosting) configuration. It was found to be a restriction put in place by the host.

So, as you can see. It is not always clear which sub-features or limitations are in place and it is worth doing your research first.

Don't be fooled by large companies and cheap(er) hosting, as the saying "Too good to be true" often stands firm. Always stick with your development firm if they offer you hosting (after all they know what you need) or ask your development firm to look over your chosen hosting package.

Home  |  More News

Receive the latest Zoomba updates by subscribing to our RSS Feed