Friday, 2 September 2016

Jenkins


In a nutshell, Jenkins is the leading open source automation server. Built with Java, it provides hundreds of plugins to support building, testing, deploying and automation for virtually any project

Prerequisite

Java

Apache Tomcat


Installation

Download   .war file
https://jenkins-ci.org/


http://mirrors.jenkins-ci.org/war/latest/jenkins.war


copy to webapps in tomcat

[root@master webapps]# pwd
/usr/apache-tomcat/webapps
[root@master webapps]#




Restart tomcat

Tuesday, 9 August 2016

GIT Server


GIT is the most versatile distributed version control system.

Installation:

yum install git

[root@rhel_client ~]# yum install git
Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package git.i686 0:1.7.1-2.el6_0.1 will be installed
--> Processing Dependency: perl-Git = 1.7.1-2.el6_0.1 for package: git-1.7.1-2.el6_0.1.i686
--> Processing Dependency: perl(Error) for package: git-1.7.1-2.el6_0.1.i686
--> Processing Dependency: perl(Git) for package: git-1.7.1-2.el6_0.1.i686
--> Running transaction check
---> Package perl-Error.noarch 1:0.17015-4.el6 will be installed
---> Package perl-Git.noarch 0:1.7.1-2.el6_0.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package           Arch          Version                   Repository      Size
================================================================================
Installing:
 git               i686          1.7.1-2.el6_0.1           sabitha        4.5 M
Installing for dependencies:
 perl-Error        noarch        1:0.17015-4.el6           sabitha         29 k
 perl-Git          noarch        1.7.1-2.el6_0.1           sabitha         28 k

Transaction Summary
================================================================================
Install       3 Package(s)

Total download size: 4.6 M
Installed size: 15 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): git-1.7.1-2.el6_0.1.i686.rpm                      | 4.5 MB     00:00
(2/3): perl-Error-0.17015-4.el6.noarch.rpm               |  29 kB     00:00
(3/3): perl-Git-1.7.1-2.el6_0.1.noarch.rpm               |  28 kB     00:00
--------------------------------------------------------------------------------
Total                                            29 MB/s | 4.6 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:perl-Error-0.17015-4.el6.noarch                            1/3
  Installing : git-1.7.1-2.el6_0.1.i686                                     2/3
  Installing : perl-Git-1.7.1-2.el6_0.1.noarch                              3/3
duration: 557(ms)
Installed products updated.

Installed:
  git.i686 0:1.7.1-2.el6_0.1

Dependency Installed:
  perl-Error.noarch 1:0.17015-4.el6      perl-Git.noarch 0:1.7.1-2.el6_0.1

Complete!

[root@rhel_client ~]#


2) ADD user git
[root@rhel_client ~]# useradd git

[root@rhel_client ~]# passwd git


3)[root@rhel_client ~]# sudo su git
[git@rhel_client root]$ cd ~
[git@rhel_client ~]$ ls
[git@rhel_client ~]$ git config --global user.name "git"
[git@rhel_client ~]$ git config --global user.email "git@sabitha.com"
[git@rhel_client ~]$ mkdir test

[git@rhel_client test]$ pwd
/home/git/test
[git@rhel_client test]$ git --bare init
Initialized empty Git repository in /home/git/test/
[git@rhel_client test]$ ls -ltrh
total 32K
drwxrwxr-x 4 git git 4.0K Feb 25 10:47 refs
drwxrwxr-x 2 git git 4.0K Feb 25 10:47 info
drwxrwxr-x 2 git git 4.0K Feb 25 10:47 branches
drwxrwxr-x 2 git git 4.0K Feb 25 10:47 hooks
-rw-rw-r-- 1 git git   23 Feb 25 10:47 HEAD
-rw-rw-r-- 1 git git   73 Feb 25 10:47 description
-rw-rw-r-- 1 git git   66 Feb 25 10:47 config
drwxrwxr-x 4 git git 4.0K Feb 25 10:47 objects

[git@rhel_client test]$


Client side:

Cloning repo

[sabitha@rhel_client ~]$ git clone git@192.168.0.16:test
Initialized empty Git repository in /home/sabitha/test/.git/
git@192.168.0.16's password:
warning: You appear to have cloned an empty repository.

Adding file
[sabitha@rhel_client test]$  git add .
[sabitha@rhel_client test]$ touch samp1
[sabitha@rhel_client test]$ git commit -am "samp1 file created"
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       samp1
nothing added to commit but untracked files present (use "git add" to track)
[sabitha@rhel_client test]$

 git push --set-upstream origin master

git status
[sabitha@rhel_client test]$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       samp1
nothing added to commit but untracked files present (use "git add" to track)
[sabitha@rhel_client test]$


git push
[sabitha@rhel_client test]$ git push -u origin master
git@192.168.0.16's password:
Counting objects: 3, done.
Writing objects: 100% (3/3), 213 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@192.168.0.16:test
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.
[sabitha@rhel_client test]$

git branch

[sabitha@rhel_client test]$ git branch -a
* master
  remotes/origin/master
[sabitha@rhel_client test]$


git pull
[sabitha@rhel_client test]$ git pull
git@192.168.0.16's password:
Already up-to-date.
[sabitha@rhel_client test]$


Remote:

git remote add origin https://github.com/try-

git/try_git.git


Adding more files

[sabitha@rhel_client test]$ touch samp2
[sabitha@rhel_client test]$ git add samp2
[sabitha@rhel_client test]$ git commit -am "Added samp2 file"
[master 25033ae] Added samp2 file
 Committer: sabitha <sabitha@rhel_client.sabitha.com>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

If the identity used for this commit is wrong, you can fix it with:

    git commit --amend --author='Your Name <you@example.com>'

 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 samp2
[sabitha@rhel_client test]$ git push
git@192.168.0.16's password:
Counting objects: 3, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 238 bytes, done.
Total 2 (delta 0), reused 0 (delta 0)
To git@192.168.0.16:test
   a79e50e..25033ae  master -> master
[sabitha@rhel_client test]$


[sabitha@rhel_client test]$ git checkout
Your branch and 'origin/master' have diverged,
and have 1 and 1 different commit(s) each, respectively.
[sabitha@rhel_client test]$


Git branch created
[sabitha@rhel_client test]$ git branch test
[sabitha@rhel_client test]$ git branch -a
* master
  test
  remotes/origin/master
[sabitha@rhel_client test]$

git merge

git merge test

git deleting branch


git branch -d <branch name>




Tuesday, 15 March 2016

Apache Tomcat

Apache Tomcat™ is an open source software implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies. The Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket specifications are developed under the Java Community Process.

Apache Tomcat is developed in an open and participatory environment and released under the Apache License version 2. Apache Tomcat is intended to be a collaboration of the best-of-breed developers from around the world. We invite you to participate in this open development project. To learn more about getting involved, click here.

Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations. Some of these users and their stories are listed on the PoweredBy wiki page.

Apache Tomcat, Tomcat, Apache, the Apache feather, and the Apache Tomcat project logo are trademarks of the Apache Software Foundation.

Download:

Binary core distribution

http://a.mbbsindia.com/tomcat/tomcat-7/v7.0.68/bin/apache-tomcat-7.0.68.tar.gz

[root@rhel6 usr]# mkdir apache_tomcat
[root@rhel6 usr]# cd apache_tomcat/
[root@rhel6 apache_tomcat]# ls
[root@rhel6 apache_tomcat]# wget http://a.mbbsindia.com/tomcat/tomcat-7/v7.0.68/bin/apache-tomcat-7.0.68.tar.gz
--2016-03-14 23:21:23--  http://a.mbbsindia.com/tomcat/tomcat-7/v7.0.68/bin/apache-tomcat-7.0.68.tar.gz
Resolving a.mbbsindia.com... 103.27.233.42
Connecting to a.mbbsindia.com|103.27.233.42|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8900822 (8.5M) [application/x-gzip]
Saving to: “apache-tomcat-7.0.68.tar.gz”

 2% [>                                                                ] 225,322     81.2K/s    



Step2:
[root@rhel6 apache_tomcat]# ls
apache-tomcat-7.0.68.tar.gz
[root@rhel6 apache_tomcat]# tar -xzf apache-tomcat-7.0.68.tar.gz
[root@rhel6 apache_tomcat]# ls
apache-tomcat-7.0.68  apache-tomcat-7.0.68.tar.gz
[root@rhel6 apache_tomcat]#


step3: 
[root@rhel6 apache_tomcat]# cd apache-tomcat-7.0.68
[root@rhel6 apache-tomcat-7.0.68]# ls
bin  conf  lib  LICENSE  logs  NOTICE  RELEASE-NOTES  RUNNING.txt  temp  webapps  work
[root@rhel6 apache-tomcat-7.0.68]# pwd
/usr/apache_tomcat/apache-tomcat-7.0.68
[root@rhel6 apache-tomcat-7.0.68]# cd bin/
[root@rhel6 bin]# pwd
/usr/apache_tomcat/apache-tomcat-7.0.68/bin
[root@rhel6 bin]# ls
bootstrap.jar       commons-daemon-native.tar.gz  digest.sh         startup.bat           tool-wrapper.sh
catalina.bat        configtest.bat                setclasspath.bat  startup.sh            version.bat
catalina.sh         configtest.sh                 setclasspath.sh   tomcat-juli.jar       version.sh
catalina-tasks.xml  daemon.sh                     shutdown.bat      tomcat-native.tar.gz
commons-daemon.jar  digest.bat                    shutdown.sh       tool-wrapper.bat
[root@rhel6 bin]# 


Step 4:  Catalina path

vim /etc/bashrc
export CATALINA_HOME=/usr/apache_tomcat/apache-tomcat-7.0.68
export PATH=$PATH:${CATALINA_HOME}
export CATALINA_BASE=/usr/apache_tomcat/apache-tomcat-7.0.68
export PATH=$PATH:${CATALINA_BASE}
[root@rhel6 bin]# 

Start service

[root@rhel6 apache-tomcat-7.0.68]# cd $CATALINA_HOME
[root@rhel6 apache-tomcat-7.0.68]# cd /usr/apache_tomcat/apache-tomcat-7.0.68/bin/
[root@rhel6 bin]# ls
bootstrap.jar  catalina-tasks.xml            configtest.bat  digest.bat        setclasspath.sh  startup.bat      tomcat-native.tar.gz  version.bat
catalina.bat   commons-daemon.jar            configtest.sh   digest.sh         shutdown.bat     startup.sh       tool-wrapper.bat      version.sh
catalina.sh    commons-daemon-native.tar.gz  daemon.sh       setclasspath.bat  shutdown.sh      tomcat-juli.jar  tool-wrapper.sh
[root@rhel6 bin]# sh startup.sh 
Using CATALINA_BASE:   /usr/apache_tomcat/apache-tomcat-7.0.68
Using CATALINA_HOME:   /usr/apache_tomcat/apache-tomcat-7.0.68
Using CATALINA_TMPDIR: /usr/apache_tomcat/apache-tomcat-7.0.68/temp
Using JRE_HOME:        /usr/java/jdk1.7.0_21
Using CLASSPATH:       /usr/apache_tomcat/apache-tomcat-7.0.68/bin/bootstrap.jar:/usr/apache_tomcat/apache-tomcat-7.0.68/bin/tomcat-juli.jar
Tomcat started.
[root@rhel6 bin]# 


Port 8080


For Credential




Copy

<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>


Paste on server following 

[root@rhel6 conf]# pwd
/usr/apache_tomcat/apache-tomcat-7.0.68/conf
[root@rhel6 conf]# 

[root@rhel6 conf]# ls
Catalina  catalina.policy  catalina.properties  context.xml  logging.properties  server.xml  tomcat-users.xml  web.xml
[root@rhel6 conf]# 


vim tomcat-users.xml

add lines

<!--
  NOTE:  The sample user and role entries below are wrapped in a comment
  and thus are ignored when reading this file. Do not forget to remove
  <!.. ..> that surrounds them.
-->
<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui"/>

<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>

Give Username and password

save and quit

->
Modify conf/server.xml

 <Connector port="8080" protocol="HTTP/1.1"
               address="192.168.61.12"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->

save and quit

and restart tomcat service













Monday, 14 March 2016

APACHE ANT

Apache Ant is a Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Ant can also be used effectively to build non Java applications, for instance C or C++ applications. More generally, Ant can be used to pilot any type of process which can be described in terms of targets and tasks.

Ant is written in Java. Users of Ant can develop their own "antlibs" containing Ant tasks and types, and are offered a large number of ready-made commercial or open-source "antlibs".

Ant is extremely flexible and does not impose coding conventions or directory layouts to the Java projects which adopt it as a build tool.

Java should configured

1) mkdir -p apache-ant

2) [root@rhel6 webmin-1.791]# cd /usr/apache-ant/


Download tar file

http://olex.openlogic.com/packages/ant/1.9.2

[root@rhel6 apache-ant]# ls
apache-ant-1.9.6-bin.tar.gz
[root@rhel6 apache-ant]#


3) tar -xvzf apache-ant-1.9.6-bin.tar.gz


[root@rhel6 apache-ant]# ls
apache-ant-1.9.6  apache-ant-1.9.6-bin.tar.gz
[root@rhel6 apache-ant]#


[root@rhel6 apache-ant]# cd apache-ant-1.9.6
[root@rhel6 apache-ant-1.9.6]# ls
bin           contributors.xml  fetch.xml   INSTALL  lib      manual  patch.xml  WHATSNEW
CONTRIBUTORS  etc               get-m2.xml  KEYS     LICENSE  NOTICE  README
[root@rhel6 apache-ant-1.9.6]# cd bin/
[root@rhel6 bin]# ls
ant      ant.cmd     antRun      antRun.pl            envset.cmd  runant.pl  runrc.cmd
ant.bat  antenv.cmd  antRun.bat  complete-ant-cmd.pl  lcp.bat     runant.py
[root@rhel6 bin]# 


4) vim /etc/bashrc
export JAVA_HOME=/usr/java/jdk1.7.0_21/
export PATH=$PATH:${JAVA_HOME}/bin/java
export ANT_HOME=/usr/apache-ant/apache-ant-1.9.6/
export PATH=$PATH:${ANT_HOME}/bin/ant


5)source /etc/bashrc


[root@rhel6 bin]# ant
Buildfile: build.xml does not exist!
Build failed






webmin Installation




Webmin is a web-based system configuration tool for Unix-like systems, although recent versions can also be installed and run on Windows.[4] With it, it is possible to configure operating system internals, such as users, disk quotas, services or configuration files, as well as modify and control open source apps, such as the Apache HTTP Server, PHP or MySQL.[5][6]


Prerequisite:

Apache install



Installation:

1)Download tar file:

http://prdownloads.sourceforge.net/webadmin/webmin-1.791.tar.gz

2) Extract tar file

copy tar to /var/www/html

tar -xvzf webmin-1.791.tar.gz

cd webmin-1.791

step 3:
[root@rhel6 webmin-1.791]#  ./setup.sh
***********************************************************************
*            Welcome to the Webmin setup script, version 1.791        *
***********************************************************************
Webmin is a web-based interface that allows Unix-like operating
systems and common Unix services to be easily administered.

Installing Webmin in /var/www/html/webmin-1.791 ...

***********************************************************************
Webmin uses separate directories for configuration files and log files.
Unless you want to run multiple versions of Webmin at the same time
you can just accept the defaults.

Config file directory [/etc/webmin]:
Log file directory [/var/webmin]:

***********************************************************************
Webmin is written entirely in Perl. Please enter the full path to the
Perl 5 interpreter on your system.

Full path to perl (default /usr/bin/perl):

Testing Perl ...
Perl seems to be installed ok

***********************************************************************
Operating system name:    Redhat Enterprise Linux
Operating system version: 6

***********************************************************************
Webmin uses its own password protected web server to provide access
to the administration programs. The setup script needs to know :
 - What port to run the web server on. There must not be another
   web server already using this port.
 - The login name required to access the web server.
 - The password required to access the web server.
 - If the webserver should use SSL (if your system supports it).
 - Whether to start webmin at boot time.

Web server port (default 10000):
Login name (default admin):
Login password:
Password again:
The Perl SSLeay library is not installed. SSL not available.
Start Webmin at boot time (y/n): y
***********************************************************************
Creating web server config files..
..done

Creating access control file..
..done

Inserting path to perl into scripts..
..done

Creating start and stop scripts..
..done

Copying config files..
..done

Configuring Webmin to start at boot time..
..done

Creating uninstall script /etc/webmin/uninstall.sh ..
..done

Changing ownership and permissions ..
..done

Running postinstall scripts ..
..done

Enabling background status collection ..
..done

Attempting to start Webmin mini web server..
Starting Webmin server in /var/www/html/webmin-1.791
Pre-loaded WebminCore
..done

***********************************************************************
Webmin has been installed and started successfully. Use your web
browser to go to

  http://rhel6.sabitha.com:10000/

and login with the name and password you entered previously.

[root@rhel6 webmin-1.791]#



Saturday, 12 March 2016

Puppet Installation

1. Install NTP

yum install ntp
2. Install the puppet repository on the server
* CentOS 5

rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-5.noarch.rpm
* CentOS 6

rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
* CentOS 7

rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
3. Ensure that the repository is enabled.

vim /etc/yum.repos.d/puppetlabs.repo
[puppetlabs-products]
name=Puppet Labs Products El 6 - $basearch
baseurl=http://yum.puppetlabs.com/el/6/products/$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
enabled=1
gpgcheck=1

[puppetlabs-deps]
name=Puppet Labs Dependencies El 6 - $basearch
baseurl=http://yum.puppetlabs.com/el/6/dependencies/$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
enabled=1
gpgcheck=1

[puppetlabs-devel]
name=Puppet Labs Devel El 6 - $basearch
baseurl=http://yum.puppetlabs.com/el/6/devel/$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
enabled=1
gpgcheck=1

[puppetlabs-products-source]
name=Puppet Labs Products El 6 - $basearch - Source
baseurl=http://yum.puppetlabs.com/el/6/products/SRPMS
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
failovermethod=priority
enabled=0
gpgcheck=1

[puppetlabs-deps-source]
name=Puppet Labs Source Dependencies El 6 - $basearch - Source
baseurl=http://yum.puppetlabs.com/el/6/dependencies/SRPMS
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
enabled=0
gpgcheck=1

[puppetlabs-devel-source]
name=Puppet Labs Devel El 6 - $basearch - Source
baseurl=http://yum.puppetlabs.com/el/6/devel/SRPMS
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
enabled=0
gpgcheck=1
4. Install Puppet Master server

yum install puppet-server
5. Set up the Pupper Masters Certificates
* Edit the main puppet config file to add DNS response entries

vim /etc/puppet/puppet.conf
* Add the dns_alt_names directive with any DNS name that the puppet master can respond to (Use your domain in liu of yourdomain.com).

[main]
    # The Puppet log directory.
    # The default value is '$vardir/log'.
    logdir = /var/log/puppet

    # Where Puppet PID files are kept.
    # The default value is '$vardir/run'.
    rundir = /var/run/puppet

    # Where SSL certificates are kept.
    # The default value is '$confdir/ssl'.
    ssldir = $vardir/ssl

    # Set up DNS Names that the server will respond to.
    dns_alt_names = puppet,puppet.yourdomain.com,svrpuppet,svrpuppet.yourdomain.com

[agent]
    # The file in which puppetd stores a list of the classes
    # associated with the retrieved configuratiion.  Can be loaded in
    # the separate ``puppet`` executable using the ``--loadclasses``
    # option.
    # The default value is '$confdir/classes.txt'.
    classfile = $vardir/classes.txt

    # Where puppetd caches the local configuration.  An
    # extension indicating the cache format is added automatically.
    # The default value is '$confdir/localconfig'.
    localconfig = $vardir/localconfig
6. Generate the certificates

puppet master --verbose --no-daemonize
* When you see Notice: Starting Puppet master version {VERSION}, hit ctrl-C to kill the startup process.

[root@SVRPUPPET ~]# puppet master --verbose --no-daemonize
Info: Creating a new SSL key for ca
Info: Creating a new SSL certificate request for ca
Info: Certificate Request fingerprint (SHA256): D1:33:5F:2F:AB:66:51:3C:43:FB:B5:72:08:00:02:A1:7C:06:28:4A:4A:A9:4D:98:68:F3:C2:27:AB:C5:AB:C7
Notice: Signed certificate request for ca
Info: Creating a new certificate revocation list
Info: Creating a new SSL key for svrpuppet
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
Info: Creating a new SSL certificate request for svrpuppet
Info: Certificate Request fingerprint (SHA256): 4B:00:C5:FA:E3:4B:44:5B:3A:C8:67:8E:37:9E:2E:64:7E:33:C5:CD:B3:65:6C:39:26:2D:1A:45:AD:76:58:0B
Notice: svrpuppet has a waiting certificate request
Notice: Signed certificate request for svrpuppet
Notice: Removing file Puppet::SSL::CertificateRequest svrpuppet at '/var/lib/puppet/ssl/ca/requests/svrpuppet.pem'
Notice: Removing file Puppet::SSL::CertificateRequest svrpuppet at '/var/lib/puppet/ssl/certificate_requests/svrpuppet.pem'
Notice: Starting Puppet master version 3.6.2
^CNotice: Caught INT; calling stop
7. Set up manifests and modules
* The main manifest and module directories are as follows
** Main Site Manifest – Applied to ALL servers – /etc/puppet/manifests/site.pp
** Manifest – /etc/puppet/manifests/
** Modules – /etc/puppet/modules/
** Environments – /etc/puppet/environments/

* Create environment directories in the environments main directory for each of your environments. This will allow us to apply different configurations to different environments.

mkdir -p /etc/puppet/environments/production/manifests
mkdir -p /etc/puppet/environments/development/manifests
mkdir -p /etc/puppet/environments/internal/manifests
mkdir -p /etc/puppet/environments/dmz/manifests
mkdir -p /etc/puppet/environments/production/modules
mkdir -p /etc/puppet/environments/development/modules
mkdir -p /etc/puppet/environments/internal/modules
mkdir -p /etc/puppet/environments/dmz/modules
* You can create folders for whatever type of environments you would like such as web_servers, haproxy_servers, centos6_servers, etc..

* Enable Directory Environments

vim /etc/puppet/puppet.conf
* Add the following to the [Main] section of the config file under the DNS names

# Enable Directory Environments
environmentpath = $confdir/environments
8. Configure Apache with Passenger to server requests to the puppet master.
* Start and then stop the puppet master. This will set certificates up properly and initilize the installation.

service puppetmaster start
service puppetmaster stop
* Install Apache

yum install httpd httpd-devel mod_ssl ruby-devel rubygems gcc
* Set apache to start on boot

chkconfig httpd on
* Install Rack/Passenger

gem install rack passenger
[root@SVRPUPPET puppet]# gem install rack passenger
Successfully installed rack-1.5.2
Building native extensions.  This could take a while...
Successfully installed rake-10.3.2
Successfully installed daemon_controller-1.2.0
Successfully installed passenger-4.0.46
4 gems installed
Installing ri documentation for rack-1.5.2...
Installing ri documentation for rake-10.3.2...
Installing ri documentation for daemon_controller-1.2.0...
Installing ri documentation for passenger-4.0.46...
Installing RDoc documentation for rack-1.5.2...
Installing RDoc documentation for rake-10.3.2...
Installing RDoc documentation for daemon_controller-1.2.0...
Installing RDoc documentation for passenger-4.0.46...
9. Run the passenger installer
* Install passenger dependencies

yum install gcc-c++ curl-devel openssl-devel zlib-devel
passenger-install-apache2-module
* Select the languages you want to install passenger for and clear up any dependencies that the installer finds

[root@SVRPUPPET puppet]# passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v4.0.46.

This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.

Here's what you can expect from the installation process:

 1. The Apache 2 module will be installed for you.
 2. You'll learn how to configure Apache.
 3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort.


--------------------------------------------

Which languages are you interested in?

Use  to select.
If the menu doesn't display correctly, press '!'

   ⬢  Ruby
   ⬢  Python
 ‣ ⬢  Node.js
   ⬡  Meteor

--------------------------------------------

Checking for required software...

 * Checking for C compiler...
      Found: yes
      Location: /usr/bin/cc
 * Checking for C++ compiler...
      Found: yes
      Location: /usr/bin/c++
 * Checking for Curl development headers with SSL support...
      Found: yes
      curl-config location: /usr/bin/curl-config
      Supports SSL: yes
      Header location: /usr/include/curl/curl.h
      Version: libcurl 7.19.7
      Usable: yes
 * Checking for OpenSSL development headers...
      Found: yes
      Location: /usr/include/openssl/ssl.h
 * Checking for Zlib development headers...
      Found: yes
      Location: /usr/include/zlib.h
 * Checking for Apache 2...
      Found: yes
      Location of httpd: /usr/sbin/httpd
      Apache version: 2.2.15
 * Checking for Apache 2 development headers...
      Found: yes
      Location of apxs2: /usr/sbin/apxs
 * Checking for Rake (associated with /usr/bin/ruby)...
      Found: yes
      Location: /usr/bin/ruby /usr/bin/rake
 * Checking for OpenSSL support for Ruby...
      Found: yes
 * Checking for RubyGems...
      Found: yes
 * Checking for Ruby development headers...
      Found: yes
      Location: /usr/lib64/ruby/1.8/x86_64-linux/ruby.h
 * Checking for rack...
      Found: yes
 * Checking for Apache Portable Runtime (APR) development headers...
      Found: yes
      Location: /usr/bin/apr-1-config
      Version: 1.3.9
 * Checking for Apache Portable Runtime Utility (APU) development headers...
      Found: yes
      Location: /usr/bin/apu-1-config
      Version: 1.3.9
 --------------------------------------------

Sanity checking Apache installation...
All good!

--------------------------------------------
Compiling and installing Apache 2 module...

{ LOTS OF COMPILING }

--------------------------------------------
Almost there!

Please edit your Apache configuration file, and add these lines:

   LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.46/buildout/apache2/mod_passenger.so
 
     PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.46
     PassengerDefaultRuby /usr/bin/ruby
 

After you restart Apache, you are ready to deploy any number of web
applications on Apache, with a minimum amount of configuration!

Press ENTER to continue.


--------------------------------------------

Deploying a web application: an example

Suppose you have a web application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:

 
      ServerName www.yourhost.com
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /somewhere/public  
     
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
         # Uncomment this if you're on Apache >= 2.4:
         #Require all granted
     
 

And that's it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:

  /usr/lib/ruby/gems/1.8/gems/passenger-4.0.46/doc/Users guide Apache.html
  https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html

Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-)
https://www.phusionpassenger.com

Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.
10. Configure Apache
* Make the Rack Applicaton directory and point apache to it

mkdir -p /usr/share/puppet/rack/puppetmasterd
mkdir /usr/share/puppet/rack/puppetmasterd/public
mkdir /usr/share/puppet/rack/puppetmasterd/tmp
cp /usr/share/puppet/ext/rack/config.ru /usr/share/puppet/rack/puppetmasterd/
chown puppet:puppet /usr/share/puppet/rack/puppetmasterd/config.ru
11. Configure the Apache VHost File
* Create an Apache config file for apache

vim /etc/httpd/conf.d/puppetmaster.conf
# You'll need to adjust the paths in the Passenger config depending on which OS
# you're using, as well as the installed version of Passenger.

# Debian/Ubuntu:
#LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-4.0.x/ext/apache2/mod_passenger.so
#PassengerRoot /var/lib/gems/1.8/gems/passenger-4.0.x
#PassengerRuby /usr/bin/ruby1.8

# RHEL/CentOS:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.46/buildout/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.46
PassengerRuby /usr/bin/ruby

# And the passenger performance tuning settings:
PassengerHighPerformance On
# Set this to about 1.5 times the number of CPU cores in your master:
PassengerMaxPoolSize 12
# Recycle master processes after they service 1000 requests
PassengerMaxRequests 1000
# Stop processes if they sit idle for 10 minutes
PassengerPoolIdleTime 600

Listen 8140

    SSLEngine On

    # Only allow high security cryptography. Alter if needed for compatibility.
    SSLProtocol ALL -SSLv2 -SSLv3
    SSLCipherSuite EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!IDEA:!ECDSA:kEDH:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA
    SSLCertificateFile      /var/lib/puppet/ssl/certs/puppet-server.example.com.pem
    SSLCertificateKeyFile   /var/lib/puppet/ssl/private_keys/puppet-server.example.pem
    SSLCertificateChainFile /var/lib/puppet/ssl/ca/ca_crt.pem
    SSLCACertificateFile    /var/lib/puppet/ssl/ca/ca_crt.pem
    SSLCARevocationFile     /var/lib/puppet/ssl/ca/ca_crl.pem
    #SSLCARevocationCheck chain
    SSLVerifyClient         optional
    SSLVerifyDepth          1
    SSLOptions              +StdEnvVars +ExportCertData

    # Apache 2.4 introduces the SSLCARevocationCheck directive and sets it to none
# which effectively disables CRL checking. If you are using Apache 2.4+ you must
    # specify 'SSLCARevocationCheck chain' to actually use the CRL.

    # These request headers are used to pass the client certificate
    # authentication information on to the puppet master process
    RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e
    RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e
    RequestHeader set X-Client-Verify %{SSL_CLIENT_VERIFY}e

    DocumentRoot /usr/share/puppet/rack/puppetmasterd/public

   
      Options None
      AllowOverride None
      # Apply the right behavior depending on Apache version.
     
        Order allow,deny
        Allow from all
     
      = 2.4>
        Require all granted
     
   

    ErrorLog /var/log/httpd/puppet-server.example.com_ssl_error.log
    CustomLog /var/log/httpd/puppet-server.example.com_ssl_access.log combined

* Check your version of the ruby gem file, and your certificate names and edit accordingly.

yum install mlocate
updatedb
* The value returned is the value that needs to be in the LoadModule directive in the puppetmaster.conf apache config file.

[root@SVRPUPPET puppet]# locate mod_passenger.so
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.46/buildout/apache2/mod_passenger.so
# RHEL/CentOS:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.46/buildout/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.46
PassengerRuby /usr/bin/ruby
* Check certificate names as well

[root@SVRPUPPET puppet]# ls /var/lib/puppet/ssl/certs/
ca.pem              svrpuppet.pem
SSLCertificateFile      /var/lib/puppet/ssl/certs/puppet-server.example.com.pem
SSLCertificateKeyFile   /var/lib/puppet/ssl/private_keys/puppet-server.example.pem

should be:

SSLCertificateFile      /var/lib/puppet/ssl/certs/svrpuppet.pem
SSLCertificateKeyFile   /var/lib/puppet/ssl/private_keys/svrpuppet.pem
12. Set the apache ServerName directive and then start the apache server

vim /etc/httpd/conf/httpd.conf
ServerName puppet.yourdomain.com:80
service httpd start
13. Ensure that the default puppetmaster webserver (default no load one) is turned off

chkconfig puppetmaster off
If Apache Started Properly, then Puppet should now be installed.

Puppet dash board

1. Install the puppet-dashboard package
* Dashboard will be installed in /usr/share/puppet-dashboard, and owned by an new puppet-dashboard user and group.

yum install puppet-dashboard
2. Create the dashboard database
* Log into your mysql server (if local you will need to install mysql on the localhost)

yum install mysql-server
CREATE DATABASE puppet_dashboard CHARACTER SET utf8;
CREATE USER 'puppet_dash'@'%' IDENTIFIED BY 'my_password'; (pupp3tMa5t34)
GRANT ALL PRIVILEGES ON puppet_dashboard.* TO 'puppet_dash'@'%';
3. Configure the database.yml file to connect to the puppet-dashboard database.

vim /usr/share/puppet-dashboard/config/database.yml
production:
  database: puppet_dashboard
  username: puppet_dash
  password: password
  encoding: utf8
  adapter: mysql
  host: localhost
4. Tune the database for puppet
* Edit the my.cnf file and make the following modifications

vim /etc/my.cnf
# Allowing 32MB allows an occasional 17MB row with plenty of spare room
max_allowed_packet = 32M
5. Restart the mysql server

service mysqld restart
* Alternatively you can set the max_allowed_packet inside of mysql if you can not reboot the server immediately.

* This step will be in addition to setting the max_allowed_packet in the my.cnf file (So it will take effect next reboot)

set global max_allowed_packet = 33554432;
6. Populate the database schema
* The migrate script must be ran from within the application directory

cd /usr/share/puppet-dashboard
rake gems:refresh_specs
rake RAILS_ENV=production db:migrate
7. Test the dashboard

cd /usr/share/puppet-dashboard
sudo -u puppet-dashboard ./script/server -e production
8. Open a browser and ensure that dashboard is showing

http://puppet.yourdomain.com:3000/
9. Configure the production web server instance for the dashboard.
* Copy the example vhost block to the apache web directory

cp /usr/share/puppet-dashboard/ext/passenger/dashboard-vhost.conf /etc/httpd/conf.d/
10. Modify the apache config file

vim /etc/httpd/conf.d/dashboard-vhost.conf
# UPDATE THESE PATHS TO SUIT YOUR ENVIRONMENT
#
# Module already loaded by puppet.
# LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.46/buildout/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.46
PassengerRuby /usr/bin/ruby

# you may want to tune these settings
PassengerHighPerformance on
PassengerMaxPoolSize 12
PassengerPoolIdleTime 1500
# PassengerMaxRequests 1000
PassengerStatThrottleRate 120
# RailsAutoDetect On

Listen 3000


ServerName puppet.yourdomain.com
ServerAlias puppet svrpuppet.yourdomain.com svrpuppet
DocumentRoot /usr/share/puppet-dashboard/public/

        Options None
        Order allow,deny
        allow from all

ErrorLog /var/log/httpd/puppet-dashboard.yourdomain.com_error.log
LogLevel warn
CustomLog /var/log/httpd/puppet-dashboard.yourdomain.com_access.log combined
ServerSignature On

# Uncomment this section to enable basic auth. This section can also be copied
# to the HTTPS VirtualHost example below.
#   # For report submission from masters.
#  
#      
#           # Configuration restricts HTTP actions to POST only
#           Order allow,deny
#           # Allow from localhost
#           # Allow from localhost.localdomain
#           # Allow from 127.0.0.1
#           # Allow from example.com
#           # This can be locked down to just your puppet master if required
#           # See examples above, or http://httpd.apache.org/docs/2.2/howto/access.html
#           Allow from all
#           Satisfy any
#      
#  
#
#   # For node definitions from masters.
#  
#      
#           # Configuration restricts HTTP actions to GET only
#           Order allow,deny
#           # Allow from localhost.localdomain
#           # Allow from localhost
#           # Allow from 127.0.0.1
#           # Allow from example.com
#           # This can be locked down to just your puppet master if required
#           # See examples above, or http://httpd.apache.org/docs/2.2/howto/access.html
#           Allow from all
#           Satisfy any
#      
#  
#
#   # For web access by humans.
#  
#       AuthType basic
#       AuthName "Puppet Dashboard"
#       Require valid-user
#       AuthBasicProvider file
#       AuthUserFile /etc/apache2/passwords # Change to your preferred password file location
#  



# Uncomment this section to enable HTTPS (SSL)
#Listen 443
#
#        SSLEngine on
#        SSLProtocol -ALL +SSLv3 +TLSv1
#        SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP
#
#        SSLCertificateFile        /usr/share/puppet-dashboard/certs/dashboard.cert.pem
#        SSLCertificateKeyFile     /usr/share/puppet-dashboard/certs/dashboard.private_key.pem
#        SSLCACertificateFile      /usr/share/puppet-dashboard/certs/dashboard.ca_cert.pem
#
#        # If Apache complains about invalid signatures on the CRL, you can try disabling
#        # CRL checking by commenting the next line, but this is not recommended.
#        SSLCARevocationFile       /usr/share/puppet-dashboard/certs/dashboard.ca_crl.pem
#
#        SSLVerifyClient optional
#        SSLVerifyDepth  1
#        SSLOptions +StdEnvVars
#
#        ServerName dashboard.example.com # UPDATE THIS TO YOUR FQDN
#        DocumentRoot /usr/share/puppet-dashboard/public
#      
#                Options None
#                AllowOverride None
#                Order allow,deny
#                allow from all
#      
#      
#                Order deny,allow
#                Allow from ALL
#                # Enable this to require client-side certificates for Dashboard connections
#                #SSLVerifyClient require
#      
#
11. Configuring puppet to work with the dashboard.
* Open the puppet master config file /etc/puppet/puppet.conf and add the following directive to the end of the master section:

reports = store, http
reporturl = http://puppet.yourdomain.com:3000/reports/upload
node_terminus = exec
external_nodes = /usr/bin/env PUPPET_DASHBOARD_URL=http://puppet.yourdomain.com:3000 /usr/share/puppet-dashboard/bin/external_node
* Add the following directive to the end of the agent section:

report = true
12. Restart puppet by restarting apache

service httpd restart
13. Open a web browser and browser to the puppet server on port 3000 to ensure that the UI comes up

http://puppet.yourdomain.com:3000
14. Put a host file entry into the server resolving puppet to the IP given to the puppet URL

vim /etc/hosts
127.0.0.1     puppet
15. Test the connection by running the following dashboard test.

puppet agent --test
[root@SVRPUPPET ~]# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for svrpuppet
Info: Applying configuration version '1405468042'
Info: Creating state file /var/lib/puppet/state/state.yaml
Notice: Finished catalog run in 0.03 seconds
* Checking the Dashboard UI should now also resut in seeing Pending Task in the Dashboard home screen. This job will be processed once the delayed job worker has been deployed.

16. Deploy the Delayed Job Worker
* Start the worker processes (Generally you will want 1 worker per CPU Core)

chmod 0666 /usr/share/puppet-dashboard/log/*
sudo -u puppet-dashboard env RAILS_ENV=production /usr/share/puppet-dashboard/script/delayed_job -p dashboard -n 4 -m start
* In order to stop the worker processes you can issue the stop command as follows

sudo -u puppet-dashboard env RAILS_ENV=production /usr/share/puppet-dashboard/script/delayed_job -p dashboard -n 4 -m stop
* You can check that the worker processes kicked off with a ps -elf command:

[root@SVRPUPPET ~]# ps -elf | grep delayed_job
1 S 498      17618     1  0  80   0 - 40669 poll_s 20:08 ?        00:00:00 dashboard/delayed_job.0                                                      
1 S 498      17619     1  0  80   0 - 40668 poll_s 20:08 ?        00:00:00 delayed_job.0_monitor                                                        
1 S 498      17623     1  0  80   0 - 40668 poll_s 20:08 ?        00:00:00 delayed_job.1_monitor                                                        
1 S 498      17624     1  0  80   0 - 40669 poll_s 20:08 ?        00:00:00 dashboard/delayed_job.1                                                      
1 S 498      17630     1  0  80   0 - 40669 poll_s 20:08 ?        00:00:00 dashboard/delayed_job.2                                                      
1 S 498      17631     1  0  80   0 - 40668 poll_s 20:08 ?        00:00:00 delayed_job.2_monitor                                                        
1 S 498      17635     1  0  80   0 - 40668 poll_s 20:08 ?        00:00:00 delayed_job.3_monitor                                                        
1 S 498      17636     1  0  80   0 - 40669 poll_s 20:08 ?        00:00:00 dashboard/delayed_job.3                                                      
0 S root     17688 15153  0  80   0 - 25811 pipe_w 20:10 pts/0    00:00:00 grep delayed_job

17. It would be advisable to run a monitoring service on the delayed_job workers to know if and when they shutdown

* If you ever need to just test a single worker process then you can do that as well using the rake command

sudo -u puppet-dashboard rake RAILS_ENV=production jobs:work

The Puppet Dashboard is now installed and ready for use. Check the puppetlabs website for plugins and advanced configurations that can be applied to the dashboard.

Tuesday, 8 March 2016

Nagios Installation

Nagios is the most popular, open source, powerful monitoring system. It enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes. Nagios has capability of monitoring application, services, entire IT infrastructure.

Install following dependencies

# yum install httpd php php-cli gcc glibc glibc-common gd gd-devel net-snmp

Start http service

# service httpd start

Now create a new nagios user account and setup a password to this account

# useradd nagios
# passwd nagios

Now create a groud for nagios setup “nagcmd” and add nagios user to this group. Also add nagios user in apache group.

# groupadd nagcmd
# usermod -a -G nagcmd nagios
# usermod -a -G nagcmd apache

# cd /opt/
# wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.1.1.tar.gz
# tar xzf nagios-4.1.1.tar.gz
# cd nagios-4.1.1
# ./configure --with-command-group=nagcmd
# make all
# make install
# make install-init
# make install-config
# make install-commandmode
Now use below command to setup apache configuration for Nagios installation.

# make install-webconf

# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Now restart Apache service to make the new settings take effect.

# service httpd restart

Nagios Plugins

# cd /opt
# wget http://nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz
# tar xzf nagios-plugins-2.1.1.tar.gz
# cd nagios-plugins-2.1.1
Now compile and install nagios plugins

# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
# make
# make install

Use the following commands to verify nagios install and start nagios core service.

# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
# service nagios start
Also configure nagios service to start on system start

# chkconfig --add nagios
# chkconfig nagios on

Client side 

Nrpe configuration

Configuring The Init System For NRPE

Now that nrpe has been installed, we need to set up an init script/system for the agent. You will first need to Install xinetd. Most Linux
distributions include the package. As of the writing of this document, you can install nrpe on the following distributions, the following
ways:
wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.14/nrpe-2.14.tar.gz

cd nrpe-2.14 ./configure make make install Copy over the nrpe.cfg from the sample-config directory into /usr/local/nagios/etc. mkdir /usr/local/nagios/etc cp sample-config/nrpe.cfg /usr/local/nagios/etc

CentOS/RHEL/Fedora$ yum install xinetd
Ubuntu/Debian$ apt-get install xinetd
Gentoo$ emerge -va xinetd
ArchLinux$ pacman -S xinetd

Once xinetd is installed, we must configure it. The nrpe source has a pre-built xinetd config for the nrpe service. Change directory to

the nrpe source and install it:

cd /tmp/nrpe-2.14
make install-xinetd

vim /etc/xinetd.d/nrpe
Change:
only_from = 127.0.0.1
To:
only_from = 127.0.0.1 x.x.x.x
(where x.x.x.x is your Nagios XI server's ip)


Finally, we need to add the nrpe port and service declaration in /etc/services:
nano /etc/services
Add:
nrpe 5666/tcp


Let's test nrpe/xinetd to make sure it starts up cleanly:

service xinetd start

cd /usr/local/nagios/libexec
./check_nrpe -H localhost

You should see the following output:
NRPE v2.14

Thursday, 3 March 2016

Java Configuration



Download JDK file from following link

http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-i586.tar.gz

step1: mkdir -p /usr/java

step2: cd /usr/java

wget download link

step3: tar -xvzf jdk_file

step4:    jdk1.7.0_21  jdk-7u21-linux-i586.gz
[root@rhel6 java]# java -version
bash: java: command not found

step5: Export path of java

[root@rhel6 java]# vim /etc/bashrc
Make entry

export JAVA_HOME=/usr/java/jdk1.7.0_21/
export PATH=$PATH:$JAVA_HOME/bin

Then source the file

[root@rhel6 java]# source /etc/bashrc

[root@rhel6 java]# java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) Client VM (build 23.21-b01, mixed mode)
[root@rhel6 java]#