Sunday 18 December 2011

How to install ntop on RedhatLinux/Centos

ntop is a network and traffic analyzer that provides a wealth of information on various networking hosts and protocols. ntop is primarily accessed via a built-in web interface.
Following instructions are tested on 32/64 bit versions only:
a) RHEL Linux 5.x
b) CentOS Linux 5.x

Disk Quotas In GNU/Linux Explained


Have you ever encountered a situation where your children who are using your PC are hoarding music and video on the harddisk and filling up all the space ? In linux, there is a way for you to prohibit others from hogging all the disk space. This you do by using quotas. Here I will explain how to setup disk quotas in Linux.

Saturday 17 December 2011

More Deep Discovery on your Linux Server With /proc

/proc isn't just for getting information out of the system and into convenient text form. You can also use it to put information into the system, and thereby change it. The sys/ directory, which is where kernel variable information is kept, is where most of the things you might want to alter live. Changes made here will take effect immediately; no need to reboot



Deep System Discovery on your Linux Server With /proc

Live Processes
/proc is a virtual filesystem generated at boot and updated regularly by the kernel. With /proc you can investigate exactly what hardware your Linux kernel sees, what processes it is running, boot options, and also manipulate kernel events.

Easy Redirection of sudo Output

If you're using Sudo, you've probably already discovered that the increased privileges apply only to the first command typed and don't extend to any input or output redirection. For example:


sudo iptables -L > /etc/iptables


Testing Linux Mail Servers with OpenSSL


Testing POP3 TLS/SSL

Telnet does not support any encryption. If you are protecting your POP3 sessions with TLS/SSL then you need s_client, which is part of OpenSSL. You can query both local and remote mail servers, using your own server names of course. Commands that you type are in bold:
openssl s_client -connect localhost.com:995
openssl s_client -connect remotehost.com:995
You'll see a whole lot of lines about certificates and protocols, and eventually something like this:

Troubleshooting Linux Servers with telnet

Telnet is one of the older ways of doing business over a network: a network protocol running over TCP/IP, which allows a client to talk to a server remotely. Back in the day (such as when I first got online), telnet was the usual means to connect to a remote computer to get a console, and from there do server administration, check email, 

Charting and Graphing Logfiles for Linux Server Admins

Some Linux server admins are comfortable with wading through text logfiles, but why wade when you can create beautiful charts and graphs that highlight trouble spots? Try the excellent CairoPlot for beautiful, informative visual server log.



Increasing Limit of The Maximum Number Of Open Files in Linux

The ulimit command provides control over the resources available to the shell and/or to processes started by it, on systems that allow such control. The maximum number of open file descriptors displayed with following command (login as the root user).

ulimit and sysctl

The ulimit and sysctl programs allow to limit system-wide resource use. This can help a lot in system administration, e.g. when a user starts too many processes and therefore makes the system unresponsive for other users.

SUID,STICKY and CHATTR in linux


SUID, STICKY and CHATTR
( Advanced permissions )


Which Linux filesystem to choose for your PC?


If you’re a Linux user, you’ve likely been asked at some point if you want Ext3, Ext4, XFS, ReiserFS, Btrfs, or one of many other filesystem acronyms. This choice confuses new and old users alike, and like all software, the options change as technology improves. Many people probably don’t care what filesystem

Friday 9 December 2011

PHP Security Best Practices For System Admins

 PHP is an open-source server-side scripting language and it is a widely used. The Apache web server provides access to files and content via the HTTP OR HTTPS protocol. A misconfigured server-side scripting language can create all sorts of problems. So, PHP should be used with caution. Here are twenty-five php security best practices for sysadmins for configuring PHP securely.



Apache Configuration File Explanation


Apache is controlled by a series of configuration files: httpd.conf, access.conf. and srm.conf (there's actually also a mime.types file, but you have to deal with that only when you're adding or removing MIME types from your server, which shouldn't be too often). The files contain instructions, called directives, that tell Apache how to run. Several companies offer GUI-basedApache front-ends, but it's easier to edit the configuration files by hand.

.htaccess file explanation

The Apache Web server provides a feature called .htaccess file, which provides commands to control a website. This file is simply a text file containing Apache directives. Those directives apply to the documents in the directory where the file is located, and to all subdirectories under it as well. Other .htaccess files in subdirectories may change or nullify the effects of those in parent directories.

Apache .htaccess file configuration in Linux example

 This tutorial is designed to provide password protection of web directories on a UNIX/Linux server. If you have a directory that you do not want the general public to have access to, this simple procedure will produce a username and password prompt anytime someone tries to access the directory.

Apache .htaccess file configuration in Linux

. There are many ways you can password protect directories under Apache web server. This is important to keep your file privates from both unauthorized users and search engines (when you do not want to get your data indexed). Here you will see the basics of password protecting a directory on your server. You can use any one of the following method:

PuTTY Connection Manager

PuTTY Connection Manager was mentioned in the 12 PuTTY add-ons that we discussed a while back. One of the major missing features in PuTTY is the ability to display multiple sessions in Tabs.

PuTTY CM displays multiple PuTTY sessions in Tabs. In this article, let us review in detail the 5 powerful features of the PuTTY Connection Manager that will make PuTTY more enjoyable.

Turbocharge PuTTY with 12 Powerful Add-Ons


PuTTY is hands-down the best, free, and lightweight SSH client for Windows. I have provided list of 12 powerful PuTTY add-ons with screenshots, that will solve few shortcomings of the original PuTTY.  Play around with these add-ons and choose the one that suites your need.

Usage of awk command in Linux

Awk Introduction and Printing Operations
Awk is a programming language which allows easy manipulation of structured data and the generation of formatted reports. Awk stands for the names of its authors “Aho, Weinberger, and Kernighan”

How to Kill a Process in Linux

Kill process using kill command under Linux/UNIX


kill command works under both Linux and UNIX/BSD like operating systems.

ps command examples


ps command (process status) will display snapshot information of all active processes.
Syntax: ps [options]

Usage of the 'ps' Command in linux

Process is a running instance of a program. Linux is a multitasking operating system, which means that more than one process can be active at once. Use ps command to find out what processes are running on your system.
This article explains 7 practical usages of ps command and its options.

Thursday 8 December 2011

Linux: Delete / Remove User Account


You need to use the userdel command to delete a user account and related files from user account. The userdel command must be run as root user. The syntax is as follows:
 
userdel userName

Linux Add User To Group


useradd Example - Add A New User To Secondary Group

You need to the useradd command to add new users to existing group (or create a new group and then add user). If group does not exist, create it. The syntax is as follows:

Create Users in Linux / Unix

let us review how to create Linux users in 4 different methods using useradd, adduser and newusers command with practical examples.


Linux Create User Account

 To create a new user account under any Linux distribution use command called useradd. The system administrator is responsible for creating account. Login as root user (or use sudo command).

Linux Basics

Every user who has access to a Linux system needs a login and a password. Each user must belong to a primary group and for security or access purposes can belong to several secondary groups.
In order to create new logins, modify or delete users, you must already be logged in as root.  

Saturday 19 November 2011

Linux Top Command Examples


In this article, let us review 15 examples for Linux top command that will be helpful for both newbies and experts.

Grep Command Examples In Linux / UNIX


In this article let us review 15 practical examples of Linux grep command that will be very useful to both newbies and experts.

15 Effective Ping Command Examples


As you already know, ping command is used to find out whether the peer host/gateway is reachable.
If you are thinking ping is such a simple command and why do I need 15 examples, you should read the rest of the article.
Ping command provides lot more options than what you might already know.

15 Awesome Cron Job Examples

An experienced Linux sysadmin knows the importance of running the routine maintenance jobs in the background automatically.

Linux Cron utility is an effective way to schedule a routine background job at a specific time and/or day on an on-going basis.

                                                                                               
   



Linux Crontab Format

MIN HOUR DOM MON DOW CMD
Table: Crontab Fields and Allowed Ranges (Linux Crontab Syntax)
Field Description Allowed Value
MIN Minute field 0 to 59
HOUR Hour field 0 to 23
DOM Day of Month 1-31
MON Month field 1-12
DOW Day Of Week 0-6
CMD Command Any command to be executed.
                                               

Linux Find Command Examples


Apart from the basic operation of looking for files under a directory structure, you can also perform several practical operations using find command that will make your command line journey easy.

In this article, let us review 15 practical examples of Linux find command that will be very useful to both newbies and experts.

Wget Download Guide With 15 Awesome Examples


wget utility is the best option to download files from internet. wget can pretty much handle all complex download situations including large file downloads, recursive downloads, non-interactive downloads, multiple file downloads etc.,

Thursday 10 November 2011

Linux Commands


History-:
                To clear the history use the following command.

[anji@mail ~]$ history –c

NGINX installation on Redhat & Centos


NGINX INSTALLATION
      Downlaod the nginx-.-.-.tar.gz file and copy in to /usr/local/src(optional) directory. Install the nginx using source code.
Step 1-: cd /usr/local/src
Step 2-: tar –zxvf nginx-.tar.gz
Step 3-: ./configure
Step 4-: make ; make install

Wednesday 9 November 2011

How to install and configure Postfix on CentOS 5



This is step by step tutorial on how to install Postfix with MySQL support for Virtual domains.

Reference Links:

http://www.howtoforge.com/virtual-us...ysql-centos4.5

Steps

Installation

After a fresh CentOS 5.4 server install using the text mode install, setup the correct time using the ntpd daemon, disable firewall and SELinux, and make sure the hostname and IP address (static) are correct before proceeding.

How to install subversion on Linux and make it working.


To install svn in linux and make it fully working , I found it really tough and it has taken my lots of time.While installing this you will miss a small thing and you got stuck.But this is not at all tough like open source it’s really very easy.

HowTo: Configure WordPress To Use A Content Delivery Network (CDN)


Research shows that if your web pages take longer than 5 seconds to load, you lose 50% of your viewers and sales. You can speed up your wordpress blog by using a CDN to display content to users faster and more efficiently.

How does Origin Pull work

Origin Pull is the method of transferring data to the CDN automatically from a webserver as opposed to manually uploading the content. This method of uploading data to the CDN can be used for HTTP, on demand Flash and on demand Windows Media content. Once the initial configuration is completed, the content will become available to the CDN by simply requesting the CDN URL associated with that content.

Monday 31 October 2011

Using sudo in Linux


Using sudo

If a server needs to be administered by a number of people it is normally not a good idea for them all to use the root account.

Secure Remote Logins and File Copying

Introduction

One of the most popular file transfer and remote login Linux applications is OpenSSH, which provides a number of ways to create encrypted remote terminal and file transfer connections between clients and servers.

Linux Boot Process


Introduction

Learning how Linux boots up is critical. When you have this information you can use it to alter the type of login screen you get as well as which programs start up. Read on for the details.

To add new user in to the system using text base command

The 'useradd' and 'adduser' command can be use to create new user account in Linux Fedora Core system.  Please note that the 'adduser' command is a sybolic link to 'useradd' command so that these two command actually is the same command that link together.

Saturday 29 October 2011

How to install Asterisk 1.4 from RPM and FreePBX 2.7 on Centos OS 5


How to install Asterisk 1.4 from RPM and FreePBX 2.7 on Centos OS 5

This is a very detailed comprehensive step by step tutorial on how to install Asterisk 1.4 from the digium website rpm repository followed by installing FreePBX 2.7 version on CentOS 5.
[toc maxlevel:5]

Note

How to redirect a URL or website in PHP


Create a file called index.php and add the following code in it

How to create Unix files with the date and time appended to the filename


touch filename-`date '+%Y-%m-%d'`  creates a file: filename-2009-05-06
touch filename-`date +"%Y%m%d%H%M%S"` creates a file:  filename-20090506142053
touch filename- `date +"%Y%m%d%H%M%S"` creates a file: filename-2009-05-06-152446
touch filename-`date +"%Y-%m-%d-%H:%M:%S"`  creates a file: filename-2009-05-06-15:36:36

How to Install BackupPC on CentOS 5


1. Introduction


BackupPC is an excellent enterprise level backup solution. I've been using BackupPC for a few months now and I decided to write an "How To" on installing and configuring BackupPC on CentOS 5 Linux.

How to install KDE and VNC server on CentOS 5


You have a CentOS 5 machine and you would like to install KDE (K Desktop Environment) and a VNC server using yum utility. Follow the steps below.

Dokuwiki templates and plugins for additional functionality


Below is a list of Dokuwiki plugins and templates that can be used to provide additional functionality in Dokuwiki.

1. Dokuwiki Templates:

How to move a Dokuwiki install from an existing server to a new server


A current working install of Dokuwiki can be moved from the existing server to a new server by following the steps below:

How to check the CPU and Memory Load on a Linux machine


yum install sysstat
sar -A 
  1. Install sysstat package on CentOS using yum:
  2. Execute the sar command:
  3. You can use KSar Java applet to visually see the output of sar

How to create a simple backup script with current date and time


Below is a Linux Shell script to create a backup directories with the current date and time stamps

How to install a standalone mysql database server on CentOS 5.6


For small web applications using MySQL database it might be okay to have both the web application and MySQL database on the same server. But as your database size grows, in order get the best performance, it's better to separate the database server from the web application server. In other words, you run the MySQL server on one server and the web application on a different server.
Let's say we have the following scenario:

How to resize a partition and filesystem to use unallocated sectors

If you cloned a CentOS disk using clonezilla and if your source disk is smaller than the destination disk, it's possible that there will be unallocated sectors at the end. To fix it you need to do two things:

1. Resize the last parition to use the unallocated sectors at the end using fdisk or Gparted.
2. Resize the filesystem to make it aware of the resized partition.




Dokuwiki Installation on CENTOS


 Dokuwiki is an excellent wiki software that can be installed very easily on a CentOS 5 server by following the steps below:



1. Introduction

After reading about several wikis, I decided to go with DokuWiki. One advantage I see is that it does not use a backend database. All the files are stored on the filesystem. Easy backup and portability. Can view the files even when the internet or server is down.

HOW TO SHUTDOWN A SYSTEM BY USER


Before going through this documentation first try to login as user and try to shutdown or reboot the system. 

                   As we know that normal user can not shutdown or reboot the system in linux. Because they don’t have privileges to do that.   

                  So try the below procedure to shutdown the system by user.


How to Create YUM repository in Redhat


Creation of YUM repository

By default createrepo-0.4.11-3.el5.noarch.rpm is not installed

1)
Need to install following packages

createrepo-0.4.11-3.el5.noarch.rpm
vsftpd-2.0.5-16.el5.x86_64.rpm