How to upgrade to java 1.6 from java 1.5 on CentOS

Tuesday, January 21, 2014

How to upgrade to java 1.6 from java 1.5 on CentOS

Interested in upgrading JAVA VERSION from JAVA 1.5 to JAVA 1.6 on CentOS / Linux.
there are following step to upgrade java 1.6 from java 1.5 on linux / CentOS :-

1. Check Current Java version :-
[oracle@server301 /]$ java -version
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Server VM (build 1.5.0_12-b04, mixed mode)

2. check which java :-
   [oracle@server301 /]# which java
   /usr/java/jdk1.5.0_12/bin/java

3. Download Jdk rpm jdk-6u25-linux-amd64.rpm :-
    [oracle@server301 /]# cd /tmp
     [oracle@server301 /tmp/]#  wget http://www.java.net/download/jdk6/6u25/promoted/b01/binaries/jdk-6u25-ea-bin-b01-linux-amd64-27_jan_2011-rpm.bin

 4. Run RPM using below command :-
     [oracle@server301 /tmp/]# rpm -Uch jdk-6u25-linux-amd64.rpm

5. Remove jdk1.5 using update-alternatives :- 
     [oracle@server301 /tmp/]#  /usr/sbin/update-alternatives --remove java /usr/java/jdk1.5.0_12/jre/bin/java

6. Install jdk 1.6 using update-alternatives :- 
     [oracle@server301 /tmp/]#  /usr/sbin/update-alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_25/bin/java 1

7. Config Java (jdk1.6) :-
  ls -l /usr/java/jdk1.6.0_25/bin/java -v
  [oracle@server301 /tmp/]#  /usr/sbin/update-alternatives --config java

8. Check New Java Version :-
     ls -l /usr/java/jdk1.6.0_25/bin/java -v
     [oracle@server301 /tmp/]# java -version
     java version "1.6.0_25"
     Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
     Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)

9. Update Java path :-
    [oracle@server301 /tmp/]# vi /etc/profile
    [oracle@server301 /tmp/]# vi /root/.bashrc
    [oracle@server301 /tmp/]# vi /home/oracle/.bashrc

   add below line in above file for java path and classpath.

    JAVA_HOME=/usr/java/jdk1.6.0_25
   PATH=$JAVA_HOME/bin:$PATH
   CLASSPATH=. : $JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
   export PATH CLASSPATH JAVA_HOME

Read more...

How To Check Current Logged Users List In UNIX/Linux/CentOS

How To Check Current Logged Users List In UNIX/Linux/CentOS :-

How to get user names from currently logged in users to the current OS like UNIX / Linux / CentOS server fusing command prompt ?

there are three commands :-
1. w command
   above command shows the information about the users which all currently on the machine, and their processes.
2. who command
   above command shows the information about users who all are currently logged in.

3. users command
   above command shows the login names of the users currently on the system, in sorted order, space separated, on a single line. It reads all information from /var/run/utmp file.

Example :- 

Open a terminal or login into remote server using ssh command and type the following commands.

w command

Type the w command on your command prompt :

# w

Sample Output :

17:52:45 up 5 days, 22:11,  1 user,  load average: 0.06, 0.02, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
test pts/0    106.219.50.199   17:22    0.00s  0.03s  0.01s sshd: test [priv]
anuj pts/0    106.219.50.199   17:22    0.00s  0.03s  0.01s sshd: anuj[priv]


To see info about a user named anuj, enter:
# w anuj


who command

Type the who command on your command prompt :

# who

Sample Output :

root pts/0        2014-01-21 17:22 (106.219.50.199)
anuj pts/0        2014-01-21 17:22 (106.219.50.199)


To see info about a user named anuj, enter:
# w anuj

Pass the -a option to who command:
# who -a

Sample Output :-

 system boot  2014-01-15 19:41
           run-level 3  2014-01-15 19:41
LOGIN      tty2         2014-01-15 19:41              1930 id=2
LOGIN      tty6         2014-01-15 19:41              1938 id=6
LOGIN      tty4         2014-01-15 19:41              1934 id=4
LOGIN      tty1         2014-01-15 19:41              1928 id=1
LOGIN      tty3         2014-01-15 19:41              1932 id=3
LOGIN      tty5         2014-01-15 19:41              1936 id=5
root + pts/0        2014-01-21 17:22   .        101828 (106.219.50.199)
           pts/1        2014-01-20 16:49             86934 id=ts/1  term=0 exit=0
           pts/2        2014-01-17 18:50             47837 id=ts/2  term=0 exit=0


users command

Open a terminal or login over the ssh session and enter the following command:
# users

Sample outputs:

anuj test micky rony





Read more...

Install OpenEMM on CentOS

How to Install OpenEMM on CentOS 6.0 64bit

How To Configure (Install) and administration Guide for OpenEMM 2013 using CentOs 6.0 64bit.

OpenEMM Configuration Steps :-

1. Update the operating system to its latest release :-
    - yum update

2. Install additional packages for compatibility with OpenEMM’s sub-programs bav, bavwrap, smctrl, updater and xmlback (all written in C) :-
   - yum install ld-linux.so.2 sqlite libxml2.i386 (make sure that line exclude=*.i386 *.i486 *.i586 *.i686 in file /etc/yum.conf is uncommented)!

3. Install the required packages (depencies) :-
    - yum install mysql-server sendmail-cf MySQL-python libxml2

4. Create User ‘openemm' :-
    Create a group and user for OpenEMM:
    - groupadd openemm
    - useradd -m -g openemm -d /home/openemm -c “OpenEMM-2013″ openemm

5. Create a directory for software required by OpenEMM :-
    mkdir -p /opt/openemm

6. Install Sun Java JDK1.6
    - Download jdk-6u33-linux-x64.bin from Oracle
    - Copy the file to the new directory:
        cp jdk-6u33-linux-x64.bin /opt/openemm
    - Change to this directory:
         cd /opt/openemm
    - Grant the file execution permission:
        chmod u+x jdk-6u33-linux-x64.bin
    - Execute the Java file:
       ./jdk-6u33-linux-x64.bin
    - Create a symbolic link java for the JDK directory:
        ln -s jdk1.6.0_33/ java
    - Test the JDK:
     You should get an output like this:

     java version “1.6.0_33″
    Java(TM) SE Runtime Environment (build 1.6.0_33-b04)
    Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)

    NOTE: If you want to use an installed JDK, simple edit /home/openemm/bin/openemm.sh after the          installation of the OpenEMM tarball and adjust parameter JAVA_HOME accordingly. Note: Only Java 6 is supported by OpenEMM since SUN does no longer support Java 5 with free bug fixes and security fixes.

7. Install Tomcat :-
   Since OpenEMM is a web application using Java, it requires a web container like Tomcat. (Please note that while OpenEMM 5.x and 6.x required web container Resin, OpenEMM 2013 was only tested with Tomcat.)

Download the latest binary distribution of release 6 from http://tomcat.apache.org/. The core package will be sufficient.

- Go to /tmp directory:
   cd /tmp

-Download apache-tomcat: wget http://apache.mirror.versatel.nl/tomcat/tomcat-6/v6.0.35/bin/apache-tomcat-6.0.35.tar.gz

- Create a directory for software required by OpenEMM:
   mkdir -p /opt/openemm

-  Copy the file to the new directory:
   cp apache-tomcat-6.0.35.tar.gz /opt//openemm/

- Change to this directory:
   cd /opt/openemm

- unpack the Tomcat file:
   tar -xvzf apache-tomcat-6.0.35.tar.gz

- Create a symbolic link tomcat for the new directory:
   ln -s  apache-tomcat-6.0.35 tomcat

- Remove downloaded files:
   rm apache-tomcat-6.0.35.tar.gz

- rm jdk-6u33-linux-x64.bin

If you want to make sure that Tomcat works, enter the following commands (and make sure to stop an existing installation of OpenEMM first):

- Set environment variable JAVA_HOME:

- Change into Tomcat directory:cd tomcat

- Start Tomcat: bin/startup.sh

- Check for Tomcat installation screen: http://yourserverip:8080

- Stop Tomcat: bin/shutdown.sh

8. Configure Tomcat to Run as a Service :-

We will now see how to run Tomcat as a service and create a simple Start/Stop/Restart script, as well as to start Tomcat at boot.

Change to the /etc/init.d directory and create a script called ‘tomcat’ as shown below.

- Change into init.d directory: cd /etc/init.d

-Create new tomcat file: vi tomcat

-copy this without line number:

#!/bin/bash
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/opt/openemm/java
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/opt/openemm/tomcat
case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sh $CATALINA_HOME/bin/shutdown.sh
;;
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;;
esac
exit 0
- Save the file: “:wq”

- Now, set the permissions for your script to make it executable: chmod 755 tomcat

- We now use the chkconfig utility to have Tomcat start at boot time. In my script above, I am using chkconfig: 234 20 80. 2345 are the run levels and 20 and 80 are the stop and start priorities respectively. You can adjust as needed.

- chkconfig –add tomcat

- chkconfig –level 234 tomcat on

Verify it: chkconfig –list tomcat

tomcat             0:off    1:off    2:on    3:on    4:on    5:off    6:off

Now, let’s test our script.

-Start Tomcat: service tomcat start

- Stop tomcat: service tomcat stop

- restarting tomcat: service tomcat restart

- Check If tomcat is working: http://yourserverip:8080

NOTE:- JAVA_HOME and CATALINA_HOME path should proper in openemm.sh

9. Enable OpenEMM Access in iptables Firewall

Edit the file /etc/sysconfig/iptables to open ports 25 (SMTP), 8080 (OpenEMM console and redirection) and 8044 (OpenEMM update service).

Add the following lines in section -A RH-Firewall-1-INPUT:

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 25 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 8044 -j ACCEPT

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 8080 -j ACCEPT

If you plan to use the internal SMTP server of OpenEMM instead of Sendmail (see chapter 7) you have to add this line to open port 8025 (OpenEMM SMTP server):
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 8025 -j ACCEPT
Additionally, you have to enable a prerouting forwarding rule from port 25 to 8025. This is done by adding the following code after the comments at the top in file /etc/sysconfig/iptables:

*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A PREROUTING -i eth+ -p tcp –dport 25 -j REDIRECT –to-port 8025 COMMIT

Commiting all these changes requires a restart of iptables, which is done by

/etc/init.d/iptables restart


10. Instal OpenEMM 2013

Get the latest version of the OpenEMM binary code from

http://www.sourceforge.net/projects/openemm/files

Copy the tarball to a temporary location – /tmp is a good choice. Change to the home directory and run the following commands to create a version specific directory for the new OpenEMM version and to create a symbolic link from openemm to that directory:
cd /home

mv openemm openemm-2013
ln -s openemm-2013 openemm
Change to OpenEMM’s directory and unpack the OpenEMM tarball. Do not forget option “p” for the tar command, because some files need to have owner and group root or special permissions which are preset in the tarball!
cd /home/openemm
tar xzvpf /tmp/OpenEMM-2013-bin.tar.gz
Finally, move the documentation folder to /usr/share/doc where doc files are usually located on a Linux system:
mkdir -p /usr/share/doc/OpenEMM-2013
mv USR_SHARE/* /usr/share/doc/OpenEMM-2013
rm -r USR_SHARE
If you decide to install OpenEMM in a other directory than /home/openemm please make sure that your home directory contains a symbolic link to that directory and grant the required file access permissions with
chown -R openemm:openemm

11. Read Access to Maillog

OpenEMM requires read access to log file /var/log/maillog.

open file /etc/logrotate.d/syslog and add the following line after the line sharedscripts:

create 0604

Also run

chmod 604 /var/log/maillog

to set the permissions of the current maillog.

12. Initialize/Update the OpenEMM and the OpenEMM CMS Database :-

Edit /usr/share/doc/OpenEMM-2013/openemm-2013.sql and find http://localhost:8080 and change it to a valid redirection url, for example http://yoursitename:8080.

Initialize/Update the OpenEMM and the OpenEMM CMS Database
Make sure that MySQL is running.

- /etc/init.d/mysqld restart

Since OpenEMM 2013 works with a CMS database which did not exist before version 6.0, you have to setup this database and load its layout if you update OpenEMM from a version before 6.0 or if you are installing OpenEMM from scratch:
cd /usr/share/doc/OpenEMM-2013
mysqladmin -u root -p create openemm_cms
(omit option –p in case your MySQL system is not password protected)
mysql -u root -p openemm_cms < openemm_cms-2013.sql

/usr/bin/mysql_secure_installation
cd /usr/share/doc/OpenEMM-2013/
mysql -u root -p openemm
13. Set Up Email :-
     Edit /etc/mail/sendmail.mc
    Change the line:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA’)dnl
to:
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA’)dnl

Add the following line at the end of file: INPUT_MAIL_FILTER(`bav’, `S=unix:/home/openemm/var/run/bav.sock, F=T’)dnl

Edit /etc/mail/relay-domains and add a line, which specifies your DNS entry for the sender hostname (FQDN).

If file relay-domains does not exist in directory /etc/mail, create the file – for example with

touch relay-domains

newsletter.company.com

Edit /etc/mail/mailertable and add a line at the end, which activates the bounce management for that FQDN:

newsletter.company.com procmail:/home/openemm/conf/bav/bav.rc

Edit /etc/mail/sendmail.cf

And change TrustedUser to openemm:

# Trusted user for file ownership and starting the da emon

O TrustedUser=openemm

cd /etc/mail

make

service sendmail stop


14. Start OpenEMM(run at user openemm): -
cd /home/openemm/bin/
openemm.sh start

OR


 su - openemm
 openemm.sh start

NOTE:- if you are getting below exception than you have to check your versions 
liaMngA.xml] failed (Missing binary? Wrong permissions?): java.lang.Exception: command returns 127 
to resolve above issue :-
we need to installed the packages: zlib-1.2.3-29.el6.i686 and

libxml2-2.7.6-14.el6.i686
The tomcat pid file has been set as: /home/openemm/tomcat.pid .


also set up proper path of java/tomcat in openemm.sh 


More References :-
http://www.openemm.org/why/features.html
http://www.openemm.org/downloads.html
http://www.openemm.org/fileadmin/docs/Comparison_EMM_OpenEMM.pdf








Read more...

Install testlink on CentOS OR Linux

How to Configure Test link on CentOS

We are explain, how to install Test link 1.9.3 on CentOS step by step. there are following steps :-

1. Install required packages using yum :-
    yum install mysql-server php php-mysql php-gd php-ldap

2. Modify /etc/php.ini to optimize php configuration for TestLink :-
    vi /etc/php.ini
    session.gc_maxlifetime = 2400
    max_execution_time = 120

3. Set up web server and mysql services :-
   chkconfig httpd on
   chkconfig mysqld on
   service httpd start
   service mysqld start

4. Set a password for mysql root user :-
    mysqladmin -u root password 'NEWPASSWORD'

5. Add port 80 to iptables, Add the following rule into /etc/sysconfig/iptables :-
    vi  /etc/sysconfig/iptables
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

6. Restart Iptables :-
    service iptables restart

7. Create a test.php php file at /var/www/html and add below text in that file to check if php works properly :-
   touch test.php
   vi test.php


8. Download TestLink 1.9.3 and configure
   Website: http://sourceforge.net/projects/testlink/

   cd /var/www/html
   wget http://goo.gl/HLuhE
   tar zxvf testlink-1.9.3.tar.gz
   mv testlink-1.9.3 testlink
   chmod -R 755 testlink
   chmod -R 777 testlink/gui/templates_c
   chown -R apache:apache testlink

9. Go to TestLink webpage to setup first configuration : http://server_ip/testlink

1. Click "New Installation"
Screenshot : [http://screencast.com/t/ghllOE4alWj](http://screencast.com/t/ghllOE4alWj)
2. Click " I agree to the terms set out in this license."
3. There is checking report. To check if there is no fatal error.
Screenshot : [http://screencast.com/t/niazmypZ6](http://screencast.com/t/niazmypZ6) and click continue
4. Here, we use MySQL. Use the root password we created before. click "Process TestLink Setup"
5. Login to test link with admin/admin

10. There are some security warning need to be fixed
     1. Change admin default password
     2. Remove Install directory: rm -rf /var/www/html/testlink/install/
     3. Modify email settings: cp custom_config.inc.php.example custom_config.inc.php

11. Uncomment the following four variables and modify them to your environment setting.
      $g_smtp_host = '127.0.0.1'; # SMTP server MUST BE configured
      $g_tl_admin_email = 'tl_admin@testlink'; # for problem/error notification
      $g_from_email = 'testlink@testlink'; # email sender
      $g_return_path_email = 'ajju@testlink';

12. For Security need to disable warning using below 
      vi var/www/html/testlink/config.inc.php
      change below property to 'SILENT', default is 'FILE'
      $tlCfg->config_check_warning_mode = SILENT; 


More Reference Urls :-
TestLink - Installation & Configuration Manual : http://goo.gl/eFNUo

Install TestLink : http://goo.gl/peKDv
 




















Read more...

About This Blog

Lorem Ipsum

  © Copyright 2009 Linux-HelpLine.Blogspot.com

Back to TOP