[ILUG] Squid vs Apache2

Colm MacCarthaigh colm at allcosts.net
Mon Jan 7 23:30:18 GMT 2008


On Mon, Jan 07, 2008 at 09:31:31PM +0000, Maciej Blizi??ski wrote:
> On Fri, 2008-01-04 at 11:16 +0000, Bernhard D Rohrer wrote:
> > I have always wondered why people use Squid, when Apache2 also has proxy 
> > functionality. Performance?
> 
> Maybe because you can't make upside-down-ternet with Apache?
> 
> http://www.ex-parrot.com/pete/upside-down-ternet.html

Erm, sure you can :-)

	RewriteRule .*\.(jpeg|jpg|png|gif)$ /path/to/upsidedowner [NC]

and;

	#!/bin/sh

	imgformat=`echo $REQUEST_URI | awk -F. '{print $NF}' | tr 'A-Z' 'a-z'`

	test $imgformat = "jpg" && imgformat="jpeg"

	echo "Content-Type: image/$imgformat"
	echo 

	wget -q -O - "$SCRIPT_URI" | convert -flip $imgformat:- $imgformat:- 


(E & OE, you get the idea, oh and without the strict rewrite rule the
above cgi would be a trivially-exploitable security hole)

Although it would be more efficient to use mod_ext_filter, and
reasonably trivial too :-)

-- 
Colm MacCárthaigh                        Public Key: colm+pgp at stdlib.net



More information about the ILUG mailing list