Setup Oracle Java jre 1.7 on Centos 6.(1,2,3,4…)

Download the rpm file from java.com. Install using the rpm command:

rpm -Uvh jre-7u17-linux-x64.rpm

Use alternatives to config:

[root@localhost ~]# alternatives --config java
There are 2 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
*  1           /usr/java/latest/jre/bin/java
 + 2           /usr/java/jre1.7.0_17/bin/java
   
Enter to keep the current selection[+], or type selection number:

Select the java you want to use in my case 2. Test using:

[root@localhost ~]# java -version
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
[root@localhost ~]# 

Create links in the Mozilla Plugins directory:

[root@localhost ~]# cd /usr/lib64/mozilla/plugins/
[root@localhost ~]# ln -fs /usr/java/latest/lib/amd64/libnpjp2.so 

Fedora, RHEL / Centos set default gateway

There is no specific command on CentOS to set the default route or gateway, there are several ways to do this on CentOS (as there often are). The method I am showing you will work on all versions of CentOS with or without a GUI and involves directly editing the network configuration file using Vim.

Setting default gateway on CentOS first requires us to open /etc/sysconfig/network config file using Vim:

$ vim /etc/sysconfig/network

You now need to add your default GW, if you don’t know the IP of your default GW (aka default route) then you need to ask your ISP / web host or network admin. The example below assumes our default GW is 192.168.0.1

GATEWAY=192.168.0.1

I always append this information to the bottom on the network config file on CentOS.

After adding the default route (GW) you need to restart the networking service using:

# service networking restart

Облачные и VPS виртуалки: Как определить, какая система виртуализации на вашем хостинге.

Frequently, customers want to install software in a virtual machine. This can be OK, but frequently they hit a CPU,memory, or IO limit caused by running in a constrained virtual environment.When this happens, we really like to know if they’re running under virtualization when we try to support them. Here’s some tricks to detect, from
a shell, if the system is virtualized.

The first thing to check is dmesg. On a recently-booted system, checking the
‘dmesg’ command output may be sufficient. Otherwise, try “cat /var/log/dmesg”
instead of “dmesg”

  • VMWare:

    “Облачные и VPS виртуалки: Как определить, какая система виртуализации на вашем хостинге.”Continue reading

Subroutine SNMP_Session::pack_sockaddr_in6 redefined on Centos 6.3 with mrtg

Here is a quick fix-patch for the following warning:

Subroutine SNMP_Session::pack_sockaddr_in6 redefined at /usr/share/perl5/Exporter.pm line 67.
 at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 149.
Subroutine SNMP_Session::unpack_sockaddr_in6 redefined at /usr/share/perl5/Exporter.pm line 67.
 at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 149.
Subroutine SNMP_Session::sockaddr_in6 redefined at /usr/share/perl5/Exporter.pm line 67.
 at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 149.
Subroutine SNMPv1_Session::pack_sockaddr_in6 redefined at /usr/share/perl5/Exporter.pm line 67.
 at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 604.
Subroutine SNMPv1_Session::unpack_sockaddr_in6 redefined at /usr/share/perl5/Exporter.pm line 67.
 at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 604.
Subroutine SNMPv1_Session::sockaddr_in6 redefined at /usr/share/perl5/Exporter.pm line 67.
 at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 604.
Subroutine main::pack_sockaddr_in6 redefined at /usr/share/perl5/Exporter.pm line 67.
 at /usr/bin/mrtg line 101.
Subroutine main::unpack_sockaddr_in6 redefined at /usr/share/perl5/Exporter.pm line 67.
 at /usr/bin/mrtg line 101.
Subroutine main::sockaddr_in6 redefined at /usr/share/perl5/Exporter.pm line 67.
 at /usr/bin/mrtg line 101.

“Subroutine SNMP_Session::pack_sockaddr_in6 redefined on Centos 6.3 with mrtg”Continue reading

Install fail2ban on RHEL/CentOS

Fail2ban is an open source free intrusion prevention framework developed in python programming language. Fail2ban operates by monitoring log files such as /var/log/pwdfail, /var/log/auth.log, /var/log/secure etc. and bans the IP address after too many password failure attempts. It used to update iptable firewall rules to reject the IP address for a specified amount of time.

Fail2ban runs as a daemon that uses python scripts to parse log files for system intrusion attempts and adds a custom rules to iptables configuration file to ban the access to certain ip addresses.

Install Fail2ban in Centos

Before heading up for installation and configuration of Fail2Ban, I would like to tell you that most of the attackers trying to gain root access via SSH. So, I recommend you to pay close attention to things such as disable ssh root logins and use pair of ssh keys for authentication etc.

“Install fail2ban on RHEL/CentOS”Continue reading

Scroll to top