Hello,this is our business case:- we have an object store where we keep video and audio files, each file identified by a technical key
- we can access this object store with the S3 protocol via http (example: http://internal-object-store.de/bucket/key)
- we want to put a reverse proxy in front of the S3 gateway to deliver the files and map user friendly urls to the technical keys (example: http://videoserver.de/myNewVideo.mp4 -> http://internal-object-store.de/bucket/key)
- the mappings must be in a database because there are new mappings every hour for new files, and we delete the mappings for files that are no longer publicly availableFrom the documentation of mod_rewrite I found that we could achieve this with a dbd RewriteMap (starting with httpd 2.4). I found very few discussions about the dbd RewriteMap via Google but at last I got a basic working example.<VirtualHost *:80>ServerName myserver.deDBDriver mysqlDBDParams "host=my-db-host.de,port=3306,user=user,pass=pw,dbname=name"DBDPersist OnDBDPrepareSQL "select S3_PATH from MAPPINGS where URL = "" mappathRewriteEngine OnRewriteMap avfile "dbd:select S3_PATH from MAPPINGS where URL = "">RewriteRule ^/s3(.*) http://internal-object-store.de${avfile:$1} [P]</VirtualHost>I was not able to use the label "mappath" of the prepared statement as a reference in the RewriteMap directive.for example:RewriteMap avfile dbd:mappathdid not work.Here are my questions:Can the prepared statement be used in the RewriteMap? (And how?)Has anybody experience with the dbd RewriteMap in production?Are there any known pitfalls?Would it be advisable to use a different approach. For example with mod_lua?Thank you and best regards,Julian
--Viele Grüße,Julian Sareyka
- References:
- [users] Use dbd RewriteMap to map user friendly URLs to files in an object store
- From: Julian Sareyka
- Prev by Date: [users] Use dbd RewriteMap to map user friendly URLs to files in an object store
- Next by Date: Re: [users] WebDAV for managing web site content HTTPD 2.4.x (9 actually)
- Previous by thread: [users] Use dbd RewriteMap to map user friendly URLs to files in an object store
- Next by thread: [users] Only allow access from specific domains?
- Index(es):
[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]