Archive for May, 2009

Installing an Internal Hard Drive on Linux

Mounting an internal hard drive in Linux is not quite as simple as installing a hard drive on a Windows machine. After installing the hard drive, there are only a few steps that I will cover below. First, before this will work, you need to make sure the motherboard recognizes there is a new hard drive. Many of the SATA driven computers require entering the BIOS and Enabling the particular SATA port number.

  1. Run fdisk -l to list all the disk, their capacity, and their space available. There may be many more drives listed than you actual have running, so you will need to identify which drive is new. The best way to do this is to look at the drive capacity. Remember thatt 1024 MB =  1 GB. In the example below, we will assume that /dev/sdb1 is our new drive.
  2. Next,  we add the following command to our fstab file located in the /etc directory. Edit the fstab file with your favorite editor and add /dev/sdb1 /mnt/hd1 ext3 defaults 0 0. Save and Close the file. Not that /mnt/hd1 can be any directory in the machine that you want.
  3. At the prompt, type mount -a to remount all the locations listed in the /etc/fstab file. You can now see a drive called hd1 in the /mnt directory.

How to Get Linux Version, Build, and Distribution

Getting the Linux Version, build, and Distribution is easy. In the example below, I  ran the command on a Dell Optiplex 755 running CentOS 4.6. Just run the command below in a terminal window and the output will display useful information:

cat /proc/version

Linux version 2.6.9-67.0.15.ELsmp (mockbuild@builder10.centos.org) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)) #1 SMP Thu May 8 10:52:19 EDT 2008


301 Redirect in IIS 6.0

Setting up a 301 Redirect in IIS 6.0

If you are planning to move a website to a new domain name, the most efficient way to setup URL redirection is to with the 301 Redirect. The 301 HTTP status code means moved permanently. For this reason, it is the best method to use to preserve a website’s search engine placement.

This tutorial will cover how to completely (including query strings) redirect a url. Setting up search engine friendly 301 Redirect for a web application in Microsoft IIS 6.0 is a matter of a few settings.

  1. In your IIS properties window, you will want to click Redirect to a URL radio button.
  2. Next, in the box below, you will want to input the new URL address. At the end of the new URL address, you want to append $S$Q to preserve the querystrings. Therefore, if I want to redirect to http://www.victorchen.info/test.php?index=1, the string will be http://www.victorchen.info/$S$Q.
  3. Finally, check the checkbox A Permenant Redirection for this resource.
  4. Click Apply and Close