Installation

1. Prereqs

- Apache (Or your preferred web server)
- PHP
- PHP GD Extension
- OSSEC (www.ossec.net)

2. Installation (Option A)

 - Download the source code (git clone should do) directly to your web directory
 - Set up your apache config
 - Modify resources/config.php to meet your needs

3. Installation (Option B)

 - Download the source code (again, git clone should do) to your home directory
 - Set up your apache config
 - Run the included install.php script

Example script run:

user@system01:~/ossecdashboard-code$ php -f install.php 
This script should help install the OSSEC Dashboard. Please answer the following questions.
Installation location [/var/www/ossecdashboard-code]: /var/www/test

The directory identified already exists; do you wish to upgrade? (y/N)y

Creating backup of your current config.php file at config.php.bk.
Copying new files...
File (/var/www/test/resources/Charts/04_NumEventsPerDay.php) modified since last update. Backup created at /var/www/test/resources/Charts/04_NumEventsPerDay.php.bk.
Updating file: /var/www/test/resources/Charts/04_NumEventsPerDay.php

Done. Exiting...

The primary advantage of utilizing the installation script is that any custom changes you have made to files will be saved to a backup file. You can then merge those changes, restore the backup file, etc.

4. Permissions

You'll need to make sure that Apache can read the OSSEC alert files and can write to image cache directory.

5. Configuration File

<?PHP
$_siteTitle = "OSSEC Dashboard";
$_rootDirectory = "/var/www/ossecdashboard-code";                         # The root directory of the code
$_ApacheRootDirectory = "/var/www";                                       # Your web root directory - this is used for img tag creation to strip out this portion of the file location since we need the fully qualified path to save a file but not to display it to users

$_EnableHTMLCaching = true;                                               # Whether or not to cache html pages (this isn't implemented just yet)
$_HTMLCacheTTL = 300;                                                     # How long to store cached html info (this isn't implemented just yet)
$_HTMLCacheDir = $_rootDirectory . '/cache/html';                         # Location for the html cache (this isn't implemented just yet)
$_ImageCacheDir = $_rootDirectory . '/cache/img';                         # Location for the image cache

$_OSSecAlertsDir = '/opt/ossec/logs/alerts';                              # Location of your ossec alerts directory
$_OSSecRulesDir = '/opt/ossec/rules';                                     # Rules directory

$_DefChartImageWidth = 350;                                               # Default width of a standard chart
$_DefChartImageHeight = 400;                                              # Default height of a standard chart

$_ChartPHPDirectory = $_rootDirectory . '/resources/Charts';              # Location of the Chart scripts

# Functions and Classes #
require($_rootDirectory . "/resources/Classes/classes.php");              # This file contains includes for all custom classes 
require($_rootDirectory . "/resources/Functions/functions.php");          # This file contains includes for all custom functions
?>

Related

Wiki: Home

MongoDB Logo MongoDB