How can I create a Wiki?
A wiki allows the collaborative creation and maintenance of websites. Wiki pages look and act like normal web pages, except they have an "Edit" link that makes it easy to modify existing pages and add new pages into the website. Page editing can be left open to the public or restricted to small groups of authors.
CETS has installed two wikis for use:
- PmWiki (installation instructions below)
- MediaWiki (instructions in this Answers article)
Setting up PmWiki
- If you don't have CGI enabled on your account already, you will need to request CGI enabled on your account. See the Answers article on CGI scripts for more information.
- Under your home directory's html directory, create a directory for your wiki and set its permissions to 755.
- In your wiki directory, create a file named
index.php. The contents of that file should be two lines:
Note: you do not need to put the "#!/usr/local/bin/php" line in any other files you create in your wiki (see the customization section below).#!/usr/local/bin/php
<?php include('/usr/local/pmwiki/pmwiki.php');?> - Customize your wiki and set up a password.
- Create a directory called
localin your wiki root. The permissions on this directory should be readable and writable by the owner only (chmod 700). - In the
localdirectory, create a file calledconfig.php. The permissions on this file should be readable and writable by the owner only (chmod 700).
- Create a directory called
- Accessing your wiki over the Internet for the first time by executing
the
index.phpfile will automatically create awiki.ddirectory in your wiki directory. The wiki will store content in there as the wiki gets edited over time.If you are a student, to access the your wiki, go to:
http://fling.seas.upenn.edu/~username/wiki/index.php
If you are a faculty or staff, to access your wiki, go to:http://alliance.seas.upenn.edu/~username/wiki/index.php
(Where username is your SEAS username and wiki is the name of your wiki directory).
mkdir wiki
chmod 755 wiki
Permissions on the index.php file should be set to:
755
Important Note: The permissions on the local directory and on your config.php file should only be readable and writable by the owner. If these permissions are not set correctly, someone else will have access to read and change your admin and edit passwords as well as any other custom configuration you do.
To set passwords for administration and editing, add this to the config.php file (you won't be able to edit your wiki until you do this):
<?php
$DefaultPasswords['admin'] = crypt('newadmin-password');
$DefaultPasswords['edit'] = crypt('newedit-password');
?>
To change the title of your Wiki (what appears
in the browser's title bar), add the following to your config.php file:
## Title of this wiki
$WikiTitle = 'New Wiki Site Title';
You can use this config file to change many other things about your wiki including the logo image, create different user controls and permissions, themes, etc. For more information on custom configuration options, please see the pmwiki.org documentation. When doing custom configurations, please check to make sure your permissions are set correctly.
Additional Custom Configuration Options for your Wiki
To customize your wiki you will need to do the following:
Creating more than one instance of PmWiki
You can create as many instances as you want of PmWiki by creating subdirectories within your wiki directory. For example, follow the wiki instructions but use ~/html/wiki/wiki1/ as the install directory. Then follow the instructions again for ~/html/wiki/wiki2/. Repeat as many times as desired.
How to Include HTML markup in wiki pages
By default PMWiki does not support HTML markup in wiki pages. Follow the instructions on this page to enable HTML. There are a few items not fully explained in the article that you will need to know:
- You will need to create a directory called "local" in your wiki directory (you may have already done this if you followed the instructions above). Make sure it is only read/write/executable by the owner (chmod 700).
- Within the "local" directory, create a directory called "cookbook" with the same permissions as "local". Put your "enablehtml.php" file (as described in the article) in this directory.
- Create a "config.php" file within your local directory (you may have already done this if you followed the instructions above). Make sure this file is not world readable.
- Add these lines to your "config.php" file:
<?php
include_once("cookbook/enablehtml.php");
EnableHtml('img|br|hr|h1|h2|h3|h4|h5|p|a');
EnableHtml('b|i|u|sup|sub');
EnableHtml('ul|ol|li');
EnableHtml('table|tr|td');
?>This enables most basic html tags. You may want to add or remove tags from the lists above depending on what you want your users to be able to do.
Warning: Be aware what types of tags you allow. Certain tags, like <script> and <meta>, can give users dangerous amounts of control over your pages.
