Setting up Squid cache

Started by SBM user

SBM user

Setting up Squid cache   01 October 2010, 14:16

I just setup squid using andres forum...[www.softperfect.com]. I got it to work in SBM but was wondering how do I setup the cache. Does it automatically pick up what I use and save it or do I have to tell it to. Please help Thank you

Help with Squid Please   01 October 2010, 20:13

Well if squid is active, most probably it would cache something yes. You can look up the logs to see if you get hits, the file is called "access.log".
There is another file, "cache.log" that logs messages, can be used to look up errors/events.
And yes, squid automatically caches some content, but not everything.
You can change some settings in squid.conf but it should work with basic settings.

Cheers,
Arthur.
SBM user

Help with Squid Please   01 October 2010, 21:16

thanks for you help two more questions on this. I went to access log and it was blank. Is this ok? and I searched on google and it said to go to.. www.whatismyipaddress.com when I go there it said there is no proxy does this mean its working or not? here is my cache.log does it look alright?


2010/10/01 15:40:57| Starting Squid Cache version 2.7.STABLE5 for i686-pc-winnt...
2010/10/01 15:40:57| Running as Squid Windows System Service on Windows Vista
2010/10/01 15:40:57| Service command line is:
2010/10/01 15:40:57| Process ID 4164
2010/10/01 15:40:57| With 2048 file descriptors available
2010/10/01 15:40:57| With 2048 CRT stdio descriptors available
2010/10/01 15:40:57| Windows sockets initialized
2010/10/01 15:40:57| Using select for the IO loop
2010/10/01 15:40:57| Performing DNS Tests...
2010/10/01 15:40:57| Successful DNS name lookup tests...
2010/10/01 15:40:57| DNS Socket created at 0.0.0.0, port 65162, FD 5
2010/10/01 15:40:57| Adding DHCP nameserver 203.80.182.43 from Registry
2010/10/01 15:40:57| Adding DHCP nameserver 203.80.182.45 from Registry
2010/10/01 15:40:57| Adding nameserver 203.80.182.43 from Registry
2010/10/01 15:40:57| Adding nameserver 203.80.182.45 from Registry
2010/10/01 15:40:57| Adding domain from Registry
2010/10/01 15:40:57| User-Agent logging is disabled.
2010/10/01 15:40:57| Referer logging is disabled.
2010/10/01 15:40:57| logfileOpen: opening log c:/squid/var/logs/access.log
2010/10/01 15:40:57| Unlinkd pipe opened on FD 8
2010/10/01 15:40:57| Swap maxSize 102400 + 8192 KB, estimated 0 objects
2010/10/01 15:40:57| Target number of buckets: 425
2010/10/01 15:40:57| Using 8192 Store buckets
2010/10/01 15:40:57| Max Mem size: 8192 KB
2010/10/01 15:40:57| Max Swap size: 102400 KB
2010/10/01 15:40:57| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2010/10/01 15:40:57| logfileOpen: opening log c:/squid/var/logs/store.log
2010/10/01 15:40:57| Rebuilding storage in c:/squid/var/cache (DIRTY)
2010/10/01 15:40:57| Using Least Load store dir selection
2010/10/01 15:40:57| Set Current Directory to c:/squid/var/cache
2010/10/01 15:40:57| Loaded Icons.
2010/10/01 15:40:57| Accepting transparently proxied HTTP connections at 0.0.0.0, port 3128, FD 13.
2010/10/01 15:40:57| Accepting ICP messages at 0.0.0.0, port 3130, FD 14.
2010/10/01 15:40:57| Accepting HTCP messages on port 4827, FD 15.
2010/10/01 15:40:57| Accepting SNMP messages on port 3401, FD 16.
2010/10/01 15:40:57| Ready to serve requests.
2010/10/01 15:40:58| Done scanning c:/squid/var/cache (0 entries)
2010/10/01 15:40:58| Finished rebuilding storage from disk.
2010/10/01 15:40:58| 0 Entries scanned
2010/10/01 15:40:58| 0 Invalid entries.
2010/10/01 15:40:58| 0 With invalid flags.
2010/10/01 15:40:58| 0 Objects loaded.
2010/10/01 15:40:58| 0 Objects expired.
2010/10/01 15:40:58| 0 Objects cancelled.
2010/10/01 15:40:58| 0 Duplicate URLs purged.
2010/10/01 15:40:58| 0 Swapfile clashes avoided.
2010/10/01 15:40:58| Took 1.2 seconds ( 0.0 objects/sec).
2010/10/01 15:40:58| Beginning Validation Procedure
2010/10/01 15:40:58| Completed Validation Procedure
2010/10/01 15:40:58| Validated 0 Entries
2010/10/01 15:40:58| store_swap_size = 0k
2010/10/01 15:40:59| storeLateRelease: released 0 objects

Thank You for your help
SBM user

Help with Squid Please   01 October 2010, 22:48

They only way I have got squid to work with SBM is on my rule setup for squid I have to use local host for source. is this correct cause i know under andrew tutorial it say use ip range?

Help with Squid Please   04 October 2010, 08:32

Squid is running, but it is not caching any objects. There are at least two problems with your setup:

1. 2010/10/01 15:40:57| Accepting transparently proxied HTTP connections at 0.0.0.0, port 3128, FD 13. << You need to specify the IP address of the network card for Squid. That is done in Squid.conf. Choose the IP of the card facing the LAN side.
2. Cannot use localsource in your ruleset. It must be IP, MAC or IP range from the users machine, else the rule would not have any effect for them. Localhost as source means you are limiting the BWM computer only.

Please read carefully and create a port mapping, set up your bridge and static route as described in my short guide here on the forum. Then in the BWM rule intercept all traffic on port 80 and redirect it to the previously defined port mapping.
Please note that Windows firewall has to be deactivated else it won´t work.

Getting hits wil look like this:

1284596803.136     31 192.168.1.16 TCP_HIT/200 3461 GET [xxx.xxxxxxxxxx] - NONE/- text/css
1284596803.136      0 192.168.1.16 TCP_HIT/200 7074 GET [xxx.xxxxxxxxxx] - NONE/- image/gif
1284596803.151     46 192.168.1.16 TCP_HIT/200 13051 GET [xxx.xxxxxxxxxx] - NONE/- text/css
1284596803.683   1407 192.168.1.16 TCP_MISS/200 37447 GET [xxx.xxxxxxxxxx] - DIRECT/91.192.108.231 text/html
1284596803.917    156 192.168.1.16 TCP_MISS/200 466 GET [xxx.xxxxxxxxxx] - DIRECT/74.125.45.113 image/gif

Not every object can be cached, this is normal.

Cheers,
Arthur.
SBM user

Help with Squid Please   04 October 2010, 16:52

I got the setup right in sbm, now where do i go into on squid.conf to setup my network card. I looked all inside there and dont know where to put my network card at. Can you please give me an example of the line where I need to change please. Thanks
SBM user

Help with Squid Please   04 October 2010, 20:44

Arthur,
After playing around I did this to it. how does this look now?



Accepting transparently proxied HTTP connections at 192.168.0.3, port 3128, FD 14.
2010/10/04 14:13:02| Accepting ICP messages at 0.0.0.0, port 3130, FD 15.
2010/10/04 14:13:02| Accepting HTCP messages on port 4827, FD 16.
2010/10/04 14:13:02| Accepting SNMP messages on port 3401, FD 17.
2010/10/04 14:13:02| Ready to serve requests.
2010/10/04 14:13:11| Done reading c:/squid/var/cache swaplog (0 entries)
2010/10/04 14:13:11| Finished rebuilding storage from disk.
2010/10/04 14:13:11| 0 Entries scanned
2010/10/04 14:13:11| 0 Invalid entries.
2010/10/04 14:13:11| 0 With invalid flags.
2010/10/04 14:13:11| 0 Objects loaded.
2010/10/04 14:13:11| 0 Objects expired.
2010/10/04 14:13:11| 0 Objects cancelled.
2010/10/04 14:13:11| 0 Duplicate URLs purged.
2010/10/04 14:13:11| 0 Swapfile clashes avoided.
2010/10/04 14:13:11| Took 8.6 seconds ( 0.0 objects/sec).
2010/10/04 14:13:11| Beginning Validation Procedure
2010/10/04 14:13:11| Completed Validation Procedure
2010/10/04 14:13:11| Validated 0 Entries
2010/10/04 14:13:11| store_swap_size = 0k
2010/10/04 14:13:12| storeLateRelease: released 0 objects
SBM user

Help with Squid Please   04 October 2010, 20:54

Ok update,
I got these under access I believe this is right. the only problem I am seeing is running squid extremly slowed down my whole internet. can you please tell me why? or what info I can send to you to get it at least as fast as it was?

1286185679.484 5351 192.168.0.118 TCP_MISS/302 793 GET [www.google.com] - DIRECT/74.125.53.105 text/html
1286185680.133 27000 192.168.0.103 TCP_MISS/000 0 GET [02583432033.100.channel.facebook.com] - DIRECT/69.63.180.46 -

Help with Squid Please   07 October 2010, 05:17

Hi,

It seems that your setup is working now. If your internet is slow, there could be a change your BWM ruleset is not correct.
Squid normally doesn't slow internet, it only caches objects.
If there are problems, the same "cache.log" file will show them. Check it often.

On another note, the whole squid concept is not all that spectacular. I mean, to see the benefits you need to have a lot of users, and still then the hit-miss ratio is rather disappointing.

Please post your rules here and we can take a look. If you like, attach your squid.conf also.

Cheers,
Arthur.

Help with Squid Please   07 October 2010, 21:10

Here are the attach files you requested.The lan2 on there is facing towards the router/modem and the lan is facing the switch/client. Any more questions I will send you what you need. Thank you for your help.
Attachments:
open | download – squid.zip (51.3 KB)

Help with Squid Please   07 October 2010, 21:11

heres my rule list
Attachments:
open | download – SBM.zip (2.9 KB)
SoftPerfect Support forum - Andrew avatar image

Help with Squid Please   08 October 2010, 05:56

As far as I can tell there is a possibility that the last rule called "Not in network" could be blocking vital ICMP messages. Try to temporarily disable the blocking rule to see if the speed improves.

Reply to this topic

Sometimes you can get the answer faster if you try the forum search and/or have a look at the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

  ******   **    **  **     **  **         **     ** 
 **    **   **  **    **   **   **    **   **     ** 
 **          ****      ** **    **    **   **     ** 
 **           **        ***     **    **   ********* 
 **           **       ** **    *********  **     ** 
 **    **     **      **   **         **   **     ** 
  ******      **     **     **        **   **     ** 

Message: