Tricks and Tips about Systems/Network

April 13, 2010

How do I remove older backup automatically both for Linux and Windows

Filed under: admins,Hacks,RedHat EL5 — Liju Mathew @ 7:49 pm

This is really helpful to Sys-Admin who is managing various backup on different geographical locations.

For Linux,

The following commands will help you to remove your old backup which cost disk usage. I used this script to remove the older backup using a cronjob.


[root@ip-8-11-50-231 database]# crontab -l
00 04 1,16 * * /usr/bin/find /home/remoteftp/database/* -mtime +30 -exec rm {} \;

This cron job will check and delete the files which are older than 30 days.

For Windows,

I uses the command “forfiles” to do.
FORFILES [/P pathname] [/M searchmask] [/S] [/C command] [/D [+ | -] {MM/dd/yyyy | dd}]
Description: Selects a file (or set of files) and executes a command on that file. This is helpful for batch jobs.

Parameter List:
/P : pathname, Indicates the path to start searching. The default folder is the current working directory (.).
/M : searchmask, Searches files according to a searchmask. The default searchmask is ‘*’ .
/S : Instructs forfiles to recurse into subdirectories. Like “DIR /S”.
/C : command Indicates the command to execute for each file. Command strings should be wrapped in double
/D : date, Selects files with a last modified date greater than or equal to (+), or less than or equal to (-), the specified date using the “MM/dd/yyyy” format; or selects files with a last modified date greater than or equal to (+) the current date plus “dd” days, or less than or equal to (-) the current date minus “dd” days. A valid “dd” number of days can be any number in the range of 0 – 32768. “+” is taken as default sign if not specified.

I have create batch file and add the following line in to it. I added some other location on the same server to delete other backup also using the same batch file. I use the ftp to push the backup to this location ( >zip files)and set a scheduler to execute this batch file once in every month.

Here is my batch file content and I uses Windows 2003 server.

rem " removing Web backup which is older thant 30 days
forfiles /P D:\FTP\LocalUser\svrbkp\live\webfiles /s /D -30 /M *.zip /C " cmd /c del @path"
forfiles /P D:\FTP\LocalUser\svrbkp\live\database /s /D -30 /M *.zip /C " cmd /c del @path "
</code
>

March 23, 2010

How do I disable Http authentication on WHM/Cpanel ?

Filed under: admins,Control panel,Linux,RedHat EL5,WHM/Cpanel — Liju Mathew @ 9:10 am

The design of HTTP Authentication does not allow for logging out of an authenticated session. Once a HTTP Authentication
session is established, the credentials are cached by the browser until the browser application is terminated. Some
browsers allow a method to flush the credentials, but this method is not reliable nor available in all browsers. Because the
authetication credentials are cached they are a likely target for cross-site request forgery attacks, often known as XSRF
or CSRF.

Due to the inherit weaknesses of HTTP Authenitcation cPanel recommends disabling its use with the product. This is
done by checking the box of the Tweak Setting labeled. Disable Http Authentication for cPanel/WebMail/WHM Logins (forces cookie authentication.) This will help prevent certain types of XSRF attacks that rely on cached Http Auth credentials.

Login to your WHM/Cpanel server
Main >> Server Configuration >> Tweak Settings

You can find a entry ” Disable Http Authentication for cPanel/WebMail/WHM Logins (forces cookie authentication.) This will help prevent certain types of XSRF attacks that rely on cached Http Auth credentials” . under security settings.

Make sure the check box is ticked and save the settings. Eventhough it was shown ticked with my default WHM installation, but not worked. After I am saving the settings I got a messages like

” Updating “Skip HTTP Authentication” from “” to “1″.
“Skip HTTP Authentication” was updated.”

After that everything will showing up correctly.

March 10, 2010

How do I install chmviewer on Centos

Filed under: admins,Linux,RedHat EL5 — Liju Mathew @ 10:36 am

# yum install python-chm if it is not work download the following rpm from rpmforge respository
# wget ttp://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
# rpm -ivh rpmforge-release-0.5.1-1.el5.rf.i386.rpm
# yum clean all , Again
# yum install python-chm
Now we need to install gnochmviewer
#wget http://dag.wieers.com/rpm/packages/gnochm/gnochm-0.9.11-1.el5.rf.noarch.rpm
# rpm -ivh gnochm-0.9.11-1.el5.rf.noarch.rpm

My installation files for this package are,

[root@rc-090 chmviewer]# ls -la
-rwxr-xr-x 1 root root 45884 Mar 10 13:26 chmlib-0.40-1.el5.rf.i386.rpm
-rwxr-xr-x 1 root root 173836 Mar 10 13:26 gnochm-0.9.11-1.el5.rf.noarch.rpm
-rw-r–r– 1 root root 239 Mar 10 13:26 install.sh
-rwxr-xr-x 1 root root 66405 Mar 10 13:26 python-chm-0.8.4-1.el5.rf.i386.rpm

February 14, 2010

How do I upgrade the ghostscripts version on my Redhat server ?

Filed under: admins,Linux,RedHat EL5 — Liju Mathew @ 6:52 pm

our requirement is, I have a pdf file which is created using doc conversion ( have a look at my previous post). While I converting it to jpg it’s showing the errors as follows,

xecution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:1147/1684(ro)(G)-- --dict:0/20(G)-- --dict:71/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.63: Unrecoverable error, exit code 1

After googling, I found upgrading of ghostscripts will solve my problem. And I had success on upgrading ghostscripts on local desktop but not on server :-(

I found the same technique will not work for me since imagemagic is bind with ghoscripts. Suppose whenever I try to install imagemagic it will either install ghostscripts along with it or terminate with the error with lasted ghostscripts package conficts that were installed manually before.
My solution is,
1. First remove the Imagemagic and ghostscripts from the server.
2. Then I did jasper installation and then installed the ghostscript latest rpm.
3. After I installed Imagemagick separately from the Centos latest package repository.

rpm -Uvh http://chrisschuld.com/centos52/jasper-libs-1.900.1-8.i386.rpm
rpm -Uvh http://chrisschuld.com/centos52/jasper-1.900.1-8.i386.rpm
rpm -Uvh http://chrisschuld.com/centos52/jasper-utils-1.900.1-8.i386.rpm
rpm -Uvh http://chrisschuld.com/centos52/jasper-devel-1.900.1-8.i386.rpm

rpm -Uvh http://chrisschuld.com/centos52/ghostscript-8.63-1.i386.rpm
rpm -Uvh http://chrisschuld.com/centos52/ghostscript-devel-8.63-1.i386.rpm
rpm -Uvh http://chrisschuld.com/centos52/ghostscript-gtk-8.63-1.i386.rpm

Then download the imagemagic rpm from here,
http://mirror.vpshosting.com.hk/pub/linux/centos/5.4/os/i386/CentOS/ You may found various youm repository list from Centos download urls. Just go through the parent url to reach rpm distribution.

After that I can convert .pdf to image easily.
# convert test.pdf test.jpg

January 13, 2010

Installing ImageMagick on Centos5

Filed under: admins,Linux,RedHat EL5 — Liju Mathew @ 6:54 am

How do I install ImageMagic on Centos

#yum install ImageMagick.i386
#yum install ImageMagick-devel.i386

1. How do I test whether it’s working or not ?
[root@u15382543 ~]# convert logo: logo.gif
2. How do I verify that which image extensions are enabled on ImageMagick ?
[root@u15382543 ~]#identify -list format

October 27, 2009

Redhat YUM Repository for LAN with failover functionality

Filed under: admins,Linux,RedHat EL5 — Liju Mathew @ 11:24 pm

How to setup yum repository for Redhat.

1. Copy all the files from Redhat/Centos DVD to a local anonymous ftp location.

creating anonymous FTP location.
1, Setup FTP servers or http web share
a. install vsftp on the target system, start the ftp service and copy the files to “/var/ftp/pub ” location. You can access the ftp server at ftp://. Create a secondary also.

2.Create a repo file on ” /etc/yum.repos.d/”
First move all the files to temporoty location.

[liju@host ~] mv /etc/yum.repos.d/ /etc/yum.repos.d_old
[liju@host ~] mkdir /etc/yum.repos.d/
[liju@host ~] vi /etc/yum.repos.d/myrepo.repo

Add the following lines..

[RHEL5]
name=RHEL 5.0 Local yum repo!
mirrorlist=file:///etc/yum.repos.d/baseurls.txt
gpgcheck=0

Save and exit. Again we are going to create baseurls.txt

Do you know what is baseurls.txt stands for ?

baseurls.txt will help us to connect next repository whenever the primary repository server goes down, like a fail over does.

Create a file and add ftp servers details on it.

[liju@host ~] vi /etc/yum.repos.d/baseurls.txt

ftp://ftp ip/pub/Centos5
ftp://ftp ip/pub/Centos5

http://172.24.254.254/rhel5/Server

Save and exit the editor.

Again execute
[liju@host ~] yum clean all
[liju@host ~] yum update

See the magic, just testing it out now.
[liju@host ~] yum install vsftpd

August 26, 2008

How to redirect the page within your php application

Filed under: Apache,Debian,Linux,RedHat EL5,Ubuntu — Liju Mathew @ 10:40 pm

PHP Redirect Script

You can easily redirect using following code:

 
<?php
/* Redirect browser */
header("Location: http://theos.in/");
/* Make sure that code below does not get executed when we redirect. */
exit;
?>

Another sample hack

Sample function – sitefunctions.php (note I’m not the author of the following I found it somewhere else on the Internet):

function movePage($num,$url){
   static $http = array (
       100 => "HTTP/1.1 100 Continue",
       101 => "HTTP/1.1 101 Switching Protocols",
       200 => "HTTP/1.1 200 OK",
       201 => "HTTP/1.1 201 Created",
       202 => "HTTP/1.1 202 Accepted",
       203 => "HTTP/1.1 203 Non-Authoritative Information",
       204 => "HTTP/1.1 204 No Content",
       205 => "HTTP/1.1 205 Reset Content",
       206 => "HTTP/1.1 206 Partial Content",
       300 => "HTTP/1.1 300 Multiple Choices",
       301 => "HTTP/1.1 301 Moved Permanently",
       302 => "HTTP/1.1 302 Found",
       303 => "HTTP/1.1 303 See Other",
       304 => "HTTP/1.1 304 Not Modified",
       305 => "HTTP/1.1 305 Use Proxy",
       307 => "HTTP/1.1 307 Temporary Redirect",
       400 => "HTTP/1.1 400 Bad Request",
       401 => "HTTP/1.1 401 Unauthorized",
       402 => "HTTP/1.1 402 Payment Required",
       403 => "HTTP/1.1 403 Forbidden",
       404 => "HTTP/1.1 404 Not Found",
       405 => "HTTP/1.1 405 Method Not Allowed",
       406 => "HTTP/1.1 406 Not Acceptable",
       407 => "HTTP/1.1 407 Proxy Authentication Required",
       408 => "HTTP/1.1 408 Request Time-out",
       409 => "HTTP/1.1 409 Conflict",
       410 => "HTTP/1.1 410 Gone",
       411 => "HTTP/1.1 411 Length Required",
       412 => "HTTP/1.1 412 Precondition Failed",
       413 => "HTTP/1.1 413 Request Entity Too Large",
       414 => "HTTP/1.1 414 Request-URI Too Large",
       415 => "HTTP/1.1 415 Unsupported Media Type",
       416 => "HTTP/1.1 416 Requested range not satisfiable",
       417 => "HTTP/1.1 417 Expectation Failed",
       500 => "HTTP/1.1 500 Internal Server Error",
       501 => "HTTP/1.1 501 Not Implemented",
       502 => "HTTP/1.1 502 Bad Gateway",
       503 => "HTTP/1.1 503 Service Unavailable",
       504 => "HTTP/1.1 504 Gateway Time-out"
   );
   header($http[$num]);
   header ("Location: $url");
}

Now call it as follows:

<?php
@include("/path/to/sitefunctions.php");
movePage(403,"http://www.cyberciti.biz/");
?>

July 30, 2008

How to run mulitple Tomcat instance on the same server

Filed under: Apache,Debian,Linux,RedHat EL5,Ubuntu — Liju Mathew @ 10:41 pm
Tags:

I am listing the steps to  archive the goal

1, Step 1: Install the Tomcat files

2, Make directories for each instance

3. Editing the server.xml

Tomcat  using  2 major port one for listening http request and another for listening shutdown port

in here i put tomcat installation on /usr/local/tomcat5.5.9 folder

now I am going to edit server.xml inside the conf folder

vi /usr/local/tomcat5.5.9 folder/conf/server.xml

Find the entry

a, <Server port=”8001″ shutdown=”SHUTDOWN”> and changed the server port to any unused port

b, <!– Define a non-SSL HTTP/1.1 Connector on port 8080 –>
<Connector port=”9000″ maxHttpHeaderSize=”8192″  Change the Connector port to any unused port which tomcat listen

Again  restart the tomcat and check the that it is listening in the connector port by

!, telnet localhost   <connector port >  if it is opend a blank window it work

2, exicute $ netstat -nlp| grep  :”<connector port> .If it shows any result it’s working

Now you can start to depoly  the website.

I recommended that always to use tomcat as a backend server for Apache. You can use proxy pass module for  this functionality in apache. It also included in my previous  blog in Apache category.

################ Tomcat start up scripts ###########

# This is the init script for starting up the
#  Jakarta Tomcat server
#
# chkconfig: 345 91 10
# description: Starts and stops the Tomcat daemon.
#

# Source function library.
. /etc/rc.d/init.d/functions

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0

tomcat=/usr/local/jakarta-tomcat-5.5.9
startup=$tomcat/bin/startup.sh
shutdown=$tomcat/bin/shutdown.sh
export JAVA_HOME=/usr/java/jdk1.5.0_06

start(){
echo -n $”Starting Tomcat service: “
#daemon -c
$startup
RETVAL=$?
echo
}

stop(){
action $”Stopping Tomcat service: ” $shutdown
RETVAL=$?
echo
}

restart(){
stop
start
}

# See how we were called.
case “$1″ in
start)
start
;;
stop)
stop
;;
status)
# This doesn’t work ;)
status tomcat
;;
restart)
restart
;;
*)
echo $”Usage: $0 {start|stop|status|restart}”
exit 1
esac

exit 0
####### end of scripts ########
How to   use this scripts

1, open in any editor and  change the path of java and  Tomcat install location

2, Move the scripts to the /etc/init.d

3, Give execute permission to the scripts, #chmod  755 /etc/init.d/tomcatd  and then execute the scripts for the testing. Eg: # ./etc/init.d/tomcat start

4, Setting runlevel and added it to system service list by # chkconfig –add /etc/init.d/tomcatd

5. Setting the tomcat  should be run at start up by #chkconfig tomcatd   on

That’s it

Liju

July 28, 2008

How to monitor SSH Login activities and FTP logins over the web

Filed under: Debian,Linux,RedHat EL5,Ubuntu — Liju Mathew @ 8:48 pm

Basic Idea behind scripts is,

We can able to monitor the activities of ssh logins,any hacking attempt and ftp logins. The steps are involved in this scripts is

1, first check the log log files for whether there is any entry is present

2, If any lines present in the logs regarding the login activities, write all those lines in our custom web access file.

3, Place the report file in a web accessable location

4, Create a virtual host on Apache for this

5, set a cron to automate the logs creation and removal

########################### Log monitoring scripts ##############

#!/bin/bash
#fingers: Liju mathew ~! lijumathewliju@gmail.com
#created: 27.07.2008
#purpose: to check the status of ssh/logins and notify the system personnel
#      if they are not listening!

today=`date +%d-%m-%y`
day_ftr=`date +%b” “%d`
web_location=/var/www/logs

# In the below example I guess the ssh log files are created in /var/log/secure (on debian /var/lig/auth.log) #and vsftp/proftp logs are created on /var/log/vsftp.log
## SSH Allow script for checking empty data from the file

/bin/cat /var/log/secure| grep “$day_ftr”| grep sshd | grep “Accepted password” &> /dev/null
if [ "$?" -eq "0"  ];then
/bin/cat /var/log/secure | grep sshd | grep “Accepted password” > $web_location/ssh-allow-$today.txt
fi

#SSH -Deny scripts for removing empty file creation
/bin/cat /var/log/secure |grep “$day_ftr” | grep “sshd” | grep “Failed password”$> /dev/null
if [ "$?" -eq "0"  ];then
/bin/cat /var/log/secure |grep “$day_ftr” | grep “sshd” | grep “Failed password” > $web_location/ssh-deny-$today.txt
fi
## FTP Scripts for avioding empty file creation
/bin/cat /var/log/xferlog | grep “$day_ftr” &> /dev/null
if [ "$?" -eq "0"  ];then
/bin/cat /var/log/xferlog | grep “$day_ftr” > $web_location/ftp-log-$today.txt
fi
### ############End of scripts ############

Create a virtual host entry for this

<VirtualHost *:80>

ServerName 182.163.98.2

Alias /logs  “/var/www/html/logs”

<Directory “/var/www/html/logs” >
Options +Indexes
AllowOverride All
Allow from all
Order allow,deny
</Directory>

<Location /logs>
AuthType Basic
AuthName “Admin access details “
AuthUserFile /var//pwd/prod/passwd
Require valid-user
Allow from all
</Location>

</VirtualHost>

3, Set up a cron for o this

copy this scripts to /var/opt/scripts/ssh_monitor.sh

30 12  * * * /bin/sh /var/opt/scripts/ssh-monitor.sh

That’s it

Note : pls make sure that log file is properly formatted with my  grep comand. If not. pls update it with your required strings.

howto-install-rrdtool-on-rhel-linux

Filed under: Linux,RedHat EL5 — Liju Mathew @ 8:20 pm

RRD is the Acronym for Round Robin Database. RRD is a system to store and display time-series data (i.e. network bandwidth, machine-room temperature, server load average). It stores the data in a very compact way that will not expand over time, and it presents useful graphs by processing the data to enforce a certain data density. It can be used either via simple wrapper scripts (from shell or Perl) or via frontends that poll network devices and put a friendly user interface on it.

Installing RRDTool on RHEL

In order to install RRDTool on Red Hat Enterprise Linux / CentOS Linux 64 bit version you need to install few development tools and libraries.

Step # 1: Install required dependencies

Login as root and type the following command:
# yum install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel
Sample output:

Loading "rhnplugin" plugin
Loading "security" plugin
rhel-x86_64-server-vt-5   100% |=========================| 1.4 kB    00:00
rhn-tools-rhel-x86_64-ser 100% |=========================| 1.2 kB    00:00
rhel-x86_64-server-5      100% |=========================| 1.4 kB    00:00
Setting up Install Process
Parsing package install arguments
Package libxml2-devel - 2.6.26-2.1.2.1.x86_64 is already installed.
Package libxml2-devel - 2.6.26-2.1.2.1.i386 is already installed.
Package pango - 1.14.9-3.el5.i386 is already installed.
Package pango - 1.14.9-3.el5.x86_64 is already installed.
Package freetype - 2.2.1-20.el5_2.i386 is already installed.
Package freetype - 2.2.1-20.el5_2.x86_64 is already installed.
Resolving Dependencies
--> Running transaction check
---> Package libart_lgpl-devel.x86_64 0:2.3.17-4 set to be updated
---> Package pango-devel.i386 0:1.14.9-3.el5 set to be updated
--> Processing Dependency: libXft-devel for package: pango-devel
--> Processing Dependency: libXrender-devel for package: pango-devel
--> Processing Dependency: libXext-devel for package: pango-devel
--> Processing Dependency: libX11-devel for package: pango-devel
--> Processing Dependency: fontconfig-devel >= 2.0 for package: pango-devel
---> Package pango-devel.x86_64 0:1.14.9-3.el5 set to be updated
---> Package freetype-devel.x86_64 0:2.2.1-20.el5_2 set to be updated
---> Package libpng-devel.i386 2:1.2.10-7.1.el5_0.1 set to be updated
---> Package cairo-devel.x86_64 0:1.2.4-5.el5 set to be updated
---> Package libpng-devel.x86_64 2:1.2.10-7.1.el5_0.1 set to be updated
---> Package cairo-devel.i386 0:1.2.4-5.el5 set to be updated
---> Package libart_lgpl-devel.i386 0:2.3.17-4 set to be updated
--> Processing Dependency: libart_lgpl_2.so.2 for package: libart_lgpl-devel
---> Package freetype-devel.i386 0:2.2.1-20.el5_2 set to be updated
--> Running transaction check
---> Package libXrender-devel.i386 0:0.9.1-3.1 set to be updated
--> Processing Dependency: xorg-x11-proto-devel for package: libXrender-devel
---> Package libXft-devel.i386 0:2.1.10-1.1 set to be updated
---> Package libX11-devel.i386 0:1.0.3-9.el5 set to be updated
--> Processing Dependency: libXdmcp-devel for package: libX11-devel
--> Processing Dependency: libXau-devel for package: libX11-devel
---> Package fontconfig-devel.i386 0:2.4.1-7.el5 set to be updated
---> Package libart_lgpl.i386 0:2.3.17-4 set to be updated
---> Package libXext-devel.i386 0:1.0.1-2.1 set to be updated
--> Running transaction check
---> Package xorg-x11-proto-devel.i386 0:7.1-9.fc6 set to be updated
--> Processing Dependency: mesa-libGL-devel for package: xorg-x11-proto-devel
---> Package libXdmcp-devel.i386 0:1.0.1-2.1 set to be updated
---> Package libXau-devel.i386 0:1.0.1-3.1 set to be updated
--> Running transaction check
---> Package mesa-libGL-devel.i386 0:6.5.1-7.5.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 libart_lgpl-devel       x86_64     2.3.17-4         rhel-x86_64-server-5   21 k
 libart_lgpl-devel       i386       2.3.17-4         rhel-x86_64-server-5   21 k
 pango-devel             i386       1.14.9-3.el5     rhel-x86_64-server-5  280 k
 pango-devel             x86_64     1.14.9-3.el5     rhel-x86_64-server-5  281 k
Installing for dependencies:
 cairo-devel             x86_64     1.2.4-5.el5      rhel-x86_64-server-5  131 k
 cairo-devel             i386       1.2.4-5.el5      rhel-x86_64-server-5  130 k
 fontconfig-devel        i386       2.4.1-7.el5      rhel-x86_64-server-5  168 k
 freetype-devel          x86_64     2.2.1-20.el5_2   rhel-x86_64-server-5  151 k
 freetype-devel          i386       2.2.1-20.el5_2   rhel-x86_64-server-5  151 k
 libX11-devel            i386       1.0.3-9.el5      rhel-x86_64-server-5  665 k
 libXau-devel            i386       1.0.1-3.1        rhel-x86_64-server-5   11 k
 libXdmcp-devel          i386       1.0.1-2.1        rhel-x86_64-server-5  7.6 k
 libXext-devel           i386       1.0.1-2.1        rhel-x86_64-server-5   57 k
 libXft-devel            i386       2.1.10-1.1       rhel-x86_64-server-5   16 k
 libXrender-devel        i386       0.9.1-3.1        rhel-x86_64-server-5  8.9 k
 libart_lgpl             i386       2.3.17-4         rhel-x86_64-server-5   76 k
 libpng-devel            i386       2:1.2.10-7.1.el5_0.1  rhel-x86_64-server-5  182 k
 libpng-devel            x86_64     2:1.2.10-7.1.el5_0.1  rhel-x86_64-server-5  186 k
 mesa-libGL-devel        i386       6.5.1-7.5.el5    rhel-x86_64-server-5  465 k
 xorg-x11-proto-devel    i386       7.1-9.fc6        rhel-x86_64-server-5  247 k

Transaction Summary
=============================================================================
Install     20 Package(s)
Update       0 Package(s)
Remove       0 Package(s)         

Total download size: 3.2 M
Is this ok [y/N]: 

Downloading Packages:
(1/20): libXext-devel-1.0 100% |=========================|  57 kB    00:00
(2/20): freetype-devel-2. 100% |=========================| 151 kB    00:00
(3/20): libXau-devel-1.0. 100% |=========================|  11 kB    00:00
(4/20): libart_lgpl-devel 100% |=========================|  21 kB    00:00
(5/20): libart_lgpl-2.3.1 100% |=========================|  76 kB    00:00
(6/20): cairo-devel-1.2.4 100% |=========================| 130 kB    00:00
(7/20): libpng-devel-1.2. 100% |=========================| 186 kB    00:00
(8/20): cairo-devel-1.2.4 100% |=========================| 131 kB    00:00
(9/20): fontconfig-devel- 100% |=========================| 168 kB    00:00
(10/20): mesa-libGL-devel 100% |=========================| 465 kB    00:01
(11/20): libXdmcp-devel-1 100% |=========================| 7.6 kB    00:00
(12/20): libpng-devel-1.2 100% |=========================| 182 kB    00:00
(13/20): libX11-devel-1.0 100% |=========================| 665 kB    00:02
(14/20): freetype-devel-2 100% |=========================| 151 kB    00:00
(15/20): libXft-devel-2.1 100% |=========================|  16 kB    00:00
(16/20): pango-devel-1.14 100% |=========================| 281 kB    00:01
(17/20): pango-devel-1.14 100% |=========================| 280 kB    00:01
(18/20): libXrender-devel 100% |=========================| 8.9 kB    00:00
(19/20): libart_lgpl-deve 100% |=========================|  21 kB    00:00
(20/20): xorg-x11-proto-d 100% |=========================| 247 kB    00:01
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: libart_lgpl                  ####################### [ 1/20]
  Installing: freetype-devel               ####################### [ 2/20]
  Installing: fontconfig-devel             ####################### [ 3/20]
  Installing: libpng-devel                 ####################### [ 4/20]
  Installing: libXau-devel                 ####################### [ 5/20]
  Installing: libart_lgpl-devel            ####################### [ 6/20]
  Installing: libart_lgpl-devel            ####################### [ 7/20]
  Installing: libpng-devel                 ####################### [ 8/20]
  Installing: freetype-devel               ####################### [ 9/20]
  Installing: xorg-x11-proto-devel         ####################### [10/20]
  Installing: libX11-devel                 ####################### [11/20]
  Installing: libXrender-devel             ####################### [12/20]
  Installing: libXft-devel                 ####################### [13/20]
  Installing: cairo-devel                  ####################### [14/20]
  Installing: libXext-devel                ####################### [15/20]
  Installing: pango-devel                  ####################### [16/20]
  Installing: pango-devel                  ####################### [17/20]
  Installing: libXdmcp-devel               ####################### [18/20]
  Installing: mesa-libGL-devel             ####################### [19/20]
  Installing: cairo-devel                  ####################### [20/20] 

Installed: libart_lgpl-devel.x86_64 0:2.3.17-4 libart_lgpl-devel.i386 0:2.3.17-4 pango-devel.i386 0:1.14.9-3.el5 pango-devel.x86_64 0:1.14.9-3.el5
Dependency Installed: cairo-devel.x86_64 0:1.2.4-5.el5 cairo-devel.i386 0:1.2.4-5.el5 fontconfig-devel.i386 0:2.4.1-7.el5 freetype-devel.x86_64 0:2.2.1-20.el5_2 freetype-devel.i386 0:2.2.1-20.el5_2 libX11-devel.i386 0:1.0.3-9.el5 libXau-devel.i386 0:1.0.1-3.1 libXdmcp-devel.i386 0:1.0.1-2.1 libXext-devel.i386 0:1.0.1-2.1 libXft-devel.i386 0:2.1.10-1.1 libXrender-devel.i386 0:0.9.1-3.1 libart_lgpl.i386 0:2.3.17-4 libpng-devel.i386 2:1.2.10-7.1.el5_0.1 libpng-devel.x86_64 2:1.2.10-7.1.el5_0.1 mesa-libGL-devel.i386 0:6.5.1-7.5.el5 xorg-x11-proto-devel.i386 0:7.1-9.fc6
Complete!

Step # 2: Download latest rrdtool tar ball

Type the following commands:
# cd /opt/
# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.1.tar.gz

Untar tar ball, enter:
# tar -zxvf rrdtool-1.3.1.tar.gz

Step #3: Compile and install rrdtool

You need to set PKG_CONFIG_PATH, enter:
# export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
Type the following commands:
# ./configure
Sample output:

config.status: executing default-1 commands
config.status: executing intltool commands
config.status: executing default commands
config.status: executing po/stamp-it commands
checking in... and out again
ordering CD from http://tobi.oetiker.ch/wish .... just kidding ;-) 

----------------------------------------------------------------
Config is DONE!

          With MMAP IO: yes
       Static programs: no
          Perl Modules: perl_piped perl_shared
           Perl Binary: /usr/bin/perl
          Perl Version: 5.8.8
          Perl Options: PREFIX=/usr/local/rrdtool-1.3.1 LIB=/usr/local/rrdtool-1.3.1/lib/perl/5.8.8
          Ruby Modules:
           Ruby Binary: no
          Ruby Options: sitedir=$(DESTDIR)NONE/lib/ruby
    Build Tcl Bindings: no
 Build Python Bindings: yes
          Build rrdcgi: yes
       Build librrd MT: yes
     Link with libintl: yes

             Libraries: -lxml2 -lcairo -lcairo -lcairo -lm  -lcairo -lpng12   -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  

Type 'make' to compile the software and use 'make install' to
install everything to: /usr/local/rrdtool-1.3.1.

       ... that wishlist is NO JOKE. If you find RRDtool useful
make me happy. Go to http://tobi.oetiker.ch/wish and
place an order.

Optional compile time settings

By default RRDTool will get installed at /usr/local/rrdtool-1.3.1/ directory. To change default installation directory use following command:
# ./configure --prefix=/usr/local/rrdtool
# make install

To see all compile configuration option enter:
# ./configure --help


                               -- Tobi Oetiker 
----------------------------------------------------------------

Now compile and install RRDTool on RHEL:
# make
# make install
# cd /usr/local/
# ln -s rrdtool-1.3.1/ rrdtool/
# cd rrdtool
# ls -l

How do I verify my installation?

Now RRDtool is installed and ready to use. You can go to /usr/local/rrdtool/share/rrdtool/examples/ directory and run them to see if your installation has been successful or not:
# cd /usr/local/rrdtool/share/rrdtool/examples/
# ./stripes.pl
# ls -l
# cp stripes.png /var/www/html/

Fire a web browser and see a graph for yourself by typing the following url:
http://your-domain.com/stripes.png

Next Page »

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.