Windows WIC Install Failed or Canceled

If you get a install failure error “WIC Setup canceled” when trying to install WIC (Windows Imaging Components) on Windows 2003 x64 and possibly 2008.

Boot into safe mode and rename the following list of files. If you are running 32 bit version, you don’t have to worry about the files in the SysWOW64 folder




Upgrade Redmine using SVN

I needed to upgrade my Redmine install from 0.9.4 to 1.1.0. Using SVN to download the update makes the process very smooth. Be sure to backup your Redmine database before updating.

I use a soft link for my redmine directory so upgrades are cleaner and could be rolled back with less pain.

Go to the directory where Redmine is installed and Remove the current soft link

# cd /opt
# rm redmine

Download the latest stable from SVN into its own directory

# svn co redmine-1.1

Create soft link to the new release

# ln -s redmine-1.1 redmine

Copy the email and database configuration files from the old install

# cp redmine-0.9/config/database.yml redmine-1.1/config/
# cp redmine-0.9/config/email.yml redmine-1.1/config/

Migrate the database

# rake db:migrate RAILS_ENV=production

I did run into couple errors when migrated. I followed the error’s output and used the following command to fix them.

# gem install -v=0.4.2 i18n
# rake config/initializers/session_store.rb

Migrate the database (Second Try)

# rake db:migrate RAILS_ENV=production

Migrate any plugins you might have

#rake db:migrate_plugins RAILS_ENV=production

Do some clean up

# rake tmp:cache:clear
# rake tmp:sessions:clear

Restart your webserver

# /etc/init.d/apache2 restart

You are done unless you need to update any cron jobs or crontabs you have made for the redmine install

You should be able to use this process for future upgrade, but you may need to update different parts of your Ruby on Rail install.

Leave a comment if you have any questions or suggestions for me.

Fix error while loading shared libraries: cannot open shared object file: No such file or directory

I was moving an old web applications off of dying hardware to a new DebianVM running 5.0 Lenny and ran into this Error “error while loading shared libraries: cannot open shared object file: No such file or directory, “. After searching for a package to work with Lenny, I just gave up and installed a package called libstdc++2.10-glibc2.2 from Woody. I had to use a package made for Woody since the Etch packages seems to have disappeared.

You can download it here from the archive.

Just extract the files

#dpkg-deb -x libstdc++2.10-glibc2.2_2.95.4-11woody1_i386.deb /root

And copy the files to their new locations

#cp /root/usr/lib/lib* /usr/lib/

This is a definitely a hack but it works.

Extend a LVM volume in a Hyper-V Linux VM

Some people running Hyper-V for the virtualization platform are not always experienced Linux administrators. So I have written this HowTo for extending the a LVM volume in Linux guest. The three main steps to complete this task are expanding the virtual hard drive, creating the LVM partition, and adding the additional storage to the correct volume group and logical volume.

Expand the virtual hard disk

Go to the Settings of the VM that you want to add storage to

Select the Virtual Hard Disk

Click Edit

Hyper-V Settings Dialog

Select Expand and then Next

Enter the new size


Creating the LVM partition

All of the commands need to be done with root or a user with sudo rights as root.

First we need to create the LVM partition in fdisk

linuxapptest # fdisk /dev/hda

Type p to print current partition configuration

Command (m for help): p

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          31      248976   83  Linux
/dev/hda2              32        3263    25961040   8e  Linux LVM

Type n for a new partition

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)

Type p for primary

Partition number (1-4): 3

Type 3 since it is next partition number available

Just enter at the next two prompts to use the full amount of storage we added to the hard drive. Your cylinder numbers will probably be different then my example.

First cylinder (1-10443, default 7000):

Last cylinder or +size or +sizeM or +sizeK (1-10443, default 10443):

Now we need to change the new partition’s system id/type to LVM

Command (m for help): t
Partition number (1-4):

Type partition 3

Hex code (type L to list codes): 8e

Type 8e to change the partition type to LVM

Changed system type of partition 1 to 8e (Linux LVM)

We aren’t finished yet. Be sure to type w so the changes will be committed to the disk.

Command (m for help): w
The partition table has been altered!

Adding the additional storage

Create a Physical volume from the new partition

linuxapptest # pvcreate /dev/hda3

Display the LVM information so we grow the correct Volume Group

linuxapptest # lvdisplay
  --- Logical volume ---
  LV Name                /dev/linuxapptest/root
  VG Name                linuxapptest
  LV UUID                jvOih8-hex2-s2Ec-avuL-wtG2-M1KI-JVY6PG
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                23.69 GB
  Current LE             6064
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0

  --- Logical volume ---
  LV Name                /dev/linuxapptest/swap_1
  VG Name                linuxapptest
  LV UUID                qOASw0-GmoL-dipj-ORrP-qRxv-yOdE-g9i7dE
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                1.07 GB
  Current LE             274
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1

We now add the new partition to the Volume Group. You see that our Volume Group name (VG Name) is linuxapptest.

 linuxapptest # vgextend linuxapptest /dev/hda3

Next we add the new storage to the logical volume. We want to expand the “root” logical volume. The command will add all of the free storage to logical volume.

linuxapptest # lvresize -l +100%FREE /dev/linuxapptest/root

Online expansion of the filesystem

linuxapptest # resize2fs /dev/linuxapptest/root

At this point your Linux VM has the additional storage to use. I also like to reboot the server at this point to make sure everything works after a clean boot.

If you have any questions or see any problems with my process let me know

Enable Message options in Outlook 2010 to show the Internet message headers

Can’t find the “Message options” or Internet headers that was in previous versions of Outlook. Well I have a quick solution for you.

The simplest way to see them again is to add the “Message options” to your QAT (Quick Access Toolbar) above the ribbon.

Click on the down arrow at the end of your QAT and select “More Commands”. From the “Choose commands from” drop down choose “Commands not in Ribbon”. Scroll down to “Message options” and click “Add >>”.

A quick and easy way to give you access to the Internet messages headers of the email you have selected.

Steps to get your Linux website ready to pass a PCI scan

Most of the companies offering PCI scans out there are just lazy companies getting easy money from scared business owners.  The scans on Linux websites are laughable. Even if your server is update with all of the current security updates, the scan still fails. It fails because it only looks at the version numbers of your Apache and PHP software. It isn’t testing if the actual security vulnerability works on the website. So you only have to hide the version numbers and most if not all of your deficiencies are gone from the report.

To hide the version number for Apache2, change ServerToken value to ProductOnly and ServerSignature to Off. These values are in /etc/apache2/apache2.conf for Debian-based distributions and  /etc/httpd/conf/httpd.conf for Red Hat-based distributions.

To hide the version number for PHP, change expose_php to Off. This value is in /etc/php5/apache2/php.ini for Debian-based distributions and /etc/php.ini for Red Hat-based distributions.

Restart Apache and you should be set for your PCI scan of your website.

I can’t stress enough hiding the versions of Apache and PHP will offer not any extra protection in attacks against the site, so make sure your web server is always current with security updates.

IIS 7.5 and Windows Server 2008 R2 – FTP Site with Active Directory User Isolation

This Howto can be completed after you have a working Active Directory environment and a Windows Server 2008 R2 server installed as a member server.

Install FTP role and Setup the Users and Group

You can use the Server Manager Role Wizard

to install the FTP service or you can just use this command

CMD /C START /w PKGMGR.EXE /l:log.etw /iu:IIS-WebServerRole;IIS-FTPServer;IIS-FTPSvc

Created a group in Active Directory for FTP use and add some users to it. I named mine FTPUsers.

Create FTP site in IIS

Open the IIS Manager and right click on Sites to start the FTP Site creation wizard.

Type a name for your site. Locate and select your ftp root on the server. You can use the default FTP root directory (C:Inetpubftproot) or create your own.

Select No SSL.

Check Basic. Select Specific roles or user groups and type the Active Directory Group name you created. Then click Finish

Select your newly created FTP site in IIS Manager and open up FTP User Isolation.

Set the Isolation to Active Directory

At this point we need create a directory under the ftproot with the same as the Active Directory domain like TESTDOMAIN. So the directory structure would look like this C:inetpubftproottestdomain. Give the FTP group (FTPUsers) Read and Write to the “testdomain” directory since the users will be unable to browse above their own home directory. This makes the permissions for adding new users much easier to manage. Then create the individual user account folders under “testdomain”. Just use the accounts SamAccountName for the accounts that are apart of the FTPUsers group.

Setting the User attributes in Active Directory

You can use ADSIEdit to manage the attributes used for the account’s FTP Home directory or you can use a tool called FTP User Editor for Microsoft Active Directory. The editor is changing the attributes ms-IIS-FTP-Dir and ms-IIS-FTP-Root in a user friendly way

You can download the latest version here.

You can go to this page that shows how to use the software.

Install and run the software. Find and select the user(s). Right click and Modify. Set the FTP Root to the ftp root you defined in your FTP site plus the domain name. The FTP Dir can be set to Account Name. Then click OK.

A Status Update window will popup that you can close. In the main window, you can see that the attributes have been set

You have a specific question just let me know. I have covered the basics on getting a Active Directory based ftp site working.You can add many other options to this setup like using UNC path for the ms-IIS-FTP-Root or using DFS to replicate the files across load balance FTP servers.

Uploaded images in WordPress 2.9 are blank

The uploading of my images in my post were failing. After searching the Internet a bit. I found the solution. Go to Setting > Miscellaneous and make sure the path to the uploads directory is set to blank and not the full system path like /var/www/wp-content/uploads. Mine was some how set to the system path and caused all of my uploads to fail even though WordPress wasn’t returning any error.

Install JDK 1.5 and MySQL Connector/J 3.0 on Debian

Installing Sun’s JDK has gotten much easier since it was added to the non-free repository. I have made a quick HowTo on installing JDK 1.5 and MySQL Connector/J 3.0 on Debian.
Add the non-free sources to /etc/apt/sources.list
# nano /etc/apt/sources.list
add these lines to the file
deb lenny main non-free
deb-src lenny main non-free

Update the package list from the new sources.
# apt-get update
Install JDK 1.5. This also installs a JRE too.
# apt-get install sun-java5-jdk
Configure the system to use the new java packages
# update-alternatives --config java
Select the option that has /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
# update-alternatives --config javac
Select the option that has /usr/lib/jvm/java-1.5.0-sun/jre/bin/javac
Download MySQL Connector
Choose the latest stable release which is 3.0 at this time.
Create a directory to hold the connector
# mkdir /opt/java
Untar the downloaded file
# tar -xzvf mysql-connector-java-3.0.17-ga.tar.gz
copy the jar file to /opt/java
# cp ./mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga-bin.jar /opt/java
Setup the CLASSPATH environment variable so Java can see the connector
# nano /etc/profile
Add the text below to the file
If you log out and back in, you can do
to confirm that the variable was set correctly.

Also let me know if you run into any problems with the process I have described.