Sunday, 4 September 2011

Setting up IIS 7.5 and Apache on same server

Recently I was asked to set up IIS 7.5 and Apache on same server to run different applications - one on .NET and another of PHP. Initially, I considered running PHP on IIS but discarded this option since the client did not want to take the risk of trying out something new. They had run the app on Apache and wanted it that way.

Turns out running IIS and Apache together is a relatively easy task. The server will require atleast two IP addresses. One IP will be used by IIS and another by Apache.

By default, when IIS is installed it will listen on all IP addresses assigned to the server. To make this work, IIS needs to be configured to listen to only one address.
1. Open command prompt
2. Type "netsh"
3. Type "http"
4. Type "sho iplisten"
5. Type "add iplisten ipaddress=192.168.1.1 (replace by correct IP address)
6. Type "sho iplisten" - this will show the added IP address
7. Exit and restart IIS services

In the next step, we have to configure Apache to listen to the correct IP address
1. Open httpd.conf in Apache folder
2. Search for "Listen" and change to "Listen 192.168.1.1:80" (replace by correct IP address)
3. Save and restart Apache services

Open browser and navigate to both IP addresses and ensure the correct server is responding.

Thursday, 1 September 2011

Easy migration to a new system on Windows XP & Windows 7

My friend just bought a new desktop and replaced his old one. He wanted to migrate all this stuff to the new desktop. He was using Windows XP on the old system and wanted to continue using the same on the new system. He started by copying files manually from all the drives. I was surprised by this action because both Windows XP and Windows 7 provide a easy utility for exactly this purpose. And it works too!!!

I have done this enough number of times in my job that I can confidently say it should be the only way to migrate. This also works for Migrating between Windows XP (old system) and Windows 7 (new system)

Windows XP has Windows Easy Transfer utility that allows you to transfer settings and data files. It works best if you have an external HDD to store the data during transfer. Alternatively you can backup over the network but I find it very slow. If you are a system admin you can also backup to local drive and then move the physical HDD to the new system before restoring.

It is easy to use and all it requires is to follow the on screen instructions. Remember to install all applications that you need on the new system before doing the transfer. Otherwise settings for those apps will not be migrated.

Both utilities (XP and 7) also allow customization of settings and data files to move. It is possible to select or exclude specific applications, drives and folders during this process.



Thursday, 25 August 2011

Automatically clean browser history

As a web developer there are times when I have to clear browser history (including cookies) to test app behavior for a first time user. During development this can become painfully slow - open browser, open tools->options, open privacy tab and then delete history.

The new versions of Firefox and IE now support automatic browser history cleanup. In Firefox, you can configure "Never remember history" on the Privacy tab in Tools->Options. In IE 9, "Delete Browsing History on exit" can be configured on the General tab in Tools-Options.

Since this setting s not optimal for regular use, I use a separate browser for regular and development. In my case, I have Firefox configured with this setting and use it for testing during development. I use IE and Chrome for my regular browser usage. This way, after developing on Firefox, I only have to test it once on IE and Chrome thereafter.

Monday, 22 August 2011

Changing domain IP address without modifying DNS

Sometimes it is required to change the domain-ip mapping of a domain without actually modifying the DNS records. I usually require this for sanity testing before moving applications to a new server.

In such cases one option can be to use a secondary domain or a subdomain pointing to the new server and then complete testing.

Sometimes, applications are hard coded to use a specific domain name, thereby leaving no alternative but to test with the domain name only.

One solution to this problem is to modify the local hosts file. Thankfully Windows (from the early versions) uses a file called "hosts" (without any extension) to map domain names to ip addresses. This file contains no mappings by default but can be used to setup local domain-up mapping. Any mapping set here will only affect this system and will not cause any network wide changes.

This file is located in "c:\windows\system32\drivers\etc" folder where "c" refers to the root windows drive. This file is plain text and can be edited in notepad.

A sample mapping would be (one mapping per line)
192.168.1.1     www.1nine.com

By adding this line, any DNS queries to www.1nine.com will be translated to 192.168.1.1 instead of the mapping in public DNS servers.

Remember to remove this mapping after testing. Forgetting to remove this mapping can cause some serious trouble later. I have spent hours debugging application problems because of leftover mapping from previous test runs.

Saturday, 20 August 2011

Useful shortcuts equivalents on MacBook Air with Windows 7

On my new MacBook Air I installed Windows 7. Initially I had a tough time because I am very much used to PgDn, Home, PgUp & End keys on my previous laptop.

MacBook Air does not have these keys at all. After some research I found the following shortcuts equivalents:

PgUp - Fn key + Up Arrow
PgDn - Fn key + Down Arrow
Home - Fn key + Left Arrow
End - Fn key + Down Arrow

Ctrl key can be used along with these combinations to simulate Ctrl+Home, Ctrl+End, etc

In addition, tapping on the trackpad and right clicking can be enabled through Boot Camp in Control Panel.

Wednesday, 17 August 2011

Entry Level New MacBook Air Windows Experience Index

A friend of mine got the entry level version of the new MacBook Air. Here is his configuration:

11.6" MacBook Air
Intel Core i5-2467M CPU @ 1.6Ghz
2 GB RAM
64GB HDD
Windows 32bit

Windows Experience Rating: 5.5
Processor: 6.3
Memory: 5.5
Graphics: 5.6
Gaming Graphics: 6.3
Disk: 6.8

Monday, 15 August 2011

Slow bootup in MacBook Air, Windows & Bootcamp

After installing Windows 7/Bootcamp on my MacBook Air, it started taking a lot of time to boot up. After power up it would show the gray/white screen for about 45 seconds and then it would start the Windows load process.

Other users have also faced the same problem and have suggested:

1) Reset NVRAM
2) Reset master boot record, partition info
3) and many others - a quick Google search will reveal many such fixes

None of these worked for me. I started taking a fresh look and figured out it was a problem with the MacBook and not my Windows setup.

Further research revealed that MacBook tries to find the bootable volume and that takes time. If the default volume is set then it would not take time.

To solve this problem, launch Windows 7, run Bootcamp From Control Panel. In the first screen select the windows volume and set it as default startup volume. Click ok to apply changes and restart.

Now the startup time is reduced to 5 seconds.