Monday, January 7, 2008

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:
  1. Go to squid source. /usr/src/squid/src
  2. Backup the existing file errorpage.c cp ./errorpage.c ./errorpage.c.bkp
  3. Remove errorpage.o rm errorpage.o
  4. 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"
    }
  5. Remove the line "Generated %T by %h (%s)\n"
  6. Save and exit :wq
  7. Reconfigure squid with old options ./configure .........
  8. Make clean make clean
  9. Make make
  10. Make all make all
  11. Make install make install
  12. Stop squid /usr/local/squid/sbin/squid -k shutdown
  13. Start squid /usr/local/squid/sbin

No comments:

Post a Comment