Google
 

Linux Distro Counter

Welcome to Open Source Software and Linux Blog.

Hi, everyone!. I just created this blog to share knowledge about open source software and Linux. If you all have knowledge and info related to open source / Linux, please share or send me an email. Thanks ^_^

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.

Friday, August 17, 2007

Job scheduler (Crontab) for Linux

Crontab is a tool for scheduling tasks for the computer to run. It will automate the jobs that needs to be done but will be difficult to be done by human because of time limitation. There are only 4 options for crontab which are -u, -e, -l and -r and the usage is described below:

  • crontab -l - list all the crontab on standard output
  • crontab -e - edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables
  • crontab -r - remove the current crontab
  • crontab -u - specify the user
    • example: $ crontab -u username -l - this command will list the crontab belongs to the username
Crontab is set by running the crontab -e command and add the necessary time and the command to be run on that particular time. Crontab scheduling format are as below:

* * * * * command to be run

1st * is for minutes (0-59)
2nd * is for hour (0-23)
3rd * is for day of month (1-31)
4th * is for month of year (1-12)
5th * is for day of the week (0-7) where 0=Sunday and 7=Sunday

Example:
To backup your pc using rsnapshot everyday at 7.30 a.m.;
  1. Open terminal and type crontab -e
  2. In crontab area type; 30 7 * * * /usr/local/bin/rsnapshot daily
  3. save your crontab setting and exit

Monday, August 13, 2007

How to: Know your mysql and php is connect properly

How to know your mysql and php is connect properly. From my experience I like to share this knowledge.

1) Install the php and mysql in Linux properly with common configuration.
2) Create user and set the password in your database.
2) Create a php file like testdb.php and follow this code. Save it and transfer this file to your webroot. For examples on redhat base is /var/www/htdocs/html or Suse /srv/www/html.
3) Open your browser and type such as http://localhost/testdb.php

If success, the result will show you like
Connecting... Using training2

Friday, August 10, 2007

How to: Install Network Storage Server on CentOS 5 (Samba)

This is the step to install Samba Server on CentOS 5.

1) Open your terminal and login as root

2) type yum install samba and wait until it complete install.

3) Edit /etc/samba/smb.conf with your favorite editor like vi

4) Find workgroup = (yourgroup), server string = (your description), security = share.

5) Go to the bottom of smb.conf and remove ; to enable the purpose.
;[myshare]
; comment = Mary's and Fred's stuff
; path = /usr/somewhere/shared
; valid users = mary fred
; public = no
; writable = yes
; printable = no
; create mask = 0765

example:

[marketing_sharing_file]
comment = Saled Item
path = /home/marketing_department
; valid users = nobody
guest ok = yes
writeable = yes
; printable = no
create mask = 0777

After you edit, save and exit.

Thats all. Easy!


Wednesday, August 8, 2007

How to: Complete Install Simple Mail Server in 30 minute including webmail

This is some guide to install mail server in 30 minute. That easy!

1) List of software that you need to install.
a. Postfix for MTA
b. Dovecot for IMAP/POP3 support
c. SquirrelMail for webmail
d. Webmin for web base administrator

2) Install CentOS 5 as common
At (I suggest you tick)
Development package
Develoment lib
Development tools
Gnome Software development
Java development
Legacy software
X software Development
Server
Mail server
-postfix
-Dovecot
-SquirrelMail
-Thunderbird
Server configuration
Webserver
Base System
Base
X windows system

and follow the Centos installation step until finish.

3) Login you the CentOS 5 as root. Install webmin for easy administration soon
rpm -Uvh (your_webmin_package.rpm)

4) After that, open terminal and start this process. (postfix, dovecot, httpd)

5) After you restart the services, test you postfix. To test follow this step:
a. open terminal
type:
telnet localhost 25
EHLO localhost
MAIL FROM: (your email address eg: skymack@foodmalaysia.net)
RCPT TO: (recipient address)
DATA
(type your message here)
.
QUIT

OR

telnet foodmalays.net 25
helo foodmalaysia.net
mail from: sender@foodmalaysia.net
rcpt to: recipientname@mydomain.com
data
subject: (you email title)
to: recipientname@mydomain.com
Write the message here
.

quit

6) After testing you postfix running succesfully, open you webmin eg:
http://localhost:10000 with your browser.
Login to your webmin and go to servers --> Dovecot IMAP/POP3 Server. Select Networking & protocol --> serve mail protocol --> (press ctrl on you keyboard) and select IMAP and POP3. Save it.

7) Create user:
Open terminal. Type
useradd -m (youruser) and enter.
To give password:
passwd (youruser) and enter

8) Open your internet browser and type,
http://localhost/webmail and you will go directly to your webmail (squirrelmail). Fill in you username and password that you created before.

9) Try to send your email to you own name. If it receive the mail its consider your email server is successfully installed.

10) To setup email server and live for world, you must go to setup DNS server, change the server name and get the fix IP number. That all.

Friday, August 3, 2007

eyeOS: New open source web operating system.

Portable applications can come in handy when you are on the move, but there are situations when using them is not an option. For instance, before you connect an external hard disk or a USB stick to a public computer, you have to ask permission. More importantly, even if you get permission, you can never be sure what kind of nasty viruses and malware you will be getting on your storage device. But why bother with portable applications at all when you can have your very own Web-based operating system bundled with a few essential applications? That's the promise of eyeOS -- an impressive and surprisingly useful open source Web-based OS.

Main link:
http://www.eyeos.org/

To download:
http://www.eyeos.org/downloads

Some screen shots:
































Ghost Virtual Computer
See also ghost virtual computer. Its same like eyeOS that running on interner browser but it is not a open source product. It is free hosted services and allow people to register as free. Never worry about your data. It can be access anyway.

Main website:
http://g.ho.st/home/

Some picture from ghost virtual computer. Picture take from my ghost virtual pc account:
































How to install eyeOS?


The installation is very easy and can be done in 5 minutes...

1) Open your terminal/shell

2) Go to web root directory such as /var/www(redhat base) or /srv/www(SuSe
Linux)
eg: cd /var/www

3) Download the package from http://www.eyeos.org/downloads
eg: wget (file download address)
You can download it in tar.gz or .zip format

4) Extract and place it in your web root
eg: tar xvzf (file name)

5) Give full permission to the package.
eg: chmod 777 (extracted file name)

6) Run the install.php on your browser and follow the instructions.