Switching between Running Apache and IIS in Windows

When one installs Apache in Windows Machine where IIS is installed, starting Apache will give the following error :

The Apache service named  reported the following error:
>>> (OS 10013) An attempt was made to access a socket in a way forbidden by its access permissions.
:make_sock: could not bind to address 0.0.0.0:80.

The reason is both the servers listen on Port 80. Even though you can make one of the servers to listen in different port it is too many changes to make things work.

Easier way is to have these servers running alternatively using simple batch scripts.

Apache and IIS are both launched as a Windows service — open Administrative Tools > Services. Locate Apache and IIS (W3SVC – World Wide Web Publishing Service) and set both Startup types to Manual:

IIS TCP port bindings

(Make a note of Apache’s service name — in the screenshot above, it’s “Apache2.2″.)

Neither server will run when your PC is booted. To start and stop the services, create 4 batch (.bat) files in the same folder.

start-apache.bat
This will stop IIS and start/restart Apache. (Note that ‘Apache’ is assumed to be the service name in the third line, but your installation may be different.)


@call stop-iis.bat
@call stop-apache.bat
@net start Apache

stop-apache.bat
This will stop Apache (change the service name if necessary).


@net stop Apache

start-iis.bat
This will stop Apache and start/restart IIS.


@call stop-apache.bat
@call stop-iis.bat
@net start W3SVC

stop-iis.bat
This will stop IIS on Windows Vista or 7.


@net stop was /y

stop-iis.bat
This will stop IIS on Windows XP or earlier.


@net stop iisadmin /y

You can double-click these files to run them or create desktop / start menu shortcuts for easier access.

Source : sitepoint.com

Installing Windows 8 in Windows 7 box with Dual boot option

I have written a post before about installing Windows 8 RC on a VHD and dual booting it.   Now Windows 8 RTM version is available (MSDN Subscribers) only at this point of time. General availability is expected on October 26th.

Steps to Install Windows 8 on a Windows 7 Box.

1. Open Device Manager from the Windows Control Panel or simply type devmgmt.msc from the command prompt or Windows -> Run.

2. Create a Partition by Shrinking the volume.

3. Specify the amount of space to shrink from the available space displayed.

4. Now specify a drive for the new Volume.

5. Create a Windows 8 Install Media. If you want to install Windows 8 from a USB Drive d ownload the Windows 7 USB/DVD download tool and follow the steps in the tool to load the image into the USB drive.

6. During the installation select the option to Install as a new install (Do not select Upgrade).

7. Install Windows 8 on the newly created volume (Step 4).

Now Windows 8 will be installed and you have the dual boot option to Windows 7/Windows 8.

Easy way to install packages

 

I wrote about the Ninite tool to install common softwares in one shot.

If you want to install more software packages which is not supported by this tool and want to install the packages from command line check the tool chocolatey.

All you have to do is install this tool and then from the command line install the package you want to install.

Eg. c:\> cinst 7zip will install the 7zip for you.

There are 290+ packages supported currently with this tool.

 

Robocopy – A cool way to copy bulk files

Robocopy is a cool way to copy the files instead of using Windows explorer or  using copy and xcopy commands and it supports Multithreading in Windows 7 & 8.

Robocopy provides the ability to

  • Resume copy from where it left off (Both local & network)
  • Copy file data and attributes correctly
  • Mirror the folders from Backup drive to main drive. – I use to backup by photos & Music (Eg. Robocopy c:\myfiles e:\myfiles /MIR)
  • Skip files that already appear in the destination folder with identical size and timestamp.
  • Copy file and folder names exceeding 256 characters.
  • Specify the number of threads to use (Max. 128) (Eg. Robocopy c:\myfiles e:\myfiles /MIR /MT:10)

For a full set of command line options check it here.

Try it out.  If you want a more advanced option than what robocopy provides try RichCopy.

Setting up a Development Machine

Common tools(Browser, Messaging, Media, Runtimes, Imaging, Security, Filesharing,utilities, developer tools) easy one step installer – Visit this site.. This will install all the above common tools with one click.

LINQPad – lets you interactively query databases in amodern query language and also you can learn LINQ & C# samples (5.0 included).

Fiddler – Don’t forget to add the addons.

Installing Windows 8 in a Virtual Hard drive (VHD) or in an external Hard drive

Windows 8 Release preview is released yesterday and i was looking around to install it in my laptop. Well.. If you do a upgrade with the existing OS it becomes a pain later.. Most of the programs won’t work etc.. Searching around i found 2 excellent ways to install it.

1. Install it in a VHD and have Windows 8 booted as dual boot.

2. Install it in a external HDD.

Scott Hanselman has written an excellent post of installing Windows 8 in a VHD with plain simple steps and it works great and all you need is :

1. 40 GB of HDD

2. USB Drive to have the Windows 8 ISO.

Manas Patnaik has written a post of installing Windows 8 in an external HDD. Read it if you want to go through the route of installing it in an external HDD.

If you want to install SQL Server 2012 from command line in Windows 8 Machine follow these steps.