Skip to content

Commit

Permalink
Merge pull request #10 from Octopussy-Project/v1.0.16_and_ansible
Browse files Browse the repository at this point in the history
V1.0.16 and ansible
  • Loading branch information
sebthebert authored Apr 8, 2018
2 parents 8125522 + a5223d6 commit 4041921
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 74 deletions.
2 changes: 2 additions & 0 deletions 00_Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Octopussy Documentation
<img src="https://raw.githubusercontent.com/sebthebert/Octopussy_Documentation/master/img/pieuvre.gif" alt="Octopussy logo"/>
</p>

**NOTE: This documentation covers Octopussy 1.0.16 and greater. For older versions take a look at [this one](https://github.com/Octopussy-Project/Octopussy_Documentation/tree/1.0.14).**

## Table of Contents

- [Installation](01_Installation.md)
Expand Down
143 changes: 69 additions & 74 deletions 01_Installation.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
# Octopussy Installation

**NOTE: This documentation covers Octopussy 1.0.16 and greater. For older versions take a look at [this one](https://github.com/Octopussy-Project/Octopussy_Documentation/tree/1.0.14).**

Please make sure that SELinux, AppArmor, or other security software like these are well configured in order to work with Octopussy and its software (Apache, MySQL, RSyslog, ...)

(cf. Issues [#213](https://github.com/sebthebert/Octopussy/issues/213#issuecomment-28749963), [#305](https://github.com/sebthebert/Octopussy/issues/305#issuecomment-28750893), [#307](https://github.com/sebthebert/Octopussy/issues/307#issuecomment-28750930))

## Installation with Ansible

A lot of work have been done during [Hacktoberfest](https://hacktoberfest.digitalocean.com) 2017 to provide an [Octopussy Ansible Role](https://github.com/Octopussy-Project/ansible-role-octopussy) which covers CentOS, Debian & Ubuntu installation.

I build a complete platform with Ansible & Docker to test Octopussy installation on:
* CentOS 6 & 7
* Debian 8 & 9
* Ubuntu 14.04 & 16.04


## Debian/Ubuntu Installation
*(tested on Debian 5&6 and Ubuntu 10.04)*
*(tested on Debian 8 & 9 and Ubuntu 14.04 & 16.04)*

Get the latest octopussy debian package [here](http://sourceforge.net/project/showfiles.php?group_id=154314|here).

**Debian 6 WARNING:**
On Debian 6, for [stupid reason](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=568652) ([Debian Free Software Guidelines](http://www.debian.org/social_contract) #6 violation), the package `libmail-sender-perl` is not in `/main/` section anymore but in `/non-free/` section.
You had to insert these 2 lines in `/etc/apt/sources.list` file if you want to install Octopussy properly:

```
deb http://ftp.fr.debian.org/debian/ squeeze non-free
deb-src http://ftp.fr.debian.org/debian/ squeeze non-free
```
Update your system with 'apt-get update':

followed by an 'apt-get update':

```
```shell
apt-get update
```

Then install Octopussy:

```
```shell
dpkg -i octopussy_<version>_all.deb
apt-get -f install
```
Expand Down Expand Up @@ -62,56 +65,39 @@ openssl req -new -x509 -nodes -sha1 -days 365 -key /etc/octopussy/server.key > /
```
and then restart Octopussy webserver

```shell
```shell
/etc/init.d/octopussy web-stop
/etc/init.d/octopussy web-start
```

## CentOS Installation
*(tested on CentOS 5.5 & 6.4 (64 bit))*
*(tested on CentOS 6.9 & 7.4)*

### Software Installation

Install software requirements:

```shell
yum install -y httpd perl mod_perl mod_ssl mysql mysql-server nscd rsyslog sudo
```

(required for CPAN)

```
yum install -y gcc make cpan
```

`rrdtool` & `htmldoc` are not available on CentOS by default.
Add DAG repository (create `/etc/yum.repos.d/dag.repo` file and add:

```
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=1
```

and then install rrdtool and htmldoc

```shell
yum install -y rrdtool htmldoc
yum install -y epel-release expat-devel gcc make htmldoc httpd \
mod_perl mod_ssl mysql mysql-devel mysql-server \
nscd openssl-devel patch perl perl-devel perl-CPAN \
psmisc rrdtool rsyslog sudo
```

Install Perl modules requirements:

```shell
cpan Apache::ASP App::Info App::Info::HTTPD Cache::Cache Crypt::PasswdMD5
cpan SBECK/Date-Manip-5.56.tar.gz
cpan DateTime::Format::Strptime DBD::mysql DBI File::Slurp
cpan JSON Linux::Inotify2 List::MoreUtils Locale::Maketext::Lexicon Locale::Maketext::Simple
cpan LWP Mail::Sender Net::FTP Net::LDAP Net::SCP Net::Telnet Net::XMPP
cpan Proc::PID::File Proc::ProcessTable Readonly Regexp::Assemble Sys::CPU Term::ProgressBar Time::Piece
cpan Unix::Syslog URI version XML::Simple
```shell
cpan Apache::ASP App::Info App::Info::HTTPD Authen::SASL Cache::Cache \
Crypt::PasswdMD5 Data::GUID Date::Manip \
Time::Hires Test2::Require::Module \
DateTime::Format::Strptime DBD::mysql DBI \
Email::MIME Email::Sender Getopt::Long IO::Socket::SSL \
JSON Linux::Inotify2 List::MoreUtils \
Locale::Maketext::Lexicon Locale::Maketext::Simple \
LWP Net::FTP Net::LDAP Net::SCP Net::SSLeay Net::Telnet Net::XMPP \
Pod::Find Pod::Usage Proc::PID::File Proc::ProcessTable Readonly \
Regexp::Assemble Sys::CPU Term::ProgressBar Time::Piece \
Unix::Syslog URI version XML::Simple
```

Get the latest octopussy source package [here](http://sourceforge.net/project/showfiles.php?group_id=154314).
Expand Down Expand Up @@ -226,7 +212,7 @@ openssl req -new -x509 -nodes -sha1 -days 365 -key /etc/octopussy/server.key > /

and then restart Octopussy webserver

```shell
```shell
/etc/init.d/octopussy web-stop
/etc/init.d/octopussy web-start
```
Expand Down Expand Up @@ -385,45 +371,55 @@ You can take a look at this [documentation](http://en.gentoo-wiki.com/wiki/Octop

### Software Requirements

Before installing Octopussy, be sure to have installed:
Before installing Octopussy, be sure to have installed:

* [Apache2](http://httpd.apache.org)
* [Apache::ASP](http://www.apache-asp.org)
* [Perl](http://www.perl.org)
* [Mod_Perl](http://perl.apache.org)
* [MySQL](http://mysql.com)
* Nscd
* [MySQL](http://mysql.com) or [MariaDB](https://mariadb.org/)
* nscd
* [RRDTool](http://oss.oetiker.ch/rrdtool/) & librrd0
* [RSyslog](http://www.rsyslog.com)
* [htmldoc](http://www.htmldoc.org)
* sudo


and these Perl modules (from CPAN):

* [App::Info](https://metacpan.org/pod/App::Info)
* [Authen::SASL](https://metacpan.org/pod/Authen::SASL)
* [Cache::Cache](https://metacpan.org/pod/Cache::Cache)
* [Crypt::PasswdMD5](https://metacpan.org/pod/Crypt::PasswdMD5)
* [Data::GUID](https://metacpan.org/pod/Data::GUID)
* [Date::Manip](https://metacpan.org/pod/Date::Manip)
* [DateTime::Format::Strptime](https://metacpan.org/pod/DateTime::Format::Strptime)
* [DBI](https://metacpan.org/pod/DBI) (with [DBD::mysql](https://metacpan.org/pod/DBD::mysql))
* [File::Slurp](https://metacpan.org/pod/File::Slurp)
* [Email::MIME](https://metacpan.org/pod/Email::MIME)
* [Email::Sender](https://metacpan.org/pod/Email::Sender)
* [Getopt::Long](https://metacpan.org/pod/Getopt::Long)
* [IO::Socket::SSL](https://metacpan.org/pod/IO::Socket::SSL)
* [JSON](https://metacpan.org/pod/JSON)
* [Linux::Inotify2](https://metacpan.org/pod/Linux::Inotify2)
* [List::MoreUtils](https://metacpan.org/pod/List::MoreUtils)
* [Locale::Maketext::Lexicon](https://metacpan.org/pod/Locale::Maketext::Lexicon)
* [Locale::Maketext::Simple](https://metacpan.org/pod/Locale::Maketext::Simple)
* [LWP](https://metacpan.org/pod/LWP)
* [Mail::Sender](https://metacpan.org/pod/Mail::Sender)
* [Net::FTP](https://metacpan.org/pod/Net::FTP)
* [Net::LDAP](https://metacpan.org/pod/Net::LDAP)
* [Net::SCP](https://metacpan.org/pod/Net::SCP)
* [Net::SSLeay](https://metacpan.org/pod/Net::SSLeay)
* [Net::Telnet](https://metacpan.org/pod/Net::Telnet)
* [Net::XMPP](https://metacpan.org/pod/Net::XMPP)
* [Pod::Find](https://metacpan.org/pod/Pod::Find)
* [Pod::Usage](https://metacpan.org/pod/Pod::Usage)
* [Proc::PID::File](https://metacpan.org/pod/Proc::PID::File)
* [Proc::ProcessTable](https://metacpan.org/pod/Proc::ProcessTable)
* [Readonly](https://metacpan.org/pod/Readonly)
* [Regexp::Assemble](https://metacpan.org/pod/Regexp::Assemble)
* [Sys::CPU](https://metacpan.org/pod/Sys::CPU)
* [Term::ProgressBar](https://metacpan.org/pod/Term::ProgressBar)
* [Time::Hires](https://metacpan.org/pod/Time::Hires)
* [Time::Piece](https://metacpan.org/pod/Time::Piece)
* [Unix::Syslog](https://metacpan.org/pod/Unix::Syslog)
* [URI](https://metacpan.org/pod/URI)
Expand All @@ -433,13 +429,17 @@ and these Perl modules (from CPAN):
Install Perl modules requirements:

```shell
cpan Apache::ASP App::Info Cache::Cache Crypt::PasswdMD5
cpan SBECK/Date-Manip-5.56.tar.gz
cpan DateTime::Format::Strptime DBD::mysql DBI File::Slurp
cpan JSON Linux::Inotify2 List::MoreUtils Locale::Maketext::Lexicon Locale::Maketext::Simple
cpan LWP Mail::Sender Net::FTP Net::LDAP Net::SCP Net::Telnet Net::XMPP
cpan Proc::PID::File Proc::ProcessTable Readonly Regexp::Assemble Sys::CPU Term::ProgressBar Time::Piece
cpan Unix::Syslog URI version XML::Simple
cpan Apache::ASP App::Info App::Info::HTTPD Authen::SASL Cache::Cache \
Crypt::PasswdMD5 Data::GUID Date::Manip \
Time::Hires Test2::Require::Module \
DateTime::Format::Strptime DBD::mysql DBI \
Email::MIME Email::Sender Getopt::Long IO::Socket::SSL \
JSON Linux::Inotify2 List::MoreUtils \
Locale::Maketext::Lexicon Locale::Maketext::Simple \
LWP Net::FTP Net::LDAP Net::SCP Net::SSLeay Net::Telnet Net::XMPP \
Pod::Find Pod::Usage Proc::PID::File Proc::ProcessTable Readonly \
Regexp::Assemble Sys::CPU Term::ProgressBar Time::Piece \
Unix::Syslog URI version XML::Simple
```

### Software Installation
Expand Down Expand Up @@ -490,19 +490,14 @@ If the [LINUX/INSTALL.sh](https://github.com/sebthebert/Octopussy/blob/master/LI

#### Create Octopussy MySQL Database and Table

For MySQL < 5.7:
```shell
/usr/bin/mysql -u root -p < LINUX/OCTOPUSSY.sql
```

Details of the OCTOPUSSY.sql file:

```mysql
CREATE DATABASE IF NOT EXISTS octopussy;
CREATE TABLE IF NOT EXISTS octopussy._alerts_ (log_id bigint(20) NOT NULL auto_increment, alert_id varchar(250)
default NULL, status varchar(50) default 'Opened', level varchar(50) default NULL, date_time datetime default NULL, device varchar(250) default NULL, log text default NULL, comment text default NULL, PRIMARY KEY (log_id));
INSERT IGNORE INTO mysql.user (host,user,password, file_priv) values ('localhost','octopussy',password('octopussy'), 'Y');
INSERT IGNORE INTO mysql.db (host,user,db,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv) values ('localhost','octopussy','octopussy','Y','Y','Y','Y','Y','Y');
FLUSH PRIVILEGES;
For MySQL >= 5.7:
```shell
/usr/bin/mysql -u root -p < LINUX/OCTOPUSSY.mysql57
```

#### Add octo_logrotate to cron.daily
Expand Down Expand Up @@ -599,7 +594,7 @@ Here is what you have in this file:
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
Expand Down Expand Up @@ -721,15 +716,15 @@ If you want to use [PostgreSQL](http://www.postgresql.org/) instead of [MySQL](h
```sql
postgres=# CREATE USER octopussy WITH PASSWORD 'octopussy';
```
* Create your Octopussy PostgreSQL database:
* Create your Octopussy PostgreSQL database:
```sql
postgres=# CREATE DATABASE octopussy OWNER octopussy;
```
* Create your Octopussy **\_alerts\_** table
```sql
CREATE TABLE _alerts_ (log_id SERIAL, alert_id varchar(250) default NULL,
status varchar(50) default 'Opened', level varchar(50) default NULL,
date_time timestamp default NULL, device varchar(250) default NULL,
CREATE TABLE _alerts_ (log_id SERIAL, alert_id varchar(250) default NULL,
status varchar(50) default 'Opened', level varchar(50) default NULL,
date_time timestamp default NULL, device varchar(250) default NULL,
log text default NULL, comment text default NULL, PRIMARY KEY (log_id));
```

Expand Down

0 comments on commit 4041921

Please sign in to comment.