Prakash Sawarkar: Kernel 3.8 Released, how to Compile in Redhat, CenOS and Fedora..

Kernel 3.8 Released, how to Compile in Redhat, CentOS and Fedora.

Saturday, 3 August 2013

Linux Netstat Command Examples

Netstat command displays various network related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships etc.
10 practical Linux netstat command examples.

1. List All Ports (both listening and non listening ports)
List all ports using netstat -a
# netstat -a | more
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             Stat
e
tcp        0      0 *:submission                *:*                         LIST
EN
tcp        0      0 localhost:dyna-access       *:*                         LIST
EN
tcp        0      0 *:sunrpc                    *:*                         LIST
EN
tcp        0      0 *:urd                       *:*                         LIST
EN
tcp        0      0 *:ssh                       *:*                         LIST
EN
tcp        0      0 *:smtp                      *:*                         LIST
EN
tcp        0      0 *:iscsi-target              *:*                         LIST
EN
tcp        0      0 *:49641                     *:*                         LIST
EN
tcp        0     52 oracle.microair.in:ssh      172.24.23.153:14211           ESTA
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ACC ]     STREAM     LISTENING     14148  /tmp/.X11-unix/X9
unix  2      [ ACC ]     STREAM     LISTENING     12054  @/var/run/hald/dbus-cYZ
kVWR8Gb
unix  2      [ ACC ]     STREAM     LISTENING     14230  /tmp/orbit-root/linc-90
0-0-3376678e2d44f
unix  2      [ ACC ]     STREAM     LISTENING     14719  /tmp/orbit-root/linc-8f
1-0-4e4fb3ab4acf6
unix  2      [ ]         DGRAM                    10609  /var/run/portreserve/so
cket
unix  2      [ ACC ]     STREAM     LISTENING     10684  /var/run/rpcbind.sock
List all tcp ports using netstat -at
# netstat -at
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 *:submission                *:*                         LISTEN
tcp        0      0 localhost:dyna-access       *:*                         LISTEN
tcp        0      0 *:sunrpc                    *:*                         LISTEN
tcp        0      0 *:urd                       *:*                         LISTEN
tcp        0      0 *:ssh                       *:*                         LISTEN
tcp        0      0 *:smtp                      *:*                         LISTEN
List all udp ports using netstat -au
# netstat -au
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
udp        0      0 *:sunrpc                    *:*                          
udp        0      0 *:ipp                       *:*                          
udp        0      0 *:iris-xpcs                 *:*                          
udp        0      0 *:821                       *:*                          
udp        0      0 *:41786                     *:*                          
udp        0      0 *:sunrpc                    *:*    
2. List Sockets which are in Listening State
List only listening ports using netstat -l
# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 *:submission                *:*                         LISTEN
tcp        0      0 localhost:dyna-access       *:*                         LISTEN
tcp        0      0 *:sunrpc                    *:*                         LISTEN
tcp        0      0 *:urd                       *:*                         LISTEN
tcp        0      0 *:ssh                       *:*                         LISTEN
tcp        0      0 *:smtp                      *:*                         LISTEN
tcp        0      0 *:iscsi-target              *:*                         LISTEN
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ACC ]     STREAM     LISTENING     14148  /tmp/.X11-unix/X9
unix  2      [ ACC ]     STREAM     LISTENING     12054  @/var/run/hald/dbus-cYZkVWR8Gb
unix  2      [ ACC ]     STREAM     LISTENING     14230  /tmp/orbit-root/linc-900-0-3376678e2d44f
unix  2      [ ACC ]     STREAM     LISTENING     14719  /tmp/orbit-root/linc-8f
List only listening TCP Ports using netstat -lt
# netstat -lt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 *:submission                *:*                         LISTEN
tcp        0      0 localhost:dyna-access       *:*                         LISTEN
tcp        0      0 *:sunrpc                    *:*                         LISTEN
tcp        0      0 *:urd                       *:*                         LISTEN
tcp        0      0 *:ssh                       *:*                         LISTEN
tcp        0      0 *:smtp                      *:*                         LISTEN
List only listening UDP Ports using netstat -lu
# netstat -lu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
udp        0      0 *:sunrpc                    *:*                          
udp        0      0 *:ipp                       *:*                          
udp        0      0 *:iris-xpcs                 *:*                          
udp        0      0 *:821                       *:*                          
List only the listening UNIX Ports using netstat -lx
# netstat -lx
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ACC ]     STREAM     LISTENING     14148  /tmp/.X11-unix/X9
unix  2      [ ACC ]     STREAM     LISTENING     12054  @/var/run/hald/dbus-cYZkVWR8Gb
unix  2      [ ACC ]     STREAM     LISTENING     14230  /tmp/orbit-root/linc-900-0-3376678e2d44f
unix  2      [ ACC ]     STREAM     LISTENING     14719  /tmp/orbit-root/linc-8f1-0-4e4fb3ab4acf6
unix  2      [ ACC ]     STREAM     LISTENING     10684  /var/run/rpcbind.sock
unix  2      [ ACC ]     STREAM     LISTENING     10737  /var/run/mcelog-client
unix  2      [ ACC ]     STREAM     LISTENING     11764  /var/run/dbus/system_bu
3. Show the statistics for each protocol
Show statistics for all ports using netstat -s
# netstat -s
Ip:
    390700 total packets received
    0 forwarded
    0 incoming packets discarded
    383228 incoming packets delivered
    8510 requests sent out
Icmp:
    7 ICMP messages received
    0 input ICMP message failed.
    ICMP input histogram:
        destination unreachable: 2
        echo requests: 5
    79 ICMP messages sent
    0 ICMP messages failed
    ICMP output histogram:
        destination unreachable: 74
        echo replies: 5
IcmpMsg:
        InType3: 2
        InType8: 5
        OutType0: 5
        OutType3: 74
Tcp:
    5 active connections openings
    113 passive connection openings
    16 failed connection attempts
    0 connection resets received
    1 connections established
    7103 segments received
    10131 segments send out
    73 segments retransmited
    0 bad segments received.
    378 resets sent
Udp:
    42 packets received
    13 packets to unknown port received.
    0 packet receive errors
    44 packets sent
Show statistics for TCP (or) UDP ports using netstat -st (or) -su
# netstat -st
# netstat -su
4. Display PID and program names in netstat output using netstat -p
netstat -p option can be combined with any other netstat option. This will add the “PID/Program Name” to the netstat output. This is very useful while debugging to identify which program is running on a particular port.
# netstat -pt
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0    248 oracle.microair.in:ssh      172.24.0.17:57321           ESTABLISHED 29088/sshd
5. Don’t resolve host, port and user name in netstat output
When you don’t want the name of the host, port or user to be displayed, use netstat -n option. This will display in numbers, instead of resolving the host name, port name, user name.
This also speeds up the output, as netstat is not performing any look-up.
# netstat -an
If you don’t want only any one of those three items ( ports, or hosts, or users ) to be resolved, use following commands.
# netsat -a --numeric-ports
# netsat -a --numeric-hosts
# netsat -a --numeric-users
6. Print netstat information continuously
netstat will print information continuously every few seconds.
# netstat -c
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 prakash-laptop.loc:33362 201-151-18-123.ama:www ESTABLISHED
tcp        1      1 prakash-laptop.loc:52144 201.41.143.232:www      CLOSING
tcp        0      0 prakash-laptop.loc:43143 server-101-41-43-5:www ESTABLISHED
7. Find the non supportive Address families in your system
# netstat --verbose
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0     52 oracle.microair.in:ssh      172.24.0.17:57321           ESTABLISHED
netstat: no support for `AF INET (sctp)' on this system.
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ]         DGRAM                    10609  /var/run/portreserve/socket
unix  2      [ ]         DGRAM                    10824  /var/run/fcm/fcm_clif
unix  2      [ ]         DGRAM                    1855   @/org/kernel/udev/udevd
unix  15     [ ]         DGRAM                    10626  /dev/log
unix  2      [ ]         DGRAM                    11192  @/org/freedesktop/hal/u
At the end, you will have something like this.
unix  3      [ ]         STREAM     CONNECTED     14695  @/tmp/.X11-unix/X9
netstat: no support for `AF IPX' on this system.
netstat: no support for `AF AX25' on this system.
netstat: no support for `AF X25' on this system.
netstat: no support for `AF NETROM' on this system.
8. Display the kernel routing information using netstat -r
#  netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
default         172.16.24.251    0.0.0.0         UG        0 0          0 eth0
link-local      *               255.255.0.0     U         0 0          0 eth0
172.10.0.0      *               255.255
Note: Use netstat -rn to display routes in numeric format without resolving for host-names.
9. Find out on which port a program is running
# netstat -ap | grep ssh
tcp        0      0 *:ssh                       *:*                         LISTEN      2125/sshd
tcp        0     52 oracle.microair.in:ssh      172.16.0.223:56231           ESTABLISHED 29088/sshd
tcp        0      0 *:ssh                       *:*                         LISTEN      2125/sshd
unix  2      [ ]         DGRAM                    62948  29088/sshd
Find out which process is using a particular port:
# netstat -an | grep ':80'
10. Show the list of network interfaces
# netstat -i
Kernel Interface table
Iface   MTU Met      RX-OK    RX-ERR  RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR
eth0       1500 0        0      0      0 0             0      0      0      0
eth2       1500 0    743679     0      0 0         262033     6      0      0
lo        65336 0        4      0      0 0             4      0      0      0
Display extended information on the interfaces (similar to ifconfig) using netstat -ie:
#  netstat -ie
Kernel Interface table
eth0      Link encap:Ethernet  HWaddr 73:CC:A0:BF:BF:14
          inet addr:172.16.0.223  Bcast:172.16.4.255  Mask:255.255.252.0
          inet6 addr: fe80::7aac:c0ff:febf:1f28/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:750344 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26214 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:78170590 (74.5 MiB)  TX bytes:8935032 (8.5 MiB)
          Interrupt:19 Memory:f0500000-f0520000

Sunday, 28 July 2013

Suricata 1.4.5 released! A Network Intrusion Detection,Prevention

Suricata is a high performance Network IDS, IPS and Network Security Monitoring engine. Open Source and owned by a community run non-profit foundation, the Open Information Security Foundation (OISF). Suricata is developed by the OISF, its supporting vendors and the community.

Suricata Features
IDS / IPS
Suricata is a rule-based Intrusion Detection and Prevention engine that make use of externally developed rules sets to monitor network traffic, as well as able to handle multiple gigabyte traffic and gives email alerts to the System/Network administrators.
Multi-threading
Suricata provides speed and importance in network traffic determination. The engine is developed to apply the increased processing power offered by modern multi-core hardware chip sets.
Automatic Protocol Detection
The engine not only provides keywords for TCP, UDP, ICMP and IP, but also has an built-in support for HTTP, FTP, TLS and SMB. A system administrator can able to create its own rule to detect a match within an HTTP stream. This is going to become different Malware detection and control.
Fast IP Matching
The engine will certainly take rules that are IP matches based on the RBN and compromised IP lists at Emerging Threats and keep them into a specific fast matching preprocessor.

Step :1 Installing Suricata in RHEL, CentOS 

You must use the Fedora’s EPEL repository to install some needed packages for i386 and x86_64 systems.
EPEL (Extra Packages for Enterprise Linux) is open source and free community based repository project from Fedora team which provides 100% high quality add-on software packages for Linux distribution including RHEL (Red Hat Enterprise Linux), CentOS, and Scientific Linux. Epel project is not a part of RHEL/Cent OS but it is designed for major Linux distributions by providing lots of open source packages like networking, sys admin, programming, monitoring and so on. Most of the epel packages are maintained by Fedora repo.

Enable EPEL Repository in RHEL/CentOS 6/5

First, you need to download the file using Wget and then install it using RPM on your system to enable the EPEL repository. Use below links based on your Linux OS versions. (Make sure you must be root user).

For RHEL/CentOS 6 32-64 Bit

## RHEL/CentOS 6 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

## RHEL/CentOS 6 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

For RHEL/CentOS 5 32-64 Bit

## RHEL/CentOS 5 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -ivh epel-release-5-4.noarch.rpm

## RHEL/CentOS 5 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# rpm -ivh epel-release-5-4.noarch.rpm

Verify EPEL Repo

# yum  repolist
# yum -v repolist | less
# yum -v repolist

Before you can compile and build Suricata for your system, install the following dependency packages that are required for further installation. The process may take a while to complete, depending on the internet speed.
# yum -y install libpcap libpcap-devel libnet libnet-devel pcre \
   pcre-devel gcc gcc-c++ automake autoconf libtool make libyaml \
   libyaml-devel zlib zlib-devel libcap-ng libcap-ng-devel magic magic-devel file file-devel

IPS Support
Next, build Suricata with IPS support. For this, we to need “libnfnetlink” and “libnetfilter_queue” packages, but these pre-built packages not available in the EPEL or CentOS Base repositories. So, we need to download and install rpms from the Emerging Threats CentOS repository.

For 32-Bit

# rpm -Uvh http://rules.emergingthreatspro.com/projects/emergingrepo/i386/libnetfilter_queue-0.0.15-    1.i386.rpm \
http://rules.emergingthreatspro.com/projects/emergingrepo/i386/libnetfilter_queue-devel-0.0.15-1.i386.rpm \
http://rules.emergingthreatspro.com/projects/emergingrepo/i386/libnfnetlink-0.0.30-1.i386.rpm \ 
http://rules.emergingthreatspro.com/projects/emergingrepo/i386/libnfnetlink-devel-0.0.30-1.i386.rpm

For 64-Bit

# rpm -Uvh http://rules.emergingthreatspro.com/projects/emergingrepo/x86_64/libnetfilter_queue-0.0.15-1.x86_64.rpm \
http://rules.emergingthreatspro.com/projects/emergingrepo/x86_64/libnetfilter_queue-devel-0.0.15-1.x86_64.rpm \
http://rules.emergingthreatspro.com/projects/emergingrepo/x86_64/libnfnetlink-0.0.30-1.x86_64.rpm \ 
http://rules.emergingthreatspro.com/projects/emergingrepo/x86_64/libnfnetlink-devel-0.0.30-1.x86_64.rpm

Download latest Suricata source files and build it using the following commands.
# cd /tmp
# wget http://www.openinfosecfoundation.org/download/suricata-1.4.5.tar.gz
# tar -xvzf suricata-1.4.5.tar.gz
# cd suricata-1.4.5

Now we use Suricata Auto Setup feature to automatically create all necessary directories, configuration files and latest rulesets.

# ./configure && make && make install-conf
# ./configure && make && make install-rules
# ./configure && make && make install-full

Step 2: Suricata Basic Setup

After downloading and installing Suricata, now its time to proceed to Basic Setup. Create following directorates.

# mkdir /var/log/suricata
# mkdir /etc/suricata

The next part is to copy configuration files such as “classification.config“, “reference.config” and “suricata.yaml” from the base build installation directory.

# cd /tmp/suricata-1.4.5
# cp classification.config /etc/suricata
# cp reference.config /etc/suricata
# cp suricata.yaml /etc/suricata

Finally, start the “Suricata Engine” first time and specify the interface device name of your preference. Instead of eth0, you can include the network card of your preference.

# suricata -c /etc/suricata/suricata.yaml -i eth0
19/8/2013 -- 21:02:17 - <Info> - This is Suricata version 1.4.5 RELEASE
19/8/2013 -- 21:02:17 - <Info> - CPUs/cores online: 2
19/8/2013 -- 21:02:17 - <Info> - Found an MTU of 1500 for 'eth0'
19/8/2013 -- 21:02:17 - <Info> - allocated 3670016 bytes of memory for the defrag hash... 65536 buckets of size 56
19/8/2013 -- 21:02:17 - <Info> - preallocated 65535 defrag trackers of size 144
19/8/2013 -- 21:02:17 - <Info> - defrag memory usage: 13107056 bytes, maximum: 33554432
19/8/2013 -- 21:02:55 - <Info> - all 4 packet processing threads, 3 management threads initialized, engine started.

After several minutes later, check the engine is correctly working and receives and inspects traffic.
# cd /usr/local/var/log/suricata/
# ls -l
-rw-r--r--. 1 root root 289910 Aug 19 21:05 fast.log
drwxr-xr-x. 2 root root   4096 Aug 19 20:16 files
-rw-r--r--. 1 root root      0 Aug 19 20:23 http.log
-rw-r--r--. 1 root root 286167 Aug 19 21:05 stats.log
-rw-r--r--. 1 root root 262586 Aug 19 20:30 unified2.alert.1376923989
-rw-r--r--. 1 root root  66517 Aug 19 21:05 unified2.alert.1376926375

Watch “stats.log” file and make sure the displayed information is up-dated in real time.

# tail -f stats.log
tcp.reassembly_memuse     | Detect                    | 0
tcp.reassembly_gap        | Detect                    | 0
detect.alert              | Detect                    | 310
flow_mgr.closed_pruned    | FlowManagerThread         | 0
flow_mgr.new_pruned       | FlowManagerThread         | 1226
flow_mgr.est_pruned       | FlowManagerThread         | 0
flow.memuse               | FlowManagerThread         | 6489568
flow.spare                | FlowManagerThread         | 10000
flow.emerg_mode_entered   | FlowManagerThread         | 0
flow.emerg_mode_over      | FlowManagerThread         | 0

Friday, 31 May 2013

Monit

Monit is a free open source utility for managing and monitoring, processes, programs, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.  

Monday, 11 March 2013

How to Install Linux (LAMP) Apache, MySQL 5.5.30 & PHP 5.4.12 on RHEL/CentOS

LAMP  using yum is very easy and takes only minutes. This is a good option for beginners who don’t feel comfortable installing from source.

Installing  Apache, MySQL 5.5.30 & PHP 5.4.12 on RHEL 6.3/6.2/6.1/6.0/5.9/5.8/5.6, CentOS 6.3/6.2/6.1/6.0/5.9/5.8/5.6 (LAMP)

Step 1: Iptables Stop 

# service iptables stop
# chkconfig iptables off

Step 2: Installing Repository

 Install Remi & Epel Repository on RHEL/CentOS 6.3-6.0 - 32 Bit 
#  rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
#  rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

 Install Remi & Epel Repository on RHEL/CentOS 6.3-6.0 - 64 Bit 
#  rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
#  rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

 Install Remi Repository on RHEL/CentOS 5.9-5.0 - 32 Bit 
#  rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
#  rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

 Install Remi Repository on RHEL/CentOS 5.9-5.0 - 64 Bit 
#  rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
#  rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

Step 3: Installing Apache, MySQL 5.5.30 & PHP 5.4.12 Modules

# yum --enablerepo=remi,remi-test install httpd  mysql  mysql-server mysql-devel  php php-common php-mysql php-pgsql php-mbstring php-mcrypt

Step 4: Starting/Stopping Apache & MySQL 5.5.30

Enable Apache and MySQL on Run-Levels

# /etc/init.d/httpd start
# /etc/init.d/mysqld start

# chkconfig --levels 235 httpd on
# chkconfig --levels 235 mysqld on

Step 5: Secure Installation of  MySQL

#  mysql_secure_installation
During the installation, MySQL will ask you for your permission twice. After you say Yes to both, MySQL will install.
Once it is done installing, you can set a root MySQL password:
The prompt will ask you for your current root password.
Since you just installed MySQL, you most likely won’t have one, so leave it blank by pressing enter.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Then the prompt will ask you if you want to set a root password. Go ahead and choose Y and follow the instructions.
CentOS automates the process of setting up MySQL, asking you a series of yes or no questions.
It’s easiest just to say Yes to all the options. At the end, MySQL will reload and implement the new changes.

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y                                            
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!
Test MySQL
To run a quick test, use the command line program mysql:
you can login to mysql root account without providing any password as shown below.
# mysql -u root  
Enter Password of root 

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.5.30 MySQL Community Server (GPL) by Remi
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
Step 6: Verifying Apache, MySQL 5.5.30 & PHP 5.4.12

1. Create a page called phpinfo.php under your Apache root directory and add the following lines to it. For example (/var/www/html/phpinfo.php).

<?php
     phpinfo ();
?>

2. Now access the page via web browser like http://localhost/phpinfo.php. You will see below screenshot.



Wednesday, 6 March 2013

Kernel 3.8 Released, how to Compile in Redhat, CentOS and Fedora.

Before starting, Compiling Kernel  make sure the system has all the necessary packages installed.

Kernel 3.8 Dependencies


rpmdevtools
yum-utils
qt3-devel
libXi-devel
gcc
ncurses
ncurses-devel

yum-utils is a default package. To install the other package, use the following command

# yum install rpmdevtools yum-utils
# yum install qt3-devel libXi-devel
# yum install gcc ncurses ncurses-devel

After that

# yum update

Step 1:Downloading Kernel 3.8 

Download the latest Kernel 3.8 using wget command.

goto

# cd /tmp
# wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.2.tar.bz2

Step 2:Extracting Kernel 3.8 

# tar -xvf linux-3.8.2.tar.bz2 -C /usr/src/

# cd /usr/src/linux-3.8.2/

Step 3:Configuring Kernel 3.8 

Run the following command:

# make menuconfig

You will get similar to below screen, where you see number of menus to select configuration for your latest kernel.



You have to select different options as per your need. Each configuration option has HELP button associated with it so select help button to get help.        
                                                                                                                                                                               If you like to configure your latest kernel with old configuration then simple type the below command.

# make oldconfig

Step 4: Compiling Kernel 3.8

# make

The compilation would take at least 30-50 minutes depends on your system configuration.

Step 5: Installing Kernel 3.8

# make modules_install install

After Install new kernel entry in your grub.conf file.

Step 6: Verifying Kernel 3.8

To verify newly installed Kernel after reboot just type the following command on the terminal.

# uname -r








                       






Before printing, please think about its necessity..