url_lfs_rewrite8
Usage
url_lfs_rewrite [--debug]
--local-dir=/var/www/
[options]
Overview
Direct all request to files who are in a local directory to a local web server hosting this directory.
This program uses Squid concurrency support.
Options
-
--debug -
Write debug info to stderr.
-
--local-dir -
Directory path under which the scripts searches for files.
-
--to-scheme -
Scheme to use for the redirected URL.
Default: http
-
--to-host -
Domain name to use for the redirected URL.
Default: localhost
-
--to-path -
URL path to add as prefix for the redirected URL path.
If set it must end with a '/'.
Default: use the original URL path.
Known issues
* The --local-dir parameter must end with a '/'. Otherwise no
file paths will be found.
* URL with no filename in the path can match directories on the local
filesystem and be wrongly redirected to the local web server.
* Any scheme name accepted by the Perl URL library can be used
as the --to-scheme parameter. However only schemes supported by
Squid will work.
* URL containing query-string are not handled well and will not
be rewritten even if the base script or file exists on the local
system.
Configuration
url_rewrite_program /path/to/url_lfs_rewrite --local-dir=\var\www\localhosturl_rewrite_children 20 startup=1 idle=1 concurrency=25url_rewrite_access deny CONNECTurl_rewrite_access deny to_localhost
This helper can redirect to any web server but only does so if there is a file matching the URL path segment in the local filesystem. Normal configuration requires a web server running on localhost serving up files from a local disk (eg. \var\www\localhost). Configuration of that web server is not covered here.