Quantcast

custom error pages with stylesheets doesn't work for me

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

custom error pages with stylesheets doesn't work for me

Dieter Bloms-2
Hello,

I use squid 3.5.25 compiled with following options:

Squid Cache: Version 3.5.25
Service Name: squid
configure options:  '--prefix=/usr' '--sysconfdir=/etc/squid' '--bindir=/usr/sbin' '--sbindir=/usr/sbin' '--localstatedir=/var' '--libexecdir=/usr/sbin' '--datadir=/usr/share/squid' '--mandir=/usr/share/man' '--with-default-user=squid' '--with-filedescriptors=24576' '--disable-auto-locale' '--disable-auth-negotiate' '--disable-auth-ntlm' '--disable-eui' '--disable-carp' '--disable-htcp' '--disable-ident-lookups' '--disable-loadable-modules' '--disable-translation' '--disable-wccp' '--disable-wccpv2' '--enable-async-io=128' '--enable-auth' '--enable-auth-basic=LDAP NCSA' '--enable-auth-digest=LDAP file' '--enable-epoll' '--enable-log-daemon-helpers=file' '--enable-icap-client' '--enable-snmp' '--enable-disk-io=AIO,DiskThreads,IpcIo,Blocking' '--enable-storeio=aufs,rock' '--enable-referer-log' '--enable-useragent-log' '--enable-large-cache-files' '--enable-removal-policies=lru,heap' '--enable-external-acl-helpers=session' '--enable-follow-x-forwarded-for' '--enable-ssl-crtd' '--disable-strict-error-checking' '--with-openssl=/opt/dv-openssl1' 'CFLAGS= -O2 -fPIE -fPIC -DSQUID_USE_SSLGETCERTIFICATE_HACK=1' 'LDFLAGS= -fPIC -pie' 'CPPFLAGS= -O2 -fPIE -fPIC -DSQUID_USE_SSLGETCERTIFICATE_HACK=1'

I wrote some custom error pages and activated style sheets in the header of the error pages like:

<style type="text/css">
%l
</style>

In the squid.conf file I set err_page_stylesheet to my stylesheet file and I restarted squid.
My expectation was, that the content of this style sheet file will be included in the error page at the %l position.
But the place between <style type="text/css"> and </style> is empty.

Does anybody know how can I insert the content of the style sheet file to the error pages ?


--
Regards

  Dieter

--
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
From field.
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: custom error pages with stylesheets doesn't work for me

Alex Rousskov
On 05/18/2017 03:17 AM, Dieter Bloms wrote:

> I wrote some custom error pages and activated style sheets in the header of the error pages like:
>
> <style type="text/css">
> %l
> </style>
>
> In the squid.conf file I set err_page_stylesheet to my stylesheet file and I restarted squid.
> My expectation was, that the content of this style sheet file will be included in the error page at the %l position.

Your expectation was correct.


> But the place between <style type="text/css"> and </style> is empty.
> Does anybody know how can I insert the content of the style sheet file to the error pages?

The steps you described above appear correct to me. Did you check for
errors in cache.log when starting Squid? Squid should complain if it
cannot load err_page_stylesheet but, unfortunately, Squid thinks that
you do not really care much about style and keeps running despite any
loading failures.

Temporary renaming the stylesheet file (so that Squid cannot load it)
will help you test whether you are looking for errors in the right place.


HTH,

Alex.

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: custom error pages with stylesheets doesn't work for me

Dieter Bloms-2
Hello Alex,

On Thu, May 18, Alex Rousskov wrote:

> On 05/18/2017 03:17 AM, Dieter Bloms wrote:
>
> > I wrote some custom error pages and activated style sheets in the header of the error pages like:
> >
> > <style type="text/css">
> > %l
> > </style>
> >
> > In the squid.conf file I set err_page_stylesheet to my stylesheet file and I restarted squid.
> > My expectation was, that the content of this style sheet file will be included in the error page at the %l position.
>
> Your expectation was correct.
>
>
> > But the place between <style type="text/css"> and </style> is empty.
> > Does anybody know how can I insert the content of the style sheet file to the error pages?
>
> The steps you described above appear correct to me. Did you check for
> errors in cache.log when starting Squid? Squid should complain if it
> cannot load err_page_stylesheet but, unfortunately, Squid thinks that
> you do not really care much about style and keeps running despite any
> loading failures.
>
> Temporary renaming the stylesheet file (so that Squid cannot load it)
> will help you test whether you are looking for errors in the right place.

thank you for the hint.
Squid had no read permission to this file. After right permissions
it worked.
But there was _no_ error message in the cache log file.
I found the wrong permission with the help of strace command.
It would be nice, when squid drop a note, that it can't read the file.


--
Regards

  Dieter

--
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
From field.
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: custom error pages with stylesheets doesn't work for me

Benjamin E. Nichols
You might actually be in the wrong directory, I wouldnt be surprised if
this was the case, particularly if you are using a debian or ubuntu box.

Heres a hint.  You need to be editing the following default document
instead...

/usr/share/squid-langpack/templates/ERR_ACCESS_DENIED

And make sure your css is within your style tag.

<style>.someclass{background:#000;}</style>

And make sure you place this css inside the tag <head></head>


On 5/19/2017 3:10 AM, Dieter Bloms wrote:

> Hello Alex,
>
> On Thu, May 18, Alex Rousskov wrote:
>
>> On 05/18/2017 03:17 AM, Dieter Bloms wrote:
>>
>>> I wrote some custom error pages and activated style sheets in the header of the error pages like:
>>>
>>> <style type="text/css">
>>> %l
>>> </style>
>>>
>>> In the squid.conf file I set err_page_stylesheet to my stylesheet file and I restarted squid.
>>> My expectation was, that the content of this style sheet file will be included in the error page at the %l position.
>> Your expectation was correct.
>>
>>
>>> But the place between <style type="text/css"> and </style> is empty.
>>> Does anybody know how can I insert the content of the style sheet file to the error pages?
>> The steps you described above appear correct to me. Did you check for
>> errors in cache.log when starting Squid? Squid should complain if it
>> cannot load err_page_stylesheet but, unfortunately, Squid thinks that
>> you do not really care much about style and keeps running despite any
>> loading failures.
>>
>> Temporary renaming the stylesheet file (so that Squid cannot load it)
>> will help you test whether you are looking for errors in the right place.
> thank you for the hint.
> Squid had no read permission to this file. After right permissions
> it worked.
> But there was _no_ error message in the cache log file.
> I found the wrong permission with the help of strace command.
> It would be nice, when squid drop a note, that it can't read the file.
>
>

--
--

Signed,

Benjamin E. Nichols
http://www.squidblacklist.org

1-405-397-1360 - Call Anytime.

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: custom error pages with stylesheets doesn't work for me

Amos Jeffries
Administrator
In reply to this post by Dieter Bloms-2
On 19/05/17 20:10, Dieter Bloms wrote:

> Hello Alex,
>
> On Thu, May 18, Alex Rousskov wrote:
>
>> On 05/18/2017 03:17 AM, Dieter Bloms wrote:
>>
>>> I wrote some custom error pages and activated style sheets in the header of the error pages like:
>>>
>>> <style type="text/css">
>>> %l
>>> </style>
>>>
>>> In the squid.conf file I set err_page_stylesheet to my stylesheet file and I restarted squid.
>>> My expectation was, that the content of this style sheet file will be included in the error page at the %l position.
>> Your expectation was correct.
>>
>>
>>> But the place between <style type="text/css"> and </style> is empty.
>>> Does anybody know how can I insert the content of the style sheet file to the error pages?
>> The steps you described above appear correct to me. Did you check for
>> errors in cache.log when starting Squid? Squid should complain if it
>> cannot load err_page_stylesheet but, unfortunately, Squid thinks that
>> you do not really care much about style and keeps running despite any
>> loading failures.
>>
>> Temporary renaming the stylesheet file (so that Squid cannot load it)
>> will help you test whether you are looking for errors in the right place.
> thank you for the hint.
> Squid had no read permission to this file. After right permissions
> it worked.
> But there was _no_ error message in the cache log file.
> I found the wrong permission with the help of strace command.
> It would be nice, when squid drop a note, that it can't read the file.

I just checked the code and do see a log entry being made at critical
level. It does not say "ERROR" like most of those things should though,
just the filename and the system error message (fixed that right now).

It may be that you missed it amongst the other informational startup
messages, or that it is in the part of "cache.log" messages that are
output before cache.log is opened - those lines currently go to stderr
and/or your system messages log (where/what that is depends on your OS).

Amos

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: custom error pages with stylesheets doesn't work for me

Dieter Bloms-2
Hello Amos,

On Sat, May 20, Amos Jeffries wrote:

> On 19/05/17 20:10, Dieter Bloms wrote:
> >Hello Alex,
> >
> >On Thu, May 18, Alex Rousskov wrote:
> >
> >>On 05/18/2017 03:17 AM, Dieter Bloms wrote:
> >>
> >>>I wrote some custom error pages and activated style sheets in the header of the error pages like:
> >>>
> >>><style type="text/css">
> >>>%l
> >>></style>
> >>>
> >>>In the squid.conf file I set err_page_stylesheet to my stylesheet file and I restarted squid.
> >>>My expectation was, that the content of this style sheet file will be included in the error page at the %l position.
> >>Your expectation was correct.
> >>
> >>
> >>>But the place between <style type="text/css"> and </style> is empty.
> >>>Does anybody know how can I insert the content of the style sheet file to the error pages?
> >>The steps you described above appear correct to me. Did you check for
> >>errors in cache.log when starting Squid? Squid should complain if it
> >>cannot load err_page_stylesheet but, unfortunately, Squid thinks that
> >>you do not really care much about style and keeps running despite any
> >>loading failures.
> >>
> >>Temporary renaming the stylesheet file (so that Squid cannot load it)
> >>will help you test whether you are looking for errors in the right place.
> >thank you for the hint.
> >Squid had no read permission to this file. After right permissions
> >it worked.
> >But there was _no_ error message in the cache log file.
> >I found the wrong permission with the help of strace command.
> >It would be nice, when squid drop a note, that it can't read the file.
>
> I just checked the code and do see a log entry being made at critical level.
> It does not say "ERROR" like most of those things should though, just the
> filename and the system error message (fixed that right now).

thank you very much, so I will see the message next time ;)


--
Regards

  Dieter

--
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
From field.
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: custom error pages with stylesheets doesn't work for me

Alex Rousskov
In reply to this post by Dieter Bloms-2
On 05/19/2017 02:10 AM, Dieter Bloms wrote:
> But there was _no_ error message in the cache log file.

You are right. The lack of an error message is a Squid bug.


On 05/19/2017 07:40 AM, Amos Jeffries wrote:

> I just checked the code and do see a log entry being made

The code you are looking at is not executed. Look two lines higher at
the if statement that guards it... Code duplication strikes again.

Alex.

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Loading...