Re: GRSEC and Varnish

2010-02-03 Thread Mark Moseley
On Tue, Feb 2, 2010 at 11:53 PM, Tollef Fog Heen
 wrote:
> ]] Bernardf FRIT
>
> | Then the parent varnishd process starts immediately a new child process
> | which lasts some time.
> |
> | Is there any way to fix this. Remocve the GRSEC kernel ? Upgrade the
> | kernel ? Varnish ? or whatever ?
>
> Work out why it thinks that varnishd is doing something wrong?  It
> doesn't seem to say so in the log.
>
> --
> Tollef Fog Heen
> Redpill Linpro -- Changing the game!
> t: +47 21 54 41 73
> ___
> varnish-misc mailing list
> varnish-misc@projects.linpro.no
> http://projects.linpro.no/mailman/listinfo/varnish-misc
>

grsec will often report that signals were sent, not that grsec
necessarily sent that signal itself. I don't think I've ever actually
seen it report itself sending a signal to a process. So varnishd could
be segfaulting for some reason and grsec is just reporting this. If
you're getting a core file, try loading it into gdb and using 'bt' on
it, to see where it's dying.

One other thing to try: As soon as it happens, try using 'dmesg' (or
"dmesg -s 131072" in case you have lots of things logging to the
kernel logs) and grep for PAX. It's not likely, but PAX could be
killing it due to some violation. And for whatever reason, the PAX
message doesn't show up in the logs, just in dmesg.
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Upper and lower case strings in Varnish

2010-02-03 Thread Cosimo Streppone
On 3 February 2010 17:15, Richard Chiswell
 wrote:

>> Hi Poul,
>>
>> Poul-Henning Kamp wrote:
>>> In message <4b69ab1a.6010...@mangahigh.com>, Richard Chiswell writes:
>>>
 I've got a simple question which I've been puzzling on for the last 30
 minutes or so - how do you change a string in Varnish to lowercase?

>>> You'll have to use a bit of inline C code to do that.

I'm no varnish or C expert, YMMV etc...
but I managed to get something like this working.

It's a VCL with embedded C that reads the "Accept-Language" header
and rewrites it (or writes into a different header, actually) the
result of some processing function.

Take a look at the examples here:

http://github.com/cosimo/varnish-accept-language/tree/master/examples

sample.vcl is the main VCL file, from which you embed the other one,
accept-language.vcl, which in turn contains the C function you want
to use.

I think `vcl_rewrite_accept_language()' is what you need.
Then you're only missing the upper->lower case bit.

-- 
Cosimo
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Upper and lower case strings in Varnish

2010-02-03 Thread Laurence Rowe
I don't think it's possible to write a regex that will do that in one
go. There's a dumb solution though:

set obj.http.Location regsuball(obj.http.Location, "A", "a");
set obj.http.Location regsuball(obj.http.Location, "B", "b");
...

Laurence

On 3 February 2010 17:15, Richard Chiswell
 wrote:
> Hi Poul,
>
> Poul-Henning Kamp wrote:
>> In message <4b69ab1a.6010...@mangahigh.com>, Richard Chiswell writes:
>>
>>> I've got a simple question which I've been puzzling on for the last 30
>>> minutes or so - how do you change a string in Varnish to lowercase?
>>>
>> You'll have to use a bit of inline C code to do that.
>>
> Thanks Poul - any chance of any example of how to do this with a regular
> expression: we currently have:
> set obj.http.Location = "http://"; req.http.host "/"
> regsub(req.url,"^/(en_gb/|en_us/)?([A-Za-z]+)/?(.*)$","\1\2");
> but we only want the \1 lowercased -I've got to
> set obj.http.Location = "http://"; req.http.host "/"
> regsub(req.url,"^/(en_gb/|en_us/)?([A-Za-z]+)/?(.*)$","C{char
> str[255];str=\1;for (i=0;str[i];i++) { str[i]=tolower(str[i]);return
> str;}C\2");
> but that doesn't seem to work. I don't suppose you can point me in the
> right direction (it's been over 10 years since I've done C [since then
> C++, C#.Net, PHP, Perl and Java: so remembering what's valid syntax is
> bad enough, and I've got no idea about the passing to/from varnish side
> of things).
>
> Thank you,
> Richard
> ___
> varnish-misc mailing list
> varnish-misc@projects.linpro.no
> http://projects.linpro.no/mailman/listinfo/varnish-misc
>
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Upper and lower case strings in Varnish

2010-02-03 Thread Richard Chiswell
Hi Poul,

Poul-Henning Kamp wrote:
> In message <4b69ab1a.6010...@mangahigh.com>, Richard Chiswell writes:
>   
>> I've got a simple question which I've been puzzling on for the last 30 
>> minutes or so - how do you change a string in Varnish to lowercase?
>> 
> You'll have to use a bit of inline C code to do that.
>   
Thanks Poul - any chance of any example of how to do this with a regular 
expression: we currently have:
set obj.http.Location = "http://"; req.http.host "/" 
regsub(req.url,"^/(en_gb/|en_us/)?([A-Za-z]+)/?(.*)$","\1\2");
but we only want the \1 lowercased -I've got to
set obj.http.Location = "http://"; req.http.host "/" 
regsub(req.url,"^/(en_gb/|en_us/)?([A-Za-z]+)/?(.*)$","C{char 
str[255];str=\1;for (i=0;str[i];i++) { str[i]=tolower(str[i]);return 
str;}C\2");
but that doesn't seem to work. I don't suppose you can point me in the 
right direction (it's been over 10 years since I've done C [since then 
C++, C#.Net, PHP, Perl and Java: so remembering what's valid syntax is 
bad enough, and I've got no idea about the passing to/from varnish side 
of things).

Thank you,
Richard
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Upper and lower case strings in Varnish

2010-02-03 Thread Poul-Henning Kamp
In message <4b69ab1a.6010...@mangahigh.com>, Richard Chiswell writes:
>Hi all,
>
>I've got a simple question which I've been puzzling on for the last 30 
>minutes or so - how do you change a string in Varnish to lowercase?
>
>Basically, all the links on our site should be lowercase, but some 
>people have been randomly capitalising them when linking to them - I'd 
>just like Varnish to issue a 301 redirect to the lowercased version of 
>the URL: everything is in place apart from converting the string to 
>lowercase.

You'll have to use a bit of inline C code to do that.

Poul-Henning

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Upper and lower case strings in Varnish

2010-02-03 Thread Richard Chiswell
Hi all,

I've got a simple question which I've been puzzling on for the last 30 
minutes or so - how do you change a string in Varnish to lowercase?

Basically, all the links on our site should be lowercase, but some 
people have been randomly capitalising them when linking to them - I'd 
just like Varnish to issue a 301 redirect to the lowercased version of 
the URL: everything is in place apart from converting the string to 
lowercase.

Any advice welcome!

Thanks,
Richard
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: varnishlog not behaving as expected (by me)

2010-02-03 Thread Poul-Henning Kamp
In message <4b6960da.6080...@bmjgroup.com>, Alex Hooper writes:

>>   /usr/local/bin/varnishlog -o RxURL "^wp-admin$"

This says you want to *O*mit all RxURL lines.  The regexp argument
should have generated an argument error.

What you want is probably:

varnishlog -i RxURL -I "^wp-admin$"

Ie: Include (only) RxURL lines, which match this regexp.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: varnishlog not behaving as expected (by me)

2010-02-03 Thread Alex Hooper
Hi,

It's OK: I'm used to not receiving responses from mailing lists. I have
an unfortunate way of communicating in such forums, I think.

Anyway, having come back to this after a slight hiatus I have noted that
the inclusion of the '-c' flag makes it work as expected.

If I instead include the '-b' flag, it also seems to work as expected
(ie, it doesn't spew output, returns data on backend requests where
tag/regex matched). If I include both -b and -c, it continues to work --
but if I include neither, I get the type of spurious* output I noted
originally, no matter what the combination of tag and regex.

My reading of the man page is that

  varnishlog -o  

is semantically equivalent to

  varnishlog -b -c -o  


Either I or the code or the man page would appear to be wrong.

Cheers,

Alex.

* The use of this term may be subjective.


Alex Hooper uttered:
> Hi,
> 
> I'm having a bit of trouble using varnishlog. I am using:
> 
>   /usr/local/bin/varnishlog -o RxURL "^wp-admin$"
> 
> Expecting to see grouped log lines for requests where the RxURL matches
> /^wp-admin$. But the (copious) output I see is like:
> 
> 0 StatAddr - 59.181.130.123 0 6 1 3 0 0 0 1003 8711
> 0 StatAddr - 120.28.216.236 0 1 6 11 0 0 0 3864 92763
> 0 StatAddr - 80.13.50.156 0 754 22 40 0 0 0 7080 0
> 0 StatAddr - 86.156.98.226 0 0 2 4 0 0 0 1397 9259
> 0 ExpPick  - 1023444941 ttl
> 0 VCL_call - timeout
> 0 VCL_return   - discard
> 0 ExpKill  - 1023444941 -1263381538
> 0 ExpPick  - 1023444953 ttl
> 0 VCL_call - timeout
> 0 VCL_return   - discard
> 0 ExpKill  - 1023444953 -1263381538
> 0 ExpPick  - 1023108126 ttl
> 0 VCL_call - timeout
> 0 VCL_return   - discard
> 0 ExpKill  - 1023108126 -10
> 0 ExpPick  - 1023109753 prefetch
> 0 VCL_call - prefetch
> 0 VCL_return   - fetch
> 0 Debug- "Attempt Prefetch 1023109753"
> 0 StatAddr - 86.156.98.226 0 0 3 5 0 0 0 1750 22988
> 0 StatAddr - 193.146.115.134 0 12 4 4 0 0 0 708 0
> 0 StatAddr - 86.156.98.226 0 0 4 6 0 0 0 2103 36115
> 0 StatAddr - 80.13.50.156 0 754 22 41 0 0 0 7257 0
> 0 StatAddr - 80.13.50.156 0 754 23 42 0 0 0 7434 0
> 
> 
> '/usr/local/bin/varnishlog' -i RxURL  shows me the requests coming in.
> '/usr/local/bin/varnishlog -i RxURL|grep wp-admin' shows that there are
> generally no requests for wp-admin.
> 
> Am I missing something obvious?
> 
> (varnish-2.0.4 on RHEL 5.4)
> 
> Cheers,
> 
> Alex.


-- 
Alex Hooper   |   www.bmjpg.com
Operations Team Leader|   ahoo...@bmjgroup.com
BMJ Technology, BMJ Publishing Group  |   +44 20 7383 6049
BMA House, LONDON, WC1H 9JR   |


___
The BMJ Group is one of the world's most trusted providers of medical 
information for doctors, researchers, health care workers and patients 
www.bmjgroup.bmj.com.  This email and any attachments are confidential.  If you 
have received this email in error, please delete it and kindly notify us.  If 
the email contains personal views then the BMJ Group accepts no responsibility 
for these statements.  The recipient should check this email and attachments 
for viruses because the BMJ Group accepts no liability for any damage caused by 
viruses.  Emails sent or received by the BMJ Group may be monitored for size, 
traffic, distribution and content.  BMJ Publishing Group Limited trading as BMJ 
Group.  A private limited company, registered in England and Wales under 
registration number 03102371.  Registered office: BMA House, Tavistock Square, 
London WC1H 9JR, UK.
___
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Varnish graphs

2010-02-03 Thread Tollef Fog Heen
]] pablort 

| Nah. using 2.0.6

Hmm, indeed.

I just fixed it in trunk, will backport it to 2.0 branch.

-- 
Tollef Fog Heen 
Redpill Linpro -- Changing the game!
t: +47 21 54 41 73
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc