Posts

Showing posts from 2014

Installing Tomcat8 on RHEL6

Image
Apache-HTTP v/s Apache-Tomcat: The basic difference is Apache-Tomcat is written in Java but Apache-HTTP is written in C. Apart from this Apache-Tomcat is used as a webserver as well as to deploy Java Servlet's and JSP's [Java server pages] so basically Apache-Tomcat is used to serve Java Technologies whereas Apache-HTTP is used to serve HTTP. Prerequisites: Appropriate version of JRE [Java run-time environment] for instance jre1.7 is required to run tomcat-8[.X.X]. Tomcat binaries, for version 8 check this link . Sudo/Root access to the machine. Step1: Install JRE Download JRE from Java's official website. You can keep Java at any location but for my ease I have kept both Tomcat and Java in /opt. # cd /opt # cp jre-7u45-linux-x64.tar.gz . # tar -zxvf jre-7u45-linux-x64.tar.gz  The above command will create a folder with JRE binaries. In my case it was "jre1.7.0_45". Now set JRE_HOME [Required by Tomcat] and PATH. export JRE_HOME=/opt/jre1.7.

Some important commands

# Find CPU specifications cat /proc/cpuinfo # System information via uname: uname -r [Kernel release] uname -a [All information about the kernal] uname -s [Kernel name] uname -m [Machine hw name] uname -p [Processor type] uname -o [OS] uname -n [Node name] # Running kernel and compiler: cat /proc/version # X server version: X -showconfig or Xorg -version # List of Kernel modules loaded: lsmod # Memory and swap information cat /proc/meminfo free free -m [in MB] # Hard drives information: fdisk -l # Free/used drive space or mount points: df -h # Distribution ?? cat /etc/issue cat /etc/issue.net # Finding or locating files find locate which whereis # Log messages as they happen: tail -f /var/log/messages (shows last 10 lines). # What processes are running [concise information]: ps -A ps -A | grep <PROCESS_NAME/PID> [For specific process] # What process are running [Brief information]: ps -ef ps -ef | grep -i <PROCESS_NAME/PID>

Ways of searching a disk/hdd in RHEL6

There must be an entry in /sys/block/XXX # ls -lrt /sys/block/ /proc/partitions ==> cat /proc/partitions  major minor  #blocks  name    8        0   15728640 sda    8        1     512000 sda1    8        2   15215616 sda2    8       16    2097152 sdb  253        0   13148160 dm-0  253        1    2064384 dm-1 To list all the disk in the machine ==> fdisk -l # fdisk -l /dev/?d? To avoid all the dm devices. # fdisk -l 2>/dev/null | grep "Disk \/" Disk /dev/sda: 16.1 GB, 16106127360 bytes Disk /dev/sdb: 2147 MB, 2147483648 bytes Disk /dev/mapper/VolGroup-lv_root: 13.5 GB, 13463715840 bytes Disk /dev/mapper/VolGroup-lv_swap: 2113 MB, 2113929216 bytes # lsblk NAME                        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT sda                               8:0                      0    15G    0 disk  ├─sda1                        8:1                      0   500M  0 part   /boot └─sda2                        8:2                      0

NIC Bonding/Teaming in RHEL6

NIC [network interface card] bonding is a term used to describe a way to increase available bandwidth.  Bonding is nothing but Linux kernel feature[aka BONDING] that allows to aggregate multiple like interfaces (such as eth0, eth1, eth2 etc) into a single virtual link. This is done to get higher data rates and as well as link failover. NIC bonding may also be called as NIC Teaming. Here we will create a bond called bond0 , number of ether-net's used are two [ eth0 and eth1 ]. Step 1: Create a bond0 file==> # vim /etc/sysconfig/network-scripts/ifcfg-bond0 Append the file with below information and save the file==> DEVICE=bond0 IPADDR=192.168.57.150 NETMASK=255.255.255.0 USERCTL=no BOOTPROTO=none ONBOOT=yes Note: IP and Netmask needs to be replaced as per your network configuration. Step 2:  Edit ifcfg-eth0 ==> # vim /etc/sysconfig/network-scripts/ifcfg-eth0  Append the details as follows ==>  DEVICE=eth0 ONBOOT=yes USERCTL=no