Installing and Configuring SquidNT 2.7 on a Windows Domain

Posted on the January 14th, 2009 under Installs by admin

If your company is looking to beef up its security somewhat then a free and flexible proxy is a good thing to have. A proxy such as squidnt sits between your users and the Internet and handles requests, usually for websites. It can provide protection for users and use a web cache to make browsing faster. SquidNT is a free Windows version of the popular linux based proxy.

In this How To Solutions guide I’ll walk you through …

  • installing SquidNT
  • configuring browsers to use the proxy
  • Using user authentication across a Windows domain
  • Blocking websites of your choice
  • Accessing and reviewing web logs of sites users have visited

I write this merely because nearly all of the documentation is for Linux or is outdated and not centralised. This was installed on a Windows XP machine but I imagine it will work on Windows Server 2003 too.

Installing SquidNT

Download SquidNT 2.7 here – you’re looking under binaries for 2.7 STABLE5, the Standard build type which is in zip format.

Unzip the squid file to your desktop. This should create a squid folder – move it into your C: drive at the top level. Don’t put it in Program Files! Squid doesn’t like spaces in folder structures.

Open up CMD by clicking Start > Run > typing “cmd” > OK. Type in the following commands, pressing Enter after each line.

cd c:\squid
cd sbin
squid.exe -i

Leave the cmd window open. This will install SquidNT as a Windows service – starting it when the computer first boots.

In Windows Explorer navigate to C:\squid\etc. Rename the four files in there so that the .default extensions are removed from all of them.

Next we will create the Squid cache directories. This should improve browser performance by caching websites locally reducing the need to download each item on the webpage. Create the directories by again using CMD to run the following command:

C:\squid\sbin>squid -z

We can now start Squid running. Open up Windows services by clicking Start > Control Panel > Administrative Tools > Services. You should see Squid listed there – right click it and Start.

Configuring Browsers

Firefox (v2)

Tools > Options > Advanced > Network tab > Settings.

Click on “Manual proxy configuration” and enter the IP of the machine which SquidNT was installed. For the port use 3128 (the squid default).

Internet Explorer (v7)

Tools > Internet Options > Connections tab > LAN Settings

Under the proxy server section click the “Use a proxy server for your LAN” box. For the server use the IP of the machine SquidNT was installed on and use port 3128 (the default for Squid).

Testing

Once the settings are saved in the browser of your choice then test to make sure you can still access websites. You can see the access logs if you navigate to C:\squid\var\logs\access.log and open it in a text editor.

User Authentication on a Windows domain

If you’re going to run the Squid proxy over a Windows domain using Active Directory then rather than log an IP address you can set Squid to log authenticated users. This comes in particular use when reviewing the logs later on.

Open up Windows Services (Control Panel > Administrative Tools > Services) and stop Squid. You need to go to C:\squid\etc and open the squid.conf file in a text editor.

Go to line 292 which should be a blank line below “#auth_param basic casesensitive off”. Paste in the following and leave a blank line below it.

auth_param ntlm program c:/squid/libexec/mswin_ntlm_auth.exe
auth_param ntlm children 5

We then determine the access control list (ACL) that will allow only authenticated users on the network to go through the proxy. Navigate to line 623 (it might be a few lines more due to the previous input!) and look for the blank line below “acl CONNECT method CONNECT”. Paste in the following

acl localnet proxy_auth REQUIRED src 10.0.0.1/255

Note: Change th IP range to suit your specific network. I have used 10.0.0.x as an example but you may use another range.

Once that is pasted in scroll down again until line 649 (again this will be lower due to the two previous pastes. Look for the line that reads “http_access deny manager”. Under that line paste the following…

http_access allow localnet

At this point you should save the squid.conf file and restart Squid as a Windows Service. Go back to your favourite web browser and make sure you can still access sites. Again you can check the access logs (C:\squid\var\logs\access.log) to make sure the Windows authentication is being recorded.

Blocking Websites

A very good reason to use a web proxy is to block websites across a network that could be potentially harmful. Again we’ll need to use the squid.conf file to declare which sites to block.

Open up squid.conf and look for where you pasted in “acl CONNECT method CONNECT” around line 628. Create a new blank line BELOW this line. It should be directly above an earlier line you pasted in (acl localnet proxy_auth REQUIRED src 10.0.0.1/255). Paste in the contents below making sure to edit the URLs. I have used Facebook and Myspace as an example but you can use anything.

acl facebook url_regex facebook.com
acl myspace url_regex myspace.com

This should create something that looks like what is in the box below.

acl CONNECT method CONNECT
acl facebook url_regex facebook.com
acl myspace url_regex myspace.com
acl localnet proxy_auth REQUIRED src 10.0.0.1/255

Now let’s look for line 655 (again it will be somewhere near there but depends on the earlier pastes). Look for the line that reads “# Only allow cachemgr access from localhost”. Make the http_access lines read like in the box below. It is important to make sure “http_access allow localnet” is the last line in this section. If you have added more sites to be blocked then use “http_access deny name”, where ‘name’ is what you defined in the acl section (acl name url_regex urlforname.com).

http_access allow manager localhost
http_access deny manager
http_access allow manager localhost
http_access deny manager
http_access deny facebook
http_access deny myspace
http_access allow localnet

Lastly scroll up to line 613 (or there abouts). Look for the section that reads like the box below. We don’t want to include this section so put a hash sign (#) before each acl statement.

acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network

Save squid.conf and close the file. Restart the Squid service and make sure your browsers can see the Internet.

Reviewing Web Logs

To review Squid logs I wouldn’t recommend opening the log file in a text editor. I’ve previously used Kraken Reports though it’s not very nice to look at. In fact all free Squid log analysers for Windows I’ve seen are fairly horrible. It would be nice to find a well made one that was more flexible.

Abit IP35-E Wont POST or boot

Posted on the January 8th, 2009 under Hardware by admin

If you have an Abit IP35-E motherboard and your computer suddenly wont boot then this is the help you need.

The Problem: You go to turn on your computer and all the power and fans come on but there is no POST (power on self test) beep and the machine wont boot. Instead the computer just stays on with the screen remaining blank.

Solution: Firstly turn the machine off and remove all of your USB devices and any other non essential adapters. Boot up the computer and you should get an error message..

BIOS ROM Checksum Error
Detecting floppy drive A media
Drive A error. System halt

This will lead you to believe and many people will inform you that you need to flash the BIOS. This isn’t true. That’s because without getting to some kind of command prompt this is impossible.

The Solution: Remove your RAM! If you have two or more sticks then remove them until you have just one and try booting up again. Make sure to try each stick of RAM on its own. If you only have one stick of RAM then I’d suggest borrowing the same kind or any compatible memory you can get your hands on.

Your computer should boot normally and possibly bring up an error about not being able to detect the CPU. You should be prompted to press F1 to continue, do that and you should go into Windows. I then powered back down and put the stick of RAM back in and again Windows booted fine but only listed one stick (1GB) as being installed.

And in case you’re wondering the RAM is Crucial Ballistix (I think it’s the DDR2 PC2-6400/DDR2-800).

How to print a list of files from a Windows directory

Posted on the January 4th, 2009 under Windows by admin

Click on Start, then Run. In the run dialogue box type cmd and click OK.

This will open a DOS prompt usually pointing to your users My Documents folder in Documents and Settings.

If you wanted to get to a folder called Movies on your E drive then you would type:

E: and then “cd Movies“. This is demonstrated in the image below.
List a Windows directory

To create the list then type “dir > movielist.txt” naming the text file anything you want. If you want to only export the file names without the file size details then use “dir /b > movielist.txt“. The movielist.txt file will be within the directory it has listed.

How To enable Windows remote desktop remotely

Posted on the January 2nd, 2009 under Windows by admin

Often at work I need to use another PC or log onto a server. Windows systems don’t have remote desktop working by default so rather than have to walk somewhere I’d rather just do it remotely. Here’s how…

Firstly click on Start and then Run. In the box type in “regedit” and hit Enter.

Then click on File and Connect Network Registry as shown in the image below.

Connect Network Registry - Regedit

This will allow you to connect to another computers registry settings and make the needed changes.

In the next box you can enter the name of the remote computer or browse for it. This will work if you’re on either a Windows workgroup or on a domain. See the image below.

Remote Registry Connection

Once you’ve selected the computer click OK and the computer should now be listed in your Registry Editor at the bottom on the left. You need to navigate your way through the hierarchy and go to the following directory: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server.

Clicking on the Terminal Server folder you should see the window on the right populate with about 20 files. Look for fDenyTSConnections. Right click it and click Modify. A box similar to the one below should appear. Simply change the Value Data from 1 (Remote Desktop enabled) to 0 (Remote Desktop enabled).

DWORD Remote Desktop Registry

Once this is changed then click OK to save the change. Remote Desktop will only be enabled once the machine is rebooted; this can also be done remotely. Open up a command prompt (Start > Run > “cmd“) and type: “shutdown -m \\WORKGROUP\PROMETHEUS -r” changing the computer name to the one you connected to.

How To Solutions PageRank Update and 2009

Posted on the January 1st, 2009 under How To Solutions by admin

Just yesterday on New Years Eve 2008 Google did their quarterly PageRank (PR) update. How To Solutions jumped from PR3 to PR4 – back to where it was shortly before this site went live. Not only that but some of the individual pages got their own PageRank.

SQL Week by Week – Now PR2

How To Audit Your Computer – Now PR2

Changing the default font in Office 2007 – Now PR2

How to add a HTML signature to Outlook 2007 – Now PR2

Javascript Wildcard with jQuery – Now PR2

How to add my blog to Google Blog Search – Now PR2

It seems that Google has ranked these pages as they are some of the older and better established pages on the site. Not only that but these pages perform the best through organic search (users typing a search term directly into Google and coming to the site). Considering I have very very few inbound links then the increased PR should greatly help the strength of the site. The How To Install Trac on Windows guide still gets the most daily traffic but this is purely from links and not Google searches.

In 2009 How To Solutions hope to provide more technology solutions. These will probably be based around more javascript, PHP/ASP, SQL, and Wordpress/SEO matters. One of these days I’ll actually put up a form on the contact page.