Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, March 20, 2013

Linux log files location


     
Linux log files location

Almost all log files are located under /var/log directory (and sub directory). You can change to this directory using cd command but you need to be the root user. You can use less, more, cat or tail command to see the logs.


Go to /var/logs directory:# cd /var/logsView common log file /var/log/messages using any one of the following command:



# tail -f /var/log/messages
# less /var/log/messages
# more -f /var/log/messages
# vi /var/log/messages


Output:

Jan 17 22:04:25 router  dnsprobe[276]: dns query failed
Jan 17 22:04:29 router last message repeated 2 times
Jan 17 22:04:29 router  dnsprobe[276]: Primary DNS server Is Down... Switching To Secondary DNS server
Jan 17 22:05:08 router  dnsprobe[276]: Switching Back To Primary DNS server
Jan 17 22:26:11 debian -- MARK --
Jan 17 22:46:11 debian -- MARK --
Jan 17 22:47:36 router  -- MARK --
Jan 17 22:47:36 router  dnsprobe[276]: dns query failed
Jan 17 22:47:38  debian kernel: rtc: lost some interrupts at 1024Hz.
Jan 17 22:47:39  debian kernel: IN=eth0 OUT= MAC=00:0f:ea:91:04:07:00:08:5c:00:00:01:08:00 SRC=61.4.218.24 DST=192.168.1.100 LEN=60 TOS=0x00 PREC=0x00 TTL=46 ID=21599 DF PROTO=TCP SPT=59297 DPT=22 WINDOW=5840 RES=0x00 SYN URGP=0


Common Linux log files name and usage

    /var/log/message: General message and system related stuff
    /var/log/auth.log: Authenication logs
    /var/log/kern.log: Kernel logs
    /var/log/cron.log: Crond logs (cron job)
    /var/log/maillog: Mail server logs
    /var/log/qmail/ : Qmail log directory (more files inside this directory)
    /var/log/httpd/: Apache access and error logs directory
    /var/log/lighttpd: Lighttpd access and error logs directory
    /var/log/boot.log : System boot log
    /var/log/mysqld.log: MySQL database server log file
    /var/log/secure: Authentication log
    /var/log/utmp or /var/log/wtmp : Login records file
    /var/log/yum.log: Yum log files


In short /var/log is the location where you should find all Linux logs file. However some applications such as httpd have a directory within /var/log/ for their own log files. You can rotate log file using logrotate software and monitor logs files using logwatch software.

Tuesday, March 19, 2013

NFS Server

NFS Server

If you have two or more machines, you may wish to share disk space or devices, such as a CD drive, between machines. For this there is network file system (NFS), the easiest way of sharing files and resources across a network.


NFS is the way of working with files on a remote machine as if they are on your local one. NFS is the standard de facto solution to access the same $HOME directories from any machine on the Net. Using it also is a good way to avoid keeping duplicated informatioNFS n from eating large amounts of disk space.

How to make NFS

System should be Yum Server or Yum Client.

yum install nfs* -y                                    (package install)

yum install portmap* -y                           (package install)

mkdir /Data_Share                                  (making Dir for sharing)

vim /Data_Share/file1                              (making file)

vim /etc/exports
(Entry)
/Data_Share   *(rw,sync)
:wq!

service nfs restart                                  (Restart the Service)

service portmap restart                         (Restart the Service)

chkconfig nfs on

chkconfig portmap on



Configuration on Client Side   

mount -t nfs 192.168.1.1:/xyz  /mnt           (Considering server ip as 192.168.1.1)

vim /etc/fstab                                             (To make Permanent Entry)

192.168.1.1:/Data_Share /mnt nfs default 0 0

Wednesday, January 9, 2013

Why is Linux popular?

There are lots of reasons for Linux popularity, but the main one is that it gives you a huge amount of software to work with completely free of charge. If you want to render 3D models, Linux has a program for it. If you want to mix music or edit a podcast, Linux has a program for it. If you want to edit Microsoft Office documents, organize family photos, chat to your friends, burn CDs and DVDs, watch movies,edit images or do just about anything, Linux has a program for it. And it's almost certainly free! 

What is LINUX ?

 Linux is a free Unix-type operating system originally created by Linus Torvalds with the assistance of developers around the world. It originated in 1991 as a personal project of Linus Torvalds, a Finnish graduate student. The Kernel version 1.0 was released in 1994 and today the most recent stable version is 2.6.9 Developed under the GNU General Public License the source code for Linux is freely available to everyone.