Friday, December 23, 2011

How to install apache and mod_ssl on Centos


Apache is the most popular web server across the entire World Wide Web, currently used by around 60% of web domains. Its released under an Apache License, which requires preservation of the copyright notices and disclaimers, but doesn’t require modified versions to be distributed using the same license. Though most prevalent on Unix-like operating system, it also runs on Windows, Mac OS X, and others.
Open a terminal, and type yum install httpd and follow on screen instruction to install Apache web server.
[root@linuxbox ~]# yum install httpd
Mod_ssl combines the flexibility of Apache with the security of OpenSSL.
This module provides strong cryptography for the Apache 1.3 webserver via the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols by the help of the Open Source SSL/TLS toolkit OpenSSL.
[root@linuxbox ~]# yum install mod_ssl
This will automatically configured Apache to use SSL when it will restart, by adding the file /etc/httpd/conf.d/ssl.conf which contains the necessary stuff to enable SSL. I restarted Apache with the following command and was good to go:
[root@linuxbox ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@linuxbox ~]#
Now check your ssl.conf file and mod_ssl.so file will be there.
[root@linuxbox ~]# ll /etc/httpd/conf.d/ssl.conf
-rw-r–r– 1 root root 9677 Aug 30 22:07 /etc/httpd/conf.d/ssl.conf
[root@linuxbox ~]# ll /etc/httpd/modules/mod_ssl.so
-rwxr-xr-x 1 root root 171184 Aug 30 22:07 /etc/httpd/modules/mod_ssl.so
[root@linuxbox ~]#

How to Setup Forward DNS


Setting up a DNS which should have my server’s forward entries.

I have a live dns server for abc.com domain and running 500 subdomains (i.e. alive.abc.com, blive.abc.com etc..) through that servers. And secondly i have local dns server for abc.com in my local network and running 20 subdomains (i.e. a.abc.com , b.abc.com etc….) through that server.

I want if any user of my network with our local DNS IP try to access ours local domain with the name, my local DNS should provide that entry from it. If the user try to use the domain which is not available within my local DNS, it should query the DNS available in internet and should respond to the query of the user computer.

1. Install DNSMASQ
[root@map007 ~]# yum install dnsmasq
2. Edit /etc/resolve.conf to lookup the localhost
[root@map007 ~]# cat /etc/resolv.conf |grep nameserver
nameserver 127.0.0.1
3. Now put the following lines in /etc/dnsmasq.conf
domain-needed
bogus-priv
filterwin2k
resolv-file=/etc/resolv.external
expand-hosts
domain=abc.com
log-queries
log-facility=/var/log/dnsmasq
conf-dir=/etc/dnsmasq.d
4. Make a file for to specify external DNS server.
[root@map007 ~]# cat /etc/resolv.external
nameserver 192.168.122.1
5. Put the entry of your abc.com into /etc/hosts
[root@map007 ~]# cat /etc/hosts |grep abc
192.168.1.51 host1.abc.com
192.168.1.52 host2.abc.com
192.168.1.53 host3.abc.com
6. Start DNSMASQ Service
[root@map007 ~]# service dnsmasq start
Now check the results
[root@map007 ~]# nslookup host1.abc.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: host1.abc.com
Address: 192.168.1.51
[root@map007 ~]# nslookup www.abc.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: www.abc.com
Address: 20.80.x.x

Howto Install Tomcat on Linux ?


# Download and Install JAVA
Download j2sdk-<version> from Sun Download center http://developers.sun.com/downloads/
# chmod +x j2sdk-1_4_2_09-linux-i586.bin
# ./j2sdk-1_4_2_09-linux-i586.bin
Now set java home path
# vi .bash_profile
JAVA_HOME=/usr/local/j2sdk
Now Check if Java is installed on the server using command java -version
[root@map ~]# java -version
java version “1.6.0_07?
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)
# Download Tomcat
Now Download Tomcat from Apache Website and extract it
http://tomcat.apache.org/download-55.cgi
# cd /usr/local/
#wget http://www.poolsaboveground.com/apache/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.tar.gz
# tar -zxvf apache-tomcat-6.0.18.tar.gz
Create Symlink for the Tomcat Folder
# ln -s /usr/local/apache-tomcat-6.0.18 /usr/local/apache/tomcat
# Install Tomcat
# cd apache-tomcat-6.0.18
# cd bin
# tar xvfz jsvc.tar.gz
# cd jsvc-src
# chmod +x configure
# ./configure
# make
# cp jsvc ..
# cd ..
Now set Cataline home path
# vi .bash_profile
CATALINA_HOME=/usr/loca/tomcat
JAVA=/usr/loca/j2sdk/bin
Save and exit
# Type following commands
# export JAVA_HOME=/usr/local/j2sdk
# export JAVA=/usr/local/j2sdk/bin
# export CATALINA=/usr/local/tomcat
# Start Tomcat
Use Following script to start Tomcat Service on the Server
# /usr/local/apache/tomcat/bin/startup.sh
# Running Tomcat as non root user
Due to security reasons always run tomcat as non-root user i.e. tomcat. To run it as tomcat first you will have to change the ownership of the tomcat folder
# chown -R tomcat.tomcat /usr/local/apache-tomcat-6.0.18
Now Tomcat can be stopped and started under user tomcat using following commands:
# su -l tomcat -c /usr/local/apache/tomcat/bin/startup.sh
# su -l tomcat -c /usr/local/apache/tomcat/bin/shutdown.sh
# Test Tomcat installation
open a browser and browse website http://xx.xx.xx.xx:8080 where xx.xx.xx.xx will be your Server IP and If you get Tomcat page than Tomcat has been installed properly on the Server.
# Creating Script to start, stop and restart Tomcat
The above installation step will not create tomcat service so that user can restart tomcat using command service tomcat restart. Create a new file in /etc/init.d as tomcat and copy following contenents into it.
# vi /etc/init.d/tomcat
#!/bin/bash
#
# Startup script for Tomcat
#
# chkconfig: 345 84 16
# description: Tomcat jakarta JSP server
# Necessary environment variables
export CATALINA_HOME=”/usr/local/tomcat”
if [ ! -f $CATALINA_HOME/bin/catalina.sh ]
then
echo “Tomcat not available…”
exit
fi
start() {
echo -n -e ‘\E[0;0m'"\033[1;32mStarting Tomcat: \033[0m \n"
su -l tomcat -c $CATALINA_HOME/bin/startup.sh
echo
touch /var/lock/subsys/tomcatd
sleep 3
}
stop() {
echo -n -e '\E[0;0m'"\033[1;31mShutting down Tomcat: \033[m \n"
su -l tomcat -c $CATALINA_HOME/bin/shutdown.sh
rm -f /var/lock/subsys/tomcatd
echo
}
status() {
ps ax --width=1000 | grep "[o]rg.apache.catalina.startup.Bootstrap start” | awk ‘{printf $1 ” “}’ | wc | awk ‘{print $2}’ > /tmp/tomcat_process_count.txt
read line < /tmp/tomcat_process_count.txt
if [ $line -gt 0 ]; then
echo -n “tomcatd ( pid ”
ps ax –width=1000 | grep “[o]rg.apache.catalina.startup.Bootstrap start” | awk ‘{printf $1 ” “}’
echo -n “) is running…”
echo
else
echo “Tomcat is stopped”
fi
}
case “$1? in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 3
start
;;
status)
status
;;
*)
echo “Usage: tomcatd {start|stop|restart|status}”
exit 1
esac
Now save and exit from the file. Now assign executable permission to this file
# chown 755 /etc/init.d/tomcat
Enable it for all the Run-levels
# chkconfig –add tomcat
# chkconfig tomcat on
Now you can restart tomcat service using following commands.
# service tomcat restart <<< To restart tomcat
# service tomcat stop <<< To stop Tomcat
# service tomcat start <<< To start Tomcat
# service tomcat Status <<< to check the status of Tomcat
Now you have successfully installed Tomcat.

Tomcat with Apache Integration on Linux server


# Installing and configuring mod_jk

To make connection between Tomcat and Apache, you will need to download and install mod_jk connector.
I chose to download the current source from the Apache archives:- http://archive.apache.org/dist/jakarta/tomcat-connectors/jk/source/jk-1.2.15/
[root@map007 /]# cd /usr/local
[root@map007 local]# wget http://archive.apache.org/dist/jakarta/tomcat-connectors/jk/source/jk-1.2.15/jakarta-tomcat-connectors-1.2.15-src.tar.gz
[root@map007 local]# tar -zxvf jakarta-tomcat-connectors-1.2.15-src.tar.gz
Change to the /usr/local/jakarta-tomcat-connectors-1.2.15-src/jk/native directory.
[root@map007 local]# cd jakarta-tomcat-connectors-1.2.15-src/jk/native
Now you are ready to create the custom configure file for your system. Execute the following:
[root@map007 local]# ./buildconf.sh
[root@map007 local]# ./configure –with-apxs=/usr/bin/apxs2
Now build the mod_jk with the following:
[root@map007 local]# make
Finally, if you were successful with the previous commands, copy the newly created mod_jk.soto your Apache2 modules directory. My modules were located at /usr/lib/apache2/modules.
[root@map007 /]# cp /usr/src/jakarta-tomcat-connectors-1.2.15-src/jk/native/apache-2.0/mod_jk.so /usr/lib/apache2/modules

# Configuring Tomcat and Apache

[root@map007 /]# vi /etc/apache2/workers.properties
workers.tomcat_home=/usr/lib/apache-tomcat
workers.java_home=/usr/lib/jdk
ps=/
worker.list=worker1
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1
# Save and close the file.
# Now you have to configure httpd.conf file and following lines.
[root@map007 /]# vi /etc/apache2/httpd.conf
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile /etc/apache2/workers.properties
# Where to put jk logs
JkLogFile /var/log/apache2/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat “[%a %b %d %H:%M:%S %Y] “
Save and close the file.
Now a final security point.
[root@map007 /]# chown -R tomcat:tomcat /usr/lib/apache-tomcat-5.5.16
# Now restart the Tomcat.
[root@map007 /]# cd /usr/local/tomcat/bin
[root@map007 bin]# ./shutdown.sh
[root@map007 bin]# ./startup.sh
And restart Apache:
[root@map007 /]# /etc/init.d/apache2 restart
You have Done all the Configurations.
Note :- Start Tomcat first: Always start Tomcat first and then start Apache.

References and paths:

Tomcat conf:
/usr/lib/apache-tomcat/conf/server.xml
Apache modules:
/usr/lib/apache2/modules
Apache conf:
/etc/apache2/workers.properties
/etc/apache2/httpd.conf
Tomcat stop and start:
cd /usr/local/apache-tomcat/bin
./shutdown.sh
./startup.sh
Apache2:
/etc/init.d/apache2 restart
/etc/init.d/apache2 stop
/etc/init.d/apache2 start

Tuesday, December 6, 2011

CPU states found in "top" output on Linux

 Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st

# us -> User CPU time: The time the CPU has spent running users’ processes that are not niced.
# sy -> System CPU time: The time the CPU has spent running the kernel and its processes.
# ni -> Nice CPU time: The time the CPU has spent running users’ process that have been niced.
# wa -> iowait: Amount of time the CPU has been waiting for I/O to complete.
# hi -> Hardware IRQ: The amount of time the CPU has been servicing hardware interrupts.
# si -> Software Interrupts.: The amount of time the CPU has been servicing software interrupts.

Sunday, December 4, 2011

Backup and Restore the Subversion Repository


It is a good practice backup Subversion repository to avoid any loss of data and sometimes you may need to move the svn repository from one server to another server.You can move your repository to another server with the following method.

1. Backup your repository( Create dump)
# svnadmin dump /path to /repository   >  repositoryname.dump

2. Copy the dump file to the new server
# scp -r repositoryname.dump   username@ipaddress:/destination path
Here destination path is location on the target server where the dump file has to be copied.

3. Create a new Repository on the target server
# svnadmin create <repositoryname>
Ex: #svnadmin create /var/www/testrepo

4.Import the dump file to the new repository.
# svnadmin load  /path to repository  <  repositoryname.dump

Monitor Your System Performance on linux


Xxxxxxxxxxxxxxx Monitor Your System Performance xxxxxxxxxxxxxxxxxxxxX
[root@server ~]# uptime
 13:14:02 up  1:30,  2 users,  load average: 0.04, 0.26, 0.27


[root@server ~]# ps -eo %u | sort | uniq -c | sort -rn
     56 root
     22 nagios
      8 apache
      1 xfs
      1 RUSER
      1 rpc
      1 ntp
      1 named
      1 mysql
      1 ldap


[root@server ~]# sar -c           ## Process/sec
Linux 2.6.18-164.el5 (server.scratch.com)       08/24/2011

11:50:01 AM    proc/s
12:00:01 PM      6.87
12:10:01 PM      6.90
12:20:01 PM      7.10
12:30:01 PM      6.77
12:40:01 PM      6.99
12:50:01 PM      6.85
01:00:01 PM      6.83
01:10:01 PM      6.92
Average:         6.90

[root@server ~]# sar -b   ## Data r/wr ps
Linux 2.6.18-164.el5 (server.scratch.com)       08/24/2011

11:50:01 AM       tps      rtps      wtps   bread/s   bwrtn/s
12:00:01 PM     24.81      0.18     24.63      6.37    376.94
12:10:01 PM     26.14      0.33     25.81     10.68    388.21
12:20:01 PM     57.68     28.05     29.63    620.21    466.02
12:30:01 PM     24.16      0.13     24.03      1.92    369.00
12:40:01 PM     24.55      0.10     24.44      1.70    374.73
12:50:01 PM     25.07      0.14     24.93      4.31    380.10
01:00:01 PM     24.95      0.58     24.37      6.20    377.88
01:10:01 PM     24.57      0.01     24.56      0.04    376.16
Average:        28.98      3.68     25.30     81.17    388.59

[root@server ~]# iostat -k
Linux 2.6.18-164.el5 (server.scratch.com)       08/24/2011

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.40    0.00    3.84    0.44    0.00   95.32

Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sda               6.60        32.24        65.92     177987     363873
sda1              0.10         0.21         0.00       1163          5
sda2              6.50        32.01        65.92     176684     363868
dm-0             20.19        31.54        65.91     174109     363844
dm-1              0.02         0.08         0.00        440          0
dm-2              0.06         0.25         0.00       1397         20
dm-3              0.03         0.11         0.00        613          4

[root@server ~]#






# cat /proc/stat
cpu  1864 0 16482 416939 2375 34 527 0
cpu0 1864 0 16482 416939 2375 34 527 0
intr 2416023 2368439 12 0 2 2 0 5 0 1 0 0 0 116 0 0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 29989 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 17399 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ctxt 258727
btime 1314166387
processes 32539
procs_running 1
procs_blocked 0

# cat /proc/meminfo
MemTotal:       218872 kB
MemFree:         36680 kB
Buffers:         40416 kB
Cached:          79080 kB
SwapCached:          0 kB
Active:         116728 kB
Inactive:        47320 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       218872 kB
LowFree:         36680 kB
SwapTotal:      614384 kB
SwapFree:       614384 kB
Dirty:             460 kBWriteback:           0 kB
AnonPages:       44556 kB
Mapped:          15936 kB
Slab:            11628 kB
PageTables:       2320 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:    723820 kB
Committed_AS:   376900 kB
VmallocTotal:   802808 kB
VmallocUsed:      3564 kB
VmallocChunk:   798832 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     4096 kB

[root@server ~]# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Pentium(R) Dual-Core  CPU      E5300  @ 2.60GHz
stepping        : 10
cpu MHz         : 2592.870
cache size      : 2048 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss constant_tsc up pni
bogomips        : 5185.74


[root@server ~]# cat /proc/buddyinfo
Node 0, zone      DMA     37     33     31     29     19     12      9      2      0      0      0
Node 0, zone   Normal   2217    861    467    317     71     17      6      1      1      0      0
[root@server ~]#

[root@server ~]# cat /proc/execdomains
0-0     Linux                   [kernel]

[root@server ~]# cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   cpuset
nodev   binfmt_misc
nodev   debugfs
nodev   securityfs
nodev   sockfs
nodev   usbfs
nodev   pipefs
nodev   anon_inodefs
nodev   futexfs
nodev   tmpfs
nodev   inotifyfs
nodev   eventpollfs
nodev   devpts
        ext2
nodev   ramfs
nodev   hugetlbfs
        iso9660
nodev   mqueue
        ext3

[root@server ~]# cat /proc/interrupts
           CPU0
  0:    2539099    IO-APIC-edge  timer
  1:         12    IO-APIC-edge  i8042
  6:          5    IO-APIC-edge  floppy
  7:          0    IO-APIC-edge  parport0
  8:          1    IO-APIC-edge  rtc
  9:          0   IO-APIC-level  acpi
 12:        116    IO-APIC-edge  i8042
 15:         21    IO-APIC-edge  ide1
 51:      31376   IO-APIC-level  ehci_hcd:usb1, ioc0
 59:         37   IO-APIC-level  uhci_hcd:usb2
 67:      19497   IO-APIC-level  eth0
 75:          0   IO-APIC-level  Ensoniq AudioPCI
NMI:          0
LOC:    4700127
ERR:          0
MIS:          0

[root@server ~]# cat /proc/iomem

[root@server ~]# cat /proc/loadavg
0.33 0.36 0.29 1/92 2916

[root@server ~]# cat /proc/locks
1: POSIX  ADVISORY  READ  2689 fd:00:320039 4 4
2: POSIX  ADVISORY  WRITE 2732 fd:00:931460 0 EOF
3: POSIX  ADVISORY  READ  2689 fd:00:320021 4 4
4: POSIX  ADVISORY  WRITE 2689 fd:00:288615 0 0
5: POSIX  ADVISORY  READ  2686 fd:00:320027 4 4
6: POSIX  ADVISORY  READ  2686 fd:00:320026 4 4
7: POSIX  ADVISORY  READ  2686 fd:00:320025 4 4
8: POSIX  ADVISORY  READ  2686 fd:00:320024 4 4
9: POSIX  ADVISORY  READ  2686 fd:00:320021 4 4
10: POSIX  ADVISORY  WRITE 2686 fd:00:288614 0 0
11: FLOCK  ADVISORY  WRITE 2641 fd:00:288138 0 EOF
12: POSIX  ADVISORY  WRITE 2592 fd:00:288509 0 EOF
13: POSIX  ADVISORY  WRITE 2592 fd:00:288508 0 EOF
14: POSIX  ADVISORY  WRITE 2592 fd:00:288507 0 EOF
15: POSIX  ADVISORY  WRITE 2457 fd:00:288680 1024 2047

[root@server ~]# cat /proc/net/tcp
  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode
   0: 00000000:0185 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 7642 1 c8adbb40 3000 0 0 2 -1
   1: 0100007F:0CEA 00000000:0000 0A 00000000:00000000 00:00000000 00000000    27        0 7887 1 c8adb240 3000 0 0 2 -1
   2: 00000000:008B 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 8138 1 c8ada4c0 3000 0 0 2 -1
   3: 00000000:006F 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 7482 1 c9720040 3000 0 0 2 -1
   4: 00000000:0015 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 7778 1 c8adb6c0 3000 0 0 2 -1
   5: 0708A8C0:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000    25        0 7399 1 c9720940 3000 0 0 2 -1
   6: 0808A8C0:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000    25        0 7397 1 c9720dc0 3000 0 0 2 -1
   7: 0908A8C0:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000    25        0 7395 1 c9721240 3000 0 0 2 -1
   8: 0A08A8C0:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000    25        0 7393 1 c97216c0 3000 0 0 2 -1
   9: 0100007F:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000    25        0 7391 1 c9721b40 3000 0 0 2 -1
  10: 0100007F:03B9 00000000:0000 0A 00000000:00000000 00:00000000 00000000    25        0 7407 1 c97204c0 3000 0 0 2 -1
  11: 00000000:01BD 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 8137 1 c8ada940 3000 0 0 2 -1
  12: 0908A8C0:D26D 3208A8C0:0016 02 00000001:00000000 01:000000DF 00000000   502        0 143213 3 c28d9b40 3000 0 0 2 -1
[root@server ~]#
[root@server ~]# cat /proc/net/udp
  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode
   9: 0A08A8C0:0089 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 8108 2 c4db8d00
   9: 0908A8C0:0089 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 8106 2 c4db32c0
   9: 0808A8C0:0089 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 8104 2 c4db36c0
   9: 0708A8C0:0089 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 8102 2 c4db3ac0
   9: 00000000:0089 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 8099 2 c8a04080
  10: 0A08A8C0:008A 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 8109 2 c4db8b00
  10: 0908A8C0:008A 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 8107 2 c4db30c0
  10: 0808A8C0:008A 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 8105 2 c4db34c0
  10: 0708A8C0:008A 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 8103 2 c4db38c0
  10: 00000000:008A 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 8100 2 c4db3cc0
  53: 00000000:0035 00000000:0000 07 00000000:00000000 00:00000000 00000000    25        0 7403 2 c96e9c40
  53: 0708A8C0:0035 00000000:0000 07 00000000:00000000 00:00000000 00000000    25        0 7398 2 c96e9240
  53: 0808A8C0:0035 00000000:0000 07 00000000:00000000 00:00000000 00000000    25        0 7396 2 c96e9440
  53: 0908A8C0:0035 00000000:0000 07 00000000:00000000 00:00000000 00000000    25        0 7394 2 c96e9640
  53: 0A08A8C0:0035 00000000:0000 07 00000000:00000000 00:00000000 00000000    25        0 7392 2 c96e9840
  53: 0100007F:0035 00000000:0000 07 00000000:00000000 00:00000000 00000000    25        0 7390 2 c96e9a40
 111: 00000000:006F 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 7476 2 c96e9040
 123: 0708A8C0:007B 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 7770 2 c8a04280
 123: 0808A8C0:007B 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 7769 2 c8a04480
 123: 0908A8C0:007B 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 7768 2 c8a04680
 123: 0A08A8C0:007B 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 7767 2 c8a04880
 123: 0100007F:007B 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 7766 2 c8a04a80
 123: 00000000:007B 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 7762 2 c8a04c80

[root@server ~]# cat /proc/net/protocols
protocol  size sockets  memory press maxhdr  slab module     cl co di ac io in de sh ss gs se re sp bi br ha uh gp em
RAWv6      648     -1      -1   NI       0   yes  ipv6        y  y  y  n  y  y  y  n  y  y  y  y  n  y  y  y  y  n  n
UDPv6      620     -1       0   NI       0   yes  ipv6        y  y  y  n  y  n  y  n  y  y  y  y  n  n  y  y  y  y  n
TCPv6     1248     19       1   no     224   yes  ipv6        y  y  y  y  y  y  y  y  y  y  y  y  n  n  y  y  y  y  y
PACKET     444     -1      -1   NI       0   no   kernel      n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n
UNIX       416     -1      -1   NI       0   yes  kernel      n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n
RAW        500     -1      -1   NI       0   yes  kernel      y  y  y  n  y  y  n  n  y  y  y  y  n  y  y  y  y  n  n
UDP        508     -1       0   NI       0   yes  kernel      y  y  y  n  y  n  y  n  y  y  y  y  y  n  y  y  y  y  n
TCP       1136     19       1   no     224   yes  kernel      y  y  y  y  y  y  y  y  y  y  y  y  n  n  y  y  y  y  y
NETLINK    404     -1      -1   NI       0   no   kernel      n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n

[root@server ~]# cat /proc/partitions
major minor  #blocks  name

   8     0   31457280 sda
   8     1     104391 sda1
   8     2   20860402 sda2
 253     0    7168000 dm-0
 253     1     512000 dm-1
 253     2    3891200 dm-2
 253     3    2048000 dm-3

[root@server ~]# cat /proc/schedstat
version 12
timestamp 2436227
cpu0 4336 4336 7 4343 7528 307075 58464 139144 139144 192048 1771799 248611
domain0 00000001 661081 661081 0 0 0 0 0 661081 360 360 0 0 0 0 0 360 58464 58464 0 0 0 0 0 58464 0 0 0 0 0 0 0 0 0 0 0 0
[root@server ~]#


[root@server ~]# cat /proc/stat
cpu  2085 0 18967 484888 2403 42 607 0
cpu0 2085 0 18967 484888 2403 42 607 0
intr 2808623 2749553 12 0 2 2 0 5 0 1 0 0 0 116 0 0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 33013 0 0 0 0 0 0 0 37 0 0 0 0 0 0 0 25861 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ctxt 302029
btime 1314166387
processes 37438
procs_running 1
procs_blocked 0


[root@server ~]# cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/mapper/MYVOL-SWAPer                partition       511992  0       -1
/extraswap                              file            102392  0       -2
[root@server ~]#


[root@server ~]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: VMware,  Model: VMware Virtual S Rev: 1.0
  Type:   Direct-Access                    ANSI SCSI revision: 02
[root@server ~]#

[root@server ~]# cat /proc/tty/drivers
/dev/tty             /dev/tty        5       0 system:/dev/tty
/dev/console         /dev/console    5       1 system:console
/dev/ptmx            /dev/ptmx       5       2 system
/dev/vc/0            /dev/vc/0       4       0 system:vtmaster
serial               /dev/ttyS       4 64-95 serial
pty_slave            /dev/pts      136 0-1048575 pty:slave
pty_master           /dev/ptm      128 0-1048575 pty:master
unknown              /dev/tty        4 1-63 console

[root@server ~]# cat /proc/uptime
5253.31 4967.57
[root@server ~]#

[root@server ~]# cat /proc/version
Linux version 2.6.18-164.el5 (mockbuild@builder16.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Thu Sep 3 03:33:56 EDT 2009
[root@server ~]# cat /proc/vmstat
nr_anon_pages 9791
nr_mapped 3984
nr_file_pages 30072
nr_slab 3002
nr_page_table_pages 521
nr_dirty 107
nr_writeback 0
nr_unstable 0
nr_bounce 0
pgpgin 183179
pgpgout 345817
pswpin 0
pswpout 0
pgalloc_dma 8166
pgalloc_dma32 0
pgalloc_normal 3542647
pgalloc_high 0
pgfree 3561159
pgactivate 41504
pgdeactivate 13669
pgfault 12248866
pgmajfault 885
pgrefill_dma 1954
pgrefill_dma32 0
pgrefill_normal 22667
pgrefill_high 0
pgsteal_dma 1177
pgsteal_dma32 0
pgsteal_normal 13810
pgsteal_high 0
pgscan_kswapd_dma 576
pgscan_kswapd_dma32 0
pgscan_kswapd_normal 7328
pgscan_kswapd_high 0
pgscan_direct_dma 608
pgscan_direct_dma32 0
pgscan_direct_normal 7744
pgscan_direct_high 0
pginodesteal 213
slabs_scanned 23552
kswapd_steal 7342
kswapd_inodesteal 289
pageoutrun 198
allocstall 142
pgrotated 0

[root@server ~]#
[root@server ~]# vmstat -m


## Check NC status
[root@server ~]# mii-tool eth0