Nagios + autentikasi LDAP di freeBSD 8.2 (Part 1)

Komponen-komponen yang perlu diinstall adalah:

  1. Apache
  2. PHP
  3. LDAP
  4. Nagios
  5. PHPLDAPAdmin (optional)

 

Instalasi Komponen:

  1. Menginstall apache 2.2:

Cd /usr/ports/www/apache22

Make install clean

Pada config, pilih yang standard aja, tekan kursor kanan terus kiri dan enter, kecuali jika ingin meload module-module yang ada pada apache

Instalasi nya sangat lama, jadi sabar ya.

Supaya bias dijalankan saat start up:

ee /etc/rc.conf

apache22_enable=”YES”

  1. Install PHP

Cd /usr/ports/lang/5.2

Make install clean

Tunggu proses penginstalan. Lalala

Setelah seleai, edit httpd.conf dari apache:

Konfigurasi PHP:

ee /usr/local/etc/apache22/httpd.conf

Pada line ~217 , tambahkan index.php

<IfModule dir_module>

DirectoryIndex index.htmlindex.php

</IfModule>

Kemudian pada line ~360 tambahkan :

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

<IfModule mime_module>

TypesConfig etc/apache22/mime.types

AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

</IfModule>

Sekarang test apache + php nya. Buat file test.php yang isinya :

<? Phpinfo(); ?>

Di /usr/local/www/apache22/data/

ee test.php

setelah itu restart apache:

service apache22 restart

3. Install LDAP

cd /usr/ports/net/openldap24-server

make install clean

pilih default aja, tekan kanan, tekan kiri, enter

konfigurasi:

buat password admin:

/usr/sbin/slappasswd
New password:
Re-enter new password:

edit file slapd.conf

ee /usr/local/etc/openldap/slapd.conf

cari bagian database bdb ~line 56

lalu tambahkan dibawahnya:

suffix “dc=example,dc=com”

rootdn “cn=Manager,dc=example,dc=com”

cari bagian index objectClass eq lalu ketik dibawahnya

include /usr/local/etc/openldap/schema/cosine.schema

include /usr/local/etc/openldap/schema/inetorgperson.schema

access to attrs=userPassword

by self write

by anonymous auth

by * none

access to *

by self write

by users read

by peername.ip=127.0.0.1 read

by anonymous auth

Supaya bias dijalankan saat startup, tambahkan konfigurasi ini di rc.conf

ee /etc/rc.conf

slapd_enable=”YES”

slapd_flags=’-h “ldapi://%2fvar%2frun%2fopenldap%2fldapi/ ldap:///”‘

slapd_sockets=”/var/run/openldap/ldapi”

1. Install nagios

cd /usr/ports/net-mgmt/nagios

make install clean

dan sekarang, silahkan menunggu dengan sabar.

nah mulai dari step ini, harus diperhatikan baik-baik langkah-langkahnya

copy file-file nagios berikut:

cd /usr/local/etc/nagios

cp cgi.cfg-sample cgi.cfg
cp nagios.cfg-sample nagios.cfg
cp resource.cfg-sample resource.cfg

sekarang pindah ke direktori /objects ci nagios:

cd /usr/local/etc/nagios/objects/

cp commands.cfg-sample commands.cfg

cp contacts.cfg-sample contacts.cfg

cp localhost.cfg-sample localhost.cfg

cp printer.cfg-sample printer.cfg

cp switch.cfg-sample switch.cfg

cp templates.cfg-sample templates.cfg

cp timeperiods.cfg-sample timeperiods.cfg

sekarang cek konfigurasi nya udah bener belum:

nagios -v  /usr/local/etc/nagios/nagios.cfg

Supaya bisa tampil di browser buat file nagios.conf di direktori Includes pada apache22 yang isinya co-pas aja dari bawah ini:

cd /usr/local/etc/apache22/Includes/

ee nagios.conf

ScriptAlias /nagios/cgi-bin/ /usr/local/www/nagios/cgi-bin/

Alias/nagios/usr/local/www/nagios/

<Directory /usr/local/www/nagios>

Options None

AllowOverride None

Order allow,deny

Allow from all

</Directory>

<Directory /usr/local/www/nagios/cgi-bin>

Options ExecCGI

AllowOverride None

Order allow,deny

Allow from all

</Directory>

Kemudian restart apache:

Service apache22 restart.   

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: