Wednesday, September 18, 2013

How to install Huawei E220 USB Modem on Centos 5.4


You want to install Huawei E220 USB Modem on Centos 5.4 and use the modem to access internet? If you use Slackware 12.2 or Fedora 12 , clickhere for Slackware 12.2 or here for Fedora 12 to follow the tutorials

It is very easy to do this. CentOS 5.4 that using kernel 2.6.18-164 is smart enough to autodetect the device so you do not need huaweiAktBbo-i386.out tool to switch the modem to the correct mode for serial port. In my case, it is detected and attached to ttyUSB0 and ttyUSB1. When you connect the modem to your laptop or PC via USB port, you would see log messages in ‘dmesg’ command something like below:
usb 2-2: new full speed USB device using uhci_hcd and address 2
usb 2-2: configuration #1 chosen from 1 choice
Initializing USB Mass Storage driver...
scsi3 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usb 2-2: USB disconnect, address 2
usb 2-2: new full speed USB device using uhci_hcd and address 3
usb 2-2: configuration #1 chosen from 1 choice
usb-storage: probe of 2-2:1.0 failed with error -5
usb-storage: probe of 2-2:1.1 failed with error -5
scsi6 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
usbcore: registered new driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbcore: registered new driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core
drivers/usb/serial/usb-serial.c: USB Serial support registered for GSM modem (1-port)
option 2-2:1.0: GSM modem (1-port) converter detected
usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0
option 2-2:1.1: GSM modem (1-port) converter detected
usb 2-2: GSM modem (1-port) converter now attached to ttyUSB1
usbcore: registered new driver option
drivers/usb/serial/option.c: USB Driver for GSM modems: v0.7.1
  Vendor: HUAWEI    Model: Mass Storage      Rev: 2.31
  Type:   CD-ROM                             ANSI SCSI revision: 02
scsi 6:0:0:0: Attached scsi generic sg1 type 5
usb-storage: device scan complete
As you can see above, Centos 5.4 already attached the modem to ttyUSB0 and ttyUSB1.
[ad#Chitika468x180]
Now build a configuration file for wvdial and stored it in /etc/wvdial.conf file by running wvdialconf command as below:
[root@fuad ~]# wvdialconf /etc/wvdial.conf
Scanning your serial ports for a modem.

Port Scan<*1>: S0   S1   S2   S3
WvModem<*1>: Cannot get information for serial port.
ttyUSB0<*1>: ATQ0 V1 E1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB0<*1>: Modem Identifier: ATI -- Manufacturer: huawei
ttyUSB0<*1>: Speed 4800: AT -- OK
ttyUSB0<*1>: Speed 9600: AT -- OK
ttyUSB0<*1>: Speed 19200: AT -- OK
ttyUSB0<*1>: Speed 38400: AT -- OK
ttyUSB0<*1>: Speed 57600: AT -- OK
ttyUSB0<*1>: Speed 115200: AT -- OK
ttyUSB0<*1>: Speed 230400: AT -- OK
ttyUSB0<*1>: Speed 460800: AT -- OK
ttyUSB0<*1>: Max speed is 460800; that should be safe.
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
WvModem<*1>: Cannot get information for serial port.
ttyUSB1<*1>: ATQ0 V1 E1 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB1<*1>: Modem Identifier: ATI -- Manufacturer: huawei
ttyUSB1<*1>: Speed 4800: AT -- OK
ttyUSB1<*1>: Speed 9600: AT -- OK
ttyUSB1<*1>: Speed 19200: AT -- OK
ttyUSB1<*1>: Speed 38400: AT -- OK
ttyUSB1<*1>: Speed 57600: AT -- OK
ttyUSB1<*1>: Speed 115200: AT -- OK
ttyUSB1<*1>: Speed 230400: AT -- OK
ttyUSB1<*1>: Speed 460800: AT -- OK
ttyUSB1<*1>: Max speed is 460800; that should be safe.
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

Found a modem on /dev/ttyUSB0.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0: Speed 460800; init \"ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0\"
ttyUSB1: Speed 460800; init \"ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0\"
The command above will generate wvdial.conf after scanning the modem. You can check that file and should be like this:
[root@fuad ~]# cat /etc/wvdial.conf
[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 460800
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = Analog Modem
; Phone = 
; Username = 
; Password =
You have to edit the Phone, Username and Password of the configuration above to meet your account.
For example, it should be like below:
[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 460800
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = Analog Modem
Phone = *99#
Username = fuadnahdi
Password = secret-eh
The next step is running ‘wvdial’ command as root. By default it will read /etc/wvdial.conf as we configured before.
[root@fuad ~]# wvdial
--> WvDial: Internet dialer version 1.54.0
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected.  Waiting for prompt.
--> Don\'t know what to do!  Starting pppd and hoping for the best.
--> Starting pppd at Mon Nov  1 19:51:01 2009
--> pid of pppd: 4206
--> Using interface ppp0
--> local  IP address 114.59.189.52
--> remote IP address 10.64.64.64
--> primary   DNS address 202.155.0.10
--> secondary DNS address 202.155.0.15
If successful you will get an IP address and DNS server assigned to you. For the DNS server, you need to manually write it into /etc/resolv.conf because the wvdial script will not automatically write it for you.

Installing and Configuring 3G DataCard on CentOS



Installation steps mentioned in the Documentation are tested on CentOS 6

Follow the steps mentioned in the following order.

1) Install CentOS 6.3.

2) Following are the prerequisite package for connecting 3G USB Dongle
   wvdial
   usb_modeswitch-data
   usb_modeswitch
You can download the above package from following site on your Pen Drive or other media.
   http://mirror.centos.org/centos/6/os/x86_64/Packages/wvdial
   http://pkgs.repoforge.org/usb_modeswitch-data
   http://pkgs.repoforge.org/usb_modeswitch
3) Connect the USB 3G Dongle on the system and check the device is detected using lsusb command or in /var/log/messages.
   lsusb
   Bus 001 Device 003: ID 12d1:140c Huawei Technologies Co., Ltd.
OR
   tail -f /var/log/messages

   Aug 1 11:09:04 localhost kernel: usb 1-7: Product: HUAWEI Mobile
   Aug 1 11:09:04 localhost kernel: usb 1-7: Manufacturer: HUAWEI Technology
4) Check the device type by which modem is connected using dmesg.
   dmesg | grep tty

   usb 1-8: GSM modem (1-port) converter now attached to ttyUSB0
   usb 1-8: GSM modem (1-port) converter now attached to ttyUSB1
   usb 1-8: GSM modem (1-port) converter now attached to ttyUSB2
   usb 1-8: GSM modem (1-port) converter now attached to ttyUSB3
5) Once USB is connected and detected, now is the time to configure wvdial.
   vi /etc/wvdial.conf 
   [Dialer Defaults]
   Init1 = ATZ
   Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
   Init3 = AT+CGDCONT=1,"IP","airtelgprs.com"
   stupid mode = 1
   Modem Type = USB Modem
   Baud = 460800
   New PPPD = yes
   Modem = /dev/ttyUSB0
   ISDN = 0
   Phone = *99#
   Carrier Check = no
   Password = airtel
   Username = airtel
   FlowControl=Hardware(CRTSCTS)
6) Once we have prepared the config file now is the time to connect wvdial.
   wvdial
   --> WvDial: Internet dialer version 1.60
   --> Cannot get information for serial port.
   --> Initializing modem.
   --> Sending: ATZ
   OK
   --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
   ATQ0 V1 E1 S0=0 &C1 &D2
   OK
   --> Sending: AT+CGDCONT=1,"IP","airtelgprs.com"
   AT+CGDCONT=1,"IP","airtelgprs.com"
   OK
   --> Modem initialized.
   --> Sending: ATDT*99#
   --> Waiting for carrier.
   ATDT*99#
   CONNECT
   --> Carrier detected.  Starting PPP immediately.
   --> Starting pppd at Mon Aug  5 18:55:58 2013
   --> Pid of pppd: 3070
   --> Using interface ppp0
   --> pppd: ?
   --> pppd: ?
   --> pppd: ?
   --> pppd: ?
   --> pppd: ?
   --> local  IP address 223.228.201.19
   --> pppd: ?
   --> remote IP address 10.64.64.64
   --> pppd: ?
   --> primary   DNS address 125.22.47.102
   --> pppd: ?
   --> secondary DNS address 125.22.47.103
   --> pppd: ?
6) Check the logs (/var/log/messages) and try to make entry of Primary and Secondary DNS server in /etc/resolv.conf, if it is not updated.
   Aug 1 14:35:40 localhost pppd[3794]: pppd 2.4.5 started by root, uid 0
   Aug 1 14:35:40 localhost pppd[3794]: Using interface ppp0
   Aug 1 14:35:40 localhost pppd[3794]: Connect: ppp0 <--> /dev/ttyUSB0
   Aug 1 14:35:40 localhost pppd[3794]: CHAP authentication succeeded
   Aug 1 14:35:40 localhost pppd[3794]: CHAP authentication succeeded
   Aug 1 14:35:43 localhost pppd[3794]: Could not determine remote IP address: defaulting to 10.64.64.64
   Aug 1 14:35:43 localhost pppd[3794]: local IP address 106.200.21.246
   Aug 1 14:35:43 localhost pppd[3794]: remote IP address 10.64.64.64
   Aug 1 14:35:43 localhost pppd[3794]: primary DNS address 125.22.47.102
   Aug 1 14:35:43 localhost pppd[3794]: secondary DNS address 125.22.47.103
   Aug 1 14:35:45 localhost ntpd[2903]: Listening on interface #5 ppp0, 106.200.21.246#123 Enabled
Resolv file will look like
   vi /etc/resolv.conf 
   nameserver 125.22.47.102
   nameserver 125.22.47.103
7) Congratulation now you are connected, grap a glass of bear and enjoy surfing the Net. Debugging steps *) Check device is in Storage or Modem Mode.
**) Use usb-devices or lsusb command to check.
   usb-devices
   T: Bus=01 Lev=01 Prnt=01 Port=07 Cnt=01 Dev#= 9 Spd=480 MxCh= 0
   D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
   P: Vendor=12d1 ProdID=1446 Rev=00.00
   S: Manufacturer=HUAWEI Technology
   S: Product=HUAWEI Mobile
   C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
   I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
   I: If#= 1 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
OR
   lsusb
   Bus 001 Device 003: ID 12d1:1446 Huawei Technologies Co., Ltd. E1552/E1800/E173 (HSPA modem)
"1446" is the product id for the file mode of this dongle. (It is in Storage mode).
   lsusb
   Bus 001 Device 003: ID 12d1:140c Huawei Technologies Co., Ltd.
"140c" is the product id for the file mode of this dongle. (It is in USB mode). **) Load the usbserial kernel module using following command.
   modprobe usbserial vendor=0x12d1 product=0x140c
**) usb_modeswitch package is used to switch the USB dongle from CDROM file system to Modem mode (→ flip flop). Create the following file.
   cat /etc/usb_modeswitch.conf
   DefaultVendor= 0x12d1 
   DefaultProduct=0x1446 

   TargetVendor= 0x12d1 
   TargetProductList="1001,1406,140b,140c,141b,14ac" 

   CheckSuccess=20 MessageContent="55534243123456780000000000000011060000000000000000000000000000" 
**) Now run the following command to switch from storage to modem mode.
   usb_modeswitch -c /etc/usb_modeswitch.conf
   Check the /var/log/message it will show something like
   Aug 1 14:35:08 localhost kernel: usb 1-8: configuration #1 chosen from 1 choice
   Aug 1 14:35:08 localhost kernel: option 1-8:1.0: GSM modem (1-port) converter detected
   Aug 1 14:35:08 localhost kernel: usb 1-8: GSM modem (1-port) converter now attached to ttyUSB0
   Aug 1 14:35:08 localhost kernel: option 1-8:1.1: GSM modem (1-port) converter detected
   Aug 1 14:35:08 localhost kernel: usb 1-8: GSM modem (1-port) converter now attached to ttyUSB1
   Aug 1 14:35:08 localhost kernel: option 1-8:1.2: GSM modem (1-port) converter detected
   Aug 1 14:35:08 localhost kernel: usb 1-8: GSM modem (1-port) converter now attached to ttyUSB2
   Aug 1 14:35:08 localhost kernel: option 1-8:1.3: GSM modem (1-port) converter detected
   Aug 1 14:35:08 localhost kernel: usb 1-8: GSM modem (1-port) converter now attached to ttyUSB3
   Aug 1 14:35:08 localhost kernel: scsi23 : SCSI emulation for USB Mass Storage devices
   Aug 1 14:35:08 localhost kernel: scsi24 : SCSI emulation for USB Mass Storage devices
   Aug 1 14:35:09 localhost modem-manager: (ttyUSB0) opening serial device...
**) Now try the steps mentioned from Steps 5 onwards. *) Also try to remove any other mounted usb storage media and try the steps mentioned above once again.

NOTE: Converting Storage Mode to Modem Mode)
http://bytefish.de/blog/huawei_e352s5/

   Reference for further reading
   *) https://wiki.archlinux.org/index.php/3G_and_GPRS_modems_with_pppd
   *) https://wiki.archlinux.org/index.php/USB_3G_Modem

Ref:1

Tuesday, September 3, 2013

LDAP Authentication


LDAP Authentication (Advanced)

The Advanced LDAP authentication mechanism offers the maximum amount of flexibility when authenticating against an LDAP directory.
When authenticating against Active Directory, try the standard LDAPAuthentication first. It is designed specifically for default configured Active Directories when the base DN matches the email address domain (i.e. dc=example,dc=com).

Terminology

KeywordDescription
LDAPHostThe hostname or the IP address of the LDAP server
LDAP PortOptional port to use when connecting to the LDAP host. The default port if no port is specified is 389 for non-ssl connections and 636 for SSL connections.(*)
LDAPBaseThe LDAP search base Distinguished Name (DN)
LDAPSearch keyThe LDAP search key that will find users in the directory
LDAPUserA user with search credentials in the LDAP Directory
LDAPPasswordThe password for the LDAP User above
LDAPDomainOptional parameter to specify the email domain used for users in the LDAP directory.
(*) Some people believe that port 3268 is the default LDAP port in Active Directory. This is not true. Port 3268 is used for the global addressbook lookups, it won't work to authenticate against. Use port 389 instead.

Background

When authenticating against the Filetransfer appliance, it need to somehow work out the users email address. This can either be accomplished by having
  • LDAP Search Key pointing to the complete email address; or
  • LDAP Search Key pointing to the username part of the email address, together with a specified LDAP Domainto build the complete email address
a common misconfiguration happens when the LDAP Search key points to the complete email address, and theLDAP domain is added as well, this will lead to the system trying to authenticateuser@example.com@example.com.
If the LDAP Search Key points to the complete email address, leave the LDAP Domain blank.
If for whatever reason, you don't have any LDAP search keys in your directory that neither matches the username part of the email address, or the email address itself, the LDAP authentication won't work. Please use the IMAPauthentication option instead.

Examples

These examples below are primarily focused around Microsoft Active Directory, but should work with all directories.
The user configured in these examples are
UsernamePasswordEmail
john.doesecretjohn.doe@company.com

Example 1 - Good

In this example the LDAP directory is configured as follows
SettingDescription
LDAP Basedc=company,dc=com
LDAP Search keymailThis points the the users email address in company.com
LDAP Domain
Authentication test
EmailPasswordResult
john.doe@company.comsecretSuccess
john.doesecretFail
This is a pretty standard configuration where the LDAP search key points to the email address and as expected, the users needs to enter their email address to authenticate to the Filetransfer appliance.
For domains with this structure, the Advanced LDAP Authentication mechanism does not need to be used. The standard LDAP Authentication would have worked just as well.

Example 2 - Good

In this example the LDAP directory is configured as follows
SettingDescription
LDAP Basedc=company,dc=local
LDAP Search keysAMAccountNameThis points to the users username (john.doe)
LDAP Domaincompany.com
Authentication test
EmailPasswordResult
john.doe@company.comsecretSuccess
john.doesecretSuccess
This example has another popular Active Directory configuration, with the internal domain being configured as company.local. By specifying the sAMAccountName as the search key, which points to the username only, together with the LDAP Domain, the system will be able to work out the correct email address.

Example 3 - Bad

In this example the LDAP directory is configured as follows
SettingDescription
LDAP Basedc=company,dc=com
LDAP Search keyuidThis points the the users username (john.doe)
LDAP Domain
Authentication test
EmailPasswordResult
john.doe@company.comsecretFail
john.doesecretFail
When authenticating with john.doe@company.com, john.doe@company.com would be search for in the uid LDAPsearch key. When authenticating with john.doe, this would actually succeed, but with no LDAP domain configured, the email would be sent From: john.doe, with no domain - which would not work when sending emails.

Example 4 - Bad

In this example the LDAP directory is configured as follows
SettingDescription
LDAP Basedc=company,dc=com
LDAP Search keyempnoThis points the the users employee number
LDAP Domaincompany.com
Authentication test
EmailPasswordResult
john.doe@company.comsecretFail
john.doesecretFail
If your users login with something else, like the employee number in this example, unless their email is on the format 12345@company.com, this won't work.

Summary

The Filetransfer appliance needs to be able to access the users email address. Either directly or by specifying the domain if the desired LDAP search key only contains the username. But the username in this case must match the username part of the email address.

Troubleshooting

The first step in troubleshooting LDAP Authentication is to look at your directory with an LDAP browser (Google forLDAP Browser if you don't have one available). This will display the structure of the directory like this:
This is the view from Active Directory from a Windows 2003 system with the domain set as dc=allard,dc=local. The alternative configurations that could possibly work with this directory are
LDAP Search KeyLDAP DomainWorks if
mailWorks if the users email address is johan@allardsoft.com
sAMAccountNameallardsoft.comWorks if the users email address is johan.allard@allardsoft.com

Monday, September 2, 2013

How do I download and install 32-bit Java for Linux Platforms?


This article applies to:
  • Platform(s): Red Hat Linux, SUSE Linux, Oracle Linux, Oracle Enterprise Linux, SLES
  • Java version(s): 6.0, 7.0


Linux System Requirements
See supported System Configurations for information about supported platforms, operating systems, desktop managers, and browsers.
You will also need a Pentium 166MHz or faster processor with a minimum of 75MB free disk space and a minimum of 64MB of RAM.
Note: For downloading Java other flavors of Linux see Java for UbuntuJava for Fedora

Follow these steps to download and install 32- bit Java for Linux.
  1. Download
  2. Install
  3. Enable and Configure
Download
  1. Go to http://java.com and click on the Download button
  2. There are two types of installation packages.
    • Java on Linux Platforms
      This is an archive binary file that can be installed by anyone (not only the root users), in any location that you can write to. However, only the root user can install Java into the system location. 
    • Java on RPM-based Linux Platforms
      32-bit RPM-based Linux platforms, such as Red Hat and SuSE, use a RPM binary file (.rpm) in the system location. You must be root to perform this installation.

    Download the package that best suits your needs. You can download the file to any of the directories on your system.
  3. Download and check the download file size to ensure that you have downloaded the full, uncorrupted software bundle. Before you download the file, notice its byte size provided on the download page on the web site. Once the download has completed, compare that file size to the size of the downloaded file to make sure they are equal.



Install
Java for Linux Platforms
The instructions below are for installing version Java 7 Update 7 (7u7). If you are installing another version, make sure you change the version number appropriately when you type the commands at the terminal. Example: For Java 6u35 replace 7u7 with 6u35. Note that, as in the preceding example, the version number is sometimes preceded with the letter u, and sometimes it is preceded with an underbar, for example, jre1.7.0_07
  1. Change to the directory in which you want to install. Type:
    cd <directory path name>
    For example, to install the software in the /usr/java/ directory, Type:
    cd /usr/java/

    Note about root access: To install Java in a system-wide location such as /usr/local, you must login as the root user to gain the necessary permissions. If you do not have root access, install the Java in your home directory or a sub directory for which you have write permissions
  2. Move the .tar.gz archive binary to the current directory.
  3. Unpack the tarball and install Java
    tar zxvf jre-7u7-linux-i586.tar.gz

    The Java files are installed in a directory called jre1.7.0_07 in the current directory.
    In this example, it is installed in the /usr/java/jre1.7.0_07 directory.
  4. Delete the .tar.gz file if you want to save disk space.



Java for RPM based Linux Platforms
The instructions below are for installing version Java 7 Update 7 (7u7). If you are installing another version, make sure you change the version number appropriately when you type the commands at the terminal. Example: For Java 6u35 replace 7u7 with 6u35. Note that, as in the preceding example, the version number is sometimes preceded with the letter u, and sometimes it is preceded with an underbar, for example, jre1.7.0_07
  1. Become root by running su and entering the super-user password.
  2. Uninstall any earlier installations of the Java packages.
    rpm -e <package_name>
  3. Change to the directory in which you want to install. Type:
    cd <directory path name>
    For example, to install the software in the /usr/java/ directory, Type:
    cd /usr/java
  4. Install the package.
    rpm -ivh jre-7u7-linux-i586.rpm

    To upgrade a package,
    rpm -Uvh jre-7u7-linux-i586.rpm
  5. Delete the .rpm file if you want to save disk space.
  6. Exit the root shell. No need to reboot.
The installation is now complete. Go to the Enable and Configure section.


Enable and Configure
Firefox or Mozilla
To configure the Java Plugin follow these steps:
  1. Exit Firefox browser if it is already running.
  2. Uninstall any previous installations of Java Plugin.
    Only one Java Plugin can be used at a time. When you want to use a different plugin, or version of a plugin, remove the symbolic links to any other versions and create a fresh symbolic link to the new one.
  3. Create a symbolic link to the libnpjp2.so file in the browser plugins directory
    • Go to the plugins sub-directory under the Firefox installation directory
      cd <Firefox installation directory>/plugins
      Create plugins directory if it does not exist.
    • Create the symbolic link
      ln -s <Java installation directory>/lib/i386/libnpjp2.so

    Note: If you are upgrading your Java version then before creating new symbolic link you should remove old symbolic link to enable latest downloaded Java.

    To remove old symbolic link:
    type cd <Firefox installation directory>/plugins
    rm libjavaplugin_oji.so

    Example
    • If Firefox is installed at this directory:
      /usr/lib/<Firefox installation directory>
    • And if the Java is installed at this directory:
      /usr/java/<Java installation directory>
    • Then type in the terminal window to go to the browser plug-in directory:
      /usr/lib/<Firefox installation directory>/plugins
    • Enter the following command to create a symbolic link to the Java Plug-in for the Mozilla browser.
      ln -s /usr/java/<Java installation directory>/lib/i386/libnpjp2.so


  4. Start the Firefox browser, or restart it if it is already up. 

    In Firefox, type about:plugins in the Location bar to confirm that the Java Plugin is loaded. You can also click the Tools menu to confirm that Java Console is there.


Test Installation
To test that Java is installed and working properly on your computer, run this test applet



For Google Chrome Browser


Note: same procedure for google chrome browser also

goto chrome installation directory


[root@thelinuxwiki ]# cd  /opt/google/chrome

then create symbolic link  ln -s <Java installation directory>/lib/i386/libnpjp2.so 

[root@thelinuxwiki ]#  ls -l


 lrwxrwxrwx 1 root root       42 Sep  2 14:12 libnpjp2.so -> /usr/java/jre1.7.0_25/lib/i386/libnpjp2.so


Restart your browser and test whether java is working or not  click here for testing java 



Ref:http://java.com/en/download/help/linux_install.xml

==================================================================

Running jnlp files in Linux while using Firefox/Chrome


Often we reach up to some web pages where browser (firefox) denies to run jnlp files automatically and asks for options either to select appropriate program from the available list to run it or select directory and filename to save it. This is a bit hazardous. But this can be resolved very easily. Just Follow the procedure below:
  • 2.Open java web start file ( jnlp ) from browser and when browser prompt – open with – direct to always open with <jdk installfolder>/bin/javaws
That’s it! You’re free from the hazard as for always.