Thursday, July 31, 2008

Install dansguardian, tinyproxy, and firehol

Original post from http://ubuntuforums.org/showpost.php?p=1222237&postcount=21

Install dansguardian, tinyproxy, and firehol

Code:
sudo apt-get install dansguardian tinyproxy firehol
Edit /etc/dansguardian/dansguardian.conf...

Code:
sudo nano -w /etc/dansguardian/dansguardian.conf
and leave everything at default. You will just need to comment out the UNCONFIGURED line

Code:
# Comment this line out once you have modified this file to suit your needs
#UNCONFIGURED
Next, you will need to edit the tinyproxy.conf

Code:
sudo nano -w /etc/tinyproxy/tinyproxy.conf
and make the following changes

Code:
##
## tinyproxy.conf -- tinyproxy daemon configuration file
##

#
# Name of the user the tinyproxy daemon should switch to after the port
# has been bound.
#
User nobody
Group nogroup

#
# Port to listen on.
#
#Port 8888
Port 3128
Now the last file to be edited is /etc/firehol/firehol.conf

Code:
sudo nano -w /etc/firehol/firehol.conf
and here is my entire firehol.conf file

Code:
#
# $Id: client-all.conf,v 1.2 2002/12/31 15:44:34 ktsaou Exp $
#
# This configuration file will allow all requests originating from the
# local machine to be send through all network interfaces.
#
# No requests are allowed to come from the network. The host will be
# completely stealthed! It will not respond to anything, and it will
# not be pingable, although it will be able to originate anything
# (even pings to other hosts).
#

version 5
iptables -t filter -I OUTPUT -d 127.0.0.1 -p tcp --dport 3128 -m owner ! --uid-owner dansguardian -j DROP
transparent_squid 8080 "nobody root"

# Accept all client traffic on any interface
interface any world
 policy drop
 protection strong
 client all accept
Then restart the services

Code:
sudo /etc/init.d/dansguardian restart
sudo /etc/init.d/tinyproxy restart
sudo /etc/init.d/firehol restart
You should now have a working internet filter without any changes being made to the proxy settings.

How to uninstall and remove webmin

How to uninstall and remove webmin after you have installed it with rmp, you can do this:
How can I uninstall Webmin?

Just run the command

COMMAND:
/etc/webmin/uninstall.sh



If you have installed the RPM version of Webmin like i have, you can use

rpm -e webmin

Dansguardian Can't locate Compress/Zlib.pm from Webmin

If you get this error try to do this

Install this package

libdate-manip-perl,
libhtml-parser-perl,
libcompress-zlib-perl

Centos or Debian

sudo apt-get install libdate-manip-perl libhtml-parser-perl libcompress-zlib-perl

Monday, July 21, 2008

How to: Install Network Monitoring Tool (Nagios+Nagmin+Webmin+Mysql+Apache2+RRDTool+NMAP) on OpenSUSE 10.2

Originally Taken From

http://opensource-2u.blogspot.com/2007/08/how-to-install-network-monitoring-tool.html

Tuesday, August 28, 2007

How to: Install Network Monitoring Tool (Nagios+Nagmin+Webmin+Mysql+Apache2+RRDTool+NMAP) on OpenSUSE 10.2

These are step by step how to setup network monitoring tool on OpenSUSE 10.2:

Install MySql, RRDTool, NMAP and Apache2:
1. Open the YaST software management. Select package mysql, mysql-client, mysql-shared, rrdtool, nmap and apache2. (*Accept all dependencies)
2. After install all package run this command mysqladmin -u root password "yourpassword"
3. Start mysql by run this command rcmysql start
4. Make this service automatically start after reboot by type chkconfig mysql on
5. Start apache2 by typing rcapache2 start
6. Make apache2 auto start after reboot by typing chkconfig apache2 on

Install Webmin:1. Download webmin from webmin.com. I recommend you to download the noarch package for support all machine architecture. Save it, such as at your desktop.
2. Go to your desktop and type rpm -Uvh webmin_name
3. Start webmin by typing /etc/init.d/webmin start
4. Log in to webmin interface by opening your browser and type https://localhost:10000

Install Nagios:
1. Open YaST and select libcrypt, perl-Net-SNMP, fping, postgresql-libs, radiusclient, apache2, gd, and perl-URI.
2. Download nagios package (
nagios-2.5-24.i586.rpm, nagios-nrpe-2.5.2-28.i586.rpm , nagios-nsca-2.5-39.i586.rpm , nagios-plugins-1.4.5-5.i586.rpm , nagios-plugins-extras-1.4.5-5.i586.rpm , nagios-plugins-sap-ccms-0.7.3-38.i586.rpm and nagios-www-2.5-24.i586.rpm )
at http://download.opensuse.org/distribution/10.2/repo/oss/suse/i586/.
I recommend use nagios version 2.5 because most stable and many package are supported.
3. Install all these packages by typing rpm -Uvh nagios*.rpm
4. Start nagios by typing rcnagios start
5. Make nagios autostart after reboot by type chkconfig nagios on
6. Check your nagios by typing http://localhost/nagios/ on your browser (firefox etc)

Install Nagmin:
Nagmin is a webmin module. To install:
1. Download nagmin from http://sourceforge.net/project/showfiles.php?group_id=77010
I recommend you to download nagmin-2.1.0.tar.gz . It is because easy to install by a setup script. Other nagmin doesn't have a setup script.
2. Extract the nagmin by typing tar xvzf yournagminname .
3. Go to the nagmin folder and type ./setup to intall. Follow this guide

Database name to use or create : [Enter]
Nagios Root directory
: /etc/nagios
[Enter]
Nagios ETC directory
: /etc/nagios [Enter]
Nagmin root directory
: [Enter]
Nagios Configuration File: :
[Enter]
CGI Configuration File:
: [Enter]
Entries will be displayed for accuracy, select Y to continue.
Script will continue with its process.
Select N to question for viewing the SQL file
Select Y to other question

4. Now acces webmin and install the Nagmin plugin

Configure Nagmin setting:
Configure Nagmin Nagios by clicking Module Config in webmin. Change the configuration to the following value:
Nagios BIN directory /usr/bin
Nagios ETC directory /etc/nagios
Nagios LIBEXEC directory /usr/lib/nagios/plugins
5. Open your terminal and type vi /etc/nagios/cgi.cfg
find use_authentication=1; chage 1 to 0
find default_user_name = user, chage the user by deamon
6. Save and quit.
7. Now install NagMin module for webmin. To install go to Webmin --> Webmin Configuration --> Webmin Modules. Install the nagmin module from the nagmin folder that you extract before. The file name is look like
nagmin-2.x.x.wbm

The Error
1. (Error: version issue):
Some error found when your login webmin --> Server --> nagMIN Network Monitoring.
Error message:
The MySQL client program /usr/bin/mysql does not appear to be the correct version. Webmin only supports MySQL versions 3 and above.
The command /usr/bin/mysql -V returned :
/usr/bin/mysql  Ver 14.12 Distrib 5.0.22, for redhat-linux-gnu (i686) using readline 5.0
Suggested fix:open terminal and type vi /usr/libexec/webmin/nagmin/index.cgi
find "distrib" and add "| 5" after 4 at same line
save and quit the vi.

2.
error found when your login webmin --> Server --> nagMIN Network Monitoring --> in column System Databases --> nagios

error message:
"Error - Perl execution failed
Can't use an undefined value as a HASH reference at /path/to/mysql.pm line 113"
Suggested fix:
Location mysql.pm on Suse /usr/lib/perl5/vendor_perl/5.8.8/i586-linux-thread-multi/DBD/mysql.pm
At around line 109 of mysql.pm:

------------------------------------
 # Avoid warnings for undefined values
 $username ||= '';
 $password ||= '';

 # create a 'blank' dbh
 my($this, $privateAttrHash) = (undef, $attrhash);
 $privateAttrHash = { %$privateAttrHash,
'Name' => $dsn,
'user' => $username,
'password' => $password
 };
-------------------------------------

Needs to be changed to

-------------------------------------
# Avoid warnings for undefined values
 $username ||= '';
 $password ||= '';
 $attrhash ||= {};

 # create a 'blank' dbh
 my($this, $privateAttrHash) = (undef, $attrhash);
 $privateAttrHash = { %$privateAttrHash,
'Name' => $dsn,
'user' => $username,
'password' => $password
 };

Finish.

5 Faedah RTOS Linux Kernel - Apa Itu Sistem Operasi Masa Nyata (RTOS) di Malaysia

Di VIENNA dimana selepas 20 Tahun, Real-Time Linux Akhirnya Masuk ke Dalam Kernel Utama Linux. Itulah pada yang memahami bagaimana berkemban...