Mirror Server

24 Jun 2008 12:55

Today I've (almost) managed to create a mirror server for wikidot.com service.


  • CentOS distribution
  • almost live Wikidot read only mirror
  • database is replicated from the original service in real time to this server
  • user uploaded files are replicated in real time to this server using FS mirror
  • avatars are to be mirrored with rsync every now and then
  • uses Portable IP address:
  • lighttpd serves ALL content with FastCGI PHP
  • database is read-only (as being replication slave)
  • CVS configured to use SSH keys (no password asking)
  • Wikidot PHP source mainly from the current production server
  • Improvements (from CVS): uploaded files served like in OpenSource version


  • FS mirror is not 100% exact, it may not synchronize some (little fraction of) files every now and then, so we must rsync them additionally, to make sure nothing's lost
  • if you were logged in to Wikidot before, it'll complain about not being able to write to ozone_session (because it's read only)
  • Flickr Gallery not working and causing the whole page to display just nothing
  • magic file recognition not working (it may be a problem in PHP configuration or an extension):
PHP Warning:  finfo_open(): Failed to load magic database at '/usr/share/misc/magic'. in /var/www/www.wikidot.com/wikidot/php/utils/- on line 3
PHP Warning:  finfo_file(): supplied argument is not a valid file_info resource in /var/www/www.wikidot.com/wikidot/php/utils/- on line 4
PHP Warning:  finfo_close(): supplied argument is not a valid file_info resource in /var/www/www.wikidot.com/wikidot/php/utils/- on line 5

UPDATE: Flickr problem solution:

  1. yum install php-pear-HTTP-Request
  2. chgrp lighttpd /var/lib/php/session


  • when switching to mirror, we must restart memcached (or force to invalidate every item in it)

Comments: 2

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


if HOST = *.wdupload.wikidotsyndication.com:
    URL = http[s]://[site].wdupload.wikidotsyndication.com/files--upload/[file]
    send = 1
    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]
if send:
    check permissions
    set mime type
    send file

Comments: 1

PingBacks To Come To Wikidot

06 Jun 2008 15:52

I'm currently working on PingBack implementation (both server and client) for current Wikidot software.

The documentation for PingBack is located here: http://hixie.ch/specs/pingback/pingback

The changes will be available on the wiki farm www.wikidot.com and will be incorporated in the open-sourced version www.wikidot.org

We've noticed there are many posts on Wordpress about Wikidot, bunch of them:

and we want to make a smart move to let people from both services (and many more) know what happens on the other.

PingBack is also known to work for many many other services than just WordPress.

Comments: 1

Ubuntu Server 7.10 Wikidot Clean Install

12 Mar 2008 21:10

After creating-a-space-for-virtual-machines-host it's time to prepare a very first productional Wikidot installation on a virtual disk image.

The problems I've encountered:

1. Compiling the PCRE not gave me the expected results (using heap for recursion matches).

More to come…

Comments: 2

page 44 of 45« previous12...42434445next »
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License