LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Problems with squid (https://www.linuxquestions.org/questions/linux-software-2/problems-with-squid-748485/)

dellthinker 08-18-2009 01:12 PM

Problems with squid
 
Hi all. Im building a server that has a DansGuardian filter for my job and need help with the configuration.

I followed the instructions from this site and i've been getting errors when trying to restart squid.

These are the errors:

Code:

squid2009/08/18 13:04:33| parseConfigFile: squid.conf:2 unrecognized: 'http_accel_host'
2009/08/18 13:04:33| parseConfigFile: squid.conf:3 unrecognized: 'http_accel_port'
2009/08/18 13:04:33| parseConfigFile: squid.conf:4 unrecognized: 'http_accel_with_proxy'
2009/08/18 13:04:33| parseConfigFile: squid.conf:5 unrecognized: 'http_accel_uses_host_header'
.

I dont understand, I followed the instructions as best i could and im getting errors with the conf file. Any suggestions? Thanx in advance!

salasi 08-18-2009 03:07 PM

Every one of those error messages seem to be saying 'when you set this parameter, there is something I don't like about it'.

There is little chance that anyone else who can't see the appropriate lines from you squid.conf will succeed in guessing what you have for those lines. You might also have need to explain a few things about your network, but will certainly need to say something about what you have set for those parameters, so just cust and paste the lines for people to look at.

dellthinker 08-18-2009 03:25 PM

Ok so as i said before im making a filter for the network to weed out certain sites. The conf file i have is pretty much default with default settings. I dont see the need in pasting the entire conf as im sure the mods here wouldnt like that so i'll paste the changes that i have made.

Code:

http_port 127.0.0.1:3128
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
cache_effective_user squid
cache_effective_group squid

These are the changes that i read in the tutorial at the site i provided in my earlier post. The machine im running squid on is apart of a LAN that has 14 other computers connected to it via Eth/Wifi. Other than that its pretty straight forward. If anyone needs me to provide any other info to help me solve this problem just ask.

P.S. Should i use the machines DHCP assigned IP Address or the default 127.0.0.1 IP?

Thanx in advance!

salasi 08-19-2009 05:08 AM

Quote:

Originally Posted by dellthinker (Post 3648469)
Code:

http_port 127.0.0.1:3128
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
cache_effective_user squid
cache_effective_group squid

These are the changes that i read in the tutorial at the site i provided in my earlier post. The machine im running squid on is apart of a LAN that has 14 other computers connected to it via Eth/Wifi. Other than that its pretty straight forward. If anyone needs me to provide any other info to help me solve this problem just ask.

P.S. Should i use the machines DHCP assigned IP Address or the default 127.0.0.1 IP?

Thanx in advance!

If you want people to read it, include a link. Otherwise, it doesn't exist (for me). And even then, I might not read it.

Code:

http_port 127.0.0.1:3128
# TAG: http_port
# Usage: port [options]
# hostname:port [options]
# 1.2.3.4:port [options]
#
# The socket addresses where Squid will listen for HTTP client
# requests. You may specify multiple socket addresses.
# There are three forms: port alone, hostname with port, and
# IP address with port. If you specify a hostname or IP
# address, Squid binds the socket to that specific
# address. This replaces the old 'tcp_incoming_address'
# option. Most likely, you do not need to bind to a specific
# address, so you can use the port number alone.
#
# If you are running Squid in accelerator mode, you
# probably want to listen on port 80 also, or instead.
#
# The -I command line option will override the *first* port
# specified here.
#
# You may specify multiple socket addresses on multiple lines.
...etc

I've always used the 'real' address of the machine (rather than the loopback address of 127.0.0.1, assuming that using the loopback address might end up with the packets traversing firewalls twice and that this might have an efficiency impact, but, I have ot admit, I'm not really that sure.

Code:

cache_effective_user squid
cache_effective_group squid

# TAG: cache_effective_user
# If you start Squid as root, it will change its effective/real
# UID/GID to the user specified below. The default is to change
# to UID to nobody. If you define cache_effective_user, but not
# cache_effective_group, Squid sets the GID to the effective
# user's default group ID (taken from the password file) and
# supplementary group list from the from groups membership of
# cache_effective_user.
#
#Default:
# cache_effective_user squid

seems reasonable, given that running services as root is a security problem waiting to happen (its still a potential security problem on a home network, just not one that you necessarily have to take seriously)...you might want to set up the squid account manually so that you know the password so that, if you need to debug, you can run squid manually

# TAG: cache_effective_group
# If you want Squid to run with a specific GID regardless of
# the group memberships of the effective user then set this
# to the group (or GID) you want Squid to run as. When set
# all other group privileges of the effective user is ignored
# and only this GID is effective. If Squid is not started as
# root the user starting Squid must be member of the specified
# group.
#
#Default:
# none

also seems reasonable

The others I can't currently comment on as this box only has 2.7 available to it and the config directives have changed between the 2.x series and the 3.x series. (So, you should say what your squid version is, because some of those directives clearly won't work on versions that don't recognise them.)

EricTRA 08-19-2009 05:21 AM

Hello,

It looks to me that you're putting tags from squid 2.5 in a 3.x version. All references I have point back to 2.5 when in my current version 3.0STABLE16 they don't appear to be there any more, nor are they in the Squid 3.0 Configuration Manual.

As salasi pointed out, please post your version.

Kind regards,

Eric

dellthinker 08-19-2009 12:12 PM

Quote:

Originally Posted by EricTRA (Post 3649179)
As salasi pointed out, please post your version.

When i ran locate on the program i saw this:

Code:

squid_2.7.STABLE3-4.1_i386.deb
So im gonna assume that its 2.7 Stable 3. Also, if it will help any..i installed it using Debians package manager apt-get. Should i uninstall it and use the src version? Or can i work this out some other way.

salasi 08-19-2009 02:45 PM

Yes, after thinking about it again, I'm pretty sure that you are trying to use config parameter in a version which isn't configured to take it. At first I felt that given the differences between 2.x and 3.x that's what was going one, but I note that the tutorial that you are using is pretty old, so it may be an early 2.x and a late 2.x.

(Note that there are other possibilities, too; some of the config parameters are optional and if whoever built your version didn't build the particular parameter in, then that would cause it too. Their squid.conf should always comply with their build settings, though.)

So, if you do this right, there is no danger of getting into this trouble. You open the squid.conf that was installed with your squid and edit the settings according to the comments. A bit tedious, because squid.conf is quite long, but it works.

If yopu are confident that the tutorial gives you good info -and with a 2004 tutorial, I don't see how you can be that confident- using the search function in your text editor will get you straight to the bits that you want to edit. If you search and don't find, that is already telling you something.

Note that your install ought to have an unmolested .conf file under somewhere like /usr/share/squid/squid.conf.default; if the install has already done any config for you (say networking addresses), the .default version may not have it. OTOH, if you saved a version before you started editing, that would be even better.

dellthinker 08-19-2009 04:03 PM

Alright then. I'll either try to get it working with the default config
(/usr/share/doc/squid/examples/squid.conf) And if it still doesnt work the way that i'm looking for i'll just scrap the entire prog and install from src.


All times are GMT -5. The time now is 09:45 PM.