Want to show your appreciation?
Please a cup of tea.
Showing posts with label Win32. Show all posts
Showing posts with label Win32. Show all posts

Sunday, December 09, 2007

Migrate Entire XP Installation to A New PC

My old laptop retired and I need to move everything over. I initially thought it would be simple as I always backup my disk with Norton Ghost. But the real story is everything but simple.

The image was made from a 40GB partition and I was restoring it to 100GB disk. Ghost has an option to resize the partition to fill unused space after restore and I used that. Of course, it didn't work and ended with a corrupted file system that couldn't be recognized. OK, let's restore the 40GB as is and resize later. This gave me a sound C: drive but when I try to boot Windows XP, BSOD!

OK, we are on a new hardware platform, I understand that Windoze can never be that smart. The BSOD was fixed by running repair installation with original Windows XP installation CD.

I finally booted into XP on the new laptop with an outdated SP2. I immediately started the update but got 0x8007043b error. It turn out to be a well known issue and fix is here.

What's left are the audio and modem drivers. The driver downloaded from Lenovo/ibm site doesn't install. The installer complains about the missing of the HD Audio Bus driver. I found out a good article here that provided the detail instruction of how to install that.

The last thing left was to resize the hard drive. This time I used qtparted and ntfsresize to resize the partition. You can get those utilities in knoppix. A lot of information are available online about how to reduce the ntfs partition size but I needed to do the opposite. Using qtparted and ntfsresize was a smooth ride. You must use qtparted to resize the partition and then ntfsresize to resize the volume if you are making a partition bigger.

Overall this saved me a lot of time, otherwise I'm still reinstalling all my applications and migrating data. Mostly likely, digging around for the installation media.

Wednesday, March 08, 2006

Subversion with ApacheSSL on Win32

After getting Apache2 + SSL running sucessfully, I started to install subversion.

Install Subversion

Download 1.3.0 installer (the setup.exe version) from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91 and run the executable. The installer not only installed Subversion but also modified the Apache http.conf file by adding two modules and restarted the Apache server.

Create Subversion Repository

Launch a command prompt and run this: svnadmin create c:\svnrepo

Import Source into repository

svn import "C:\path\to\project" file:///svnrepo -m "initial import"

Link apache to repository

Add location directive to the https virtual host in the ssl.conf file.

<location>
  DAV svn
  SVNPath "C:/svnrepo"
</location>

Restart the Apache server and launch browser to https://www.my-site.com/svn/

Enforce security

Go to Apache's conf directory and run command below to create two user account. Note: the first command has -c option to create the password file.

..\bin\htpasswd -cm svn-auth-file user1
..\bin\htpasswd -m svn-auth-file user2

Edit the ssl.conf file to change the section we just added as below.

<location>
  DAV svn
  SVNPath "C:/svnrepo"
  AuthType Basic
  AuthName "Subversion repository"
  AuthUserFile "conf/svn-auth-file"
  Require valid-user
</location>

Final Restart

Restart the Apache server and launch the browser. We did it!

Apache2 + SSL + Win32

I have been following the instructions posted here by Raible to get Apache2SSL running on Win32. Well, there were something extra that I had to do to get it working finally.
  1. Download precompiled Apache2 binary with SSL module from http://hunter.campbus.com/ and extract them to
    C:\Program Files\Apache2
    .
    You can place it anywhere in your drive.
  2. Find two ddl files ssleay32.dll and libeay32.dll in the installation directory and copy them to
    %SYSTEMROOT%/system32.
  3. Followed the instruction to create the test cert. I have cygwin so it was simple the only difference is that I didn't need to use -config option.
    • openssl req -new -out server.csr
    • openssl rsa -in privkey.pem -out server.key
    • openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650
  4. Create a subdir called ssl.crt under conf and place the genereated file server.crt and server.key there.
  5. edit httpd.conf file (The instruction on Raible's site didn't work for me on this part):
    • Uncommented this line LoadModule ssl_module modules/mod_ssl.so
    • Replaced all c:/apache with the installation directory. (Note that I use forward slash)
    • Removed line <IfModule mod_ssl.c> and it's closing tag to force include ssl.conf.
  6. edit ssl.conf
    • Removed line <IfDefine SSL> and it's closing tag to force SSL
    • Replaced all c:/apache.
    • Changed ServerName to your site name. Changed ServerAdmin too but should have no impact.
Start Apache and test, it works now! My next task is to get Subverion working with ApacheSSL on Win32...