Project

General

Profile

Installing Prewikka

This section explains how to install the Prelude Interface Prewikka using the tarball available from the Prelude website. However, Prewikka might be included with your distribution as a package and it would be easier to install it this way.

Table of Contents

Requirements

Prewikka 1.2.6 and higher

  • libpreludedb version >= 1.2.6 (database schema 14.7) with python bindings
  • Python >= 2.6 (not Python 3.x)
  • python-babel
  • python-lesscpy
  • Cheetah templates for Python from http://cheetahtemplate.org/
  • One of the following DBMS:
    • MySQL >= 4.0.18 or
    • PostgreSQL >= 8 or
    • SQLite

Get the sources

Download the latest Prewikka source distribution.

Install

You might install Prewikka as root:

# python setup.py install

Or as an user:

$ python setup.py install --prefix /prefix/where/prewikka/should/be/installed

Create the Prewikka database

Make sure the Prelude Framework (libprelude + libpreludedb with python bindings) is installed.

Three databases are available:

MySQL

Database creation

Connect to your database server using the mysql client like this:

$ mysql -u root -p
Enter password:

where "root" is the name of the database administrator (this is the default account on mysql) and -p will prompt you for a password (by default the root account has no password on mysql and is only accessible from localhost).

Then, if everything is ok, you should see something like this:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.73 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

To create a new database named 'prewikka' (for example):

mysql> CREATE database prewikka;
Query OK, 1 row affected (0.05 sec)

Create a dedicated user to access the database (optional)

You might want to access your database through a dedicated user (if you don't have already one).
If you want to create a new user called 'prewikka' with the password 'password' that we will have full access on a database called 'prewikka' but only from localhost, use the following query:

GRANT ALL PRIVILEGES ON prewikka.* TO prewikka@'localhost' IDENTIFIED BY 'password';

PostgreSQL

Database creation

Connect to your database server using the psql client like this:

$ psql -U postgres -W

where "postgres" is the name of the database administrator (this is the default account on postgresql) and -W will prompt you for a password.

Then, if everything is ok, you should see something like this:

psql (8.4.20)
Type "help" for help.

postgres=# 

To create a new database named 'prewikka' (for example):

postgres> CREATE database prewikka;
CREATE DATABASE

Create a dedicated user to access the database (optional)

You might want to access your database through a dedicated user (if you don't have already one).
If you want to create a new user called 'prewikka' with the password 'prewikka' that we will have full access on a database called 'prewikka', use the following query:

CREATE USER prewikka WITH ENCRYPTED PASSWORD 'prewikka' NOCREATEDB NOCREATEUSER;

SQLite3

Database creation

Make sure the DB file has read permissions for and only for user prelude (or root if you have not created one).

$ sqlite3 /path/to/your/sqlite-prewikka.db

then, use the following instructions concerning database in /etc/prewikka/prewikka.conf instead of those in the next paragraph:

[idmef_database]
type: sqlite3
file: /path/to/your/sqlite-prelude.db

[database]
type: sqlite3
file: /path/to/your/sqlite-prewikka.db

Edit prewikka.conf

Once you have created the database for Prewikka you need to edit /etc/prewikka/prewikka.conf to fit your database settings prior to starting Prewikka.

[interface]
#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: company ltd.
browser_title: Prelude management

#The following are the setting for your prelude database
[idmef_database]
type: mysql
host: localhost
user: prelude
pass: prelude
name: prelude

#This is the database information for the prewikka DB you created above
[database]
type: mysql
host: localhost
user: prewikka
pass: prewikka
name: prewikka

#You can comment this out to stop logs from writing to stderr
[log stderr]

Run Prewikka

Apache / WSGI setup with VirtualHost

<VirtualHost *:80>
        # This is optional: handling is faster if this is done by Apache, but
        # Prewikka WSGI module will handle it if not.
        #
        #<Location /prewikka>
        #        SetHandler None
        #</Location>
        #
        # Alias /prewikka /usr/share/prewikka/htdocs

        # For inclusion of a non-default configuration file
        # SetEnv PREWIKKA_CONFIG /etc/prewikka/prewikka.conf

        WSGIApplicationGroup %{GLOBAL}
        WSGIScriptAlias / /var/www/html/prewikka.wsgi
</VirtualHost>

with a prewikka.wsgi file that should look like:

from prewikka.web import wsgi
application = wsgi.application

From the command line tool

If you didn't install Prewikka system wide (ie: you specified a prefix), use:

$ PYTHONPATH=$prefix/lib/python2.6/site-packages:$prefix/bin/prewikka-httpd

Note: Check your install, python2.6 above may be another version.

If you installed Prewikka system wide:

$ /usr/bin/prewikka-httpd

You can then use your browser to connect to your machine on port 8000.
The default login/password is admin: please remember to change it.

Initial login

Once everything is set up, you can use your browser to connect to the machine where Prewikka was installed. If you are not using Apache support, then remember you should use the port 8000 to access Prewikka.
The default login/password is admin: please remember to change it.

Depending on the Prewikka plugins you have installed, you might need to activate them through the interface : go to Settings > Plugins > Install update.

SELinux impact

If you find that prewikka is not able to connect to the local MySQL server then you may be encountering a problem with SELinux.
Starting with Fedora Core 3, SELinux is turned on by default. SELinux is the Secure Edition that has extra security features.
There are many ways to handle this, but a convenient way is from the Start menu on the desktop. Use System Settings > Security Settings > SELinux. You can disable SELinux completely or just for the mysqld daemon. (gdk - Telcordia 5/2/05)