LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-19-2012, 06:06 PM   #1
4Paul4
Member
 
Registered: Jul 2011
Posts: 51

Rep: Reputation: Disabled
unrecognized: 'error_map' in squid Squid 3.2


Hi,

I am trying to map 404 errors (and later other error codes) to external html files using error_map as per this documentation:

http://www.squid-cache.org/Doc/config/error_map/

I have added in
error_map http://my.domain/page.html 404
however when trying to start squid, I get the following error:

root@ip-10-0-0-36:~# squid
2012/11/19 00:33:57| cache_cf.cc(519) parseOneConfigFile: squid.conf:21 unrecognized: 'error_map'

Squid version:

Code:
root@ip-10-0-0-36:/usr# squid -v 
Squid Cache: Version 3.2.1 
configure options:  '--build=x86_64-linux-gnu' '--prefix=/usr' '--enable-ssl' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--libexecdir=${prefix}/lib/squid3' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-silent-rules' '--srcdir=.' '--datadir=/usr/share/squid3' '--sysconfdir=/etc/squid3' '--mandir=/usr/share/man' '--with-cppunit-basedir=/usr' '--enable-inline' '--enable-async-io=8' '--enable-storeio=ufs,aufs,diskd' '--enable-removal-policies=lru,heap' '--enable-delay-pools' '--enable-cache-digests' '--enable-underscores' '--enable-icap-client' '--enable-arp-acl' '--with-filedescriptors=65536' '--with-large-files' '--with-default-user=proxy' '--enable-epoll' '--enable-linux-netfilter' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -g -Wall -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS=' 'CXXFLAGS=-g -O2 -g -Wall -O2' 'FFLAGS=-g -O2' '-with-openssl=/usr/include/openssl/' '--enable-http-violations'
Any ideas?
 
Old 11-20-2012, 03:48 PM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,905

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Hi,

There is no such option in squid-3.x.
You can use the deny_info option instead.

Regards
 
1 members found this post helpful.
Old 11-20-2012, 05:46 PM   #3
4Paul4
Member
 
Registered: Jul 2011
Posts: 51

Original Poster
Rep: Reputation: Disabled
Thanks for clearnig this up for me.
 
Old 12-13-2012, 08:38 PM   #4
4Paul4
Member
 
Registered: Jul 2011
Posts: 51

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
Hi,

There is no such option in squid-3.x.
You can use the deny_info option instead.

Regards
I can't see how to use deny_info to respond to 404/500 errors.

"deny_info err_page_name acl"

doesn't exactly let me specify an HTTP error code but rather an ACL.

Any ideas?
 
Old 12-14-2012, 03:20 AM   #5
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,905

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Quote:
I can't see how to use deny_info to respond to 404/500 errors.

"deny_info err_page_name acl"

doesn't exactly let me specify an HTTP error code but rather an ACL.

Any ideas?
deny_info is used to give users a customized page regarding the "Access Denied" acl.
The 404/500 errors are errors generated from the backend server, so for squid these are legitimate answers not errors.
 
Old 12-16-2012, 06:33 PM   #6
4Paul4
Member
 
Registered: Jul 2011
Posts: 51

Original Poster
Rep: Reputation: Disabled
I figured it out.

1. Define a http_status ACL for 404 (or 500, etc).
2. deny_info to set a custom error page (as you said).
3. Need to use 'http_reply_access' rather than http_access since you're checking the reply from the cache peer.
Code:
acl denied_status_404 http_status 404
deny_info ERR_404.html denied_status_404
http_reply_access deny denied_status_404
 
1 members found this post helpful.
  


Reply

Tags
error message, proxy, server, squid, ubuntu 12.04


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
squid: unrecognized service philbong_borces Linux - Newbie 7 03-27-2012 01:23 PM
Squid Error: "... parseConfigFile: line 1 unrecognized: '' ..." bergakker Linux - Newbie 17 01-24-2012 04:38 AM
Squid Redirect specific domain to an Secondary (External) Squid Proxy Zxarr Linux - Server 2 04-20-2010 12:50 PM
squid conf: squid failed when I type insert redirect_program /usr/bin/squidguard laxmantsharma Linux - Software 1 02-24-2009 06:02 AM
squid conf: squid failed when I type insert redirect_program /usr/bin/squidguard Niceman2005 Linux - Software 1 11-24-2004 02:29 PM


All times are GMT -5. The time now is 12:04 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration