httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Davies" <...@stickyeyes.com>
Subject RE: [users@httpd] ext_filter + negotiation?
Date Mon, 02 Jun 2008 09:47:27 GMT
Don't know if this helps, but I did the following:

ExtFilterDefine TranscodeMP3 intype="audio/flac" outtype="audio/mp3"
cmd="flac2mp3"

<LocationMatch "^/(.*).mp3$">
	SetOutputFilter TranscodeMP3
</LocationMatch>
AliasMatch "^/(.*)\.mp3$" /flac/lib/$1.flac

The above means that if anyone requests "mysong.mp3", they get the file
"mysong.flac" filtered through my flac2mp3 script which converts it to mp3
(via LAME) on the fly.

I didn't need to use Multiviews in the end.

Dunno if that helps, but it took me a while to realise I didn't need
multiviews.

Cheers,

Ben

Ben Davies | Lead Developer | Stickyeyes
6th Floor, 
West One, 
Wellington Street, 
Leeds, LS1 1BA 
Email: ben.davies@stickyeyes.com
0113 391 2929 | Fax 0113 391 2939

This e-mail may contain information that is privileged, confidential or
otherwise protected from disclosure. It must not be used by, or its contents
copied or disclosed to persons other than the intended recipient. Any
liability (in negligence or otherwise) arising from any third party acting,
or refraining from acting, on any information contained in this e-mail is
excluded. The views expressed may not be official company policy, but
instead, the personal views of the originator. If you have received this
e-mail in error please notify the sender and delete the e-mail.

-----Original Message-----
From: Jonathan H N Chin [mailto:jc254@newton.cam.ac.uk] 
Sent: 30 May 2008 22:12
To: users@httpd.apache.org
Subject: Re: [users@httpd] ext_filter + negotiation?

nick wrote:
> Jonathan H N Chin <jc254@newton.ac.uk> wrote:
> 
> > Using debian's apache 2.0.54 and 2.2.3, I define a filter:
> > 
> > 	ExtFilterDefine test \
> > 		mode=output intype=text/html \
> > 		cmd="/usr/bin/perl -pe 's/foo/bar/g'"
> 
> Presumably that's just illustrative (if that's what you want
> to do, then using ext_filter for it is a terrible solution).

Yes.


> > I use it with:
> > 	DocumentRoot /export/www
> > 	<Directory /export/www>
> > 		Options Indexes FollowSymLinks MultiViews
> > 	</Directory>
> > 	<Location />
> > 		SetOutputFilter test
> > 	</Location>
> 
> As a general rule, using <Location> with local contents
> is a bad idea, and may not work as expected.  That could
> be your problem here, though I'm not sure.

I'm afraid I have no idea what "local contents" means here.
Please do expand (or point me to the relevant docs).


> > If I GET http://server/test.html, the substitution happens.
> > However, if I GET http://server/test, it does not.
> > What do I need to do to make substitution also work with
> > content negotiation?

If I change "Location" to "Directory" the substitution occurs.

However, in either case mod_info/mod_status then fail.
Given:

	<Location /info>
		SetHandler server-info
	</Location>
	<Location /status>
		SetHandler server-status
	</Location>

when I GET http://server/info or GET http://server/status,
I just get back an empty page.

When I remove the SetOutputFilter, info/status work again.



> See the mod_filter documentation for better filter control.

mod_filter doesn't seem to exist in 2.0.54 ?
I need something that works with both 2.0 and 2.2.



-jonathan

-- 
   Jonathan H N Chin     | deputy computer | Newton Institute, Cambridge, UK
<jc254@newton.cam.ac.uk> | systems manager | tel/fax: +44 1223 767091/330508

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message