Archive

Archive for July, 2009

New: Download Essential Configuration Files for CentOS, HTTPD, IPTables, and ZenCart

July 21st, 2009
Comments Off

Yes, we have a new downloads section on our blog. In it we offer some free configuration files that simplify our daily routine work, shorten the time it takes to perform these tasks, and since we tweak them all the time it is relatively safe to use them. I certainly use these files almost every time I setup a new server.

Improved ZenCart Config Files

[download id="1"]

Improved config files only need DB information. URL related information and Folder location information are auto populated by PHP functions and server variables. Great for keeping the same file for both dev and production environment.

The default ZenCart config files lack some flexibility. In the last two years my team has developed these config files which we wanted to share with you. The main difference here is that the URL and the folders of the ZenCart website is auto-determined and there is no need to change them or edit this file if either one of these changes. One great usage is if you want to be able to copy your ZenCart files from one machine to another or from a dev environment to your production environment. These improved ZenCart config files make it easy.

Script to Configure IPTables on CentOS for WWW server

[download id="2"]

In order to simplify my work I have created this simple script that automatically configures iptables on CentOS for WWW server. It blocks everything except ports 80, 443, and 22 (http, https, and ssh respectively).

Script to Configure IPTables on CentOS to block certain IP ranges

[download id="3"]

Once I configure the iptables to only open the ports I need on the specific server, I use this script to block any suspicious activity like failed unauthorized ssh login attempts or spam blasters trying to abuse any contact form on the website. I usually trace the IP and if it is outside of the US I block the entire 255.255.x.x subnet. Sometimes the entire 255.x.x.x range. As long as you don’t block your own users, you should be fine.

Web Development

Speed Optimized Websites Rank Higher with Search Engines

July 16th, 2009
Comments Off

Website performance should not be taken lightly. Now, when I say website performance optimization in general I mean the time that it takes a webpage to fully render in the browser. Many different factors can influence that including the number of files that make your page, the size of the files, whether it renders in standard XHTML or quirks mode, etc. But, for search engines all that matters is the raw HTML output of your site. One of the ways that search engines measure a site’s validity is by measuring the speed it takes it to serve the HTML portion. Yes, raw web server power. Why?

Search engines try to guess which websites out there should gain more respect than others, one characteristics is speed. If you think of it, the speed it takes to serve a page reflects how much the owner invested in it and hence reflects on the ranking that it should get in a backwards way. In other words, a site that is served on a dedicated server with serious horse power should get higher rankings than a site that is served on the cheapest shared hosting plan. Another fact is that major search engines researched user return rate and have found that the return is higher for faster sites and even microseconds count. That is why the best search engines focus on speedier results and favor results from faster websites. Really?

google_webmaster_tools_crawl_stats2

Look at the graph above, you will see a direct correlation between the website’s speed and the number of indexed pages. There might be a delay and it is not 100% accurate because the speed is not the only factor here, but over time it seems to have an effect. These graphs are from Google Webmaster Tools, under the crawler stats. Ok, how should I increase the performance of my site?

Here are a few things to consider:

  • Invest in a good hosting package. If you are serious, get at least a VPS with your own IP address (dedicated IP is also a measure). A VPS or a dedicated server will always trump the performance of shared hosting over time. Notice that some shared hosting environments reach 500+ websites on the same piece of hardware.
  • If you use PHP make sure to use APC: Alternative PHP Caching.
  • Always turn on caching at all levels: Apache, PHP, and your application. All levels usually have some sort of a caching mechanism – use it!
  • Research your biggest bottleneck and tackle it, always repeat over time. Just like you do with SEO – it is always work in progress.
  • Look in the logs: every time that your server experiences an error or a warning it has to trigger the error handling mechanism which in most environments require additional resources. Especially unhandled exceptions in ASP.NET/IIS7 environments.

The list is really long and can get very technical but in general you always want to keep website performance optimization in the back of your head. It is well worth it!

What is your experience with speed optimized websites? how did it affect your SEO results?

Performance Optimization, Web Application Hosting, Web Development ,

Take a Look at Dell’s Fortuna Server

July 9th, 2009
Comments Off

As web traffic grows constantly and will continue to grow, I am always on the lookout for better ways to host a robust websites. Our clients always demand the best hosting solution but with an eye on the price. Currently the biggest price tags when it comes to hosting data centers is the power consumption and second is the actual space. Note that a side benefit to lower power consumption is reduction in the need of cooling, since logically increased power consumption means more generated heat.

In other words, to remain competitive hosting providers will strive to provide servers with lower power consumption and smaller form factors while assuming a certain level of processing power. This is exactly what DELL’s R&D is working on these days. Here is a video of what is in the works:

What is interesting is that the fortuna will supposedly place 12 of these mini servers in a single enclosure that fits in 2U space. This makes it a 1/6U server. 6 Servers per 1U of space. Here is a photo of a prototype:

dell_fortuna_server

Now, can you imagine each mini server hosting 2-4 VPS with CentOS serving the LAMP stack and either a Joomla, WordPress, or ZenCart on it? Nice!

Web Application Hosting, Web Development ,

Embedding Videos in Ektron

July 2nd, 2009

video_icon_fullAlmost every other day what seems to be a simple task will reveal itself as a mini project. Perhaps a side-effect of the paste of which things change in the web development world. This is exactly what happened when I tried to embed a movie from backlight.tv in to an Ektron site. It did not work and the issue was not trivial.

This is the code that needed to be embedded into the body of the page which will trigger a flash player and stream a flash movie in to the browser:

<object class="cantaloupe_video" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
width="480" height="294" id="backlight_player" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="http://player.backlight.tv/player/?video_code=VDF2upIPH8s6239EQ90L" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<param name="flashvars" value="" />
<embed src="http://player.backlight.tv/player/?video_code=VDF2upIPH8s6239EQ90L" flashvars="" quality="high" bgcolor="#000000" width="480" height="294" name="backlight_player" align="middle" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Well, after I open a new content block and paste this code in the richtextarea/html input field and publish it, no video is displayed on the front page. After various debugging sessions I discovered that Ektron automatically strips out the <embed> tag. This is done probably because Ektron is trying to produce valid XHTML/HTML code and the embed tag is not.

How do we overcome the issue? We really have two options:

  1. Force Ektron’s new WYSIWYG editor to accept the invalid code and display it with the embed tag (not recommended, will not be covered here).
  2. Find a better way to embed the video with valid code.

While option one is not recommended and I’ll not cover it here, option two is quite easy and clean. To produce clean code use the following few lines of HTML instead, you can edit the original video code manually in an editor and then insert it into the content block:

<object type="application/x-shockwave-flash" style="width:454px; height:278px;"
data="http://player.backlight.tv/player/?video_code=VDF2upIPH8s6239EQ90L">
<param name="movie" value="http://player.backlight.tv/player/?video_code=VDF2upIPH8s6239EQ90L" />
<param name="wmode" value="transparent" />
</object>

What you need to focus on in the object tag which includes the width and height in the style element and the data element which includes the URL to the movie itself. Only one parameter is really required here: ‘movie’ which has the same URL to the actual movie. Everything else is not required and may not be necessary.

So, after cleaning up the original code, I inserted this new one into the content block, published it and vuala! it worked.

Thanks to Jeff Martinez for pointing it out on the Ektron Fourms.

Ektron