I'm using squid proxy sever on my ubuntu 12.04 LTS. Where is the error page location so that I can customize it..

  • No! I've searched in nook and corner of that squid.conf file. /var/log/syslog contains only system log file. – Ruban Savvy Nov 27 '13 at 10:24
  • Nope It contains all the squid log files (like the web accessed URLs). I need the error page location. – Ruban Savvy Nov 27 '13 at 10:26
  • Sorry, I misread your question... Do you have an error_directory directive in your configuration ? Error pages should be there. – Vinz Nov 27 '13 at 10:32
  • No Vinz. I'm looking for that! – Ruban Savvy Nov 27 '13 at 10:32
  • There is no such dierctory. :( – Ruban Savvy Nov 27 '13 at 10:38

If you do not have a configured error_directory as mentioned, squid -v will report your version of squids compile time options.

The following options will impact the path to the error templates:

  --prefix=PREFIX         install architecture-independent files in PREFIX
                      [/usr/local/squid]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]

The following will impact which error templates are rendered:

  --disable-translation   Prevent Squid generating localized error page
  --disable-auto-locale   This prevents Squid providing localized error pages

So you end up with PREFIX/DATADIR/errors/templates as the default or PREFIX/DATADIR/errors/$locale/

Locale can be based on the clients request if using a recent version of Squid or yours was compiled with --enable-auto-locale for older versions (3.1)

The error_default_language config option can be involved as well.

Then the templates directory is the fallback.

I think this holds true for squid 3.x. Not so sure about 2.x

Error page location is set by the error_directory directive.

  • Where is that? I need the path! – Ruban Savvy Nov 27 '13 at 10:36
  • According to help.ubuntu.com/community/Squid/Customize it should be in /usr/share/squid/errors/<language>/. If it does not exist, I suggest you to generate an error and strace the process to see where it looks for these pages. – Vinz Nov 27 '13 at 10:50
  • I've seen that page. but it is of no use. – Ruban Savvy Nov 27 '13 at 10:51
  • Another solution would be to save the HTML error page on your harddisk, make the changes you want, add an error_directory directive in your configuration file, and put your new file in this directory. – Vinz Nov 27 '13 at 10:56
  • I did that prior asking question here. – Ruban Savvy Nov 27 '13 at 10:57

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.