Skip to main content
Welcome guest. | Register | Login | Post

Setting up squid

9 replies [Last post]
libervisco's picture
Offline
Joined: 2006-05-04

I have been advised to set up a squid proxy to decrease my bandwidth usage through caching and compressing data transfered.

So I installed squid via apt-get and am now trying to properly set it up to work, not with much luck as it appear though. I went through the /etc/squid/squid.conf file and uncommented some basic settings, but I am still getting a "The requested URL could not be retrieved" error when trying to access http://localhost:3128/ to see if it is working.

I've also ran the squid -k reconfigure to apply config changes. In it's access and cache log I don't see anything that would positively confirm that it is chaching pages.

So I'm not sure what should I do. Are there any easy to follow tutorials on setting squid up on desktop GNU/Linux machines for purpose of decreasing bandwidth consumption? Most of all FAQs, HOWTO's and such that I've found are stuff oriented at full server and network setups (like ISPs) while I only need a simple caching proxy on the desktop.

Anyone knows anything about it?

Thank you
Daniel

tbuitenh's picture
Offline
Joined: 2005-12-21

Why don't you just make the disk cache of your browser really big?

libervisco's picture
Offline
Joined: 2006-05-04

Good idea.. I just increased it from 50 to 300MB at least until I figure this out.

But I am already considering maybe getting a satelite DSL for downstream traffic to combine with GPRS/EDGE for upstream. That way I'd have a fixed subscription per month since the sat adsl is flat-rate and upstream is much easier to keep below 512 MB a month (included in the GPRS/EDGE subscription).

Squid would probably help for EDGE downstream, but I'm not sure how much could it really save up for me and it doesn't cover direct downloads that are also sometimes neccessery (no, not music and video downloads, but software and updates).

Squid looks like a good idea either way though.. (acceleration, access control in addition to traffic control).

Thanks
Daniel

tbuitenh's picture
Offline
Joined: 2005-12-21

As far as I know proxies only make sense if you have multiple users using the same computer for the same websites, or multiple computers.

GPRS upstream + satelite downstream... damn I'm jealous. The only thing you still need is solar panels, then you will be completely wireless :grinning:

tbuitenh's picture
Offline
Joined: 2005-12-21

I poked around in the squid FAQ a bit...

1) access control: you might block stuff you don't want to download with this, but do you really need something that powerful? I think it's for firewalls of big networks. I'd use the adblock firefox extension instead.

2) acceleration: that's server side acceleration (squid sitting in front of apache on the server). It doesn't make sense for you to use it unless you plan to serve websites from your home computer (and get a really expensive GPRS bill).

So, I think you're trying to use an electric drill to pick your nose: it might work, but it's not the right tool for the job.

libervisco's picture
Offline
Joined: 2006-05-04
"tbuitenh" wrote:

GPRS upstream + satelite downstream... damn I'm jealous. The only thing you still need is solar panels, then you will be completely wireless :grinning:

Well, that certainly is cool, but plain T-Com MaxADSL would cost three times less than that with the same connection speed if I was lucky enough to live in an area where it is supported. But to get to that area I'd have to move and pay a rent for a place to live which turns out even more expensive than all this internet connection mumbo jumbo.

In the end, the satelite ADSL plus GPRS/EDGE will cost me about the same as dial up costed me before, not really a saving, but at least I'd have a stable connection with a flat rate downstream traffic (not to mention free satelite television and radio that can be recorded to the hard disk, which comes with it).

Oh and btw, while I am at it, to make it so that all downstream traffic goes through one connection and upstream traffic through another I would have to route it that way somehow. How would I do that on GNU/Linux? I'd first have to connect both through the ppp0 interface I guess and then the ppp would have to be configured to block downstream via GPRS and route it through SatADSL connection..

"tbuitenh" wrote:

So, I think you're trying to use an electric drill to pick your nose: it might work, but it's not the right tool for the job.

Laughing Indeed so. Laughing out loud

Anyway, this squid thing was recommended to me by some guy in Croatian #linux channel (not freenode network), but all I can find on the web confirms that it's not really meant to be used on the desktop. Firefox cache and adblock would probably be better then (although if I decide to get SatADSL it wont be much of an issue anyway).

Thanks
Daniel

supermike's picture
Offline
Joined: 2006-02-17
Re: Setting up squid
"libervisco" wrote:

I have been advised to set up a squid proxy to decrease my bandwidth usage through caching and compressing data transfered....So I'm not sure what should I do.

I've got Squid set up at my office, but it was a real bear. After doing a *LOT* of reading, I finally got it going. Here's my squid.conf file:

# start
acl all src 0.0.0.0/0.0.0.0
acl timecard_access dst timecard.mycompany.com
http_access allow timecard_access
http_access deny all
http_reply_access allow all
coredump_dir /var/spool/squid
# end

This isn't exactly what you want, however, so you'll have to start with this and compare to your squid.conf and adapt it. Note you'll have to bounce the squid daemon in /etc/init.d in order to accept your new conf file. Anyway, this conf file above allows me to restrict access on a kiosk to only "timecard.mycompany.com" and nothing else.

Hope this helps.

P.S. You're not trying to do this because you have these forums served up on your home DSL, do you? That would be bad. Better to host it at a cheap but feature-laden company like webcomindia.net. You can get a Linux website for $82 a year with 1GB of space, PHP, and 1 database of MySQL. Their service is awesome and they have slick control panels to administer the site.

libervisco's picture
Offline
Joined: 2006-05-04
Re: Setting up squid
"supermike" wrote:

I've got Squid set up at my office, but it was a real bear. After doing a *LOT* of reading, I finally got it going. Here's my squid.conf file:

Thanks for the advice. I might try it sometimes and it might be helpful to someone wanting it, but now that I've got satelite ADSL downstream which is flat rate, it is much easier to save on chargeable bandwidth (GPRS upstream) so it's not a problem anymore.

"supermike" wrote:

P.S. You're not trying to do this because you have these forums served up on your home DSL, do you? That would be bad. Better to host it at a cheap but feature-laden company like webcomindia.net. You can get a Linux website for $82 a year with 1GB of space, PHP, and 1 database of MySQL. Their service is awesome and they have slick control panels to administer the site.

Of course not. The whole Libervis Network (all its sites) is hosted by the professional web hosting company that I've been with for well over a year now. They're not perfect, but they're pretty reliable and have a very good support, so no worries. Smiling

Thanks
Daniel

Offline
Joined: 2006-01-29

I'm a little lost here, so forgive the questions. Your goal is to minimize outbound bw usage? If so, using squid on the same box that is the server won't help bw; it will just change how often the data must be read from disk/memory. The data still has to be sent down the pipe regardless of where its read from.

mod_gzip will help some, but really the best way to deal with excessive bw usage is to look at what is the cause and work to either lessen it by various methods (mirroring for files, round-robin dns with your hosted server for http, etc.) or simply move to a connection or machine that won't have issues with bw usage.

If you (or anyone else running a F/OSS website, project, or small business) really get in a pinch and need some fast help or mirroring, we at DC are more than happy to help out. We've got 2 mirrors up for projects already, and I'm working with another site to help them with hosting.

libervisco's picture
Offline
Joined: 2006-05-04
"dotmil" wrote:

I'm a little lost here, so forgive the questions. Your goal is to minimize outbound bw usage?.

That was the idea because the connection that I had at the time of writing the original post of this thread was only this EDGE (GPRS improved) charged per MB while downloads can account for a bit too much in a whole month period. I have however got a satelite connection since then for downstream which is flat rate so it's not a problem anymore. The only thing left to limit and watch out is upload bandwidth which still goes through that more expensive "charged per MB" EDGE connection. Upload is however usually much lesser so it's not such a big deal anymore. I don't expect it to come over the 512 MB monthly traffic included in a normal obligatory subscription.

You're right though. If somethings still eating up bandwidth it probably is the best to just see what and deal with it individually, like right now I've got some suspicions and should probably go through my processes to see if anything uses the network for something it shouldn't. Smiling But no.. I don't mean spyware, god forbid that on GNU/Linux. Laughing

"dotmil" wrote:

If you (or anyone else running a F/OSS website, project, or small business) really get in a pinch and need some fast help or mirroring, we at DC are more than happy to help out. We've got 2 mirrors up for projects already, and I'm working with another site to help them with hosting.

Thanks alot for the offer. Right now there's no immediate need as there's plenty of space on hosting account for nuxified.org and still enough for other sites while time to pay for next year hosting is not yet (that scary part comes in a few months).

Thanks

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.