Installing and configuring prewikka



Files included for the distribution (prewikka-0.9.5.tar)

NCSA/Mithril version (prewikka-0.9.5_ncsa.tar)


If this is a reinstall, make sure that all prewikka remnants are cleaned up. This includes everything in the following directories, files and the mysql database prewikka.





and the daemon /usr/bin/prewikka-httpd


First of all, extract the files from prewikka-0.9.5.tar into /etc/prewikka

From /etc/prewikka/prewikka-0.9.5/


1) Run the setup

python install


2) Create the mysql database prewikka with the following steps:


mysql -u root -p
mysql> CREATE database prewikka;
GRANT ALL PRIVILEGES ON prewikka.* TO prewikka@'localhost' IDENTIFIED BY 'password';
$ mysql -u prewikka prewikka -p < /usr/share/prewikka/database/mysql.sql


3) Configure by editing /etc/prewikka/prewikka.conf


#This is the name at the top right and left of the Prewikka interface
#You can change it or leave as is
software: Prewikka
place: NCSA
title: Prelude/Mithril
#The following are the setting for your prelude database
type: mysql
host: localhost
user: prelude
pass: <password>
name: prelude
#This is the database information for the prewikka DB you created above
type: mysql
host: localhost
user: prewikka
pass: <password>
name: prewikka
#You can comment this out to stop logs from writing to stderr
[log stderr]
#No real need to edit this except to increase/decrease expiration time
[auth loginpassword]
expiration: 60


4) Configure apache2 by editing /etc/apache2/apache2.conf


Add the following at the end of the file then restart apache2:


Alias /prewikka/prewikka/ /etc/prewikka/prewikka-0.9.5/htdocs/

ScriptAlias /prewikka/ /etc/prewikka/prewikka-0.9.5/cgi-bin/prewikka.cgi

<Directory /etc/prewikka/prewikka-0.9.5/htdocs/>

    Options None

    AllowOverride None

    Order allow,deny

    Allow from all


<Directory /etc/prewikka/prewikka-0.9.5/cgi-bin/>

    AllowOverride None

    Options ExecCGI

    <IfModule mod_mime.c>

        AddHandler cgi-script .cgi


    Order allow,deny

    Allow from all



5) test prewikka from the command line




6) run prewikka through the browser




7) initially there is only one user admin/admin

   add another with al privileges, then delete the admin


8) Modifications –

   do all in /etc/prewikka/prewikka-0.9.5/

   then run ‘python install’

   to build and distribute the changes


a)    Adding a shell command to a drop-down menu for an IP address link

      - in general, follow the insertions for other commands

      - changes need to be made in:

        prewikka.conf – add the command name and path – add an appropriate class

                      e.g. class example(HostCommand):

                               view_name = "example"

                               command = "example"

        – add “example” to the list on line 322

                      e.g. for command in "netstat", "nmap", "traceroute", "whois", "ipdrop", “example”:

  – add the appropriate object

                      e.g. commands.Example()


        finally - run ‘python install’