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

Sunday, October 12, 2014

MYSQL ERROR 1051 (42S02): Unknown table corrupttablename


Very rare we got a message to the browser saying "Unknown table tablename". Though we have the database and the table properly to the server. To solve the issue, we need to follow the below steps-

ERROR 1051 (42S02): Unknown table corrupttablename

[root@db ~]# service mysqld stop
[root@db ~]# mv /var/lib/mysql/database_name/corrupttablename.frm /tmp
[root@db ~]# service mysqld start

Wednesday, August 27, 2014

How to capture network traffic using Wireshark & TCPdump

How to capture network traffic using Wireshark & TCPdump

Using Wireshark (Grafical interface)
Install wireshark:
mahidul@mtr:~$ sudo apt-get install wireshark

Or, download it from official site https://www.archlinux.org

Error: Wireshark not listing interfaces on Ubuntu 12.04 precise pangolin
Solution:
mahidul@mtr:~$ sudo dpkg-reconfigure wireshark-common
mahidul@mtr:~$ sudo usermod -a -G wireshark $USER
mahidul@mtr:~$ sudo reboot

Reference:
http://it-connects.co/wireshark-not-listing-interfaces-on-ubuntu-12-04-precise-pangolin/


Using TCPdump (Command Line Interface)
Install tcpdump in redhat.
[root@mahidul ~]# yum install tcpdump

Install tcpdump in ubuntu.
mahidul@mtr:~$ apt-get install tcpdump

Check if tcpdump installed properly.
[root@mahidul ~]# rpm -qa | grep tcpdump

1. Capture Packets from Specific Interface
[root@mahidul ~]# tcpdump -i eth0

2. Capture Only N Number of Packets
[root@mahidul ~]# tcpdump -c 5 -i eth0

3. Display Available Interfaces
[root@mahidul ~]# tcpdump -D

4. Display Available Interfaces
[root@mahidul ~]# tcpdump -D

5. Display Captured Packets in HEX and ASCII
[root@mahidul ~]# tcpdump -XX -i eth0

6. Capture and Save Packets in a File
[root@mahidul ~]# tcpdump -w 0001.pcap -i eth0

7. Read Captured Packets File
[root@mahidul ~]# tcpdump -r 0001.pcap

8. Capture IP address Packets
[root@mahidul ~]# tcpdump -n -i eth0

9. Capture only TCP Packets.
[root@mahidul ~]# tcpdump -i eth0 tcp

10. Capture Packet from Specific Port
[root@mahidul ~]# tcpdump -i eth0 port 22

11. Capture Packets from source IP
[root@mahidul ~]# tcpdump -i eth0 src 192.168.0.2

12. Capture Packets from destination IP
[root@mahidul ~]# tcpdump -i eth0 dst 50.116.66.139
 


Reference:
http://www.tecmint.com/12-tcpdump-commands-a-network-sniffer-tool/



Friday, June 13, 2014

Burning CD/DVD using CLI in linux (redhat/debian/ubuntu)

Burning CD/DVD using CLI:
1. find cdrom/dvdrom
2. make an iso
    i. create an iso
    ii. create an iso from collecting data from diffrent location
    iii. add new data to an existence iso
3. burn the disk (cd/dvd)
    i. single session burning
    ii. Multi-session burning
    iii. Blank a disk for re-writing cd/dvd (re-writable disk)


1. First findout the cd drive. Here my cd/dvd rom is dev=1,0,0
root@mahidul:~# cdrecord --devices
wodim: Overview of accessible drives (1 found) :
-------------------------------------------------------------------------
 0  dev='/dev/sg1'    rwrw-- : 'hp' 'DVDRAM GT80N'
-------------------------------------------------------------------------

"OR"
root@mahidul:~# cdrecord -scanbus
scsibus0:
    0,0,0      0) 'ATA     ' 'Hitachi HTS54757' 'JE4O' Disk
    0,1,0      1) *
    0,2,0      2) *
    0,3,0      3) *
    0,4,0      4) *
    0,5,0      5) *
    0,6,0      6) *
    0,7,0      7) *

scsibus1:
    1,0,0    100) 'hp      ' 'DVDRAM GT80N    ' 'R102' Removable CD-ROM
    1,1,0    101) *
    1,2,0    102) *
    1,3,0    103) *
    1,4,0    104) *
    1,5,0    105) *
    1,6,0    106) *
    1,7,0    107) *


2. Then make an iso of the folder that you want to write.
root@mahidul:~# mkisofs -J -r -o /storage/cdwrite.iso /storage/cdwrite/

If -joliet-long error shows then use below command.
root@mahidul:~# mkisofs -joliet-long -r -o /storage/cdwrite.iso /storage/cdwrite/

You can make an iso from diffrent locations.
root@mahidul:~# mkisofs -J -r -o  /root/testburn.iso -graft-points /folder1=/var/log/test.log /folder2=/home/mahidul/DSC_9881_20131111_140755.jpg

You can add folders/files later like the below step.

3. Now, Burn the cd with cdrecord command.
root@mahidul:~# cdrecord -v -dev='/dev/sg1' /storage/cdwrite.iso

"OR"
root@mahidul:~# cdrecord -v -dao dev=1,0,0 /storage/cdwrite.iso

"OR" Using wodim (Write Optical DIsc Media):
root@mahidul:~# wodim -eject -tao speed=1 dev=/dev/sg1 -v -data /storage/cdwrite.iso

Write multiple times to a re-writable disk:
root@mahidul:~# cdrecord -v -multi -eject -tao speed=1 -dev='/dev/sg1' /storage/cdwrite.iso

Note:
1. The programs wodim, cdrskin, and xorrecord may be used on all kinds of media with the options shown with "cdrecord".
2. The meaning of the options is:
    -V: Gives the filesystem a name which will probably show up as mount point if the medium is mounted automatically. The ISO specs allow             only "A" to "Z", "0" to "9", and "_". 32 characters at most.
    -J: Prepares names of up to 64 UTF-16 characters for MS-Windows readers. Aka "Joliet".
    -joliet-long: Would allow 103 UTF-16 characters for MS-Windows readers. Not conformant to Joliet specs.
    -r: Prepares names of up to 255 characters for Unix readers and gives read permission for everybody. Aka "Rock Ridge".
    -o: Sets the file path for the resulting ISO image.

Monday, June 2, 2014

Install and Configure Hudson in redhat 6.x

Install and Configure Hudson in redhat 6.x

Packages Requirements:
. Java
. Apache
. Apache-tomcat

Installing java:
Download the leatest java from http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html#jdk-7u10-oth-JPR
[root@hudson~]# mkdir -p /usr/jdk
[root@hudson~]# tar -zxvf /Packages/jdk-7u10-linux-x64.tar.gz -C /usr/jdk/
[root@hudson~]# ls /usr/jdk/jdk1.7.0_10/

Installing Apache2:
[root@hudson~]# yum install httpd -y
[root@hudson~]# service httpd restart
[root@hudson~]# chkconfig httpd on

Installing apache-tomcat:
[root@hudson~]# wget http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.tar.gz
[root@hudson~]# tar -zxvf /Packages/apache-tomcat-6.0.36.tar.gz -C /usr/share/
[root@hudson~]# vim /usr/share/apache-tomcat-6.0.36/bin/catalina.sh
    #Add the following lines
    JAVA_HOME=/usr/jdk/jdk1.7.0_10/ 
    JAVA_OPTS="-Xms1024m -Xmx4096m -XX:PermSize=256m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"

### Set Java Heap size: (memory allocation for java)
[root@hudson ~]# vim /usr/share/apache-tomcat-6.0.36/bin/setenv.sh
CATALINA_OPTS="-Djava.awt.headless=true -Xms1024m -Xmx10240m -XX:PermSize=1024m -XX:MaxPermSize=2048m"

[root@hudson~]# sh /usr/share/apache-tomcat-6.0.36/bin/startup.sh

[root@hudson~]# yum install -y nmap
[root@hudson~]# nmap localhost
    8080/tcp open  http-proxy

Sometimes apache-tomcat get stuck then pls kill the apache-tomcat process and restart from the below script.

[root@hudson~]# vim /usr/share/apache-tomcat-6.0.36/conf/tomcat-users.xml
# Append the beloow lines under the tomcat-users tag
  <role rolename="manager-gui"/>
  <user username="tomcat" password="your_tomcat_password" roles="manager-gui"/>
 
Now restart the apache-tomcat services:
[root@hudson~]# killall java
[root@hudson~]# sh /usr/share/apache-tomcat-6.0.36/bin/shutdown.sh
[root@hudson~]# sh /usr/share/apache-tomcat-6.0.36/bin/startup.sh

Now our server is ready. We can install hudson in two diffrent ways. First option is using war file and second is installing from repository as standalone service. Here I have presented both procedures. Lets get started.

Install hudson from war file:
First download leatest hudson.war:
[root@hudson ~]# wget http://eclipse.stu.edu.tw//hudson/war/hudson-3.1.2.war

Stop tomcat service:
[root@hudson ~]# /usr/share/apache-tomcat-6.0.36/bin/shutdown.sh
[root@hudson ~]# ps aux | grep tomcat
[root@hudson ~]# killall tomcat
[root@hudson ~]# kill -9 tomcat_id

Copy the hudson war to the tomcat webapps folder.
[root@hudson ~]# cp hudson-3.1.2.war /usr/share/apache-tomcat-6.0.36/webapps/hudson.war

Make hudson home directory and give proper permission:
[root@hudson ~]# mkdir /usr/share/apache-tomcat-6.0.36/.hudson/
[root@hudson ~]# chown tomcat.tomcat -R /usr/share/apache-tomcat-6.0.36/.hudson/

Startup tomcat and check the logs:
[root@hudson ~]# /usr/share/apache-tomcat-6.0.36/bin/shartup.sh
[root@hudson ~]# tail -f /usr/share/apache-tomcat-6.0.36/logs/catalina.out

Wait until all of your web applications loaded. Now go to the web browser, install your required plugins and complete the installation.
http://your_ip_address:8080/hudson/

Note: If you are not getting the hudson you may need to restart the war from tomcat manager (http://your_ip_address:8080).

Install hudson (standalone) from rpm:

[root@hudson ~]# wget -O /etc/yum.repos.d/hudson.repo http://hudson-ci.org/redhat/hudson.repo
[root@hudson ~]# yum check-update
[root@hudson ~]# yum install hudson
[root@hudson ~]# /etc/init.d/hudson start
[root@hudson ~]# tail -f /var/log/hudson/hudson.log

Thats all. Hope this helps you.



Reference:
http://docs.oracle.com/middleware/1212/core/MAVEN/config_hudson.htm#A1001805

Tuesday, May 6, 2014

How to rotate your application logs

How to rotate your application logs

Concept:
We use system's logrotate script to rotate our services logs. This (/etc/logrotate.conf) is a default script of the system which is executed by cronjob (/etc/cron.daily/logrotate) for log rotation. So, logration script and cronjob is already prepared by system, all we need to do is create a new file on (/etc/logrotate.d/) directory for our application and declair our requirement as below-

[root@db1 ~]# vim /etc/logrotate.d/asterisk
/var/log/asterisk/call.log {
    #If the log file is missing, go on to the next one without issuing an error message.
        missingok

    #rotate log files hourly/daily/weekly
        daily

    #Do not rotate the log if it is empty
        notifempty

    #Old versions of log files are compressed with gzip to save disk space.
        compress

    #create new (empty) log files after rotating old ones with ownership and password
        create 0664 root root
}

Note: Change the file name "asterisk" and log file location "/var/log/asterisk/call.log" as per your application.

Perameters:
weekly: Log files are rotated if the current weekday is less then the weekday of the last rotation or if more then a week has passed since the last rotation.
rotate 52: Log files are rotated 52 times before being removed or mailed to the address specified in a mail directive. If count is 0, old versions are removed rather then rotated.
compress: Old versions of log files are compressed with gzip to save disk space.
missingok: If the log file is missing, go on to the next one without issuing an error message.
notifempty: Do not rotate the log if it is empty
sharedscripts: Normally, prerotate and postrotate scripts are run for each log which is rotated, meaning that a single script may be run multiple times for log file entries which match multiple files. If sharedscript is specified, the scripts are only run once, no matter how many logs match the wildcarded pattern. However, if none of the logs in the pattern require rotating, the scripts will not be run at all.
postrotate
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript: The lines between postrotate and endscript (both of which must appear on lines by themselves) are executed after the log file is rotated. These directives may only appear inside a log file definition.

For Documentation purpose, I have also given the default scripts here.
[root@db1 ~]# vim /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# use date as a suffix of the rotated file
dateext

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp and btmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    create 0664 root utmp
        minsize 1M
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0600 root utmp
    rotate 1
}

# system-specific logs may be also be configured here.

Cronjob scripts:
[root@db1 ~]# vim /etc/cron.daily/logrotate
#!/bin/sh

/usr/sbin/logrotate /etc/logrotate.conf >/dev/null 2>&1
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0

Referance:
http://www.thegeekstuff.com/2010/07/logrotate-examples/
http://www.cyberciti.biz/faq/how-do-i-rotate-log-files/

Monday, April 28, 2014

Log-in problem and Nautilus problem in Ubuntu 12.04

Log-in problem and Nautilus problem in Ubuntu 12.04

After a long search in web didn't find the right solution. Here is the solutions to fix those problems.

Error1: Desktop is not comming after login in Ubuntu 12.04.
Solution:
mahidul@mahidul-pc:~$ sudo apt-get update
mahidul@mahidul-pc:~$ sudo apt-get -y install --reinstall ubuntu-desktop

Error2: Nautilus does not working in ubuntu 12.04. And error log shows as below- (Press Ctrl+Alt+F1)

mahidul@mahidul-pc:~$ tail -f /var/log/syslog
mahidul-pc kernel: [  809.241978] nautilus[3199]: segfault at ab ip 00007f8016d4ef08 sp 00007fff9e2155d0 error 4 in libpython2.7.so.1.0[7f8016bc8000+281000]

mahidul@mahidul-pc:~$ nautilus
Segmentation fault (core dumped)

Solution:

mahidul@mahidul-pc:~$ sudo mv /usr/share/nautilus-python/extensions/ /tmp
[sudo] password for mahidul: give_your_sudo_password_here

mahidul@mahidul-pc:~$ nautilus

Tuesday, April 8, 2014

How to install and configure Torrent client in redhat/centos 6.x

How to install and configure Torrent client in redhat 6

Topic Index:
   1. Concept
   2. Installation
   3. Set global speed restriction
   4. Start a download from Transmission-gui
   5. Start a download from command line
   6. Start a download from web interface
   7. Create new Torrent
   8. Download torrent file using cronjob
   9. Troubleshooting

01. Concept:          
As we all know torrent is a peer-to-peer file sharing protocal whish is used for the transaction of big amount data. For this kinds of sharing we can use may kinds of torrent clients like bittorrent, utorrent, transmission etc. Torrent is simple in windows internment but little bit complected from linux command line. Here I have explained details regarding transmission torrent client which gives you all the features you want. Some of the major feature is like below-
1. Command line usability
2. Uses as desktop client
3. Remote access to the client
4. Web interface for accessing through Internet

02. Installation:
First install dependencies:
[root@gw1 ~]# yum -y install openssl* make gcc gcc-c++ autoconf automake openssl-devel curl-devel libevent-devel wget libevent-1.4.so.2

If still libevent is missing then menually download and install it like this way:
[root@gw1 ~]# wget ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6rolling/x86_64/os/Packages/libevent-1.4.13-4.el6.x86_64.rpm
or
[root@gw1 ~]# wget ftp://rpmfind.net/linux/centos/6.4/os/x86_64/Packages/libevent-1.4.13-4.el6.x86_64.rpm
[root@gw1 ~]# rpm -ivh libevent-1.4.13-4.el6.x86_64.rpm

Now we are going to download a torrent client named transmission:
[root@gw1 ~]# wget ftp://ftp.univie.ac.at/systems/linux/fedora/epel/6/x86_64/transmission-daemon-2.13-1.el6.x86_64.rpm
[root@gw1 ~]# wget http://dl.dropboxusercontent.com/u/72284235/transmission.tar.gz
[root@gw1 ~]# tar -zxvf transmission.tar.gz

Lets unzip it and install the nessesary packages:
[root@gw1 ~]# rpm -ivh transmission-daemon-2.13-1.el6.x86_64.rpm

To use transmission client from desktop envirnment follow below step:
[root@gw1 ~]# rpm -ivh transmission/*

To use transmission client only from command line interface (CLI) follow below steps:
[root@gw1 ~]# rpm -ivh transmission/transmission-common-2.13-1.el6.x86_64.rpm
[root@gw1 ~]# rpm -ivh transmission/transmission-cli-2.13-1.el6.x86_64.rpm

[root@gw1 ~]# service transmission-daemon restart
[root@gw1 ~]# chkconfig transmission-daemon on

03. Set global speed restriction:
The daemon has to be stopped before making changes to the config file. Otherwise, the config file will be overwritten on daemon restart later. Unless performing a reload instead of restart.

[root@gw1 ~]# /etc/init.d/transmission-daemon stop

[root@gw1 ~]# vim /etc/init.d/transmission-daemon
DAEMON_ARGS="-g $TRANSMISSION_HOME/.config/transmission"
#DAEMON_ARGS="-T --blocklist -g $TRANSMISSION_HOME/.config/transmission"

[root@gw1 ~]# vim /var/lib/transmission/.config/transmission/settings.json
{
    "alt-speed-down": 50,
    "alt-speed-enabled": false,
    "alt-speed-time-begin": 540,
    "alt-speed-time-day": 127,
    "alt-speed-time-enabled": false,
    "alt-speed-time-end": 1020,
    "alt-speed-up": 50,
    "bind-address-ipv4": "0.0.0.0",
    "bind-address-ipv6": "::",
    "blocklist-enabled": true,
    "blocklist-url": "http://www.example.com/blocklist",
    "cache-size-mb": 2,
    "dht-enabled": true,
    "download-dir": "/storage/Downloads",
    "encryption": 1,
    "idle-seeding-limit": 30,
    "idle-seeding-limit-enabled": false,
    "incomplete-dir": "/storage/Downloads",            
    "incomplete-dir-enabled": false,
    "lazy-bitfield-enabled": true,
    "lpd-enabled": false,
    "message-level": 2,
    "open-file-limit": 32,
    "peer-limit-global": 240,
    "peer-limit-per-torrent": 60,
    "peer-port": 51413,
    "peer-port-random-high": 65535,
    "peer-port-random-low": 49152,
    "peer-port-random-on-start": false,
    "peer-socket-tos": 0,
    "pex-enabled": true,
    "port-forwarding-enabled": true,
    "preallocation": 1,
    "ratio-limit": 2,
    "ratio-limit-enabled": false,
    "rename-partial-files": true,
    "rpc-authentication-required": true,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-password": "your_password_here",
    "rpc-port": 9091,
    "rpc-username": "admin",
    "rpc-whitelist": "127.0.0.1",
    "rpc-whitelist-enabled": false,
    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
    "speed-limit-down": 100,
    "speed-limit-down-enabled": false,
    "speed-limit-up": 5,
    "speed-limit-up-enabled": true,
    "start-added-torrents": true,
    "trash-original-torrent-files": false,
    "umask": 18,
    "upload-slots-per-torrent": 14
}

[root@gw1 ~]# mkdir -p /storage/Downloads
[root@gw1 ~]# chown transmission.transmission /storage/Downloads
[root@gw1 ~]# chown transmission.transmission -R /storage/Downloads
[root@gw1 ~]# /etc/init.d/transmission-daemon start
                           
04. Start a download from Transmission-gui:
Edit-> Preferences -> Transmission Preferences -> Speed Limits/Alternative Speed Limits
Under Speed Limits/Alternative Speed Limits you can set what the max speed your data needs to be uploaded.

05. Start a download from command line:
[root@gw1 ~]#  /usr/bin/transmission-cli magnet:?xt=urn:btih:4d2220f8855996486033ff7b83f5e5d0ba863640&dn=New+Avengers+010+%282013%29+%28Digital%29+%28Zone-Empire%29&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Fopen.demonii.com%3A1337

To stop the transmission deamon use the below command:
[root@gw1 ~]# killall transmission-cli

To Resume the download:
[root@gw1 ~]# /usr/bin/transmission-cli /root/.config/transmission/torrents/StarCraft_2_HOTS.4be19f8ca99be826.torrent

Stop the download:
[root@gw1 ~]# killall transmission-cli

Download location:
[root@gw1 ~]# ls /storage/Downloads

06. Start a download from web interface:
Go to the transmission web interface.
http://localhost:9091
Username: admin
Password: web_password_here




07. Create new Torrent: 
Create a new torrent on the transmission server using transmission-create
[root@gw1 ~]# transmission-create -t -o .torrent
[root@gw1 ~]# transmission-create -t http://xxx.yyy.com:6969/announce -o your_file_or_folder_name.torrent your_file_or_folder

Verify the torrent file using transmission-show
[root@gw1 ~]# transmission-show .torrent

08. Download torrent file using cronjob:            

[root@gw Downloads]# crontab -e
# Minute   Hour   Day of Month       Month          Day of Week              Command
# (0-59)  (0-23)     (1-31)    (1-12 or Jan-Dec)  (0-6 or Sun-Sat)    command with full path

20      22      23      *       *       /usr/bin/killall transmission-cli
21      22      23      *       *       /usr/bin/transmission-cli magnet:?xt=urn:btih:4d2220f8855996486033ff7b83f5e5d0ba863640&dn=New+Avengers+010+%282013%29+%28Digital%29+%28Zone-Empire%29&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Fopen.demonii.com%3A1337

09. Troubleshooting: 
Error#01:
After restarting the transmission-daemon "settings.json" config back to previous state. Or sometimes only authentication reset to false.

Solution:
[root@gw1 ~]# vim /etc/init.d/transmission-daemon
DAEMON_ARGS="-g $TRANSMISSION_HOME/.config/transmission"
#DAEMON_ARGS="-T --blocklist -g $TRANSMISSION_HOME/.config/transmission"

Then stop the transmission-daemon, change your settings and start the transmission-daemon again. Problem solved.

How to install and configure JIRA in redhat/centos 6.x


How to install and configure JIRA

Concept:
JIRA is a proprietary issue tracking product, used for bug tracking, issue tracking and project management which is developed by Atlassian. We can install JIRA three different ways like using .bin, .war or .tar.gz files. Here I will show you how to install jira using .bin file. It's very easy and simple. Follow the below steps and total installation will be complete within a few minutes.

Install mysql:
[root@db1 ~]# yum -y install mysqld

Or, download the following rpm packages and install from it.
[root@db1 ~]# yum remove mysql-libs perl-DBD-MySQL
[root@db1 ~]# yum install libaio perl-DBI
[root@db1 ~]# rpm -ivh /Packages/mysql-5.5.27-packages/mysql-libs-5.5.27-11.el6.art.x86_64.rpm
[root@db1 ~]# rpm -ivh /Packages/mysql-5.5.27-packages/mysql-5.5.27-11.el6.art.x86_64.rpm
[root@db1 ~]# rpm -ivh /Packages/mysql-5.5.27-packages/mysqlclient16-5.1.59-1.el6.art.x86_64.rpm
[root@db1 ~]# rpm -ivh /Packages/mysql-5.5.27-packages/perl-DBD-MySQL-4.022-1.el6.rfx.x86_64.rpm
[root@db1 ~]# rpm -ivh /Packages/mysql-5.5.27-packages/mysql-server-5.5.27-11.el6.art.x86_64.rpm
[root@db1 ~]# yum install crontabs 
[root@db1 ~]# service mysqld restart
[root@db1 ~]# chkconfig mysqld on

Create a database for jira and give proper permission:
[root@db1 ~]# mysqladmin -u root password your_root_password
[root@db1 ~]# mysql -u root -p
mysql> CREATE DATABASE jiradb CHARACTER SET utf8 COLLATE utf8_bin;
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX on jiradb.* TO 'jira'@'localhost' IDENTIFIED BY 'jira_db_password';
mysql> flush privileges;
mysql> SHOW GRANTS FOR 'jira'@'localhost';
mysql> exit;

Install Jira:
Download atlassian-jira-6.2.2-x64.bin (32/64 bit) from https://www.atlassian.com/software/jira/download. And install as below-
[root@db1 JIRA_Packages]# ./atlassian-jira-6.2.2-x64.bin
Unpacking JRE ...
Starting Installer ...
Apr 08, 2014 10:09:06 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Apr 08, 2014 10:09:06 AM java.util.prefs.FileSystemPreferences$2 run
INFO: Created system preferences directory in java.home.

This will install JIRA 6.2.2 on your computer.
OK [o, Enter], Cancel [c]

Choose the appropriate installation or upgrade option.
Please choose one of the following:
Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing JIRA installation [3]
2

Where should JIRA 6.2.2 be installed?
[/opt/atlassian/jira]

Default location for JIRA data
[/var/atlassian/application-data/jira]

Configure which ports JIRA will use.
JIRA requires two TCP ports that are not being used by any other
applications on this machine. The HTTP port is where you will access JIRA
through your browser. The Control port is used to Startup and Shutdown JIRA.
Use default ports (HTTP: 8080, Control: 8005) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2]
2
HTTP Port Number
[8080]
9080
Control Port Number
[8005]
9005

JIRA can be run in the background.
You may choose to run JIRA as a service, which means it will start
automatically whenever the computer restarts.
Install JIRA as Service?
Yes [y, Enter], No [n]
y

Extracting files ...
Please wait a few moments while JIRA starts up.
Launching JIRA ...
Installation of JIRA 6.2.2 is complete
Your installation of JIRA 6.2.2 is now ready and can be accessed via your
browser.
JIRA 6.2.2 can be accessed at http://localhost:9080
Finishing installation ...


Note: Here, we have used 9080 and 9005 port cause other applications also use the default 8080 port.

Install mysql driver for Jira:
Download mysql driver for JIRA from http://dev.mysql.com/downloads/connector/j and Select Connector/J 5.1.30: Platfrom Independent.
[root@db1 ~]# wget http://cdn.mysql.com/Downloads/Connector-J/mysql-connector-java-5.1.30.tar.gz
[root@db1 ~]# tar -zxvf mysql-connector-java-5.1.30.tar.gz
[root@db1 ~]# cp -pfrv mysql-connector-java-5.1.30/mysql-connector-java-5.1.30-bin.jar /opt/atlassian/jira/lib
[root@db1 ~]# service mysqld restart
[root@db1 ~]# service jira stop
[root@db1 ~]# service jira start

Configure and setup your license through jira web interface:
Now, open your our web browser and follow the below settings:
http://192.168.1.198:9080

Server Language: English (United States)
Connection: My Own Database (recommended for production environments)
Database Type: localhost
Port: 3306
Database: jiradb
Username: jira
Password: jira_db_password

Rest of procedure is piece of cake. Complete it and your jira server is ready to use. Hope this article will help you.

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.