Lighttpd Serving Wikidot

12 Jun 2008 06:46

I work on the configuration of the Lighttpd webserver and Wikidot tweaks to eventually run Wikidot on Lighttpd.

The configuration of Lighttpd:

  • .htaccess rewritten to lighttpd.conf
  • all rules are rewrite-once (like RewriteRule [L] in Apache)
    • mixing rewrite-repeat with rewrite-once is tricky
  • standard lighttpd fastcgi php configuration
  • serving uploaded files through php program (no more flags/private)
  • non-existing avatars handled by 404 error handler on avatar directories

The tweaks in Wikidot:

  • sanitized PrivateFileFlowController
  • created new: UploadedFileFlowController
  • they can eventually become one file (PrivateFileFlowController shouldn't be needed anymore)
  • created new: local.php (to substitute private_file_filter.php)
  • SSL seem to work correctly

Still to do:

  • replace (configure the backend) readfile() with Header("X-Sendfile…")
  • UploadedFileFlowController should deal with:
    • redirections
    • html files
    • secure *.wdupload.wikidotsyndication.com domain
    • SSL
    • magic database better

UPDATE: 2008-06-13: done some things, still to do:

  • replace (configure the backend) readfile() with Header("X-Sendfile…")
  • SSL is not ready, because $_SERVER["HTTPS"] is not supported in fast-cgi

PROPER FLOW:

if HOST = *.wdupload.wikidotsyndication.com:
    URL = http[s]://[site].wdupload.wikidotsyndication.com/files--upload/[file]
    send = 1
else:
    URL = http[s]://[domain]/files--upload/[file]
    if file is text/html or xml+html:
        301 to http[s]://[site].wdupload.wikidotsyndication.com/files--upload/[file]
    else
        send=1
if send:
    check permissions
    set mime type
    send file

Next post: Mirror Server


More posts on this topic

Comments

Add a New Comment
or Sign in as Wikidot user
(will not be published)
- +
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License