RE: ext_filter + negotiation?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxx] 
Sent: 30 May 2008 22:12
To: users@xxxxxxxxxxxxxxxx
Subject: Re:  ext_filter + negotiation?

nick wrote:
> Jonathan H N Chin <jc254@xxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx> | 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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux