Installation and configuration

The only software requirement for LionWiki is PHP installation. Recommended is PHP5, but LionWiki (without plugins) works also on PHP4 (tested on PHP 4.3.4).

Download(Edit)

Download LionWiki from Home page. You have to options — either core LionWiki (just one file) or full featured LionWiki with plugins.

Installation(Edit)

Copy all the files in the archive to some directory on your FTP account. On this account, change permissions of directories "history" and "pages" (and create them if they don't exist yet) so that everybody can write into them ("0777"). And that's it. Just try if it's working in your web browser.

Configuration(Edit)

Configuration options are located in file _config.php. If you don't have _config.php file, edit index.php, configuration options are same there.

  • $WIKI_TITLE is the name of your Wiki site
  • $PASSWORD is the password needed to write to pages (optionally to see pages). If left blank, no password is required to write (or read) pages.
  • $USE_AUTOLANG is set true, LionWiki tries to detect default language from visitor's browser
  • $LANG is language code of language you want to use. Not all languages are supported, take a look into lang/ directory and see if your is supported. In case of some problem, english is used.
  • $TEMPLATE is path to template

You should change all of the options above. The options below are mostly for tweaking purposes:

  • $PASSWORD_MD5 is secure way to store password with MD5 one way encryption. If not set $PASSWORD is used.
  • $PROTECTED_READ - if you want to protect pages not only from editing but also from seeing by unwanted visitors, you can set this variable to true. It's particularly useful when writing your private notebook or journal.
  • $HISTORY_COMPRESSION - can contain three possible values - "plain" (no compression), "gzip" and "bzip2". Default is gzip because it's in every PHP installation and has reasonable compression ratio. Best results can be achieved with "bzip2" but it's not provided in every PHP installation. You can switch values anytime, LionWiki has no problem working with mixed history (one revision compressed, second not compressed etc.).
  • $NO_HTML - optional XSS protection, prohibits use of {html} tag. Default is off, it's useful only when site is protected by password.
  • $USE_META - if set false, LionWiki doesn't use Edit summary and IP info, i.e. no meta.dat files are saved and if they exist, they're not used
  • $USE_HISTORY - if you want to disable history tracking (it's enabled by default), you do it by setting this variable to false
  • $START_PAGE is page used as a starting point.
  • $HELP_PAGE is page containing informations on syntax of LionWiki
  • $COOKIE_LIFE_WRITE - contains time in seconds during which is user "logged on" and doesn't have to enter password. Default value is 1 year.
  • $COOKIE_LIFE_READ - same as with $COOKIE_LIFE_WRITE, but this applies when $PROTECTED_READ is true. Default value is 4 hours.

And that's all. Further configuration options can be found in Plugins.

Plugins(Edit)

There are some plugins in default installation, you can see list of them and their description here. They are located (by default) in directory "plugins". The only way to activate/deactivate them is to copy them there/delete them, that means that all the plugins located in this directory are active.

Some plugins need to write to some files — these are located in plugins/data, this directory should be kept writable (chmod 777).

Stripping your installation(Edit)

To run LionWiki you need only index.php (core LionWiki file) and directory "pages" (with properly set permissions). All the other files and directories can be deleted. index.php contains minimal template which isn't very pretty, but is functional, so you can delete template file(s) if you want. If you delete directory "history", you won't be able to see past revisions of pages, obviously. The same goes with plugins directory. If you want to get rid of _config.php file, just delete it and set the default values in index.php (they are comfortably placed at the beginning of the file). English is built-in in index.php too, so you can delete whole lang directory.

Playing with data files(Edit)

So, there are too many revisions and it's just too big. How to delete some very old revisions? Go to history/Name_of_page/ and delete whichever revisions you want. Or delete whole history/Name_of_page/ (but not history directory!). Wanna do some changes to the page using your FTP editor? Just edit it, no problem (remember it's in UTF-8, as everything else). You can do almost anything, "database" stays always consistent.

Wiki farming(Edit)

Wiki farming is known to work only on some very early versions. It was completely removed as of 3.0

You have a lot of subdomains and you would like to serve all of them (or some of them) from one LionWiki installation to avoid redundancy. The easiest way to do this is to create symlink (or hardlink) in every subdirectory (subdomain). But you need to access to shell to do this. LionWiki provides another way to do this by using mod_rewrite. Let's say we have this directory structure:

root (example.com)

first (first.example.com)

second (second.example.com)

wwww (www.example.com)

Place index.php to the root directory. Then insert this in your .htacces in root directory (or something similar) for every subdomain you want to be served by LionWiki:

RewriteCond %{HTTP_HOST} first\.example\.com
RewriteRule index.php(.*)$ index.php?basedir=first [L,QSA]
RewriteCond %{HTTP_HOST} first\.example\.com
RewriteRule $ index.php?basedir=first [L,QSA]

As you can see, the key thing is that this rewrite rules pass the directory (first) as the parameter to index.php, so LionWiki knows where to look for needed files.

Placing of directories and files is a little bit more complicated here. Language directory (if any) should always be placed in the root directory, as it is common for all the subdomains. There can be also plugins directory, where will be located common plugins for all the subdomains. If you want to have some plugins just for some subdomains, create plugins directory ("plugins") in subdomains directory ("first") = "first/plugins" and place them there. They will be used only for first.example.com. It's similar with config files and templates. Config file has in the root directory contains common values for all subdomains which can be overriden by config files placed in the subdomains directories. Template file placed in the root directory is used when no template is placed in subdomains directory. It's all quite logical, so it should behave the way you expect.

Tags: