Installation instructions

Requirements

Steps

  1. Extract the archive and copy the mykswiki folder in the root directory of your web server.
  2. Make the files, history, and pages folders writable by the web server.
  3. Fire your browser and start editing!

If you installed the wiki in another directory, if you encounter an Internal Server Error, or if links don't work, read the Troubleshoot URL rewriting section below.

Optional steps

Configuration and localization

You can change any text displayed by the website, which makes it very easy to customize or localize mykswiki. If needed, you can also configure several features and parameters, although the defaults should be all right for most uses.

All configuration variable are defined in defaults.php. You can override them by creating a file named config.php and defining the configuration constants here.

For example, to change the title of the wiki, you can write in config.php:

<?php
@define('WIKI_TITLE', 'My very own wiki');
?>

Change the style of the wiki

You can create your own page template and stylesheet by putting them in the templates and css directories respectively. Then, in config.php, define TEMPLATE and STYLESHEET to the names of your files without extension.

An alternate CSS is provided as an example. To try it, put in config.php:

<?php
@define('STYLESHEET', 'modern');
?>

NB: this stylesheet looks best in a modern browser such as Firefox or Safari.

You can also define a custom template for archive snapshots with ARCHIVE_TEMPLATE.

Enable file uploads

For security reasons, file uploads are disabled by default. It is dangerous to allow arbitrary files uploads on your web server; google for "php shell" if you don't believe me.

By default, mykswiki uses a .htaccess file to prevent direct access to the files directory. You must make sure that this restriction is working, e.g. that you can not access directly the contents of this directory. Then add in config.php:

@define('ENABLE_UPLOADS', true);

A better solution is to move the files directory outside of the root directory of your web server and change $FILES_DIR accordingly in config.php.

Enable archive snapshots

This feature is also disabled by default because it may put a heavy load on your server if your wiki is large. This works only on Unix-like servers (Linux, Mac OS X). The zip utility must be available in the PATH. To enable archive snapshots, add in config.php:

@define('ENABLE_UPLOADS', true);

You can download a browsable snapshot of the wiki by pointing your browser to /archive or, if you don't use URL rewriting ?action=archive.

Troubleshoot URL rewriting

URL rewriting is enabled by default and will work out of the box if:

This depends on your server configuration. In doubt, ask your system administrator.

If you didn't install mykswiki in the default location (/mykswiki), you must edit the .htaccess file and change the value of RewriteBase accordingly. It is the path to access your wiki from the root of your web server, with a leading slash and no trailing slash.

If you do not have mod_rewrite or do not want to use URL rewriting, define URL_REWRITING to false in config.php and delete the .htaccess file in the mykswiki directory. Then the wiki will work without URL rewriting.

Use Apache configuration files

If you prefer Apache configuration files over .htaccess files, and there are many good reasons for this, here is a suggested configuration file. Adapt the paths as needed.

<Directory "/var/www/mykswiki">
    AllowOverride None

    # Enable URL rewriting 
    RewriteEngine On

    # Path to the wiki in your URLs
    RewriteBase /mykswiki

    # Convert search URLs and redirect the browser
    RewriteCond %{QUERY_STRING} ^query=([^&]*)$
    RewriteRule ^$ search/%1? [L,R]

    # Re-translate the good-looking URL to a query string
    # and add action=search to avoid rewriting loops
    RewriteRule ^search/(.*)$ ?action=search&query=$1 [L]

    # Display a page
    RewriteRule ^view/([^/]+)$ ?page=$1 [L]

    # Edit or save page
    # Download a file
    RewriteRule ^(edit|save|file)/([^/]+)$ ?action=$1&page=$2 [L]

    # Select, upload, or delete files
    # Recent changes
    # Archives
    RewriteRule ^(select|upload|delete|recent|archive)$ ?action=$1 [L]

    Order Allow,Deny
    Allow from all
</Directory>

<Directory "/var/www/mykswiki/files">
    AllowOverride None
    Order Allow,Deny
    Deny from all
</Directory>

<Directory "/var/www/mykswiki/history">
    AllowOverride None
    Order Allow,Deny
    Deny from all
</Directory>

<Directory "/var/www/mykswiki/pages">
    AllowOverride None
    Order Allow,Deny
    Deny from all
</Directory>
Last change: 07/22/08 23:39