Let's Share Knowledge And Make A Difference

  • Monitor your network and systems like a hawk

    There are some perfact open souce solution for monitoing your Network devices and server system's health. Nagios, Cacti, WhatsUpGold and Smokeping are the leading monitoring tools among them...

    Read More
  • Email service and Security

    Now a days life without email service is unthinkable and E-mail service is quite expensive. As always linux gives us the answer with a strong mail service named postfix...

    Read More
  • Data Center Solution

    A data centre is a facility where companies can keep and operate most of the ICT infrastructure that supports their business. IT host the most critical systems that are vital to the continuity of daily operations...

    Read More

Tuesday, February 18, 2014

How to install glances

How to install glances

Introduction:
In short Glances is a command line monitoring tools which present real time report regarding the following uses at a glance.
1. CPU uses,
2. server load,
3. memeory uses,
4. swap memory uses,
5. network interface uses,
6. HDD uses, and
7. Processes uses

On RedHat   
Download the packages:
[root@gw ~]# wget ftp://ftp.univie.ac.at/systems/linux/fedora/epel/6/i386/glances-1.7.3-1.el6.noarch.rpm
[root@gw ~]# wget ftp://ftp.univie.ac.at/systems/linux/fedora/epel/6/x86_64/python-psutil-0.6.1-1.el6.x86_64.rpm

Simply install them:
[root@gw ~]# rpm -ivh python-psutil-0.6.1-1.el6.x86_64.rpm
[root@gw ~]# rpm -ivh glances-1.7.3-1.el6.noarch.rpm
[root@gw ~]# glances

On Debian/Ubuntu/Linux Mint
root@gw~# sudo apt-add-repository ppa:arnaud-hartmann/glances-stable
root@gw~# sudo apt-get update
root@gw~# sudo apt-get install glances

Usage of Glances
root@gw~# glances

 Glances Color Codes
Meaning of Glances color code:
    -> GREEN: OK (everything is fine)
    -> BLUE: CAREFUL (need attention)
    -> VIOLET: WARNING (alert)
    -> RED: CRITICAL (critical)

Reference
http://www.tecmint.com/glances-an-advanced-real-time-system-monitoring-tool-for-linux/

How to configure yum repository (with groupinstall) in redhat 6

How to configure yum repository (with groupinstall) in redhat 6

Create a local repository repository:
First insert the redhat 6.X dvd in the dvdrom and mount it.
[root@gw ~]# mount /dev/dvdrw /mnt/

Copy the Packages folder to a location
[root@gw ~]# cp -Rfv /mnt/Packages /storage/
[root@gw ~]# cd /storage/Packages

Lets install dependencies for createrepo:
[root@gw Packages]# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
[root@gw Packages]# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
[root@gw Packages]# rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm
[root@gw Packages]# cd ..
[root@gw storage]# createrepo Packages
[root@gw storage]# cd
[root@gw ~]# vim /etc/yum.repos.d/local.repo
[local_repo]
name=RedHat6
baseurl=file:///storage/Packages/
enabled=1
gpgcheck=0

[root@gw ~]# yum clean all

Testing yum install:
[root@gw ~]# yum list
[root@gw ~]# yum install vim

Unmount the dvd drive
[root@gw ~]# umount /mnt/


Configure yum group install:
Insert the redhat 6.X dvd in the dvdrom and mount it.
[root@gw ~]# mount /dev/dvdrw /mnt/
[root@gw ~]# mkdir -P /storage/Packages_grp
[root@gw ~]# cp -pfr /mnt/Server/* /storage/Packages_grp/
[root@gw ~]# cd /storage/Packages_grp/
[root@gw Packages_grp]# createrepo -g repodata/1a7fc54d30d0d44222742c63069ab0126afef9f160931cc15e564dbe6414f268-comps-rhel6-Server.xml .

Please note that total file name of "-comps-rhel6-Server.xml" may be change to your distribution.
[root@gw Packages_grp]# cd
[root@gw ~]# vim /etc/yum.repos.d/group.repo
[group_repo]
name=RedHat6
baseurl=file:///storage/Packages_grp/
enabled=1
gpgcheck=0

[root@gw yum.repos.d]# yum clean all && yum makecache

Unmount the dvd drive
[root@gw ~]# umount /mnt/

Testing groupinstall:
[root@gw ~]# yum grouplist
[root@gw ~]# yum groupinstall "Web Server"


Thursday, January 16, 2014

How to install phpMyadmin from tar.gz

How to install phpMyadmin from tar.gz   

Install Dependency(php and mysql):
[root@nccsc ~]# yum install -y php* mysql-server
[root@nccsc ~]# wget ftp://mirror.switch.ch/pool/1/mirror/scientificlinux/6.4/x86_64/os/Packages/php-mbstring-5.3.3-22.el6.x86_64.rpm
[root@nccsc ~]# rpm -ivh php-mbstring-5.3.3-22.el6.x86_64.rpm

Install phpMyAdmin:
First download the latest tar from http://www.phpmyadmin.net/home_page/downloads.php.
[root@nccsc ~]# wget http://garr.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.1.4/phpMyAdmin-4.1.4-all-languages.tar.gz
[root@nccsc ~]# tar -zxvf phpMyAdmin-4.1.4-all-languages.tar.gz
[root@nccsc ~]# mv phpMyAdmin-4.1.4-all-languages /var/www/html/phpmyadmin
[root@nccsc ~]# chmod 755 -R /var/www/html/phpmyadmin/
[root@nccsc ~]# service httpd restart

Checking logs for error detection:
[root@nccsc ~]# tail -f /var/log/httpd/error_log

Lets check from a browser and login with your mysql database username and password.
http://your_ip_address/phpmyadmin

Troubleshooting:
PHP Fatal error:  Call to undefined function mb_detect_encoding() in /var/www/html/phpmyadmin/libraries/php-gettext/gettext.inc on line 177

Solution: you need the "php-mbstring" packages. Here my redhat php system is rhel6 5.3.3-22. thats why I have download the php-mbstring-5.3.3-22.el6.x86_64.rpm packages at first.

Thursday, November 21, 2013

How to re-install grub???

How to re-install grub???
---------------------------------------

1.  First find the partition which contains the /boot directory
grub> find  /boot/grub/stage1
  (hd0,4) 

or,
grub> find  /grub/stage1
  (hd0,4) 

2.  Execute the root command to find "/boot" partition
grub> root
  (hd0,4)

grub> root (hd0,4)
 Filesystem is type ext2fs, partition type 0x83

3.  Lets re-install Grub to a partition boot sector
grub> setup  (hd0,4)

4. Now restart the server-
grub> reboot

5. After restarting your server will get a grup menu but still it may not open. If it happens follow the below steps-
    - Press "e" from the grup menu where it says (hd0,1)
    - Now change to (hd0,4) and press "b" for boot.

6. It should start the OS. But to make this entry permanent edit the grub.conf as below-

[root@mahidul ~]# vim /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,6)
#          kernel /vmlinuz-version ro root=/dev/sda9
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda

default=0
timeout=5
splashimage=(hd0,4)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-220.el6.x86_64)
        root (hd0,4)
        kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=UUID=cd9be899-3467-4601-a6a7-b5a5774d7a55 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
        initrd /initramfs-2.6.32-220.el6.x86_64.img
title Other
        rootnoverify (hd0,0)
        chainloader +1


Thats it. Restart the server. It should works properly now. shue !!! big relief. :D

Thursday, October 31, 2013

VNC (Remote Desktop) Basic Configuration

VNC (Remote Desktop) Basic Configuration

Intruduction:
--------------------

VNC is used for remote desktop login. It's not like team viewer software. Diffrence is Team viewer needs internet to connect with the workstation. But VNC is used within a same network. For example, In most cases, VNC is used for local network.

Concept:
-------------

VNC has two parts-
1. Server end (VNC-*.*.*): First, the computer you want to login remotely install VNC server on that machine. To activate it you should give the serial key. VNC give 5 days free trial key to check out.
Download link:
http://realvnc.com/download/binary/1320/

2. Client end (VNC viewer): Second, install VNC viewer into those workstations from where you want to login to the VNC server machine.
Download link:
32-bit: http://www.realvnc.com/download/binary/1339/
64-bit: http://www.realvnc.com/download/binary/1341/

Note: VNC has both Windows and Linux version.

Saturday, September 28, 2013

Passwordless ssh login in RedHat6

Passwordless ssh login in RedHat6

1.1. First install openssh to both machine:
[root@vpn ~]# yum install openssh*

1.2. Now create a pair of keys one is public (id_rsa.pub) and other is private key (id_rsa).
[root@vpn ~]# ssh-keygen -t dsa
[root@vpn ~]# ls -l /root/.ssh/
-rw-------. 1 root root 1675 Sep 27 23:49 id_rsa
-rw-r--r--. 1 root root  402 Sep 27 23:49 id_rsa.pub

1.3. Now keep the public key to the destination server where you want to login passwordlessly. To do so use the below command. here my remote server's ip address is 192.168.1.73
[root@vpn ~]# ssh-copy-id root@192.168.1.73
Now try logging into the machine, with "ssh 'root@192.168.1.73'", and check in:
  .ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

1.4. Lets check its works or not:
[root@vpn ~]# ssh root@192.168.1.73

1.5. Troubleshooting: 
Sometime you may get the below error:
[root@vpn ~]# ssh-copy-id root@192.168.1.73
/usr/bin/ssh-copy-id: ERROR: No identities found

And this is how you should fix the problem:
[root@vpn ~]# ssh-agent $SHELL
[root@vpn ~]# ssh-add -L
[root@vpn ~]# ssh-add

Sometimes it may also gives an error like- "Could not open a connection to your authentication agent". To remove this error, use the following command.
[root@vpn ~]# eval `ssh-agent`

[root@vpn ~]# ssh-add -L
[root@vpn ~]# ssh-copy-id root@192.168.1.72
[root@vpn ~]# ssh root@192.168.1.72

Well all done. See, how easy was that !!! :D