Remove Squid footer completely
You can remove footer from squid error pages. Removing the version number from the footer is very easy.
In squid.conf enable
httpd_suppress_version_string
But what if you want to remove the whole message.
Generated Thu, 08 Jun 2000 06:58:30 GMT by proxy1.proxy.com (Squid/2.3.STABLE1)
There is no configuration available to remove it but you can always edit the source file for that. Don't worry its very easy. Easy because its really easy.
Just follow the following steps:
In squid.conf enable
httpd_suppress_version_string
But what if you want to remove the whole message.
Generated Thu, 08 Jun 2000 06:58:30 GMT by proxy1.proxy.com (Squid/2.3.STABLE1)
There is no configuration available to remove it but you can always edit the source file for that. Don't worry its very easy. Easy because its really easy.
Just follow the following steps:
- Go to squid source. /usr/src/squid/src
- Backup the existing file errorpage.c cp ./errorpage.c ./errorpage.c.bkp
- Remove errorpage.o rm errorpage.o
- Edit the file errorpage.c vim errorpage.c
{
ERR_SQUID_SIGNATURE,
"\n<\BR clear=\"all\">\n"
"<\HR noshade size=\"1px\">\n"
"\n"
"Generated %T by %h (%s)\n"
"\n"
"<\/BODY><\/HTML>\n"
} - Remove the line "Generated %T by %h (%s)\n"
- Save and exit :wq
- Reconfigure squid with old options ./configure .........
- Make clean make clean
- Make make
- Make all make all
- Make install make install
- Stop squid /usr/local/squid/sbin/squid -k shutdown
- Start squid /usr/local/squid/sbin
coooooool
ReplyDeletethanks lots
I usually remove squid error footer by adding >!-- Generated %T by %h (%s)--<
ReplyDeleteto the end of line from ERR_ACCESS_DENIED file
You are commenting the line. So the result will be the same.
ReplyDelete*lol*
ReplyDeleteAnd no one will look at the source of the page?
THERE IS A WAY without messed up with the source code,especially for you that install squid with aptitude or synaptic things.
ReplyDeleteJust add in the end of the line of ERR_ACCESS_DENIED this applied to other error message.
thanks for momonsolommon very inspiring
THERE IS A WAY without messed up with the source code,especially for you that install squid with aptitude or synaptic things.
ReplyDeleteJust add (without qoute) in the end of the line of ERR_ACCESS_DENIED this applied to other error message.
thanks for momonsolommon very inspiring
May you explain a little bit more what to add please ?
ReplyDeleteRight now, the squid error footer doesn't appear in the page, but it is visible as a comment in the page source code.
Hi Anonymous, he means to do,
ReplyDelete<!-- Generated %T by %h (%s)-->
Noticed the <!-- and --> ?
It's only a solution to put the entry in comment and not show it in the web page.
ReplyDeleteBut this entry is still available in the page source code. I obtain this :
!--Generated Tue, 12 Oct 2010 10:04:07 GMT by Server (squid)--
So every body knows you are using Squid !
I am looking for a full solution whithout modifying the Squid sources and a new compilation...
try using " & l t ; " and " & g t ; " without the space and quotes for < and > sign.
ReplyDeleteStill not OK...
ReplyDeleteCan you confirm you don't have anything in your source page ? I am using Squid2.7 stable7.
Where do you add the < !-- Generated %T by %h (%s)-- > in the file ? After the < /body >?
Maybe you can send me the ERR_ACCESS_DENIED file you are using for exemple in order to test it ? (arno_2003 at yahoo dot fr)
Thx
Hi, I'm just elaborating the point "momonsolommon" said.
ReplyDeleteI'm running squid on Debian Lenny,
ReplyDeleteusually I edit ERR_ACCESS_DENIED file with nano,
nano /usr/share/squid/errors/English/ERR_ACCESS_DENIED
at the end of the file there's a line:
Generated %T by %h (%s)
changes to:
<-- Generated %T by %h (%s) -->
is a simpler method: edit a binary file generated from the conversion of a string ... a corresponding removal of this value ie the amount of space - I recommend "mcedit squid;)
ReplyDelete... and for that you delete the contents of files / usr / share / squid / errors / En / *
There is an error in the case of large squid die - we make a copy
So what have i done wrong?
ReplyDeletethis -> <-- Generated %T by %h (%s) -->
produces 2 of the footers.
this -> < !-- Generated %T by %h (%s)-- >
does the same thing.
i found 'httpd_suppress_version_string off' in the config file,
it change nothing.
someone above say theres a version string at the end of the error files, but i dont see it.
i dont really want to re-complie squid, it was yum installed..
when i search google for 'remove squid footer' i get redirected ONLY to this webpage, f... google has gone s.i*.
Hi anonymous, you must compile Squid if you want to completely remove the footer.
ReplyDeleteIf you want to remove it yet, compiling is the easiest way... But if you just want to make it disappear you can do that much easier, all you need is the following text in a custom error page (it will make the hr and the footer text transparent). *argh it doesn't want to accept the code so execute this script to get the code :-(
ReplyDeleteecho '1TITLE21/TITLE21STYLE type=5text/css521344hr{opacity807filter8alpha$opacity60%7}address{opacity807filter8alpha$opacity60%7}1/STYLE21/HEAD21BODY2' | tr '12345678$%' '<>!-"=;:()'
Correction - got a little overzealous with the substitutions... this will work! :-) 1 and 2 map to < and > respectively
ReplyDeleteecho '1TITLE21/TITLE21STYLE type="text/css"21!--hr{opacity:0;filter:alpha(opacity=0);}address{opacity:0;filter:alpha(opacity=0);}1/STYLE21/HEAD21BODY2' | tr '12' '<>'
Clever use of CSS I must say :)
Deleteor simply add this css code on your error page between the STYLE directives:
ReplyDelete...
address {
display: none;
}
hr {
display: none;
}
...