środa, 26 października 2011

Cyberoam iview Debian 6

Cyberoam Iview adalah software Intelligent Logging dan Reporting. Software ini bersifat open source dan dapat kita download dan gunakan gratis tanpa membayar lisensi, fitur software ini sangat bagus dimana banyak software sejenis lainnya di develop secara lisensi. Cyberoam iView merupakan keluaran terbaru setelah perusahaan Cyberoam mengeluarkan devices untuk network security dan router. Traffic pemakaian setiap user dapat kita monitor melalui iView, Devices dan software Cyberiam sangat cocok bagi internet service provider dimana dapat menempatkan router cyberoam di clientnya dan memberikan user login ke usernya melalui server iView untuk dapat melihat dan memantau aktifitas internet user tersebut. Software ini dapat saya katakan gabungan dari beberapa software lain seperti Untangle, Cacti, SARG, Bandwidth Management, QOS, Filtering,dan sebagainya.

Instalasi software versi Linux Cyberoam-iView agak sulit tetapi dengan waktu yang cukup akhirnya saya berhasil menginstall software ini dan memasukkan puluhan cyberoam devices ke dalam server ini untuk dapat dimonitor dan diberikan ke client. Bagaimana proses instalasi dan konfigurasinya ?

Saya menggunakan iView-Linux-0.111, sistem operasi Debian GNU Linux 5.0.8 Lenny, PostgreSQL 8.4, Java 1.5 untuk server menggunakan Supermicro Computer, Inc dengan memory 2 GB

Pastikan sistem operasi debian sudah di install dengan standart system, tanpa GUI, biar lite dan ringan.

PRI-IVIEW1:/home/gtoms# cat /etc/debian_version
5.0.8

PRI-IVIEW1:/home/gtoms# uname -a
Linux NGLAEM1 2.6.26-2-686 #1 SMP Thu Jan 27 00:28:05 UTC 2011 i686 GNU/Linux

apt-get install syslog-ng

vi /etc/syslog-ng/syslog-ng.conf

options {
long_hostnames(off);
sync(0);
stats(43200);
dns_cache(yes);
use_fqdn(no);
keep_hostname(yes);
use_dns(yes);
};

source gateway {
unix-stream("/dev/log");
internal();
udp(ip(0.0.0.0) port(514));
};

source tcpgateway {
unix-stream("/dev/log");
internal();
tcp(ip(0.0.0.0) port(514) max_connections(1000));
};

destination hosts {
file("/var/log/syslog-ng/$HOST/$FACILITY"
owner(root) group(root) perm(0600) dir_perm(0700)
create_dirs(yes));
};

log {
source(gateway); destination(hosts);
};

log {
source(tcpgateway); destination(hosts);
};

/etc/init.d/syslog-ng restart

Untuk memudahkan instalasi PostgreSQL 8.4 saya edit sources.list :

PRI-IVIEW1:~# apt-get install postgresql
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libdb4.8 libexpat1 libpq5 libssl0.9.8 lsb-release openssl
openssl-blacklist php5-common php5-pgsql postgresql-client-8.4 postgresql-client-common postgresql-common postgresql-doc postgresql-doc-8.4 ssl-cert
Suggested packages:
lsb ca-certificates postgresql slony1-bin oidentd ident-server
The following NEW packages will be installed:
libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libdb4.8 libexpat1 lsb-release openssl openssl-blacklist
php5-common php5-pgsql postgresql-8.4 postgresql-client-8.4 postgresql-client-common postgresql-common postgresql-doc postgresql-doc-8.4 ssl-cert
The following packages will be upgraded:
libpq5 libssl0.9.8
2 upgraded, 24 newly installed, 0 to remove and 30 not upgraded.
Need to get 26.0MB of archives.
After this operation, 66.8MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://security.debian.org lenny/updates/main php5-common 5.2.6.dfsg.1-1+lenny10 [366kB]
Get:2 http://backports.debian.org lenny-backports/main libssl0.9.8 0.9.8o-4~bpo50+1 [3063kB]
Get:3 http://ftp.us.debian.org lenny/main openssl-blacklist 0.4.2 [6338kB]
Get:4 http://security.debian.org lenny/updates/main libapache2-mod-php5 5.2.6.dfsg.1-1+lenny10 [2485kB]
12% [2 libssl0.9.8 1910056/3063kB 62%] [3 openssl-blacklist 786029/6338kB 12%] [4 libapache2-mod-php5 213989/2485kB 8%]———————————skip————————————————————-
Enabling site default.
Enabling module alias.
Enabling module autoindex.
Enabling module dir.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module status.
Enabling module auth_basic.
Enabling module deflate.
Enabling module authz_default.
Enabling module authz_user.
Enabling module authz_groupfile.
Enabling module authn_file.
Enabling module authz_host.
Enabling module reqtimeout.
Setting up libpq5 (8.4.7-0squeeze1~bpo50+1) ...
Setting up php5-pgsql (5.2.6.dfsg.1-1+lenny10) ...
Setting up postgresql-client-common (111~bpo50+1) ...
Setting up postgresql-client-8.4 (8.4.7-0squeeze1~bpo50+1) ...
Setting up ssl-cert (1.0.23) ...
Setting up postgresql-common (111~bpo50+1) ...
Adding user postgres to group ssl-cert
Building PostgreSQL dictionaries from installed myspell/hunspell packages…
Setting up postgresql-8.4 (8.4.7-0squeeze1~bpo50+1) ...
Creating new cluster (configuration: /etc/postgresql/8.4/main, data: /var/lib/postgresql/8.4/main)...
Moving configuration file /var/lib/postgresql/8.4/main/postgresql.conf to /etc/postgresql/8.4/main…
Moving configuration file /var/lib/postgresql/8.4/main/pg_hba.conf to /etc/postgresql/8.4/main…
Moving configuration file /var/lib/postgresql/8.4/main/pg_ident.conf to /etc/postgresql/8.4/main…
Configuring postgresql.conf to use port 5432…
Starting PostgreSQL 8.4 database server: main.
Setting up postgresql-doc-8.4 (8.4.7-0squeeze1~bpo50+1) ...
Setting up postgresql-doc (8.4.7-0squeeze1~bpo50+1) ...
Setting up lsb-release (3.2-20) ...

PRI-IVIEW1:~# ln -s /etc/init.d/postgresql /etc/init.d/postgresql-8.4

PRI-IVIEW1:~# ln -s /var/lib/postgresql/8.4/main /var/lib/postgresql/8.4/main/data

PRI-IVIEW1:~#

PRI-IVIEW1:~# mkdir /iviewdb/

PRI-IVIEW1:~# chown -R postgres.postgres /iviewdb

postgres@PRI-IVIEW1:/root$

PRI-IVIEW1:~# su postgres

postgres@PRI-IVIEW1:/root$ /usr/lib/postgresql/8.4/bin/initdb -D /iviewdb
The files belonging to this database system will be owned by user “postgres”.
This user must also own the server process.

The database cluster will be initialized with locale en_NG.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to “english”.

fixing permissions on existing directory /iviewdb … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers … 28MB
creating configuration files … ok
creating template1 database in /iviewdb/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok

WARNING: enabling “trust” authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

/usr/lib/postgresql/8.4/bin/postgres -D /iviewdb
or
/usr/lib/postgresql/8.4/bin/pg_ctl -D /iviewdb -l logfile start

postgres@PRI-IVIEW1:/root$ createuser pguser
Shall the new role be a superuser? (y/n) y
postgres@PRI-IVIEW1:/root$ psql postgres
psql (8.4.7)
Type “help” for help.

postgres=# template1=# \password pguser;
Enter new password:
Enter it again:

postgres-# \q

postgres@PRI-IVIEW1:/root$ exit
exit

PRI-IVIEW1:/etc/postgresql/8.4/main# su – postgres

postgres@PRI-IVIEW1:~$ createdb iviewdb;

postgres@PRI-IVIEW1:~$ psql -c -d template1

postgres:~$ ALTER USER postgres WITH PASSWORD 'passworddb';

postgres@PRI-IVIEW1:~$ exit

PRI-IVIEW1:~# cd /etc/postgresql/8.4/main

PRI-IVIEW1:/etc/postgresql/8.4/main# ls
environment pg_ctl.conf pg_hba.conf pg_ident.conf postgresql.conf start.conf

PRI-IVIEW1:/etc/postgresql/8.4/main# mkdir data

PRI-IVIEW1:/iviewdb#chmod 777 /etc/postgresql/8.4/main/data

PRI-IVIEW1:/iviewdb#chmod 777 /var/lib/postgresql/8.4/main/data

PRI-IVIEW1:/iviewdb# cp /var/lib/postgresql/8.4/main/PG_VERSION /etc/postgresql/8.4/main/data

PRI-IVIEW1:/iviewdb#cp /var/lib/postgresql/8.4/main/PG_VERSION /var/lib/postgresql/8.4/main/data/

PRI-IVIEW1:/home/gtoms# nano /etc/postgresql/8.4/main/pg_hba.conf

Database administrative login by UNIX sockets
local all postgres trust

TYPE DATABASE USER CIDR-ADDRESS METHOD

“local” is for Unix domain socket connections only
local all all trust
IPv4 local connections:
host all all 127.0.0.1/32 trust
IPv6 local connections:
host all all ::1/128 trust

/etc/init.d/postgresql restart

Selesai menginstall PostgreSQL 8.4 saya menginstall JAVA 1.5 sesuai syarat iView agar bisa berjalan, edit kembali sources.list untuk dapat mencari paket instalasi Java 1.5 :

nano /etc/apt/sources.list

deb http://ftp.us.debian.org/debian/ lenny main non-free
deb-src http://ftp.us.debian.org/debian/ lenny main non-free

deb http://security.debian.org/ lenny/updates main non-free
deb-src http://security.debian.org/ lenny/updates main non-free

PRI-IVIEW1:/home/gtoms# apt-get install openjdk-6-jdk openjdk-6-jre
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
avahi-daemon dbus dbus-x11 defoma gsfonts gsfonts-x11 java-common libasound2 libavahi-common-data libavahi-common3 libavahi-core5 libdaemon0 libdbus-1-3 libfontenc1 libfreetype6 libice6 libltdl3
libnss-mdns libsm6 libxfont1 libxi6 libxt6 libxtst6 odbcinst1debian1 sun-java5-bin sun-java5-demo sun-java5-jre unixodbc xfonts-encodings xfonts-utils
Suggested packages:
avahi-autoipd defoma-doc dfontmgr psfontmgr x-ttcidfont-conf equivs libasound2-plugins libfreetype6-dev sun-java5-doc sun-java5-source sun-java5-plugin ia32-sun-java5-plugin sun-java5-fonts ttf-baekmuk
ttf-unfonts ttf-unfonts-core ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho ttf-sazanami-mincho ttf-arphic-uming libmyodbc odbc-postgresql libct1
Recommended packages:
libft-perl
The following NEW packages will be installed:
avahi-daemon dbus dbus-x11 defoma gsfonts gsfonts-x11 java-common libasound2 libavahi-common-data libavahi-common3 libavahi-core5 libdaemon0 libdbus-1-3 libfontenc1 libfreetype6 libice6 libltdl3
libnss-mdns libsm6 libxfont1 libxi6 libxt6 libxtst6 odbcinst1debian1 sun-java5-bin sun-java5-demo sun-java5-jdk sun-java5-jre unixodbc xfonts-encodings xfonts-utils
0 upgraded, 31 newly installed, 0 to remove and 0 not upgraded.
Need to get 51.8MB of archives.
After this operation, 130MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://security.debian.org lenny/updates/main libavahi-common-data 0.6.23-3lenny3 [31.4kB]
Get:2 http://ftp.us.debian.org lenny/main libice6 2:1.0.4-1 [46.6kB]
Get:3 http://security.debian.org lenny/updates/main libavahi-common3 0.6.23-3lenny3 [48.0kB]
Get:4 http://security.debian.org lenny/updates/main libavahi-core5 0.6.23-3lenny3 [115kB]
Get:5 http://ftp.us.debian.org lenny/main libsm6 2:1.0.3-2 [22.3kB]
———————————————-skip——————————————————————-

Selesai instalasi Java 1.5 tiba saatnya menginstall iView, download iView di :

http://sourceforge.net/projects/cyberoam-iview/files/

PRI-IVIEW1:/home/gtoms#mkdir /iview

PRI-IVIEW1:/home/gtoms#mkdir /iview/archive

PRI-IVIEW1:/home/gtoms#chmod 755 iView-Linux-0.111-Setup.bin

PRI-IVIEW1:/home/gtoms# ./iView-Linux-0.111-Setup.bin

Enter Directory path to install iView
: /iview
Enter Directory path to store archived logs
: /iview/archive
Path values
IVIEW_HOME:/iview
ARCHIVE_HOME:/iview/archive
Checking kernel version compatibility …Done
Enter Postgresql 8.4 Home directory path
(Absolute path of directory that contains PostgreSQL data folder)
:/var/lib/postgresql/8.4/main/
Checking PG_version (PG 8.4 is required)...Done
searching psql client…Done
Enter JAVA 1.5 Home path
:/usr/lib/jvm/java-6-openjdk
Setting up JAVA for Cyberoam-iView (jdk 1.5 or greater is required)Java…Done
Creating IVIEW_HOME directory…Done
Copying GUI files…Done
Copying system files…Done
Updating PostgreSQL database parameters according to hardware configuration…Done
Setup starting service postgre
./iview_linux_installer/setup: line 373: /etc/init.d/postgresql-8.4: No such file or directory
please wait creating database
25%
50%
75%
100%...Done
Updating Cyberoam-iView parameters in database…Done
Specify password for default Cyberoam-iView administrator â “admin”
Administrator Username is: admin
Specify Password:
Re-enter Password:
Administrator’s Email id
henry@gultom.or.id
Registering Cyberoam-iView as a service…Done
Starting iviewd service
PRI-IVIEW1:/home/gtoms#

Ada error /etc/init.d/postgresql-8.4: No such file or directory tidak masalah, kita bisa merestart kembali dengan #/etc/init.d/postgresql restart

Cek status iview :

NGLAEM1:/home/gtoms# /etc/init.d/iviewd status
iView Web application is Running
iView Syslog server is Running

Kita bisa login ke webase iView :

http;//hostnameip:8000

2 komentarze: