RocketReviews.com

Archives

RocketReviews.com Moved to New Server

Over the past weekend, I transferred the RocketReviews.com website to a new server. One of the hard drives on the old server began showing signs of failing, so I decided to move RocketReviews.com and the other sites I host to the new server.

The new server is very similar to the one used before. It has an Intel Xeon Quadcore processor and 4GB of memory. It’s running RedHat Linux and is located in one of Softlayer’s data centers in Dallas, Texas, with direct connections to the largest and fastest internet backbones.

The only real difference between the new server and the old is that the new server has three 500GB hard drives in a RAID 5 configuration while the old server had just two 500GB drives configured individually. The RAID system provides protection in case a drive fails. If one of the drives fails, a new one can replace it without turning the system off.

Continue reading RocketReviews.com Moved to New Server …

Performance Improvements

I’m aware that the RocketReviews.com web site has been performing slowly at times, but I’ve addressed the issues and the site is performing much better now.

If you found RocketReviews.com to be slow in the past, please visit the site now and let me know if you are still having problems. You can use the Contact Us link at the bottom of any page at RocketReviews.com to contact me.

For those interested in the details, a number of issues were causing the problems. These issues came together in a “perfect storm” a few days ago causing the site to be down for a few hours.

The main issue was that the database engine’s parameters were not tuned very well. It was using more memory than physically exists on the server. Combined with some inefficiencies in the way the database was being used, this caused a high load on the entire server. A monitoring program rebooted

Continue reading Performance Improvements …

A Sneak Peak at the Flight Log Updates

Here’s a quick sneak peak at the new form that I am currently developing for entering flights.

Please click the image if you wish to see it full size.

The first thing you that you’ve probably noticed is that it’s more attractive than the current “wizard” and multiple-flights form available at RocketReviews.com. And this is before I’ve spent any time on the “look and feel” of the form. It’s appearance is based on a standard template. But, it already looks very nice.

Besides looking better, the new form will work better. For example, as you type the name of the rocket into the “Rocket Name” field, the form will display a list of matching choices from rockets you’ve previously flown. The same “autocomplete” function works when entering other information, such as the launch site and types of motors.

The input form is divided into sections. The

Continue reading A Sneak Peak at the Flight Log Updates …

Misbehaving Hard Drives and Backups

A problem with the file system on one of the web server’s hard drives caused RocketReviews.com to be down for about 12 hours recently. The operating system detected an error writing to one of the hard drives so it marked the drive as “read-only” to avoid more errors. Ironically, this occurred over night as I was running a full backup of the server – the first full backup that I had attempted since moving RocketReviews.com and the other sites to the new server.

I rebooted the server so that it would run a file system check and repair any problems with the drive. Because the web server is located in a data center in another state, I wasn’t able to monitor it directly. Instead I used an application which allows me to remotely monitor it through the Internet. What I did not realize is that the boot process had stopped and was waiting for

Continue reading Misbehaving Hard Drives and Backups …

Under the Hood – Image Management

Images are important to RocketReviews.com. The site permits users to upload images which means that it has to deal with multiple sizes and types of image files. Users can also upload non-image files such as PDF files and Rocksim data files. The RocketReviews.com Image Manager is used to handle images as well as the other types of uploaded files.

Uploaded images are stored in a directory on the server. When a file is uploaded, a unique new filename is assigned to it since user’s might upload a file with the same name as one that already exists. The unique filename is stored with the user’s ID and the original name of the file in a record in the database. If the file is an image file, the dimensions (height and width) of the image are also stored in the database record. A unique ID is returned for the image.

To allow the image to be

Continue reading Under the Hood – Image Management …

Under the Hood – Templates

RocketReviews.com uses the Smarty template system to define the layout of the web pages displayed by the web site. Smarty one of the ways the “Application Layer” and “Presentation Layer” of the web site are kept seperate. This allows the functionality of the web site to be changed or expanded without affecting the overall “look and feel” of the site. It also allows the overall appearance of the site to be changed without having to change the software that generates the content of the site.

Originally, I had planned to use Smarty to define both the general layout of each page (the header, sidebars, content area, and footer) as well as to define the layout of the content of each page. But, I found it easier to use Smarty just for the site’s overall theme. For the content of each page, I use HTML produced by the PHP scripts and CSS defined in a text

Continue reading Under the Hood – Templates …

Under the Hood – Animated GIFs

RocketReviews.com uses GIFEncoder by Laszlo Zsidi to dynamically create animated GIF images for widgets and other purposes. When I ported the site to a new server running PHP 5, the code failed with the following error:

Catchable fatal error: Object of class GIFEncoder could not be converted to string in …

The fix turned out to be simple. Change all occurrences of $$this->OFS to $this->OFS in the source code. The mistake needs to be fixed in two places.

Under the Hood – Friendly URLs

To determine which Action to execute, the CMS looks at the action parameter passed in the URL. If you’ve used RocketReviews.com, however, you may have never seen “?action=xxxxx” in a URL for the site. This is because RocketReviews.com uses “friendly” URLs. A friendly URL looks more like a title than a function call. For example, the actual URL for displaying a dynamically-generated web page might look like:

http://www.rocketreviews.com/index.php?action=reviews

Instead of the above, RocketReviews.com will display the more friendly-looking URL:

http://www.rocketreviews.com/rocket-kit-reviews.html

</pre> function getFriendly($title, $url) { $xurl = addslashes($url); $result = mysql_query("SELECT Friendly_ID, FriendlyName FROM view_friendly WHERE URL = ‘$xurl’"); if (list($id, $friendlyname) = mysql_fetch_row($result)) { return $friendlyname . ".html"; } $extra = rand(1000, 9999); $title = strip_tags($title); $FriendlyName = preg_replace(‘/[^a-z0-9\-]+/i’, ”, strtolower(str_replace(" ", "-", trim($title)))); $FriendlyName2 = $FriendlyName; $result = mysql_query("SELECT FriendlyName FROM view_friendly WHERE FriendlyName = ‘$FriendlyName’"); while (list($x) = mysql_fetch_row($result)) { $FriendlyName = $FriendlyName2 . "-" . $extra; $result

Continue reading Under the Hood – Friendly URLs …

Under the Hood – Menus

Menus – the main menus displayed by RocketReviews.com are also defined by classes. When the CMS displays an Action, it loops though the Menu Blocks defined by the Action. Each Menu Block is defined by a class in a source file in a specific menu block directly. Each Menu Block class returns a list of Menu Items which are represented by classes in sources files in a menu items directory.

The Menu Block and Menu Item Classes include functions which are called by the CMS to determine if the Block or Item should be displayed. If the function returns false, the Block or Item is not displayed. This is how, for example, RocketReviews.com displays different menu options when you are logged into the site than when you are not logged into the site.

The Menu Item class returns the URL of the web page to display when the item is clicked. Generally, the URL is

Continue reading Under the Hood – Menus …

Under the Hood – Action Classes

The CMS for RocketReviews.com is built around the concept of “Actions.” An Action represents a web page displayed to the user or a group of related web pages. For example, RocketReviews.com has a “Reviews” action for displaying pages related to rocketry reviews.

Internally, an Action is represented by a class. A new Action can be easily added to the site. To add a new Action, I ceate a source file containing the new Action class and save it in a specific directory. The CMS recognizes any class files added to the directory as new Actions.

An Action class must implement a few functions that are used to do common things such as returning the content for the body of the page, setting the metadata attributes for the web page (such as the page Title), and defining which menu blocks to display on the page.

The class may contain optional functions which do things such as

Continue reading Under the Hood – Action Classes …