0

Background

I have a web page X, which I would like to serve through only through URLs matching /X/${UUID}, where UUID is a random UUID which I give to a person. I have come up with a solution which involves creating symbolic links from directory outside of the web root to a directory with name ${UUID}$ inside the web root.

Approximate Solution

  1. Define WEB=/Users/jpcooper/Web.
  2. mkdir $WEB/internal
  3. mv index.html style.css script.js $WEB.
  4. mkdir -p $WEB/root/X.
  5. cd $WEB/root/X; ln -s ../../internal ${UUID}.

lighttpd.conf:

server.document-root = "${WEB}/root"
server.follow-symlink = "enable"
index-file.names = ( "index.html" )
mimetype.assign = (
  ".html" => "text/html",
  ".css" => "text/css",
  ".js" => "text/javascript"
)

Lighttpd will now expose only the urls of the form /X/${UUID}.

Improvement?

Is there any better way of registering UUIDs somewhere and having URLs of the form /X/${UUID} proxied to the ${WEB}/internal directory? Can this be done without CGI?

justinpc
  • 151
  • 5

1 Answers1

0

Have you looked at lighttpd mod_secdownload? https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModSecDownload

gstrauss
  • 221
  • 1
  • 5