Create your own torrent download server - Part 2
Okay, if you've got uTorrent running and accessible via a browser (locally and remotely) we're ready to install it as a Windows Service.
Install uTorrent as a Windows Service
We need a couple of tools to do this, I downloaded them with the Windows 2003 Resource Kit. The two files are
instsrv.exe and srvany.exe
and available to download on this page.
Copy these files into the program directory you have created for uTorrent. Get a command prompt by Start -> Run and entering CMD at the prompt.
At the command line get into the uTorrent directory using the cd command. Then run the following command. Where uTorrent is the name of your uTorrent folder in Program Files. If you've installed this elsewhere amend the path accordingly.
instsrv uTorrent "C:\Program Files\uTorrent\srvany.exe"
This creates the appropriate Registry Entries to manage the service. Srvany.exe acts as a wrapper to the uTorrent.exe and allows it to be managed as a Windows Service.
Okay, now we need to make a tweak to the registry, to basically map the path of the uTorrent.exe that Srvany.exe has to manage. Do this by creating a .Reg file using notepad
Paste in the code below.
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\uTorrent\Parameters] "Application"="C:\\Program Files\\utorrent\\utorrent.exe"
You can navigate to the registry and make the same change. You've now done enough to get an entry in the Windows Services Database and you can now access it via the Services section of Microsoft Management Console.
Once in Services you can configure the User Account that uTorrent runs under when it runs as a service. See below. My service is already running in these shots.
You need to configure it so that it starts automatically (screen shot 1), and make sure that the user it logs on as is the same one you configured uTorrent with in part 1.
Now start it. Use MMC and simply click start. You can do it from the Command line by typing Net Start uTorrent
The service should start, and if you fire up a browser you should be able to access uTorrent's WebUI via the URL with the UID, PWD and Port you configured uTorrent with in Part 1.
That's it, you now have a torrent server that you can use for your downloads without having to keep the box logged on with a UserID.
I was also running PeerGuardian2 from Phoenix Labs on my old desktop, to protect my privacy
Using the same tools I configured this as a service too.
I'm not a huge online gamer, but occasionally I play Halo 2 on the Kai network. My Xbox connects to the Kai network via the XLink Kai engine on my server. Previously this ran on the desktop, but with some effort I eventually got it running as a service. You can see it at the bottom of my service list on the screen print above.
I hope these articles were useful, and if you weren't using uTorrent you are now.
A self confessed Microsoft bigot, Paul loves all Microsoft products with a particular fondness for SQL Server. Paul is currently focusing on Web 2.0 patterns and practices and is always looking for better ways of doing things.
I love the .net platform, and I find it to be the most productive toolset I have used to date.