<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Denie&#039;s Tech Blog</title>
	<atom:link href="http://blog.nataprawira.com/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nataprawira.com/tech</link>
	<description>Information Technology for Life!</description>
	<lastBuildDate>Tue, 13 Dec 2011 05:17:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HOWTO: Deletes mailqueue files using matched keywords</title>
		<link>http://blog.nataprawira.com/tech/2011/12/13/howto-deletes-mailqueue-files-using-matched-keywords/</link>
		<comments>http://blog.nataprawira.com/tech/2011/12/13/howto-deletes-mailqueue-files-using-matched-keywords/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 05:17:04 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=203</guid>
		<description><![CDATA[

#!/bin/bash
# Programmed by Denie Nataprawira (nataprawira@gmail.com)
# (c) 2011 &#8212; www.ayodiet.com  
#
# Purposes:
#	Deletes mailqueue files using matched keywords.
#
cd /var/spool/mqueue
if test -z $1
then
        echo &#8220;The required parameter was empty. Please try again!&#8221;
        echo &#8220;Format: delkeyw.sh [KEYWORDS]&#8220;
       [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2011%2F12%2F13%2Fhowto-deletes-mailqueue-files-using-matched-keywords%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2011%2F12%2F13%2Fhowto-deletes-mailqueue-files-using-matched-keywords%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>#!/bin/bash</p>
<p># Programmed by Denie Nataprawira (nataprawira@gmail.com)<br />
# (c) 2011 &#8212; www.ayodiet.com <img src='http://blog.nataprawira.com/tech/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br />
#<br />
# Purposes:<br />
#	Deletes mailqueue files using matched keywords.<br />
#</p>
<p>cd /var/spool/mqueue</p>
<p>if test -z $1<br />
then<br />
        echo &#8220;The required parameter was empty. Please try again!&#8221;<br />
        echo &#8220;Format: delkeyw.sh [KEYWORDS]&#8220;<br />
        echo &#8221; &#8220;<br />
        exit<br />
fi</p>
<p>        echo &#8221;  SEARCHING: \&#8221;$1\&#8221; from all files&#8230;&#8221;</p>
<p>find . -type f -exec grep -il &#8216;$1&#8242; {} \; -exec rm -f {} \;</p>
<p>        echo &#8221;  DONE: \&#8221;$1\&#8221; has been checked and deleted (if found).&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2011/12/13/howto-deletes-mailqueue-files-using-matched-keywords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sendmail Multiple Queues</title>
		<link>http://blog.nataprawira.com/tech/2011/01/13/sendmail-multiple-queues/</link>
		<comments>http://blog.nataprawira.com/tech/2011/01/13/sendmail-multiple-queues/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 09:32:42 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[multiple]]></category>
		<category><![CDATA[queue]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=200</guid>
		<description><![CDATA[

Source:
http://www.ducea.com/2008/08/19/sendmail-multiple-queues/
Sendmail will use by default a single mail queue. This is what most users will need, and if you don’t have any special requirement you will not care about this. Still for high traffic mail servers it might be useful to split the queue over several directories, as thousands of files in a single directory [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2011%2F01%2F13%2Fsendmail-multiple-queues%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2011%2F01%2F13%2Fsendmail-multiple-queues%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>Source:<br />
<a href="http://www.ducea.com/2008/08/19/sendmail-multiple-queues/">http://www.ducea.com/2008/08/19/sendmail-multiple-queues/</a></p>
<p>Sendmail will use by default a single mail queue. This is what most users will need, and if you don’t have any special requirement you will not care about this. Still for high traffic mail servers it might be useful to split the queue over several directories, as thousands of files in a single directory will become a performance penalty at some point and also processing the queue sequentially will become very slow.</p>
<p>This post will show how we can implement multiple mail queues with modern sendmail versions.<br />
Let’s start by assuming we want to use 8 mail queues. First thing is to create the actual directories as sendmail will not do this by default:</p>
<p><code>mkdir /var/spool/mqueue/q{1,2,3,4,5,6,7,8}</code></p>
<p>And fix the permissions to the ones of the original folder /var/spool/mqueue. For ex. this might look like:</p>
<p><code>chown -R root:smmsp /var/spool/mqueue/q*</code></p>
<p>using a default sendmail install running on debian. Fix the users to the specific ones found on your system (ls -al /var/spool/mqueue if you are uncertain of this).</p>
<p>Next, we need to enable the multiple queues in the sendmail configuration. For this we will edit sendmail.mc (normally found under /etc/mail) and append one line:</p>
<p><code>define(`QUEUE_DIR', `/var/spool/mqueue/q*')dnl</code></p>
<p>and now regenerate sendmail.cf; this is done normally running:</p>
<p><code>m4 sendmail.mc &gt; /etc/mail/sendmail.cf</code></p>
<p>(fix your paths appropriately), or if you are using debian sendmail you can just run make all in /etc/mail.</p>
<p>After restarting sendmail, it will start using the multiple queues we defined. Running mailq will output each of the queues:</p>
<p><code>#mailq<br />
/var/spool/mqueue/q6 is empty<br />
/var/spool/mqueue/q4 is empty<br />
/var/spool/mqueue/q3 is empty<br />
/var/spool/mqueue/q2 is empty<br />
/var/spool/mqueue/q5 is empty<br />
/var/spool/mqueue/q1 is empty<br />
/var/spool/mqueue/q7 is empty<br />
/var/spool/mqueue/q8 is empty<br />
Total requests: 0</code></p>
<p>Note: if you want to add more folders to the configuration all you have to do is to create the respective folders, set the appropriate permissions and restart sendmail.</p>
<p>If you had existing mails in the queue (most likely if you were looking for this solution), if you want them still processed, move them from /var/spool/mqueue in one of the newly created queues (q1 for ex).</p>
<p>Individual queue directories can be symbolic links to other partitions to spreads load among multiple disks. Queue IDs are unique across queues so you can move the items among queues if you have to.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2011/01/13/sendmail-multiple-queues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fully Optimized Sendmail.mc</title>
		<link>http://blog.nataprawira.com/tech/2010/12/24/fully-optimized-sendmail-mc/</link>
		<comments>http://blog.nataprawira.com/tech/2010/12/24/fully-optimized-sendmail-mc/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 17:54:13 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[optimize]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=185</guid>
		<description><![CDATA[

This is what I&#8217;m currently using on &#8220;sendmail.mc&#8221;. So far quite good and I can blast around 100K emails within few hours. Enjoy!
divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4&#8242;)dnl
VERSIONID(`setup for linux&#8217;)dnl
OSTYPE(`linux&#8217;)dnl
define(`confDEF_USER_ID&#8217;, &#8220;8:12&#8221;)dnl
dnl define(`confAUTO_REBUILD&#8217;)dnl
define(`confTO_CONNECT&#8217;, `1m&#8217;)dnl
define(`confTRY_NULL_MX_LIST&#8217;, `True&#8217;)dnl
define(`confDONT_PROBE_INTERFACES&#8217;, `True&#8217;)dnl
define(`PROCMAIL_MAILER_PATH&#8217;, `/usr/bin/procmail&#8217;)dnl
define(`ALIAS_FILE&#8217;, `/etc/aliases&#8217;)dnl
define(`STATUS_FILE&#8217;, `/var/log/mail/statistics&#8217;)dnl
define(`UUCP_MAILER_MAX&#8217;, `2000000&#8242;)dnl
define(`confUSERDB_SPEC&#8217;, `/etc/mail/userdb.db&#8217;)dnl
define(`confPRIVACY_FLAGS&#8217;, `authwarnings,novrfy,noexpn,restrictqrun&#8217;)dnl
define(`confAUTH_OPTIONS&#8217;, `A&#8217;)dnl
define(`confCHECKPOINTINTERVAL&#8217;,`0&#8242;)dnl
define(`confCONNECTION_RATE_THROTTLE&#8217;,`0&#8242;)dnl
define(`confDF_BUFFER_SIZE&#8217;,`16384&#8242;)dnl
define(`confMAX_DAEMON_CHILDREN&#8217;,`0&#8242;)dnl
define(`confMAX_QUEUE_RUN_SIZE&#8217;,`0&#8242;)dnl
define(`confMCI_CACHE_SIZE&#8217;,`4&#8242;)dnl
define(`confMCI_CACHE_TIMEOUT&#8217;,`120s&#8217;)dnl
define(`confMIN_QUEUE_AGE&#8217;,`0&#8242;)dnl
define(`confSAFE_QUEUE&#8217;,`false&#8217;)dnl
define(`confTO_IDENT&#8217;,`0&#8242;)dnl
define(`confXF_BUFFER_SIZE&#8217;,`16384&#8242;)dnl
define(`confQUEUE_LA&#8217;,`1000&#8242;)dnl
define(`confREFUSE_LA&#8217;,`500&#8242;)dnl
FEATURE(`nocanonify&#8217;, `canonify_hosts&#8217;)dnl
FEATURE(`no_default_msa&#8217;, `dnl&#8217;)dnl
FEATURE(`mailertable&#8217;, `hash -o /etc/mail/mailertable.db&#8217;)dnl
FEATURE(`virtusertable&#8217;, `hash -o /etc/mail/virtusertable.db&#8217;)dnl
FEATURE(redirect)dnl
dnl # FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
FEATURE(local_procmail, `&#8217;, `procmail -t -Y -a $h -d $u&#8217;)dnl
FEATURE(`access_db&#8217;, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F12%2F24%2Ffully-optimized-sendmail-mc%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F12%2F24%2Ffully-optimized-sendmail-mc%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><strong>This is what I&#8217;m currently using on &#8220;sendmail.mc&#8221;. So far quite good and I can blast around 100K emails within few hours. Enjoy!<span id="more-185"></span></strong></p>
<p>divert(-1)dnl<br />
include(`/usr/share/sendmail-cf/m4/cf.m4&#8242;)dnl<br />
VERSIONID(`setup for linux&#8217;)dnl<br />
OSTYPE(`linux&#8217;)dnl<br />
define(`confDEF_USER_ID&#8217;, &#8220;8:12&#8221;)dnl<br />
dnl define(`confAUTO_REBUILD&#8217;)dnl<br />
define(`confTO_CONNECT&#8217;, `1m&#8217;)dnl<br />
define(`confTRY_NULL_MX_LIST&#8217;, `True&#8217;)dnl<br />
define(`confDONT_PROBE_INTERFACES&#8217;, `True&#8217;)dnl<br />
define(`PROCMAIL_MAILER_PATH&#8217;, `/usr/bin/procmail&#8217;)dnl<br />
define(`ALIAS_FILE&#8217;, `/etc/aliases&#8217;)dnl<br />
define(`STATUS_FILE&#8217;, `/var/log/mail/statistics&#8217;)dnl<br />
define(`UUCP_MAILER_MAX&#8217;, `2000000&#8242;)dnl<br />
define(`confUSERDB_SPEC&#8217;, `/etc/mail/userdb.db&#8217;)dnl<br />
define(`confPRIVACY_FLAGS&#8217;, `authwarnings,novrfy,noexpn,restrictqrun&#8217;)dnl<br />
define(`confAUTH_OPTIONS&#8217;, `A&#8217;)dnl<br />
define(`confCHECKPOINTINTERVAL&#8217;,`0&#8242;)dnl<br />
define(`confCONNECTION_RATE_THROTTLE&#8217;,`0&#8242;)dnl<br />
define(`confDF_BUFFER_SIZE&#8217;,`16384&#8242;)dnl<br />
define(`confMAX_DAEMON_CHILDREN&#8217;,`0&#8242;)dnl<br />
define(`confMAX_QUEUE_RUN_SIZE&#8217;,`0&#8242;)dnl<br />
define(`confMCI_CACHE_SIZE&#8217;,`4&#8242;)dnl<br />
define(`confMCI_CACHE_TIMEOUT&#8217;,`120s&#8217;)dnl<br />
define(`confMIN_QUEUE_AGE&#8217;,`0&#8242;)dnl<br />
define(`confSAFE_QUEUE&#8217;,`false&#8217;)dnl<br />
define(`confTO_IDENT&#8217;,`0&#8242;)dnl<br />
define(`confXF_BUFFER_SIZE&#8217;,`16384&#8242;)dnl<br />
define(`confQUEUE_LA&#8217;,`1000&#8242;)dnl<br />
define(`confREFUSE_LA&#8217;,`500&#8242;)dnl<br />
FEATURE(`nocanonify&#8217;, `canonify_hosts&#8217;)dnl<br />
FEATURE(`no_default_msa&#8217;, `dnl&#8217;)dnl<br />
FEATURE(`mailertable&#8217;, `hash -o /etc/mail/mailertable.db&#8217;)dnl<br />
FEATURE(`virtusertable&#8217;, `hash -o /etc/mail/virtusertable.db&#8217;)dnl<br />
FEATURE(redirect)dnl<br />
dnl # FEATURE(always_add_domain)dnl<br />
FEATURE(use_cw_file)dnl<br />
FEATURE(use_ct_file)dnl<br />
FEATURE(local_procmail, `&#8217;, `procmail -t -Y -a $h -d $u&#8217;)dnl<br />
FEATURE(`access_db&#8217;, `hash -T&lt;TMPF&gt; -o /etc/mail/access.db&#8217;)dnl<br />
EXPOSED_USER(`root&#8217;)dnl<br />
DAEMON_OPTIONS(`Name=MTA-v4, Family=inet&#8217;)<br />
LOCAL_DOMAIN(`localhost.localdomain&#8217;)dnl<br />
MODIFY_MAILER_FLAGS(`PROCMAIL&#8217;, `+m&#8217;)dnl<br />
dnl # INPUT_MAIL_FILTER(`dk-filter&#8217;, `S=inet:8891@localhost&#8217;)dnl<br />
FEATURE(`dnsbl&#8217;,`bl.spamcop.net&#8217;,`554 Mail from $&amp;{client_addr} rejected by bl.spamcop.net&#8217;)dnl<br />
FEATURE(`dnsbl&#8217;,`rbl-plus.mail-abuse.org&#8217;,`&#8221;MAPS-listed host: http://mail-abuse.org/cgi-bin/lookup?&#8221;$&amp;{client_addr}&#8217;)dnl<br />
FEATURE(`dnsbl&#8217;,`sbl-xbl.spamhaus.org&#8217;,`554 Mail from $&amp;{client_addr} has been rejected by the Spamhaus Blackhole List&#8217;)dnl<br />
FEATURE(`dnsbl&#8217;,`dnsbl.sorbs.net&#8217;,`554 Mail from $&amp;{client_addr} has been rejected by the SORBS&#8217;)dnl<br />
MAILER(smtp)dnl<br />
MAILER(procmail)dnl</p>
<hr />[root@edm mail]# cat /proc/meminfo<br />
MemTotal:        8455500 kB</p>
<hr />[root@edm mail]# cat /proc/cpuinfo<br />
processor       : 0<br />
vendor_id       : AuthenticAMD<br />
cpu family      : 16<br />
model           : 2<br />
model name      : Quad-Core AMD Opteron(tm) Processor 2350 HE<br />
stepping        : 3<br />
cpu MHz         : 1995.000<br />
cache size      : 512 KB<br />
fpu             : yes<br />
fpu_exception   : yes<br />
cpuid level     : 5<br />
wp              : yes<br />
flags           : fpu de tsc msr pae cx8 apic cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow constant_tsc rep_good nonstop_tsc pni cx16 popcnt lahf_lm cmp_legacy extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch<br />
bogomips        : 3999.51<br />
TLB size        : 1024 4K pages<br />
clflush size    : 64<br />
cache_alignment : 64<br />
address sizes   : 48 bits physical, 48 bits virtual<br />
power management: ts ttp tm stc 100mhzsteps hwpstate</p>
<p>processor       : 1<br />
vendor_id       : AuthenticAMD<br />
cpu family      : 16<br />
model           : 2<br />
model name      : Quad-Core AMD Opteron(tm) Processor 2350 HE<br />
stepping        : 3<br />
cpu MHz         : 1995.000<br />
cache size      : 512 KB</p>
<p>processor       : 2<br />
vendor_id       : AuthenticAMD<br />
cpu family      : 16<br />
model           : 2<br />
model name      : Quad-Core AMD Opteron(tm) Processor 2350 HE<br />
stepping        : 3<br />
cpu MHz         : 1995.000<br />
cache size      : 512 KB</p>
<p>processor       : 3<br />
vendor_id       : AuthenticAMD<br />
cpu family      : 16<br />
model           : 2<br />
model name      : Quad-Core AMD Opteron(tm) Processor 2350 HE<br />
stepping        : 3<br />
cpu MHz         : 1995.000<br />
cache size      : 512 KB</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/12/24/fully-optimized-sendmail-mc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tuning Sendmail</title>
		<link>http://blog.nataprawira.com/tech/2010/12/24/tuning-sendmail/</link>
		<comments>http://blog.nataprawira.com/tech/2010/12/24/tuning-sendmail/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 17:20:01 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Tuning]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=183</guid>
		<description><![CDATA[

# Copyright (c) 2001 Sendmail, Inc. and its suppliers.
#	All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
#	$Id: TUNING,v 1.16 2001/08/19 21:03:38 gshapiro Exp $
#
********************************************
** This is a DRAFT, comments are welcome! **
********************************************
If [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F12%2F24%2Ftuning-sendmail%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F12%2F24%2Ftuning-sendmail%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p># Copyright (c) 2001 Sendmail, Inc. and its suppliers.<br />
#	All rights reserved.<br />
#<br />
# By using this file, you agree to the terms and conditions set<br />
# forth in the LICENSE file which can be found at the top level of<br />
# the sendmail distribution.<br />
#<br />
#	$Id: TUNING,v 1.16 2001/08/19 21:03:38 gshapiro Exp $<br />
#<span id="more-183"></span></p>
<p>********************************************<br />
** This is a DRAFT, comments are welcome! **<br />
********************************************</p>
<p>If the default configuration of sendmail does not achieve the<br />
required performance, there are several configuration options that<br />
can be changed to accomplish higher performance.  However, before<br />
those options are changed it is necessary to understand why the<br />
performance is not as good as desired.  This may also involve hardware<br />
and software (OS) configurations which are not extensively explored<br />
in this document.  We assume that your system is not limited by<br />
network bandwidth because optimizing for this situation is beyond<br />
the scope of this guide.  In almost all other cases performance will<br />
be limited by disk I/O.</p>
<p>This text assumes that all options which are mentioned here are<br />
familiar to the reader, they are explained in the Sendmail Installation<br />
and Operations Guide; doc/op/op.txt.</p>
<p>There are basically three different scenarios which are treated<br />
in the following:<br />
* Mailing Lists and Large Aliases (1-n Mailing)<br />
* 1-1 Mass Mailing<br />
* High Volume Mail</p>
<p>Depending on your requirements, these may need different options<br />
to optimize sendmail for the particular purpose.  It is also possible<br />
to configure sendmail to achieve good performance in all cases, but<br />
it will not be optimal for any specific purpose.  For example, it<br />
is non-trivival to combine low latency (fast delivery of incoming<br />
mail) with high overall throughput.</p>
<p>Before we explore the different scenarios, a basic discussion about<br />
disk I/O, delivery modes, and queue control is required.</p>
<p>* Disk I/O<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>In general mail will be written to disk up before a delivery attempt<br />
is made.  This is required for reliability and should only be changed<br />
in a few specific cases that are mentioned later on.  To achieve<br />
better disk I/O performance the queue directories can be spread<br />
over several disks to distribute the load.  This is some basic tuning<br />
that should be done in all cases where the I/O speed of a single<br />
disk is exceeded, which is true for almost every high-volume<br />
situation except if a special disk subsystem with large (NV)RAM<br />
buffer is used.</p>
<p>Depending on your OS there might be ways to speed up I/O, e.g.,<br />
using softupdates or turning on the noatime mount option.  If this<br />
is done make sure the filesystem is still reliable, i.e., if fsync()<br />
returns without an error, the file has really been committed to<br />
disk.</p>
<p>* Queueing Strategies and DeliveryMode<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>There are basically three delivery modes:</p>
<p>background: incoming mail will be immediately delivered by a new process<br />
interactive: incoming mail will be immediately delivered by the same process<br />
queue: incoming mail will be queued and delivered by a queue runner later on</p>
<p>The first offers the lowest latency without the disadvantage of the<br />
second, which keep the connection from the sender open until the<br />
delivery to the next hop succeeded or failed.  However, it does not<br />
allow for a good control over the number of delivery processes other<br />
than limiting the total number of direct children of the daemon<br />
processes (MaxChildren) or by load control options (RefuseLA,<br />
DelayLA).  Moreover, it can&#8217;t make as good use as &#8216;queue&#8217; mode can<br />
for connection caching.</p>
<p>Interactive DeliveryMode should only be used in rare cases, e.g.,<br />
if the delivery time to the next hop is a known quantity or if the<br />
sender is under local control and it does not matter if it has to<br />
wait for delivery.</p>
<p>Queueing up e-mail before delivery is done by a queue runner allows<br />
the best load control but does not achieve as low latency as the<br />
other two modes.  However, this mode is probably also best for<br />
concurrent delivery since the number of queue runners can be specified<br />
on a queue group basis.  Persistent queue runners (-qp) can be used<br />
to minimize the overhead for creating processes because they just<br />
sleep for the specified interval (which shold be short) instead of<br />
exiting after a queue run.</p>
<p>* Queue Groups<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>In most situations disk I/O is a bottleneck which can be mitigated<br />
by spreading the load over several disks.  This can easily be achieved<br />
with different queue directories.  sendmail 8.12 introduces queue<br />
groups which are collections of queue directories with similar<br />
properties, i.e., number of processes to run the queues in the<br />
group, maximum number of recipients within an e-mail (envelope),<br />
etc.  Queue groups allow control over the behaviour of different<br />
queues.  Depending on the setup, it is usually possible to have<br />
several queue runners delivering mails concurrently which should<br />
increase throughput.  The number of queue runners can be controlled<br />
per queue group (Runner=) and overall (MaxQueueChildren).</p>
<p>* DNS Lookups<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>sendmail performs by default host name canonifications by using<br />
host name lookups.  This process is meant to replace unqualified<br />
host name with qualified host names, and CNAMEs with the non-aliased<br />
name.  However, these lookups can take a while for large address<br />
lists, e.g., mailing lists.  If you can assure by other means that<br />
host names are canonical, you should use</p>
<p>FEATURE(`nocanonify&#8217;, `canonify_hosts&#8217;)</p>
<p>in your .mc file.  For further information on this feature and<br />
additional options see cf/README.  If sendmail is invoked directly<br />
to send e-mail then either the -G option should be used or</p>
<p>define(`confDIRECT_SUBMISSION_MODIFIERS&#8217;, `C&#8217;)</p>
<p>should be added to the .mc file.</p>
<p>* Mailing Lists and Large Aliases (1-n Mailing)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Before 8.12 sendmail delivers an e-mail sequentially to all its<br />
recipients.  For mailing lists or large aliases the overall delivery<br />
time can be substantial, especially if some of the recipients are located<br />
at hosts that are slow to accept e-mail.  Some mailing list software<br />
therefore &#8220;split&#8221; up e-mails into smaller pieces with fewer recipients.<br />
sendmail 8.12 can do this itself, either across queue groups or<br />
within a queue directory.  For the former the option SplitAcrossQueueGroups<br />
option must be set, the latter is controlled by the &#8216;r=&#8217; field of<br />
a queue group declaration.</p>
<p>Let&#8217;s assume a simple example: a mailing lists where most of<br />
the recipients are at three domains: the local one (local.domain)<br />
and two remotes (one.domain, two.domain) and the rest is splittered<br />
over several other domains.  For this case it is useful to specify<br />
three queue groups:</p>
<p>QUEUE_GROUP(`local&#8217;, `P=/var/spool/mqueue/local, F=f, R=2, I=1m&#8217;)dnl<br />
QUEUE_GROUP(`one&#8217;, `P=/var/spool/mqueue/one, F=f, r=50, R=3&#8242;)dnl<br />
QUEUE_GROUP(`two&#8217;, `P=/var/spool/mqueue/two, F=f, r=30, R=4&#8242;)dnl<br />
QUEUE_GROUP(`remote&#8217;, `P=/var/spool/mqueue/remote, F=f, r=5, R=8, I=2m&#8217;)dnl<br />
define(`ESMTP_MAILER_QGRP&#8217;, `remote&#8217;)dnl<br />
define(`confSPLIT_ACROSS_QUEUEGROUPS&#8217;, `True&#8217;)dnl<br />
define(`confDELIVERY_MODE&#8217;, `q&#8217;)dnl<br />
define(`confMAX_QUEUE_CHILDREN&#8217;, `50&#8242;)dnl<br />
define(`confMIN_QUEUE_AGE&#8217;, `27m&#8217;)dnl</p>
<p>and specify the queuegroup ruleset as follows:</p>
<p>LOCAL_RULESETS<br />
Squeuegroup<br />
R$* @ local.domain	$# local<br />
R$* @ $* one.domain	$# one<br />
R$* @ $* two.domain	$# two<br />
R$* @ $*		$# remote<br />
R$*			$# mqueue</p>
<p>Now it is necessary to control the number of queue runners, which<br />
is done by MaxQueueChildren.  Starting the daemon with the option<br />
-q5m assures that the first delivery attempt for each e-mail is<br />
done within 5 minutes, however, there are also individual queue<br />
intervals for the queue groups as specified above.  MinQueueAge<br />
is set to 27 minutes to avoid that entries are run too often.</p>
<p>Notice: if envelope splitting happens due to alias expansion, and<br />
DeliveryMode is not &#8216;i&#8217;nteractive, then only one envelope is sent<br />
immediately.  The rest (after splitting) are queued up and queue<br />
runners must come along and take care of them.  Hence it is essential<br />
that the queue interval is very short.</p>
<p>* 1-1 Mass Mailing<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>In this case some program generates e-mails which are sent to<br />
individual recipients (or at most very few per e-mail).  A simple<br />
way to achieve high throughput is to set the delivery mode to<br />
&#8216;interactive&#8217;, turn off the SuperSafe option and make sure that the<br />
program that generates the mails can deal with mail losses if the<br />
server loses power.  In no other case should SuperSafe be set to<br />
&#8216;false&#8217;.  If these conditions are met, sendmail does not need to<br />
commit mails to disk but can buffer them in memory which will greatly<br />
enhance performance, especially compared to normal disk subsystems, e.g.,<br />
non solid-state disks.</p>
<p>* High Volume Mail<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>For high volume mail it is necessary to be able to control the load<br />
on the system.  Therefore the &#8216;queue&#8217; delivery mode should be used,<br />
and all options related to number of processes and the load should<br />
be set to reasonable values.  It is important not to accept mail<br />
faster than it can be delivered otherwise the system will be<br />
overwhelmed.  Hence RefuseLA should be lower than QueueLA, the number<br />
of daemon children should probably be lower than the number of queue<br />
runnners (MaxChildren vs. MaxQueueChildren).  DelayLA is a new option<br />
in 8.12 which allows delaying connections instead of rejecting them.<br />
This may result in a smoother load distribution depending on how<br />
the mails are submitted to sendmail.</p>
<p>* Miscellaneous<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Other options that are interesting to tweak performance are<br />
(in no particular order):</p>
<p>SuperSafe: if interactive DeliveryMode is used, then this can<br />
be set to the new value &#8220;interactive&#8221; in 8.12 to save some disk<br />
synchronizations which are not really necessary in that mode.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Source:<br />
http://luxio.us/gXwyLu</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/12/24/tuning-sendmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTAccess Tricks</title>
		<link>http://blog.nataprawira.com/tech/2010/12/06/htaccess-tricks/</link>
		<comments>http://blog.nataprawira.com/tech/2010/12/06/htaccess-tricks/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 02:19:37 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[HTaccess]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=176</guid>
		<description><![CDATA[


Source: Stupid HTAccess Tricks
GENERAL INFORMATION [ ^ ]
.htaccess Definition 1 ^
Apache server software provides distributed (i.e., directory-level) configuration via Hypertext Access files. These .htaccess files enable the localized fine-tuning of Apache’s universal system-configuration directives, which are defined in Apache’s main configuration file. The localized .htaccess directives must operate from within a file named .htaccess. The user must have appropriate file permissions to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F12%2F06%2Fhtaccess-tricks%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F12%2F06%2Fhtaccess-tricks%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><a name="top"></a><span style="color: #000000"><br />
<em>Source: <a title="Stupid HTAccess Tricks" href="http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/" target="_blank">Stupid HTAccess Tricks</a></em></span></p>
<h3 id="general"><span style="color: #000000">GENERAL INFORMATION [ <a href="#top">^</a> ]</span></h3>
<h4 id="gen1"><span style="color: #000000">.htaccess Definition <sup>1</sup> <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Apache server software provides distributed (i.e., directory-level) configuration via <em>Hypertext Access</em> files. These <a title="htaccess at Wikipedia" rel="nofollow" href="http://en.wikipedia.org/wiki/Htaccess"><code>.</code><code>htaccess</code></a> files enable the localized fine-tuning of Apache’s universal system-configuration directives, which are defined in Apache’s main configuration file. The localized <code>.</code><code>htaccess</code> directives must operate from within a file named <code>.</code><code>htaccess</code>. The user must have appropriate file permissions to access and/or edit the <code>.</code><code>htaccess</code> file. Further,<code>.</code><code>htaccess</code> file permissions should never allow world write access — a secure permissions setting is “644”, which allows universal read access and user-only write access. Finally,<code>.</code><code>htaccess</code> rules apply to the parent directory and all subdirectories. Thus to apply configuration rules to an entire website, place the <code>.</code><code>htaccess</code> file in the root directory of the site.<span id="more-176"></span></span></p>
<h4 id="gen2"><span style="color: #000000">Commenting .htaccess Code <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Comments are essential to maintaining control over any involved portion of code. Comments in<code>.</code><code>htaccess</code> code are fashioned on a per-line basis, with each line of comments beginning with a pound sign <code>#</code>. Thus, comments spanning multiple lines in the <code>.</code><code>htaccess</code> file require multiple pound signs. Further, due to the extremely volatile nature of htaccess voodoo, it is wise to include only alphanumeric characters (and perhaps a few dashes and underscores) in any<code>.</code><code>htaccess</code> comments.</span></p>
<h4 id="gen3"><span style="color: #000000">Important Notes for .htaccess Noobs <a href="#top">^</a></span></h4>
<p><span style="color: #000000">As a configuration file, <code>.</code><code>htaccess</code> is very powerful. Even the slightest syntax error (like a missing space) can result in severe server malfunction. Thus it is crucial to make backup copies of <em>everything</em> related to your site (including any original <code>.</code><code>htaccess</code> files) <em>before</em> working with your Hypertext Access file(s). It is also important to check your entire website thoroughly after making any changes to your <code>.</code><code>htaccess</code> file. If any errors or other problems are encountered, employ your backups immediately to restore original functionality.</span></p>
<h4 id="gen4"><span style="color: #000000">Performance Issues <a href="#top">^</a></span></h4>
<p><code><span style="color: #000000">.</span></code><code><span style="color: #000000">htaccess</span></code><span style="color: #000000"> directives provide directory-level configuration without requiring access to Apache’s main server cofiguration file (httpd.conf). However, due to performance and security concerns, the main configuration file should always be used for server directives whenever possible. For example, when a server is configured to process <code>.</code><code>htaccess</code> directives, Apache must search every directory within the domain and load any and all <code>.</code><code>htaccess</code> files upon every document request. This results in increased page processing time and thus decreases performance. Such a performance hit may be unnoticeable for sites with light traffic, but becomes a more serious issue for more popular websites. Therefore, <code>.</code><code>htaccess</code> files should only be used when the main server configuration file is inaccessible. See the “<a href="#performance">Performance Tricks</a>” section of this article for more information.</span></p>
<h4 id="gen5"><span style="color: #000000">Regex Character Definitions for htaccess <sup>2</sup> <a href="#top">^</a></span></h4>
<dl>
<dt><code><span style="color: #000000">#</span></code></dt>
<dd><span style="color: #000000">the <code>#</code> instructs the server to ignore the line. used for including comments. each line of comments requires it’s own <code>#</code>. when including comments, it is good practice to use only letters, numbers, dashes, and underscores. this practice will help eliminate/avoid potential server parsing errors. </span></dd>
<dt><code><span style="color: #000000">[F]</span></code></dt>
<dd><span style="color: #000000">Forbidden: instructs the server to return a <code>403 Forbidden</code> to the client. </span></dd>
<dt><code><span style="color: #000000">[L]</span></code></dt>
<dd><span style="color: #000000">Last rule: instructs the server to stop rewriting after the preceding directive is processed. </span></dd>
<dt><code><span style="color: #000000">[N]</span></code></dt>
<dd><span style="color: #000000">Next: instructs Apache to rerun the rewrite rule until all rewriting directives have been achieved. </span></dd>
<dt><code><span style="color: #000000">[G]</span></code></dt>
<dd><span style="color: #000000">Gone: instructs the server to deliver <code>Gone (no longer exists)</code> status message. </span></dd>
<dt><code><span style="color: #000000">[P]</span></code></dt>
<dd><span style="color: #000000">Proxy: instructs server to handle requests by <code>mod_proxy</code> </span></dd>
<dt><code><span style="color: #000000">[C]</span></code></dt>
<dd><span style="color: #000000">Chain: instructs server to chain the current rule with the previous rule. </span></dd>
<dt><code><span style="color: #000000">[R]</span></code></dt>
<dd><span style="color: #000000">Redirect: instructs Apache to issue a redirect, causing the browser to request the rewritten/modified URL. </span></dd>
<dt><code><span style="color: #000000">[NC]</span></code></dt>
<dd><span style="color: #000000">No Case: defines any associated argument as case-<em>in</em>sensitive. i.e., &#8220;NC&#8221; = &#8220;No Case&#8221;. </span></dd>
<dt><code><span style="color: #000000">[PT]</span></code></dt>
<dd><span style="color: #000000">Pass Through: instructs <code>mod_rewrite</code> to pass the rewritten URL back to Apache for further processing. </span></dd>
<dt><code><span style="color: #000000">[OR]</span></code></dt>
<dd><span style="color: #000000">Or: specifies a logical &#8220;or&#8221; that ties two expressions together such that either one proving true will cause the associated rule to be applied. </span></dd>
<dt><code><span style="color: #000000">[NE]</span></code></dt>
<dd><span style="color: #000000">No Escape: instructs the server to parse output without escaping characters. </span></dd>
<dt><code><span style="color: #000000">[NS]</span></code></dt>
<dd><span style="color: #000000">No Subrequest: instructs the server to skip the directive if internal sub-request. </span></dd>
<dt><code><span style="color: #000000">[QSA]</span></code></dt>
<dd><span style="color: #000000">Append Query String: directs server to add the query string to the end of the expression (URL). </span></dd>
<dt><code><span style="color: #000000">[S=x]</span></code></dt>
<dd><span style="color: #000000">Skip: instructs the server to skip the next &#8220;x&#8221; number of rules if a match is detected. </span></dd>
<dt><code><span style="color: #000000">[E=variable:value]</span></code></dt>
<dd><span style="color: #000000">Environmental Variable: instructs the server to set the environmental variable &#8220;variable&#8221; to &#8220;value&#8221;. </span></dd>
<dt><code><span style="color: #000000">[T=MIME-type]</span></code></dt>
<dd><span style="color: #000000">Mime Type: declares the mime type of the target resource. </span></dd>
<dt><code><span style="color: #000000">[]</span></code></dt>
<dd><span style="color: #000000">specifies a character class, in which any character within the brackets will be a match. e.g., [xyz] will match either an x, y, or z. </span></dd>
<dt><code><span style="color: #000000">[]+</span></code></dt>
<dd><span style="color: #000000">character class in which any combination of items within the brackets will be a match. e.g., [xyz]+ will match any number of x’s, y’s, z’s, or any combination of these characters. </span></dd>
<dt><code><span style="color: #000000">[^]</span></code></dt>
<dd><span style="color: #000000">specifies <em>not</em> within a character class. e.g., [^xyz] will match any character that is neither x, y, nor z. </span></dd>
<dt><code><span style="color: #000000">[a-z]</span></code></dt>
<dd><span style="color: #000000">a dash (-) between two characters within a character class ([]) denotes the range of characters between them. e.g., [a-zA-Z] matches all lowercase and uppercase letters from a to z. </span></dd>
<dt><code><span style="color: #000000">a{n}</span></code></dt>
<dd><span style="color: #000000">specifies an exact number, <code>n</code>, of the preceding character. e.g., x{3} matches exactly three<code>x</code>’s. </span></dd>
<dt><code><span style="color: #000000">a{n,}</span></code></dt>
<dd><span style="color: #000000">specifies <code>n</code> or more of the preceding character. e.g., x{3,} matches three or more <code>x</code>’s. </span></dd>
<dt><code><span style="color: #000000">a{n,m}</span></code></dt>
<dd><span style="color: #000000">specifies a range of numbers, between <code>n</code> and <code>m</code>, of the preceding character. e.g., x{3,7} matches three, four, five, six, or seven <code>x</code>’s. </span></dd>
<dt><code><span style="color: #000000">()</span></code></dt>
<dd><span style="color: #000000">used to group characters together, thereby considering them as a single unit. e.g., (perishable)?press will match press, with or without the perishable prefix. </span></dd>
<dt><code><span style="color: #000000">^</span></code></dt>
<dd><span style="color: #000000">denotes the beginning of a regex (regex = regular expression) test string. i.e., begin argument with the proceeding character. </span></dd>
<dt><code><span style="color: #000000">$</span></code></dt>
<dd><span style="color: #000000">denotes the end of a regex (regex = regular expression) test string. i.e., end argument with the previous character. </span></dd>
<dt><code><span style="color: #000000">?</span></code></dt>
<dd><span style="color: #000000">declares as optional the preceding character. e.g., <code>monzas?</code> will match monza or monzas, while <code>mon(za)?</code> will match either mon or monza. i.e., <code>x?</code> matches zero or one of <code>x</code>. </span></dd>
<dt><code><span style="color: #000000">!</span></code></dt>
<dd><span style="color: #000000">declares negation. e.g., “<code>!string</code>” matches everything except “<code>string</code>”. </span></dd>
<dt><code><span style="color: #000000">.</span></code></dt>
<dd><span style="color: #000000">a dot (or period) indicates any single arbitrary character. </span></dd>
<dt><code><span style="color: #000000">-</span></code></dt>
<dd><span style="color: #000000">instructs “not to” rewrite the URL, as in “<code>...domain.com.* - [F]</code>”. </span></dd>
<dt><code><span style="color: #000000">+</span></code></dt>
<dd><span style="color: #000000">matches one or more of the preceding character. e.g., <code>G+</code> matches one or more G’s, while &#8220;+&#8221; will match one or more characters of any kind. </span></dd>
<dt><code><span style="color: #000000">*</span></code></dt>
<dd><span style="color: #000000">matches zero or more of the preceding character. e.g., use “<code>.*</code>” as a wildcard. </span></dd>
<dt><code><span style="color: #000000">|</span></code></dt>
<dd><span style="color: #000000">declares a logical “or” operator. for example, <code>(x|y)</code> matches <code>x</code> or <code>y</code>. </span></dd>
<dt><code><span style="color: #000000">\</span></code></dt>
<dd><span style="color: #000000">escapes special characters ( <code>^ $ ! . * |</code> ). e.g., use “<code>\.</code>” to indicate/escape a literal dot. </span></dd>
<dt><code><span style="color: #000000">\.</span></code></dt>
<dd><span style="color: #000000">indicates a literal dot (escaped). </span></dd>
<dt><code><span style="color: #000000">/*</span></code></dt>
<dd><span style="color: #000000">zero or more slashes. </span></dd>
<dt><code><span style="color: #000000">.*</span></code></dt>
<dd><span style="color: #000000">zero or more arbitrary characters. </span></dd>
<dt><code><span style="color: #000000">^$</span></code></dt>
<dd><span style="color: #000000">defines an empty string. </span></dd>
<dt><code><span style="color: #000000">^.*$</span></code></dt>
<dd><span style="color: #000000">the standard pattern for matching everything. </span></dd>
<dt><code><span style="color: #000000">[^/.]</span></code></dt>
<dd><span style="color: #000000">defines one character that is neither a slash nor a dot. </span></dd>
<dt><code><span style="color: #000000">[^/.]+</span></code></dt>
<dd><span style="color: #000000">defines any number of characters which contains neither slash nor dot. </span></dd>
<dt><code><span style="color: #000000">http://</span></code></dt>
<dd><span style="color: #000000">this is a literal statement — in this case, the literal character string, “http://”. </span></dd>
<dt><code><span style="color: #000000">^domain.*</span></code></dt>
<dd><span style="color: #000000">defines a string that begins with the term “<code>domain</code>”, which then may be proceeded by any number of any characters. </span></dd>
<dt><code><span style="color: #000000">^domain\.com$</span></code></dt>
<dd><span style="color: #000000">defines the exact string “<code>domain.com</code>”. </span></dd>
<dt><code><span style="color: #000000">-d</span></code></dt>
<dd><span style="color: #000000">tests if string is an existing directory </span></dd>
<dt><code><span style="color: #000000">-f</span></code></dt>
<dd><span style="color: #000000">tests if string is an existing file </span></dd>
<dt><code><span style="color: #000000">-s</span></code></dt>
<dd><span style="color: #000000">tests if file in test string has a non-zero value </span></dd>
</dl>
<h4 id="gen6"><span style="color: #000000">Redirection Header Codes <a href="#top">^</a></span></h4>
<ul style="margin-top: 25px;margin-right: 0px;margin-bottom: 25px;margin-left: 0px;line-height: 18px;padding: 0px"> <span style="color: #000000"></p>
<li>301 &#8211; Moved Permanently</li>
<li>302 &#8211; Moved Temporarily</li>
<li>403 &#8211; Forbidden</li>
<li>404 &#8211; Not Found</li>
<li>410 &#8211; Gone</li>
<p></span></ul>
<h3 id="essentials"><span style="color: #000000">ESSENTIALS [ <a href="#top">^</a> ]</span></h3>
<h4 id="ess1"><span style="color: #000000">Commenting your htaccess Files <a href="#top">^</a></span></h4>
<p><span style="color: #000000">It is an excellent idea to consistenly and logically comment your htaccess files. Any line in an htaccess file that begins with the pound sign ( # ) tells the server to ignore it. Multiple lines require multiple pounds and use letters/numbers/dash/underscore only:</span></p>
<p><code><span style="color: #000000"># this is a comment</span></code><span style="color: #000000"><br />
<code># each line must have its own pound sign</code><br />
<code># use only alphanumeric characters along with dashes - and underscores _</code></span></p>
<h4 id="ess2"><span style="color: #000000">Enable Basic Rewriting <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Certain servers may not have “<code>mod_rewrite</code>” enabled by default. To ensure <code>mod_rewrite</code>(basic rewriting) is enabled throughout your site, add the following line once to your site’s root htaccess file:</span></p>
<p><code><span style="color: #000000"># enable basic rewriting</span></code><span style="color: #000000"><br />
<code>RewriteEngine on</code></span></p>
<h4 id="ess3"><span style="color: #000000">Enable Symbolic Links <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Enable symbolic links (symlinks) by adding the following directive to the target directory’s htaccess file. Note: for the <code>FollowSymLinks</code> directive to function, <code>AllowOverride Options</code>privileges must be enabled from within the server configuration file (<a href="#ess4">see proceeding paragraph for more information</a>):</span></p>
<p><code><span style="color: #000000"># enable symbolic links</span></code><span style="color: #000000"><br />
<code>Options +FollowSymLinks</code></span></p>
<h4 id="ess4"><span style="color: #000000">Enable AllowOverride <a href="#top">^</a></span></h4>
<p><span style="color: #000000">For directives that require <code>AllowOverride</code> in order to function, such as <code>FollowSymLinks</code> (see above paragraph), the following directive must be added to the server configuration file. For performance considerations, it is important to only enable <code>AllowOverride</code> in the specific directory or directories in which it is required. In the following code chunk, we are enabling the<code>AllowOverride</code> privs only in the specified directory (/www/replace/this/with/actual/directory). Refer to <a href="#per1">this section</a> for more information about <code>AllowOverride</code> and performance enhancement:</span></p>
<p><code><span style="color: #000000"># enable allowoverride privileges</span></code><span style="color: #000000"><br />
<code>&lt;Directory /www/replace/this/with/actual/directory&gt;</code><br />
<code>AllowOverride Options</code><br />
<code>&lt;/Directory&gt;</code></span></p>
<h4 id="ess5"><span style="color: #000000">Rename the htaccess File <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Not every system enjoys the extension-only format of htaccess files. Fortunately, you can rename them to whatever you wish, granted the name is valid on your system. Note: This directive must be placed in the server-wide configuration file or it will not work:</span></p>
<p><code><span style="color: #000000"># rename htaccess files</span></code><span style="color: #000000"><br />
<code>AccessFileName ht.access</code></span></p>
<p><span style="color: #000000">Note: If you rename your htaccess files, remember to update any associated configuration settings. For example, if you are protecting your htaccess file via <code>FilesMatch</code>, remember to inform it of the renamed files:</span></p>
<p><code><span style="color: #000000"># protect renamed htaccess files</span></code><span style="color: #000000"><br />
<code>&lt;FilesMatch "^ht\."&gt;</code><br />
<code>Order deny,allow</code><br />
<code>Deny from all</code><br />
<code>&lt;/FilesMatch&gt;</code></span></p>
<h4 id="ess6"><span style="color: #000000">Retain Rules Defined in httpd.conf <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Save yourself time and effort by defining replicate rules for multiple virtual hosts once and only once via your httpd.conf file. Then, simply instruct your target htaccess file(s) to inherit the httpd.conf rules by including this directive:</span></p>
<p><code><span style="color: #000000">RewriteOptions Inherit</span></code></p>
<h3 id="performance"><span style="color: #000000">PERFORMANCE [ <a href="#top">^</a> ]</span></h3>
<h4 id="per1"><span style="color: #000000">Improving Performance via AllowOverride <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Limit the extent to which htaccess files decrease performance by enabling <code>AllowOverride</code> only in required directories. For example, if <code>AllowOverride</code> is enabled throughout the entire site, the server must dig through every directory, searching for htaccess files that may not even exist. To prevent this, we disable the <code>AllowOverride</code> in the site’s root htaccess file and then enable<code>AllowOverride</code> only in required directories via the server config file (refer to <a href="#ess4">this section</a> for more information). Note: if you do not have access to your site’s server config file and also need <code>AllowOverride</code> privileges, do not use this directive:</span></p>
<p><code><span style="color: #000000"># increase performance by disabling allowoverride</span></code><span style="color: #000000"><br />
<code>AllowOverride None</code></span></p>
<h4 id="per2"><span style="color: #000000">Improving Performance by Passing the Character Set <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Prevent certain 500 error displays by passing the default character set parameter before you get there. Note: replace the “utf-8” below with the charset that your site is using:</span></p>
<p><code><span style="color: #000000"># pass the default character set</span></code><span style="color: #000000"><br />
<code>AddDefaultCharset utf-8</code></span></p>
<h4 id="per3"><span style="color: #000000">Improving Performance by Preserving Bandwidth <a href="#top">^</a></span></h4>
<p><span style="color: #000000">To increase performance on PHP enabled servers, add the following directive:</span></p>
<p><code><span style="color: #000000"># preserve bandwidth for PHP enabled servers</span></code><span style="color: #000000"><br />
<code>&lt;ifmodule mod_php4.c&gt;</code><br />
<code>php_value zlib.output_compression 16386</code><br />
<code>&lt;/ifmodule&gt;</code></span></p>
<h4 id="per4"><span style="color: #000000">Disable the Server Signature <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Here we are disabling the digital signature that would otherwise identify the server:</span></p>
<p><code><span style="color: #000000"># disable the server signature</span></code><span style="color: #000000"><br />
<code>ServerSignature Off</code></span></p>
<h4 id="per5"><span style="color: #000000">Set the Server Timezone <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Here we are instructing the server to synchronize chronologically according to the time zone of some specified state:</span></p>
<p><code><span style="color: #000000"># set the server timezone</span></code><span style="color: #000000"><br />
<code>SetEnv TZ America/Washington</code></span></p>
<h4 id="per6"><span style="color: #000000">Set the Email Address for the Server Administrator <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Here we are specifying the default email address for the server administrator:</span></p>
<p><code><span style="color: #000000"># set the server administrator email</span></code><span style="color: #000000"><br />
<code>SetEnv SERVER_ADMIN default@domain.com</code></span></p>
<h4 id="per7"><span style="color: #000000">Improve Site Transfer Speed by Enabling File Caching <a href="#top">^</a></span></h4>
<p><span style="color: #000000">The htaccess genius over at askapache.com explains how to dramatically improve your site’s transfer speed by enabling file caching <sup>3</sup>. Using time in seconds* to indicate the duration for which cached content should endure, we may generalize the htaccess rules as such (edit file types and time value to suit your needs):</span></p>
<p><code><span style="color: #000000"># cache images and flash content for one month</span></code><span style="color: #000000"><br />
<code>&lt;FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf)$"&gt;</code><br />
<code>Header set Cache-Control "max-age=2592000"</code><br />
<code>&lt;/FilesMatch&gt;</code></span></p>
<p><code><span style="color: #000000"># cache text, css, and javascript files for one week</span></code><span style="color: #000000"><br />
<code>&lt;FilesMatch ".(js|css|pdf|txt)$"&gt;</code><br />
<code>Header set Cache-Control "max-age=604800"</code><br />
<code>&lt;/FilesMatch&gt;</code></span></p>
<p><code><span style="color: #000000"># cache html and htm files for one day</span></code><span style="color: #000000"><br />
<code>&lt;FilesMatch ".(html|htm)$"&gt;</code><br />
<code>Header set Cache-Control "max-age=43200"</code><br />
<code>&lt;/FilesMatch&gt;</code></span></p>
<p><code><span style="color: #000000"># implement minimal caching during site development</span></code><span style="color: #000000"><br />
<code>&lt;FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|js|css|pdf|swf|html|htm|txt)$"&gt;</code><br />
<code>Header set Cache-Control "max-age=5"</code><br />
<code>&lt;/FilesMatch&gt;</code></span></p>
<p><code><span style="color: #000000"># explicitly disable caching for scripts and other dynamic files</span></code><span style="color: #000000"><br />
<code>&lt;FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$"&gt;</code><br />
<code>Header unset Cache-Control</code><br />
<code>&lt;/FilesMatch&gt;</code></span></p>
<p><code><span style="color: #000000"># alternate method for file caching</span></code><span style="color: #000000"><br />
<code>ExpiresActive On</code><br />
<code>ExpiresDefault A604800 # 1 week</code><br />
<code>ExpiresByType image/x-icon A2419200 # 1 month</code><br />
<code>ExpiresByType application/x-javascript A2419200 # 1 month</code><br />
<code>ExpiresByType text/css A2419200 # 1 month</code><br />
<code>ExpiresByType text/html A300 # 5 minutes</code><br />
<code># disable caching for scripts and other dynamic files</code><br />
<code>&lt;FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$"&gt;</code><br />
<code>ExpiresActive Off</code><br />
<code>&lt;/FilesMatch&gt;</code></span></p>
<ul style="margin-top: 25px;margin-right: 0px;margin-bottom: 25px;margin-left: 0px;line-height: 18px;padding: 0px"> <span style="color: #000000"></p>
<li>* <strong>Convert common time intervals into seconds:</strong></li>
<li>300 = 5 minutes</li>
<li>2700 = 45 minutes</li>
<li>3600 = 1 hour</li>
<li>54000 = 15 hours</li>
<li>86400 = 1 day</li>
<li>518400 = 6 days</li>
<li>604800 = 1 week</li>
<li>1814400 = 3 weeks</li>
<li>2419200 = 1 month</li>
<li>26611200 = 11 months</li>
<li>29030400 = 1 year = never expires</li>
<p></span></ul>
<h4 id="per8"><span style="color: #000000">Set the default language and character set <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Here is an easy way to set the default language for pages served by your server (edit the language to suit your needs):</span></p>
<p><code><span style="color: #000000"># set the default language</span></code><span style="color: #000000"><br />
<code>DefaultLanguage en-US</code></span></p>
<p><span style="color: #000000">Likewise, here we are setting the default character set (edit to taste):</span></p>
<p><code><span style="color: #000000"># set the default character set</span></code><span style="color: #000000"><br />
<code>AddDefaultCharset UTF-8</code></span></p>
<h4 id="per9"><span style="color: #000000">Declare specific/additional MIME types <a href="#top">^</a></span></h4>
<p><code><span style="color: #000000"># add various mime types</span></code><span style="color: #000000"><br />
<code>AddType application/x-shockwave-flash .swf</code><br />
<code>AddType video/x-flv .flv</code><br />
<code>AddType image/x-icon .ico</code></span></p>
<h4 id="per10"><span style="color: #000000">Send character set and other headers without meta tags <a href="#top">^</a></span></h4>
<p><code><span style="color: #000000"># send the language tag and default character set</span></code><span style="color: #000000"><br />
<code># AddType 'text/html; charset=UTF-8' html</code><br />
<code>AddDefaultCharset UTF-8</code><br />
<code>DefaultLanguage en-US</code></span></p>
<h4 id="per11"><span style="color: #000000">Limit server request methods to GET and PUT <a href="#top">^</a></span></h4>
<p><code><span style="color: #000000"># limit server request methods to GET and PUT</span></code><span style="color: #000000"><br />
<code>Options -ExecCGI -Indexes -All</code><br />
<code>RewriteEngine on</code><br />
<code>RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD) RewriteRule .* - [F]</code></span></p>
<h4 id="per12"><span style="color: #000000">Selectively process files according to server request method <a href="#top">^</a></span></h4>
<p><code><span style="color: #000000"># process files according to server request method</span></code><span style="color: #000000"><br />
<code>Script PUT /cgi-bin/upload.cgi</code><br />
<code>Script GET /cgi-bin/download.cgi</code></span></p>
<h4 id="per13"><span style="color: #000000">Execute various file types through a cgi script <a href="#top">^</a></span></h4>
<p><span style="color: #000000">For those special occasions where certain file types need to be processed with some specific cgi script, let em know who sent ya:</span></p>
<p><code><span style="color: #000000"># execute all png files via png-script.cgi</span></code><span style="color: #000000"><br />
<code>Action image/png /cgi-bin/png-script.cgi</code></span></p>
<h3 id="security"><span style="color: #000000">SECURITY [ <a href="#top">^</a> ]</span></h3>
<h4 id="sec1"><span style="color: #000000">Prevent Access to .htaccess <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Add the following code block to your htaccess file to add an extra layer of security. Any attempts to access the htaccess file will result in a 403 error message. Of course, your first layer of defense to protect htaccess files involves setting htaccess file permissions via CHMOD to 644:</span></p>
<p><code><span style="color: #000000"># secure htaccess file</span></code><span style="color: #000000"><br />
<code>&lt;Files .</code><code>htaccess&gt;</code><br />
<code>order allow,deny</code><br />
<code>deny from all</code><br />
<code>&lt;/Files&gt;</code></span></p>
<h4 id="sec2"><span style="color: #000000">Prevent Acess to a Specific File <a href="#top">^</a></span></h4>
<p><span style="color: #000000">To restrict access to a specific file, add the following code block and edit the file name, “secretfile.jpg”, with the name of the file that you wish to protect:</span></p>
<p><code><span style="color: #000000"># prevent viewing of a specific file</span></code><span style="color: #000000"><br />
<code>&lt;files secretfile.jpg&gt;</code><br />
<code>order allow,deny</code><br />
<code>deny from all</code><br />
<code>&lt;/files&gt;</code></span></p>
<h4 id="sec2a"><span style="color: #000000">Prevent acess to multiple file types <a href="#top">^</a></span></h4>
<p><span style="color: #000000">To restrict access to a variety of file types, add the following code block and edit the file types within parentheses to match the extensions of any files that you wish to protect:</span></p>
<p><code><span style="color: #000000">&lt;FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$"&gt;</span></code><span style="color: #000000"><br />
<code>Order Allow,Deny</code><br />
<code>Deny from all</code><br />
<code>&lt;/FilesMatch&gt;</code></span></p>
<h4 id="sec3"><span style="color: #000000">Prevent Unauthorized Directory Browsing <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Prevent unauthorized directory browsing by instructing the server to serve a “xxx Forbidden &#8211; Authorization Required” message for any request to view a directory. For example, if your site is missing it’s default index page, everything within the root of your site will be accessible to all visitors. To prevent this, include the following htaccess rule:</span></p>
<p><code><span style="color: #000000"># disable directory browsing</span></code><span style="color: #000000"><br />
<code>Options All -Indexes</code></span></p>
<p><span style="color: #000000">Conversely, to enable directory browsing, use the following directive:</span></p>
<p><code><span style="color: #000000"># enable directory browsing</span></code><span style="color: #000000"><br />
<code>Options All +Indexes</code></span></p>
<p><span style="color: #000000">Likewise, this rule will prevent the server from listing directory contents:</span></p>
<p><code><span style="color: #000000"># prevent folder listing</span></code><span style="color: #000000"><br />
<code>IndexIgnore *</code></span></p>
<p><span style="color: #000000">And, finally, the <code>IndexIgnore</code> directive may be used to prevent the display of select file types:</span></p>
<p><code><span style="color: #000000"># prevent display of select file types</span></code><span style="color: #000000"><br />
<code>IndexIgnore *.wmv *.mp4 *.avi *.etc</code></span></p>
<h4 id="sec4"><span style="color: #000000">Change Default Index Page <a href="#top">^</a></span></h4>
<p><span style="color: #000000">This rule tells the server to search for and serve “business.html” as the default directory index. This rule must exist in the htaccess files of the root directory for which you wish to replace the default index file (e.g., “index.html”):</span></p>
<p><code><span style="color: #000000"># serve alternate default index page</span></code><span style="color: #000000"><br />
<code>DirectoryIndex business.html</code></span></p>
<p><span style="color: #000000">This rule is similar, only in this case, the server will scan the root directory for the listed files and serve the first match it encounters. The list is read from left to right:</span></p>
<p><code><span style="color: #000000"># serve first available alternate default index page from series</span></code><span style="color: #000000"><br />
<code>DirectoryIndex filename.html index.cgi index.pl default.htm</code></span></p>
<h4 id="sec5"><span style="color: #000000">Disguise Script Extensions <a href="#top">^</a></span></h4>
<p><span style="color: #000000">To enhance security, disguise scripting languages by replacing actual script extensions with dummy extensions of your choosing. For example, to change the “<code>.foo</code>” extension to “<code>.php</code>”, add the following line to your htaccess file and rename all affected files accordingly:</span></p>
<p><code><span style="color: #000000"># serve foo files as php files</span></code><span style="color: #000000"><br />
<code>AddType application/x-httpd-php .foo</code></span></p>
<p><code><span style="color: #000000"># serve foo files as cgi files</span></code><span style="color: #000000"><br />
<code>AddType application/x-httpd-cgi .foo</code></span></p>
<h4 id="sec6"><span style="color: #000000">Limit Access to the Local Area Network (LAN) <a href="#top">^</a></span></h4>
<p><code><span style="color: #000000"># limit access to local area network</span></code><span style="color: #000000"><br />
<code>&lt;Limit GET POST PUT&gt;</code><br />
<code>order deny,allow</code><br />
<code>deny from all</code><br />
<code>allow from 192.168.0.0/33</code><br />
<code>&lt;/Limit&gt;</code></span></p>
<h4 id="sec7"><span style="color: #000000">Secure Directories by IP Address and/or Domain <a href="#top">^</a></span></h4>
<p><span style="color: #000000">In the following example, all IP addresses are <em>allowed access</em> except for 12.345.67.890 and domain.com:</span></p>
<p><code><span style="color: #000000"># allow all except those indicated here</span></code><span style="color: #000000"><br />
<code>&lt;Limit GET POST PUT&gt;</code><br />
<code>order allow,deny</code><br />
<code>allow from all</code><br />
<code>deny from 12.345.67.890</code><br />
<code>deny from .*domain\.com.*</code><br />
<code>&lt;/Limit&gt;</code></span></p>
<p><span style="color: #000000">In the following example, all IP addresses are <em>denied access</em> except for 12.345.67.890 and domain.com:</span></p>
<p><code><span style="color: #000000"># deny all except those indicated here</span></code><span style="color: #000000"><br />
<code>&lt;Limit GET POST PUT&gt;</code><br />
<code>order deny,allow</code><br />
<code>deny from all</code><br />
<code>allow from 12.345.67.890</code><br />
<code>allow from .*domain\.com.*</code><br />
<code>&lt;/Limit&gt;</code></span></p>
<p><span style="color: #000000">This is how to block unwanted visitors based on the referring domain. You can also save bandwidth by <a href="#types">blocking specific file types</a> — such as <code>.jpg, .zip, .mp3, .mpg</code> — from specific referring domains. Simply replace “scumbag” and “wormhole” with the offending domains of your choice:</span></p>
<p><code><span style="color: #000000"># block visitors referred from indicated domains</span></code><span style="color: #000000"><br />
<code>&lt;IfModule mod_rewrite.c&gt;</code><br />
<code>RewriteEngine on</code><br />
<code>RewriteCond %{HTTP_REFERER} scumbag\.com [NC,OR]</code><br />
<code>RewriteCond %{HTTP_REFERER} wormhole\.com [NC,OR]</code><br />
<code>RewriteRule .* - [F]</code><br />
<code>&lt;/ifModule&gt;</code></span></p>
<h4 id="sec7a"><span style="color: #000000">Prevent or allow domain access for a specified range of IP addresses <a href="#top">^</a></span></h4>
<p><span style="color: #000000">There are several effective ways to block a range of IP addresses via htaccess. This first method blocks an IP range specified by their <acronym title="Classless Inter-Domain Routing">CIDR</acronym> (Classless Inter-Domain Routing) number. This method is useful for blocking mega-spammers such as RIPE, Optinet, and others. If, for example, you find yourself adding line after line of Apache <code>deny</code> directives for addresses beginning with the same first few numbers, choose one of them and try a <a title="whois lookup" href="http://www.whois.net/">whois lookup</a>. Listed within the whois results will be the CIDR value representing every IP address associated with that particular network. Thus, blocking via CIDR is an effective way to eloquently prevent all IP instances of the offender from accessing your site. Here is a generalized example for blocking by CIDR (edit values to suit your needs):</span></p>
<p><code><span style="color: #000000"># block IP range by CIDR number</span></code><span style="color: #000000"><br />
<code>&lt;Limit GET POST PUT&gt;</code><br />
<code>order allow,deny</code><br />
<code>allow from all</code><br />
<code>deny from 10.1.0.0/16</code><br />
<code>deny from 80.0.0/8</code><br />
<code>&lt;/Limit&gt;</code></span></p>
<p><span style="color: #000000">Likewise, to allow an IP range by CIDR number:</span></p>
<p><code><span style="color: #000000"># allow IP range by CIDR number</span></code><span style="color: #000000"><br />
<code>&lt;Limit GET POST PUT&gt;</code><br />
<code>order deny,allow</code><br />
<code>deny from all</code><br />
<code>allow from 10.1.0.0/16</code><br />
<code>allow from 80.0.0/8</code><br />
<code>&lt;/Limit&gt;</code></span></p>
<p><span style="color: #000000">Another effective way to block an entire range of IP addresses involves truncating digits until the desired range is represented. As an IP address is read from left to right, its value represents an increasingly specific address. For example, a fictitious IP address of 99.88.77.66 would designate some uniquely specific IP address. Now, if we remove the last two digits (66) from the address, it would represent <em>any</em> address beginning with the remaining digits. That is, 99.88.77 represents 99.88.77.1, 99.88.77.2, … 99.88.77.99, …etc. Likewise, if we then remove another pair of digits from the address, its range suddenly widens to represent every IP address 99.88.x.y, where x and y represent any valid set of IP address values (i.e., you would block 256*256 = 65,536 unique IP addresses). Following this logic, it is possible to block an entire range of IP addresses to varying degrees of specificity. Here are few generalized lines exemplifying proper htaccess syntax (edit values to suit your needs):</span></p>
<p><code><span style="color: #000000"># block IP range by address truncation</span></code><span style="color: #000000"><br />
<code>&lt;Limit GET POST PUT&gt;</code><br />
<code>order allow,deny</code><br />
<code>allow from all</code><br />
<code>deny from 99.88.77.66</code><br />
<code>deny from 99.88.77.*</code><br />
<code>deny from 99.88.*.*</code><br />
<code>deny from 99.*.*.*</code><br />
<code>&lt;/Limit&gt;</code></span></p>
<p><span style="color: #000000">Likewise, to allow an IP range by address truncation:</span></p>
<p><code><span style="color: #000000"># allow IP range by address truncation</span></code><span style="color: #000000"><br />
<code>&lt;Limit GET POST PUT&gt;</code><br />
<code>order deny,allow</code><br />
<code>deny from all</code><br />
<code>allow from 99.88.77.66</code><br />
<code>allow from 99.88.77.*</code><br />
<code>allow from 99.88.*.*</code><br />
<code>allow from 99.*.*.*</code><br />
<code>&lt;/Limit&gt;</code></span></p>
<h4 id="sec7b"><span style="color: #000000">Block or allow multiple IP addresses on one line <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Save a little space by blocking multiple IP addresses or ranges on one line. Here are few examples (edit values to suit your needs):</span></p>
<p><code><span style="color: #000000"># block two unique IP addresses</span></code><span style="color: #000000"><br />
<code>deny from 99.88.77.66 11.22.33.44</code><br />
<code># block three ranges of IP addresses</code><br />
<code>deny from 99.88 99.88.77 11.22.33</code></span></p>
<p><span style="color: #000000">Likewise, to allow multiple IP addresses or ranges on one line:</span></p>
<p><code><span style="color: #000000"># allow two unique IP addresses</span></code><span style="color: #000000"><br />
<code>allow from 99.88.77.66 11.22.33.44</code><br />
<code># allow three ranges of IP addresses</code><br />
<code>allow from 99.88 99.88.77 11.22.33</code></span></p>
<h4 id="sec7c"><span style="color: #000000">Miscellaneous rules for blocking and allowing IP addresses <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Here are few miscellaneous rules for blocking various types of IP addresses. These rules may be adapted to <em>allow</em> the specified IP values by simply changing the <code>deny</code> directive to <code>allow</code>. Check ’em out (edit values to suit your needs):</span></p>
<p><code><span style="color: #000000"># block a partial domain via network/netmask values</span></code><span style="color: #000000"><br />
<code>deny from 99.1.0.0/255.255.0.0</code></span></p>
<p><code><span style="color: #000000"># block a single domain</span></code><span style="color: #000000"><br />
<code>deny from 99.88.77.66</code></span></p>
<p><code><span style="color: #000000"># block domain.com but allow sub.domain.com</span></code><span style="color: #000000"><br />
<code>order deny,allow</code><br />
<code>deny from domain.com</code><br />
<code>allow from sub.domain.com</code></span></p>
<h4 id="sec8"><span style="color: #000000">Stop Hotlinking, Serve Alternate Content <a href="#top">^</a></span></h4>
<p><span style="color: #000000">To serve ‘em some unexpected alternate content when hotlinking is detected, employ the following code, which will protect all files of the types included in the last line (add more types as needed). Remember to replace the dummy path names with real ones. Also, the name of the nasty image being served in this case is “eatme.jpe”, as indicated in the line containing the<code>RewriteRule</code>. Please advise that this method will also block services such as FeedBurner from accessing your images.</span></p>
<p><code><span style="color: #000000"># stop hotlinking and serve alternate content</span></code><span style="color: #000000"><br />
<code>&lt;IfModule mod_rewrite.c&gt;</code><br />
<code>RewriteEngine on</code><br />
<code>RewriteCond %{HTTP_REFERER} !^$</code><br />
<code>RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain\.com/.*$ [NC]</code><br />
<code>RewriteRule .*\.(gif|jpg)$ http://www.domain.com/eatme.jpe [R,NC,L]</code><br />
<code>&lt;/ifModule&gt;</code></span></p>
<p><span style="color: #000000">Note: To deliver a standard (or custom, if configured) error page instead of some nasty image of the Fonz, replace the line containing the <code>RewriteRule</code> in the above htaccess directive with the following line:</span></p>
<p><code><span style="color: #000000"># serve a standard 403 forbidden error page</span></code><span style="color: #000000"><br />
<code>RewriteRule .*\.(gif|jpg)$ - [F,L]</code></span></p>
<p><span style="color: #000000">Note: To grant linking permission to a site other than yours, insert this code block after the line containing the “domain.com” string. Remember to replace “goodsite.com” with the actual site domain:</span></p>
<p><code><span style="color: #000000"># allow linking from the following site</span></code><span style="color: #000000"><br />
<code>RewriteCond %{HTTP_REFERER} !^http://(www\.)?goodsite\.com/.*$ [NC]</code></span></p>
<h4 id="sec9"><span style="color: #000000">Block Evil Robots, Site Rippers, and Offline Browsers <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Eliminate some of the unwanted scum from your userspace by injecting this handy block of code. After such, any listed agents will be denied access and receive an error message instead. Please advise that there are much more comprehensive lists available this example has been truncated for business purposes. Note: DO NOT include the “[OR]” on the very last <code>RewriteCond</code>or your server will crash, delivering “500 Errors” to all page requests.</span></p>
<p><code><span style="color: #000000"># deny access to evil robots site rippers offline browsers and other nasty scum</span></code><span style="color: #000000"><br />
<code>RewriteBase /</code><br />
<code>RewriteCond %{HTTP_USER_AGENT} ^Anarchie [OR]</code><br />
<code>RewriteCond %{HTTP_USER_AGENT} ^ASPSeek [OR]</code><br />
<code>RewriteCond %{HTTP_USER_AGENT} ^attach [OR]</code><br />
<code>RewriteCond %{HTTP_USER_AGENT} ^autoemailspider [OR]</code><br />
<code>RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]</code><br />
<code>RewriteCond %{HTTP_USER_AGENT} ^Xenu [OR]</code><br />
<code>RewriteCond %{HTTP_USER_AGENT} ^Zeus.*Webster [OR]</code><br />
<code>RewriteCond %{HTTP_USER_AGENT} ^Zeus</code><br />
<code>RewriteRule ^.* - [F,L]</code></span></p>
<p><span style="color: #000000">Or, instead of delivering a friendly error message (i.e., the last line), send these bad boys to the hellish website of your choice by replacing the <code>RewriteRule</code> in the last line with one of the following two examples:</span></p>
<p><code><span style="color: #000000"># send em to a hellish website of your choice</span></code><span style="color: #000000"><br />
<code>RewriteRule ^.*$ http://www.hellish-website.com [R,L]</code></span></p>
<p><span style="color: #000000">Or, to send em to a virtual blackhole of fake email addresses:</span></p>
<p><code><span style="color: #000000"># send em to a virtual blackhole of fake email addresses</span></code><span style="color: #000000"><br />
<code>RewriteRule ^.*$ http://english-61925045732.spampoison.com [R,L]</code></span></p>
<p><span style="color: #000000">You may also include specific referrers to your blacklist by using <code>HTTP_REFERER</code>. Here, we use the infamously scummy domain, “iaea.org” as our blocked example, and we use “yourdomain” as your domain (the domain to which you are blocking iaea.org):</span></p>
<p><code><span style="color: #000000">RewriteCond %{HTTP_REFERER} ^http://www.iaea.org$</span></code><span style="color: #000000"><br />
<code>RewriteRule !^http://[^/.]\.yourdomain\.com.* - [F,L]</code></span></p>
<h4 id="sec10"><span style="color: #000000">More Stupid Blocking Tricks <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Note: Although these redirect techniques are aimed at blocking and redirecting nasty scumsites, the directives may also be employed for friendly redirection purposes:</span></p>
<p><code><span style="color: #000000"># redirect any request for anything from spamsite to differentspamsite</span></code><span style="color: #000000"><br />
<code>RewriteCond %{HTTP_REFERER} ^http://.*spamsite.*$ [NC]</code><br />
<code>RewriteRule .* http://www.differentspamsite.com [R]</code></span></p>
<p><code><span style="color: #000000"># redirect all requests from spamsite to an image of something at differentspamsite</span></code><span style="color: #000000"><br />
<code>RewriteCond %{HTTP_REFERER} ^http://.*spamsite.*$ [NC]</code><br />
<code>RewriteRule .* http://www.differentspamsite/something.jpg [R]</code></span></p>
<p><code><span style="color: #000000"># redirect traffic from a certain address or range of addresses to another site</span></code><span style="color: #000000"><br />
<code>RewriteCond %{REMOTE_ADDR} 192.168.10.*</code><br />
<code>RewriteRule .* http://www.differentspamsite.com/index.html [R]</code></span></p>
<h4 id="sec11"><span style="color: #000000">Even More Scum-Blocking Tricks <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Here is a step-by-step series of code blocks that should equip you with enough knowledge to block any/all necessary entities. Read through the set of code blocks, observe the patterns, and then copy, combine and customize to suit your specific scum-blocking needs:</span></p>
<p><code><span style="color: #000000"># set variables for user agents and referers and ip addresses</span></code><span style="color: #000000"><br />
<code>SetEnvIfNoCase User-Agent ".*(user-agent-you-want-to-block|php/perl).*" BlockedAgent</code><br />
<code>SetEnvIfNoCase Referer ".*(block-this-referrer|and-this-referrer|and-this-referrer).*" BlockedReferer</code><br />
<code>SetEnvIfNoCase REMOTE_ADDR ".*(666.666.66.0|22.22.22.222|999.999.99.999).*" BlockedAddress</code></span></p>
<p><code><span style="color: #000000"># set variable for any class B network coming from a given netblock</span></code><span style="color: #000000"><br />
<code>SetEnvIfNoCase REMOTE_ADDR "66.154.*" BlockedAddress</code></span></p>
<p><code><span style="color: #000000"># set variable for two class B networks 198.25.0.0 and 198.26.0.0</span></code><span style="color: #000000"><br />
<code>SetEnvIfNoCase REMOTE_ADDR "198.2(5|6)\..*" BlockedAddress</code></span></p>
<p><code><span style="color: #000000"># deny any matches from above and send a 403 denied</span></code><span style="color: #000000"><br />
<code>&lt;Limit GET POST PUT&gt;</code><br />
<code>order deny,allow</code><br />
<code>deny from env=BlockedAgent</code><br />
<code>deny from env=BlockedReferer</code><br />
<code>deny from env=BlockedAddress</code><br />
<code>allow from all</code><br />
<code>&lt;/Limit&gt;</code></span></p>
<h4 id="sec12"><span style="color: #000000">Password-Protect Directories <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Here is an excellent online tool for generating the necessary elements for a password-protected directory:</span></p>
<p><code><span style="color: #000000"># password protect directories</span></code><span style="color: #000000"><br />
<a title="htaccess Password Generator" rel="nofollow" href="http://www.thejackol.com/scripts/htpasswdgen.php">htaccess Password Generator</a></span></p>
<h4 id="sec12a"><span style="color: #000000">Password-protect Files, Directories, and More.. <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Secure site contents by requiring user authentication for specified files and/or directories. The first example shows how to password-protect any single file type that is present beneath the directory which houses the htaccess rule. The second rule employs the <code>FilesMatch</code> directive to protect any/all files which match any of the specified character strings. The third rule demonstrates how to protect an entire directory. The fourth set of rules provides password-protection for all IP’s except those specified. Remember to edit these rules according to your specific needs.</span></p>
<p><code><span style="color: #000000"># password-protect single file</span></code><span style="color: #000000"><br />
<code>&lt;Files secure.php&gt;</code><br />
<code>AuthType Basic</code><br />
<code>AuthName "Prompt"</code><br />
<code>AuthUserFile /home/path/.</code><code>htpasswd</code><br />
<code>Require valid-user</code><br />
<code>&lt;/Files&gt;</code></span></p>
<p><code><span style="color: #000000"># password-protect multiple files</span></code><span style="color: #000000"><br />
<code>&lt;FilesMatch "^(execute|index|secure|insanity|biscuit)*$"&gt;</code><br />
<code>AuthType basic</code><br />
<code>AuthName "Development"</code><br />
<code>AuthUserFile /home/path/.</code><code>htpasswd</code><br />
<code>Require valid-user</code><br />
<code>&lt;/FilesMatch&gt;</code></span></p>
<p><code><span style="color: #000000"># password-protect the directory in which this htaccess rule resides</span></code><span style="color: #000000"><br />
<code>AuthType basic</code><br />
<code>AuthName "This directory is protected"</code><br />
<code>AuthUserFile /home/path/.</code><code>htpasswd</code><br />
<code>AuthGroupFile /dev/null</code><br />
<code>Require valid-user</code></span></p>
<p><code><span style="color: #000000"># password-protect directory for every IP except the one specified</span></code><span style="color: #000000"><br />
<code># place in htaccess file of a directory to protect that entire directory</code><br />
<code>AuthType Basic</code><br />
<code>AuthName "Personal"</code><br />
<code>AuthUserFile /home/path/.</code><code>htpasswd</code><br />
<code>Require valid-user</code><br />
<code>Allow from 99.88.77.66</code><br />
<code>Satisfy Any</code></span></p>
<h4 id="sec13"><span style="color: #000000">Require SSL (Secure Sockets Layer) <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Here is an excellent method for requiring SSL (via askapache.com <sup>3</sup>):</span></p>
<p><code><span style="color: #000000"># require SSL</span></code><span style="color: #000000"><br />
<code>SSLOptions +StrictRequire</code><br />
<code>SSLRequireSSL</code><br />
<code>SSLRequire %{HTTP_HOST} eq "domain.tld"</code><br />
<code>ErrorDocument 403 https://domain.tld</code></span></p>
<p><code><span style="color: #000000"># require SSL without mod_ssl</span></code><span style="color: #000000"><br />
<code>RewriteCond %{HTTPS} !=on [NC]</code><br />
<code>RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]</code></span></p>
<h4 id="sec14"><span style="color: #000000">Automatically CHMOD Various File Types <a href="#top">^</a></span></h4>
<p><span style="color: #000000">This method is great for ensuring the CHMOD settings for various file types. Employ the following rules in the root htaccess file to affect <em>all</em> specified file types, or place in a specific directory to affect only those files (edit file types according to your needs):</span></p>
<p><code><span style="color: #000000"># ensure CHMOD settings for specified file types</span></code><span style="color: #000000"><br />
<code># remember to never set CHMOD 777 unless you know what you are doing</code><br />
<code># files requiring write access should use CHMOD 766 rather than 777</code><br />
<code># keep specific file types private by setting their CHMOD to 400</code><br />
<code>chmod .</code><code>htpasswd files 640</code><br />
<code>chmod .</code><code>htaccess files 644</code><br />
<code>chmod php files 600</code></span></p>
<h4 id="sec15"><span style="color: #000000">Disguise all file extensions <a href="#top">^</a></span></h4>
<p><span style="color: #000000">This method will disguise all file types (i.e., any file extension) and present them as .<code>php</code> files (or whichever extension you choose):</span></p>
<p><code><span style="color: #000000"># diguise all file extensions as php</span></code><span style="color: #000000"><br />
<code>ForceType application/x-httpd-php</code></span></p>
<h4 id="sec16"><span style="color: #000000">Protect against denial-of-service (DOS) attacks by limiting file upload size <a href="#top">^</a></span></h4>
<p><span style="color: #000000">One method to help protect your server against DOS attacks involves limiting the maximum allowable size for file uploads. Here, we are limiting file upload size to 10240000 bytes, which is equivalent to around 10 megabytes. For this rule, file sizes are expressed in bytes. Check<a title="File Size Conversion Table" rel="nofollow" href="http://www.webopedia.com/quick_ref/FileSizeConversionTable.asp">here</a> for help with various file size conversions. Note: this code is only useful if you actually allow users to upload files to your site.</span></p>
<p><code><span style="color: #000000"># protect against DOS attacks by limiting file upload size</span></code><span style="color: #000000"><br />
<code>LimitRequestBody 10240000</code></span></p>
<h4 id="sec17"><span style="color: #000000">Secure directories by disabling execution of scripts <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Prevent malicious brainiacs from actively scripting secure directories by adding the following rules to the representative htaccess file (edit file types to suit your needs):</span></p>
<p><code><span style="color: #000000"># secure directory by disabling script execution</span></code><span style="color: #000000"><br />
<code>AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi</code><br />
<code>Options -ExecCGI</code></span></p>
<h3 id="usability"><span style="color: #000000">USABILITY TRICKS [ <a href="#top">^</a> ]</span></h3>
<h4 id="usa1"><span style="color: #000000">Minimize CSS Image Flicker in IE6 <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Add the following htaccess rules to minimize or even eliminate CSS background-image “flickering” in MSIE6:</span></p>
<p><code><span style="color: #000000"># minimize image flicker in IE6</span></code><span style="color: #000000"><br />
<code>ExpiresActive On</code><br />
<code>ExpiresByType image/gif A2592000</code><br />
<code>ExpiresByType image/jpg A2592000</code><br />
<code>ExpiresByType image/png A2592000</code></span></p>
<h4 id="usa2"><span style="color: #000000">Deploy Custom Error Pages <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Replicate the following patterns to serve your own set of custom error pages. Simply replace the “<code>/errors/###.html</code>” with the correct path and file name. Also change the “###” preceding the path to summon pages for other errors. Note: your custom error pages must be larger than 512 bytes in size or they will be completely ignored by Internet Explorer:</span></p>
<p><code><span style="color: #000000"># serve custom error pages</span></code><span style="color: #000000"><br />
<code>ErrorDocument 400 /errors/400.html</code><br />
<code>ErrorDocument 401 /errors/401.html</code><br />
<code>ErrorDocument 403 /errors/403.html</code><br />
<code>ErrorDocument 404 /errors/404.html</code><br />
<code>ErrorDocument 500 /errors/500.html</code></span></p>
<h4 id="usa2a"><span style="color: #000000">Provide a Universal Error Document <a href="#top">^</a></span></h4>
<p><code><span style="color: #000000"># provide a universal error document</span></code><span style="color: #000000"><br />
<code>RewriteCond %{REQUEST_FILENAME} !-f</code><br />
<code>RewriteCond %{REQUEST_FILENAME} !-d</code><br />
<code>RewriteRule ^.*$ /dir/error.php [L]</code></span></p>
<h4 id="usa3"><span style="color: #000000">Employ Basic URL Spelling Check <a href="#top">^</a></span></h4>
<p><span style="color: #000000">This bit of voodoo will auto-correct simple spelling errors in the URL:</span></p>
<p><code><span style="color: #000000"># automatically corect simple speling erors</span></code><span style="color: #000000"><br />
<code>&lt;IfModule mod_speling.c&gt;</code><br />
<code>CheckSpelling On</code><br />
<code>&lt;/IfModule&gt;</code></span></p>
<h4 id="usa4"><span style="color: #000000">Instruct browser to download multimedia files rather than display them <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Here is a useful method for delivering multimedia file downloads to your users. Typically, browsers will attempt to play or stream such files when direct links are clicked. With this method, provide a link to a multimedia file and a dialogue box will provide users the choice of saving the file or opening it. Here are a few htaccess rules demonstrating the technique (edit file types according to your specific needs):</span></p>
<p><code><span style="color: #000000"># instruct browser to download multimedia files</span></code><span style="color: #000000"><br />
<code>AddType application/octet-stream .avi</code><br />
<code>AddType application/octet-stream .mpg</code><br />
<code>AddType application/octet-stream .wmv</code><br />
<code>AddType application/octet-stream .mp3</code></span></p>
<h4 id="usa5"><span style="color: #000000">Instruct server to display source code for dynamic file types <a href="#top">^</a></span></h4>
<p><span style="color: #000000">There are many situations where site owners may wish to display the contents of a dynamic file rather than executing it as a script. To exercise this useful technique, create a directory in which to place dynamic files that should be displayed rather than executed, and add the following line of code to the htaccess file belonging to that directory. This method is known to work for <code>.pl</code>,<code>.py</code>, and <code>.cgi</code> file-types. Here it is:</span></p>
<p><code><span style="color: #000000">RemoveHandler cgi-script .pl .py .cgi</span></code></p>
<h4 id="usa6"><span style="color: #000000">Redirect visitors to a temporary site during site development <a href="#top">^</a></span></h4>
<p><span style="color: #000000">During web development, maintenance, or repair, send your visitors to an alternate site while retaining full access for yourself. This is a very useful technique for preventing visitor confusion or dismay during those awkward, web-development moments. Here are the generalized htaccess rules to do it (edit values to suit your needs):</span></p>
<p><code><span style="color: #000000"># redirect all visitors to alternate site but retain full access for you</span></code><span style="color: #000000"><br />
<code>ErrorDocument 403 http://www.alternate-site.com</code><br />
<code>Order deny,allow</code><br />
<code>Deny from all</code><br />
<code>Allow from 99.88.77.66</code></span></p>
<h4 id="usa7"><span style="color: #000000">Provide a password prompt for visitors during site development <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Here is another possible solution for &#8220;hiding&#8221; your site during those private, site-under-construction moments. Here we are instructing Apache to provide visitors with a password prompt while providing open access to any specifically indicated IP addresses or URL’s. Edit the following code according to your IP address and other development requirements (thanks to Caleb at askapache.com for sharing this trick <sup>3</sup>):</span></p>
<p><code><span style="color: #000000"># password prompt for visitors</span></code><span style="color: #000000"><br />
<code>AuthType basic</code><br />
<code>AuthName "This site is currently under construction"</code><br />
<code>AuthUserFile /home/path/.</code><code>htpasswd</code><br />
<code>AuthGroupFile /dev/null</code><br />
<code>Require valid-user</code><br />
<code># allow webmaster and any others open access</code><br />
<code>Order Deny,Allow</code><br />
<code>Deny from all</code><br />
<code>Allow from 111.222.33.4</code><br />
<code>Allow from favorite.validation/services/</code><br />
<code>Allow from googlebot.com</code><br />
<code>Satisfy Any</code></span></p>
<h4 id="usa8"><span style="color: #000000">Prevent file or directory access according to specified time periods <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Prevent viewing of all pictures of Fonzi during the midnight hour — or <em>any</em> files during <em>any</em> time period — by using this handy htaccess ruleset:</span></p>
<p><code><span style="color: #000000"># prevent access during the midnight hour</span></code><span style="color: #000000"><br />
<code>RewriteCond %{TIME_HOUR} ^12$</code><br />
<code>RewriteRule ^.*$ - [F,L]</code></span></p>
<p><code><span style="color: #000000"># prevent access throughout the afternoon</span></code><span style="color: #000000"><br />
<code>RewriteCond %{TIME_HOUR} ^(12|13|14|15)$</code><br />
<code>RewriteRule ^.*$ - [F,L]</code></span></p>
<h3 id="redirects"><span style="color: #000000">REDIRECT TRICKS [ <a href="#top">^</a> ]</span></h3>
<h4 id="red1"><span style="color: #000000">Important Note About Redirecting via mod_rewrite <a href="#top">^</a></span></h4>
<p><span style="color: #000000">For all redirects using the <code>mod_rewrite</code> directive, it is necessary to have the <code>RewriteEngine</code>enabled. It is common practice to enable the <code>mod_rewrite</code> directive in either the server configuration file or at the top of the site’s root htaccess file. If the <code>mod_rewrite</code> directive is not included in either of these two places, it should be included as the first line in any code block that utilizes a rewrite function (i.e., <code>mod_rewrite</code>), but only needs to be included once for each htaccess file. The proper <code>mod_rewrite</code> directive is included here for your convenience, but may or may not also be included within some of the code blocks provided in this article:</span></p>
<p><code><span style="color: #000000"># initialize and enable rewrite engine</span></code><span style="color: #000000"><br />
<code>RewriteEngine on</code></span></p>
<h4 id="red2"><span style="color: #000000">Redirect from http://www.domain.com to http://domain.com <a href="#top">^</a></span></h4>
<p><span style="color: #000000">This method uses a “301 redirect” to establish a permanent redirect from the “www-version” of a domain to its respectively corresponding “non-www version”. Be sure to test <em>immediately</em> after preparing 301 redirects and remove it immediately if any errors occur. Use a “<a title="Server Header Checker" href="http://www.seoconsultants.com/tools/headers.asp">server header checker</a>” to confirm a positive 301 response. Further, always include a trailing slash “/” when linking directories. Finally, be consistent with the “www” in all links (either use it always or never).</span></p>
<p><code><span style="color: #000000"># permanently redirect from www domain to non-www domain</span></code><span style="color: #000000"><br />
<code>RewriteEngine on</code><br />
<code>Options +FollowSymLinks</code><br />
<code>RewriteCond %{HTTP_HOST} ^www\.domain\.tld$ [NC]</code><br />
<code>RewriteRule ^(.*)$ http://domain.tld/$1 [R=301,L]</code></span></p>
<h4 id="red3"><span style="color: #000000">Redirect from http://old-domain.com to http://new-domain.com <a href="#top">^</a></span></h4>
<p><span style="color: #000000">For a basic domain change from “old-domain.com” to “new-domain.com” (and folder/file names have <em>not</em> been changed), use the <code>Rewrite</code> rule to remap the old domain to the new domain. When checking the redirect live, the old domain may appear in the browser’s address bar. Simply check an image path (right-click an image and select “properties”) to verify proper redirection. Remember to check your site thoroughly after implementing this redirect.</span></p>
<p><code><span style="color: #000000"># redirect from old domain to new domain</span></code><span style="color: #000000"><br />
<code>RewriteEngine On</code><br />
<code>RewriteRule ^(.*)$ http://www.new-domain.com/$1 [R=301,L]</code></span></p>
<h4 id="red4"><span style="color: #000000">Redirect String Variations to a Specific Address <a href="#top">^</a></span></h4>
<p><span style="color: #000000">For example, if we wanted to redirect any requests containing the character string, “perish”, to our main page at http://perishablepress.com/, we would replace “some-string” with “perish” in the following code block:</span></p>
<p><code><span style="color: #000000"># redirect any variations of a specific character string to a specific address</span></code><span style="color: #000000"><br />
<code>RewriteRule ^some-string http://www.domain.com/index.php/blog/target [R]</code></span></p>
<p><span style="color: #000000">Here are two other methods for accomplishing string-related mapping tasks:</span></p>
<p><code><span style="color: #000000"># map URL variations to the same directory on the same server</span></code><span style="color: #000000"><br />
<code>AliasMatch ^/director(y|ies) /www/docs/target</code></span></p>
<p><code><span style="color: #000000"># map URL variations to the same directory on a different server</span></code><span style="color: #000000"><br />
<code>RedirectMatch ^/[dD]irector(y|ies) http://domain.com</code></span></p>
<h4 id="red5"><span style="color: #000000">Other Fantastic Redirect Tricks <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Redirect an entire site via 301:</span></p>
<p><code><span style="color: #000000"># redirect an entire site via 301</span></code><span style="color: #000000"><br />
<code>redirect 301 / http://www.domain.com/</code></span></p>
<p><span style="color: #000000">Redirect a specific file via 301:</span></p>
<p><code><span style="color: #000000"># redirect a specific file via 301</span></code><span style="color: #000000"><br />
<code>redirect 301 /current/currentfile.html http://www.newdomain.com/new/newfile.html</code></span></p>
<p><span style="color: #000000">Redirect an entire site via permanent redirect:</span></p>
<p><code><span style="color: #000000"># redirect an entire site via permanent redirect</span></code><span style="color: #000000"><br />
<code>Redirect permanent / http://www.domain.com/</code></span></p>
<p><span style="color: #000000">Redirect a page or directory via permanent redirect:</span></p>
<p><code><span style="color: #000000"># redirect a page or directory</span></code><span style="color: #000000"><br />
<code>Redirect permanent old_file.html http://www.new-domain.com/new_file.html</code><br />
<code>Redirect permanent /old_directory/ http://www.new-domain.com/new_directory/</code></span></p>
<p><span style="color: #000000">Redirect a file using RedirectMatch:</span></p>
<p><code><span style="color: #000000"># redirect a file using RedirectMatch</span></code><span style="color: #000000"><br />
<code>RedirectMatch 301 ^.*$ http://www.domain.com/index.html</code></span></p>
<p><span style="color: #000000">Note: When redirecting specific files, use Apache‘s <code>Redirect</code> rule for files within the same domain. Use Apache‘s <code>RewriteRule</code> for <em>any</em> domains, especially if they are different. The<code>RewriteRule</code> is more powerful than the <code>Redirect</code> rule, and thus should serve you more effectively.</span></p>
<p><span style="color: #000000">Thus, use the following for a stronger, harder page redirection (first line redirects a file, second line a directory, and third a domain):</span></p>
<p><code><span style="color: #000000"># redirect files directories and domains via RewriteRule</span></code><span style="color: #000000"><br />
<code>RewriteRule http://old-domain.com/old-file.html http://new-domain.com/new-file.html</code><br />
<code>RewriteRule http://old-domain.com/old-dir/ http://new-domain.com/new-dir/</code><br />
<code>RewriteRule http://old-domain.com/ http://new-domain.com/</code></span></p>
<h4 id="red6"><span style="color: #000000">Send visitors to a subdomain <a href="#top">^</a></span></h4>
<p><span style="color: #000000">This rule will ensure that all visitors are viewing pages via the subdomain of your choice. Edit the &#8220;subdomain&#8221;, &#8220;domain&#8221;, and &#8220;tld&#8221; to match your subdomain, domain, and top-level domain respectively:</span></p>
<p><code><span style="color: #000000"># send visitors to a subdomain</span></code><span style="color: #000000"><br />
<code>RewriteCond %{HTTP_HOST} !^$</code><br />
<code>RewriteCond %{HTTP_HOST} !^subdomain\.domain\.com$ [NC]</code><br />
<code>RewriteRule ^/(.*)$ http://subdomain.domain.tld/$1 [L,R=301]</code></span></p>
<h4 id="red7"><span style="color: #000000">More fun with RewriteCond and RewriteRule <a href="#top">^</a></span></h4>
<p><code><span style="color: #000000"># rewrite only if the file is not found</span></code><span style="color: #000000"><br />
<code>RewriteCond %{REQUEST_FILENAME} !-f</code><br />
<code>RewriteRule ^(.+)special\.html?$ cgi-bin/special/special-html/$1</code></span></p>
<p><code><span style="color: #000000"># rewrite only if an image is not found</span></code><span style="color: #000000"><br />
<code>RewriteCond %{REQUEST_FILENAME} !-f</code><br />
<code>RewriteRule images/special/(.*).gif cgi-bin/special/mkgif?$1</code></span></p>
<p><code><span style="color: #000000"># seo-friendly rewrite rules for various directories</span></code><span style="color: #000000"><br />
<code>RewriteRule ^(.*)/aud/(.*)$ $1/audio-files/$2 [L,R=301]</code><br />
<code>RewriteRule ^(.*)/img/(.*)$ $1/image-files/$2 [L,R=301]</code><br />
<code>RewriteRule ^(.*)/fla/(.*)$ $1/flash-files/$2 [L,R=301]</code><br />
<code>RewriteRule ^(.*)/vid/(.*)$ $1/video-files/$2 [L,R=301]</code></span></p>
<p><code><span style="color: #000000"># broswer sniffing via htaccess environmental variables</span></code><span style="color: #000000"><br />
<code>RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*</code><br />
<code>RewriteRule ^/$ /index-for-mozilla.html [L]</code><br />
<code>RewriteCond %{HTTP_USER_AGENT} ^Lynx.*</code><br />
<code>RewriteRule ^/$ /index-for-lynx.html [L]</code><br />
<code>RewriteRule ^/$ /index-for-all-others.html [L]</code></span></p>
<p><code><span style="color: #000000"># redirect query to Google search</span></code><span style="color: #000000"><br />
<code>Options +FollowSymlinks</code><br />
<code>RewriteEngine On</code><br />
<code>RewriteCond %{REQUEST_URI} .google\.php*</code><br />
<code>RewriteRule ^(.*)$ ^http://www.google.com/search?q=$1 [R,NC,L]</code></span></p>
<p><code><span style="color: #000000"># deny request according to the request method</span></code><span style="color: #000000"><br />
<code>RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD)$ [NC]</code><br />
<code>RewriteRule ^.*$ - [F]</code></span></p>
<p><code><span style="color: #000000"># redirect uploads to a better place</span></code><span style="color: #000000"><br />
<code>RewriteCond %{REQUEST_METHOD} ^(PUT|POST)$ [NC]</code><br />
<code>RewriteRule ^(.*)$ /cgi-bin/upload-processor.cgi?p=$1 [L,QSA]</code></span></p>
<h4 id="red8"><span style="color: #000000">More fun with Redirect 301 and RedirectMatch 301 <a href="#top">^</a></span></h4>
<p><code><span style="color: #000000"># seo friendly redirect for a single file</span></code><span style="color: #000000"><br />
<code>Redirect 301 /old-dir/old-file.html http://domain.com/new-dir/new-file.html</code></span></p>
<p><code><span style="color: #000000"># seo friendly redirect for multiple files</span></code><span style="color: #000000"><br />
<code># redirects all files in dir directory with first letters xyz</code><br />
<code>RedirectMatch 301 /dir/xyz(.*) http://domain.com/$1</code></span></p>
<p><code><span style="color: #000000"># seo friendly redirect entire site to a different domain</span></code><span style="color: #000000"><br />
<code>Redirect 301 / http://different-domain.com</code></span></p>
<h3 id="wordpress"><span style="color: #000000">WORDPRESS TRICKS [ <a href="#top">^</a> ]</span></h3>
<h4 id="wor1"><span style="color: #000000">Secure WordPress Contact Forms <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Protect your insecure WordPress contact forms against online unrighteousness by verifying the domain from whence the form is called. Remember to replace the “domain.com” and “contact.php” with <em>your</em> domain and contact-form file names, respectively.</span></p>
<p><code><span style="color: #000000"># secure wordpress contact forms via referrer check</span></code><span style="color: #000000"><br />
<code>RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$ [NC]</code><br />
<code>RewriteCond %{REQUEST_POST} .*contact.php$</code><br />
<code>RewriteRule .* - [F]</code></span></p>
<h4 id="wor2"><span style="color: #000000">WordPress Permalinks <a href="#top">^</a></span></h4>
<p><span style="color: #000000">In our article, <a title="In depth: htaccess rules for WordPress" href="http://perishablepress.com/press/2006/06/14/the-htaccess-rules-for-all-wordpress-permalinks/">The htaccess rules for all WordPress Permalinks</a>, we revealed the precise htaccess directives used by the WordPress blogging platform for permalink functionality. Here, for the sake of completeness, we repeat the directives only. For more details please refer to the original article:</span></p>
<p><span style="color: #000000">If WordPress is installed in the site’s root directory, WordPress creates and uses the following htaccess directives:</span></p>
<p><code><span style="color: #000000"># BEGIN WordPress</span></code><span style="color: #000000"><br />
<code>&lt;IfModule mod_rewrite.c&gt;</code><br />
<code>RewriteEngine On</code><br />
<code>RewriteBase /</code><br />
<code>RewriteCond %{REQUEST_FILENAME} !-f</code><br />
<code>RewriteCond %{REQUEST_FILENAME} !-d</code><br />
<code>RewriteRule . /index.php [L]</code><br />
<code>&lt;/IfModule&gt;</code><br />
<code># END WordPress</code></span></p>
<p><span style="color: #000000">If WordPress is installed in some subdirectory “foo”, WordPress creates and uses the following htaccess directives:</span></p>
<p><code><span style="color: #000000"># BEGIN WordPress</span></code><span style="color: #000000"><br />
<code>&lt;IfModule mod_rewrite.c&gt;</code><br />
<code>RewriteEngine On</code><br />
<code>RewriteBase /foo/</code><br />
<code>RewriteCond %{REQUEST_FILENAME} !-f</code><br />
<code>RewriteCond %{REQUEST_FILENAME} !-d</code><br />
<code>RewriteRule . /foo/index.php [L]</code><br />
<code>&lt;/IfModule&gt;</code><br />
<code># END WordPress</code></span></p>
<h3 id="random"><span style="color: #000000">RANDOM TRICKS [ <a href="#top">^</a> ]</span></h3>
<h4 id="ran1"><span style="color: #000000">Activate SSI for HTML/SHTML file types: <a href="#top">^</a></span></h4>
<p><code><span style="color: #000000"># activate SSI for HTML and or SHTML file types</span></code><span style="color: #000000"><br />
<code>AddType text/html .html</code><br />
<code>AddType text/html .shtml</code><br />
<code>AddHandler server-parsed .html</code><br />
<code>AddHandler server-parsed .shtml</code><br />
<code>AddHandler server-parsed .htm</code></span></p>
<h4 id="ran2"><span style="color: #000000">Grant CGI access in a specific directory: <a href="#top">^</a></span></h4>
<p><code><span style="color: #000000"># grant CGI access in a specific directory</span></code><span style="color: #000000"><br />
<code>Options +ExecCGI</code><br />
<code>AddHandler cgi-script cgi pl</code><br />
<code># to enable all scripts in a directory use the following</code><br />
<code>SetHandler cgi-script</code></span></p>
<h4 id="ran3"><span style="color: #000000">Disable magic_quotes_gpc for PHP enabled servers: <a href="#top">^</a></span></h4>
<p><code><span style="color: #000000"># turn off magic_quotes_gpc for PHP enabled servers</span></code><span style="color: #000000"><br />
<code>&lt;ifmodule mod_php4.c&gt;</code><br />
<code>php_flag magic_quotes_gpc off</code><br />
<code>&lt;/ifmodule&gt;</code></span></p>
<h4 id="ran4"><span style="color: #000000">Enable MD5 digests: <a href="#top">^</a></span></h4>
<p><span style="color: #000000">Note: enabling this option may result in a relative decrease in server performance.</span></p>
<p><code><span style="color: #000000"># enable MD5 digests via ContentDigest</span></code><span style="color: #000000"><br />
<code>ContentDigest On</code></span></p>
<h4 id="ran5"><span style="color: #000000">Expression Engine Tricks: <a href="#top">^</a></span></h4>
<p><code><span style="color: #000000"># send Atom and RSS requests to the site docroot to be rewritten for ExpressionEngine</span></code><span style="color: #000000"><br />
<code>RewriteRule .*atom.xml$ http://www.yoursite.com/index.php/weblog/rss_atom/ [R]</code><br />
<code>RewriteRule .*rss.xml$ http://www.yoursite.com/index.php/weblog/rss_2.0/ [R]</code></span></p>
<p><code><span style="color: #000000"># cause all requests for index.html to be rewritten for ExpressionEngine</span></code><span style="color: #000000"><br />
<code>RewriteRule /.*index.html$ http://www.domain.com/index.php [R]</code></span></p>
<h3><span style="color: #000000">REFERENCES</span></h3>
<ul style="margin-top: 25px;margin-right: 0px;margin-bottom: 25px;margin-left: 0px;line-height: 18px;padding: 0px"> <span style="color: #000000"></p>
<li><sup>1</sup> <a title="Original Wikipedia htaccess article archived at WebGeek" rel="nofollow" href="http://www.hybrid6.com/webgeek/2007/02/htaccess-reference.php">Wikipedia htaccess Resource</a></li>
<li><sup>2</sup> <a title="Apache Cookbook" rel="nofollow" href="http://www.oreilly.com/catalog/apacheckbk/">Apache Cookbook</a></li>
<li><sup>3</sup> <a title="Ultimate htaccess Article" rel="nofollow" href="http://www.askapache.com/2006/htaccess/htaccesselite-ultimate-htaccess-article.html">Ultimate htaccess Article</a></li>
<li><a title="Regular-Expressions.info" rel="nofollow" href="http://www.regular-expressions.info/">More on regular expressions</a></li>
<li><a title="Apache Reference" rel="nofollow" href="http://httpd.apache.org/docs/1.3/howto/htaccess.html">Apache htaccess Reference</a></li>
<li><a title="Apache Tutorial" rel="nofollow" href="http://httpd.apache.org/docs/trunk/howto/htaccess.html">Apache htaccess Tutorial</a></li>
<li><a title="Apache mod_rewrite" rel="nofollow" href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html">Apache mod_rewrite</a></li>
<li><a title="htaccess Forum" rel="nofollow" href="http://www.webmasterworld.com/forum13/687.htm">htaccess Forum</a></li>
<li><a title="Behind the Scenes with htaccess" rel="nofollow" href="http://brainstormsandraves.com/archives/2005/10/09/htaccess/">Behind the Scenes with htaccess</a></li>
<li><a title="Automatic htaccess file generator" rel="nofollow" href="http://cooletips.de/htaccess/">Automatic htaccess file generator</a></li>
<p></span></ul>
<p><span style="color: #000000"> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/12/06/htaccess-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advanced MRTG Configurations</title>
		<link>http://blog.nataprawira.com/tech/2010/12/02/advanced-mrtg-configurations/</link>
		<comments>http://blog.nataprawira.com/tech/2010/12/02/advanced-mrtg-configurations/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 16:40:30 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[MRTG]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=174</guid>
		<description><![CDATA[

Introduction
In many cases using MRTG in a basic configuration to monitor the volume of network traffic to your server isn&#8217;t enough. You may also want to see graphs of CPU, disk, and memory usage. This chapter explains how to find the values you want to monitor in the SNMP MIB files and then how to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F12%2F02%2Fadvanced-mrtg-configurations%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F12%2F02%2Fadvanced-mrtg-configurations%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<h1 style="color: green;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: #048444;font-size: 24px"><span>Introduction</span></h1>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">In many cases using MRTG in a basic configuration to monitor the volume of network traffic to your server isn&#8217;t enough. You may also want to see graphs of CPU, disk, and memory usage. This chapter explains how to find the values you want to monitor in the SNMP MIB files and then how to use this information to configure MRTG.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">All the chapter&#8217;s examples assume that the SNMP Read Only string is craz33guy and that the net-snmp-utils RPM package is installed (see Chapter 22, &#8220;<a title="Quick HOWTO : Ch22 : Monitoring Server Performance" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch22_:_Monitoring_Server_Performance"> Monitoring Server Performance</a>&#8220;).<span id="more-174"></span></p>
<h1 style="color: green;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: #048444;font-size: 24px"><span>Locating And Viewing The Contents Of Linux MIBs</span></h1>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Residing in memory, MIBs are data structures that are constantly updated via the SNMP daemon. The MIB configuration text files are located on your hard disk and loaded into memory each time SNMP restarts.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">You can easily find your Fedora Linux MIBs by using the locate command and filtering the output to include only values with the word &#8220;snmp&#8221; in them. As you can see in this case, the MIBs are located in the /usr/share/snmp/mibs directory:</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# locate mib | grep snmp
/usr/share/doc/net-snmp-5.0.6/README.mib2c
/usr/share/snmp/mibs
/usr/share/snmp/mibs/DISMAN-SCHEDULE-MIB.txt
...
...
[root@bigboy tmp]#</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">As the MIB configurations are text files you can search for keywords in them using the grep command. This examples searches for the MIBs that keep track of TCP connections and returns the RFC1213 and TCP MIBs as the result.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@silent mibs]# grep -i tcp /usr/share/snmp/mibs/*.txt | grep connections
...
RFC1213-MIB.txt: "The limit on the total number of TCP connections
RFC1213-MIB.txt: "The number of times TCP connections have made a
...
TCP-MIB.txt:     "The number of times TCP connections have made a
...
...
[root@silent mibs]#</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">You can use the vi editor to look at the MIBs. Don&#8217;t change them, because doing so could cause SNMP to fail. MIBs are very complicated, but fortunately the key sections are commented.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Each value tracked in a MIB is called an object and is often referred to by its object ID or OID. In this snippet of the RFC1213-MIB.txt file, you can see that querying the tcpActiveOpens object returns the number of active open TCP connections to the server. The SYNTAX field shows that this is a counter value.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">MIBs usually track two types of values. Counter values are used for items that continuously increase as time passes, such as the amount of packets passing through a NIC or amount of time CPU been busy since boot time. Integer values change instant by instant and are useful for tracking such statistics as the amount of memory currently being used.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">tcpActiveOpens OBJECT-TYPE
    SYNTAX  Counter
    ACCESS  read-only
    STATUS  mandatory
    DESCRIPTION
            "The number of times TCP connections have made a
            direct transition to the SYN-SENT state from the
            CLOSED state."
    ::= { tcp 5 }</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">You&#8217;ll explore the differences between SNMP and MRTG terminologies in more detail later. Understanding them will be important in understanding how to use MRTG to track MIB values.</p>
<h1 style="color: green;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: #048444;font-size: 24px"><span>Testing Your MIB Value</span></h1>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Once you have identified an interesting MIB value for your Linux system you can then use the snmpwalk command to poll it. Many times the text aliases in a MIB only reference the OID branch and not the OID the data located in a leaf ending in an additional number like a &#8220;.0&#8243; or &#8220;.1&#8243;. The snmpget command doesn&#8217;t work with branches giving an error stating that the MIB variable couldn&#8217;t be found.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">In the example below, the ssCpuRawUser OID alias was found to be interesting, but the snmpget command fails to get a value. Follow up with the snmpwalk command shows that the value is located in ssCpuRawUser.0 instead. The snmpget is then successful in retrieving the &#8220;counter32&#8243; type data with a current value of 396271.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# snmpget -v1 -c craz33guy localhost ssCpuRawUser
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ssCpuRawUser
[root@bigboy tmp]#

[root@bigboy tmp]# snmpwalk -v1 -c craz33guy localhost ssCpuRawUser
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 396241
[root@bigboy tmp]# snmpget -v1 -c craz33guy localhost ssCpuRawUser.0
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 396271
[root@bigboy tmp]#</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The MIB values that work successfully with snmpget are the ones you should use with MRTG.</p>
<h1 style="color: green;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: #048444;font-size: 24px"><span>Differences In MIB And MRTG Terminology</span></h1>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Always keep in mind that MRTG refers to MIB counter values as counter values. It refers to MIB integer and gauge values as gauge. By default, MRTG considers all values to be counters.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">MRTG doesn&#8217;t plot counter values as a constantly increasing graph, it plots only how much the value has changed since the last polling cycle. CPU usage is typically tracked by MIBs as a counter value; fortunately, you can edit your MRTG configuration file to make it graph this information in a percentage use format (more on this later).</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The syntax type, the MIB object name, and the description of what it does are the most important things you need to know when configuring MRTG; I&#8217;ll come back to these later.</p>
<h1 style="color: green;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: #048444;font-size: 24px"><span>The CPU And Memory Monitoring MIB</span></h1>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The UCD-SNMP-MIB MIB keeps track of a number of key performance MIB objects, including the commonly used ones in Table 23-1.</p>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Table 23-1 Important Objects In The UCD-SNMP-MIB MIB</span></h2>
<table style="font-size: 13px;color: black;background-color: white" border="1" cellspacing="0" cellpadding="5" align="center">
<tbody>
<tr>
<th>UCD-SNMP-MIB Object Variable</th>
<th>MIB Type</th>
<th>MRTG Type</th>
<th>Description</th>
</tr>
<tr valign="top">
<td>ssCpuRawUser</td>
<td>Counter</td>
<td>Counter</td>
<td>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Total CPU usage by applications run by nonprivileged users since the system booted. Adding the user, system, and nice values can give a good approximation of total CPU usage..</p>
</td>
</tr>
<tr valign="top">
<td>ssCpuRawSystem</td>
<td>Counter</td>
<td>Counter</td>
<td>Total CPU usage by applications run by privileged system processes since the system booted.</td>
</tr>
<tr valign="top">
<td>ssCpuRawNice</td>
<td>Counter</td>
<td>Counter</td>
<td>Total CPU usage by applications running at a nondefault priority level.</td>
</tr>
<tr valign="top">
<td>ssCpuRawIdle</td>
<td>Counter</td>
<td>Counter</td>
<td>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The percentage of the time the CPU is running idle. Subtracting this value from 100 can give a good approximation of total CPU usage.</p>
</td>
</tr>
<tr valign="top">
<td>memAvailReal</td>
<td>Integer</td>
<td>Gauge</td>
<td>Available Physical Memory Space On The Host</td>
</tr>
</tbody>
</table>
<h1 style="color: green;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: #048444;font-size: 24px"><span>The TCP/IP Monitoring MIB</span></h1>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The TCP-MIB MIB keeps track of data connection information and contains the very useful tcpActiveOpens and tcpCurrEstab objects. Table 23.2 details the most important objects in TCP-MIB.</p>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Table 23-2 Important Objects In The TCP-MIB MIB</span></h2>
<table style="font-size: 13px;color: black;background-color: white" border="1" cellspacing="0" cellpadding="5" align="center">
<tbody>
<tr>
<th>UCD-SNMP-MIB Object Variable</th>
<th>MIB Type</th>
<th>MRTG Type</th>
<th>Description</th>
</tr>
<tr valign="top">
<td>tcpActiveOpens</td>
<td>Counter</td>
<td>Counter</td>
<td>Measures the number of completed TCP connections.</td>
</tr>
<tr valign="top">
<td>tcpCurrEstab</td>
<td>Gauge</td>
<td>Gauge</td>
<td>Measures the number of TCP connections in the established state</td>
</tr>
<tr valign="top">
<td>tcpInErrs</td>
<td>Counter</td>
<td>Counter</td>
<td>Total number of TCP segments with bad checksum errors</td>
</tr>
</tbody>
</table>
<h1 style="color: green;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: #048444;font-size: 24px"><span>Manually Configuring Your MRTG File</span></h1>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The MRTG cfgmaker program creates configuration files for network interfaces only, simultaneously tracking two OIDs: the NIC&#8217;s input and output data statistics. The mrtg program then uses these configuration files to determine the type of data to record in its data directory. The indexmaker program also uses this information to create the overview, or Summary View Web page for the MIB OIDs you&#8217;re monitoring.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">This Summary View page shows daily statistics only. You have to click on the Summary View graphs to get the Detailed View page behind it with the daily, weekly, monthly, and annual graphs. Some of the parameters in the configuration file refer to the Detailed View, others refer to the Summary View.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">If you want to monitor any other pairs of OIDs, you have to manually create the configuration files, because cfgmaker isn&#8217;t aware of any OIDs other than those related to a NIC. The mrtg and indexmaker program can be fed individual OIDs from a customized configuration file and will function as expected if you edit the file correctly.</p>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Parameter Formats</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">MRTG configuration parameters are always followed by a graph name surrounded by square brackets and a colon. The format looks like this:</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Parameter[graph name]: value</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">For ease of editing, the parameters for a particular graph are usually grouped together. Each graph can track two OIDS listed in the Target parameter, which is usually placed at the very top of the graph name list. The two OID values are separated by an &amp; symbol; the first one can be is the input OID, and the second one is the output OID.</p>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Legend Parameters</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">On the Detailed View Web page, each graph has a legend that shows the max, average, and current values of the graph&#8217;s OID statistics. You can use the legendI parameter for the description of the input graph (first graph OID) and the legendO for the output graph (second graph OID).</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The space available under each graph&#8217;s legend is tiny so MRTG also has legend1 and legend2 parameters that are placed at the very bottom of the page to provide more details. Parameter legend1 is the expansion of legendI, and legend2 is the expansion of legendO.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The Ylegend is the legend for the Y axis, the value you are trying to compare. In the case of a default MRTG configuration this would be the data flow through the interface in bits or bytes per second. Here is an example of the legends of a default MRTG configuration:</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">YLegend[graph1]: Bits per second
Legend1[graph1]: Incoming Traffic in Bits per Second
Legend2[graph1]: Outgoing Traffic in Bits per Second
LegendI[graph1]: In
LegendO[graph1]: Out</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">You can prevent MRTG from printing the legend at the bottom of the graph by leaving the value of the legend blank like this:</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">LegendI[graph1]:</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Later you&#8217;ll learn how to match the legends to the OIDs for a variety of situations.</p>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Options Parameters</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Options parameters provide MRTG with graph formatting information. The growright option makes sure the data at the right of the screen is for the most current graph values. This usually makes the graphs more intuitively easy to read. MRTG defaults to growing from the left.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The nopercent option prevents MRTG from printing percentage style statistics in the legends at the bottom of the graph. The gauge option alerts MRTG to the fact that the graphed values are of the gauge type. If the value you are monitoring is in bytes, then you can convert the output to bits using the bits option. Likewise, you can convert per second values to per minute graphs using the perminute option. Here are some examples for two different graphs:</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">options[graph1]: growright,nopercent,perminute

options[graph2]: gauge,bits</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">If you place this parameter at the top with a label of [_] it gets applied to all the graphs defined in the file. Here&#8217;s an example.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">options[_]: growright</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Title Parameters</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The title on the Summary Page is provided by the Title parameter, the PageTop parameter tells the title for the Detailed View page. The PageTop string must start with &lt; H1 &gt; and end with &lt; H1 &gt;.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Title[graph1]: Interface eth0

PageTop[graph1]: &lt; H1 &gt;Detailed Statistics For Interface eth0 &lt; H1 &gt;</pre>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Scaling Parameters</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The MaxBytes parameter is the maximum amount of data MRTG will plot on a graph. Anything more than this seems to disappear over the edge of the graph.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">MRTG also tries to adjust its graphs so that the largest value plotted on the graph is always close to the top. This is so even if you set the MaxBytes parameter.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">When you are plotting a value that has a known maximum and you always want to have this value at the top of the vertical legend, you may want to turn off MRTG&#8217;s auto scaling. If you are plotting percentage CPU usage, and the server reaches a maximum of 60%, with scaling, MRTG will have a vertical plot of 0% to 60%, so that the vertical peak is near the top of the graph image.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">When scaling is off, and MaxBytes is set to 100, then the peak will be only 60% of the way up as the graph plots from 0% to 100%. The example removes scaling from the yearly, monthly, weekly, and daily views on the Detailed View page and gives them a maximum value of 100.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Unscaled[graph1]: ymwd
MaxBytes[graph1]: 100</pre>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Defining The MIB Target Parameters</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">As stated before, MRTG always tries to compare two MIB OID values that are defined by the Target parameter. You have to specify the two MIB OID objects, the SNMP password and the IP address of the device you are querying in this parameter, and separate them with an &amp; character:</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Target[graph1]: mib-object-1.0&amp;mib-object-2.0:&lt;SNMP-password&gt;@&lt;IP-address&gt;</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The numeric value, in this case .0, at the end of the MIB is required. The next example uses the SNMP command to return the user mode CPU utilization of a Linux server. Notice how the .0 is tagged onto the end of the output.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@silent mibs]# snmpwalk -v 1 -c craz33guy localhost ssCpuRawUser
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 926739
[root@silent mibs]#</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The MRTG legends map to the MIBs listed in the target as shown in Table 23-3.</p>
<h3 style="color: black;background-color: initial;font-weight: bold;margin-top: 0px;margin-right: 0px;margin-bottom: 0.3em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: initial;border-bottom-style: none;border-bottom-color: initial;font-size: 17px"><span>Table 23-3 Mapping MIBs To The Graph Legends</span></h3>
<table style="font-size: 13px;color: black;background-color: white" border="1" cellspacing="0" cellpadding="5" align="center">
<tbody>
<tr>
<th>Legend</th>
<th>Maps To Target MIB</th>
</tr>
<tr valign="top">
<td>Legend1</td>
<td>#1</td>
</tr>
<tr valign="top">
<td>Legend2</td>
<td>#2</td>
</tr>
<tr valign="top">
<td>LegendI</td>
<td>#1</td>
</tr>
<tr valign="top">
<td>LegendO</td>
<td>#2</td>
</tr>
</tbody>
</table>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">So in the example below, legend1 and legendI describe mib-object-1.0 and legend2 and legendO describe mib-object-2.0.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Target[graph1]: mib-object-1.0&amp;mib-object-2.0:&lt;SNMP-password&gt;@&lt;IP-address&gt;</pre>
<h3 style="color: black;background-color: initial;font-weight: bold;margin-top: 0px;margin-right: 0px;margin-bottom: 0.3em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: initial;border-bottom-style: none;border-bottom-color: initial;font-size: 17px"><span>Plotting Only One MIB Value</span></h3>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">If you want to plot only one MIB value, you can just repeat the target MIB in the definition as in the next example, which plots only mib-object-1. The resulting MRTG graph actually superimposes the input and output graphs one on top of the other.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Target[graph1]: mib-object-1.0&amp;mib-object-1.0:&lt;SNMP-password&gt;@&lt;IP-address&gt;</pre>
<h3 style="color: black;background-color: initial;font-weight: bold;margin-top: 0px;margin-right: 0px;margin-bottom: 0.3em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: initial;border-bottom-style: none;border-bottom-color: initial;font-size: 17px"><span>Adding MIB Values Together For a Graph</span></h3>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">You can use the plus sign between the pairs of MIB object values to add them together. The next example adds mib-object-1.0 and mib-object-3.0 for one graph and adds mib-object-2.0 and mib-object-4.0 for the other.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Target[graph1]: mib-object-1.0&amp;mib-object-2.0:&lt;SNMP-password&gt;@&lt;IP-address&gt; + mib-object-3.0&amp;mib-object-4.0:&lt;SNMP-password&gt;@&lt;IP-address&gt;</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">You can use other mathematical operators, such as subtract (-), multiply (*), and divide (%). Left and right parentheses are also valid. There must be white spaces before and after all these operators for MRTG to work correctly. If not, you&#8217;ll get oddly shaded graphs.</p>
<h3 style="color: black;background-color: initial;font-weight: bold;margin-top: 0px;margin-right: 0px;margin-bottom: 0.3em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: initial;border-bottom-style: none;border-bottom-color: initial;font-size: 17px"><span>Sample Target: Total CPU Usage</span></h3>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Linux CPU usage is occupied by system processes, user mode processes, and a few processes running in nice mode. This example adds them all together in a single plot.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Target[graph1]:ssCpuRawUser.0&amp;ssCpuRawUser.0:&lt;SNMP-password&gt;@&lt;IP-address&gt; + ssCpuRawSystem.0&amp;ssCpuRawSystem.0:&lt;SNMP-password&gt;@&lt;IP-address&gt; + ssCpuRawNice.0&amp;ssCpuRawNice.0:&lt;SNMP-password&gt;@&lt;IP-address&gt;</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Be sure to place this command on a single line</p>
<h3 style="color: black;background-color: initial;font-weight: bold;margin-top: 0px;margin-right: 0px;margin-bottom: 0.3em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: initial;border-bottom-style: none;border-bottom-color: initial;font-size: 17px"><span>Sample Target: Memory Usage</span></h3>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Here is an example for the plotting the amount of free memory versus the total RAM installed in the server. Notice that this is a gauge type variable.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Target[graph1]: memAvailReal.0&amp;memTotalReal.0:&lt;SNMP-password&gt;@&lt;IP-address&gt;
options[graph1]: nopercent,growright,gauge</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Next, plot the percentage of available memory. Notice how the mandatory white spaces separate the mathematical operators from the next target element.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Target[graph1]: ( memAvailReal.0&amp; memAvailReal.0:&lt;SNMP-password&gt;@&lt;IP-Address&gt; ) * 100 / ( memTotalReal.0&amp;memTotalReal.0:&lt;SNMP-password&gt;@&lt;IP-Address&gt; )
options[graph1]: nopercent,growright,gauge</pre>
<h3 style="color: black;background-color: initial;font-weight: bold;margin-top: 0px;margin-right: 0px;margin-bottom: 0.3em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: initial;border-bottom-style: none;border-bottom-color: initial;font-size: 17px"><span>Sample Target: Newly Created Connections</span></h3>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">HTTP traffic caused by Web browsing usually consists of many very short lived connections. The tcpPassiveOpens MIB object tracks newly created connections and is suited for this type of data transfer. The tcpActiveOpens MIB object monitors new connections originating from the server. On smaller Web sites you may want to use the perminute option to make the graphs more meaningful.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Target[graph1]: tcpPassiveOpens.0&amp; tcpPassiveOpens.0:&lt;SNMP-password&gt;@&lt;IP-address&gt;
MaxBytes[graph1]: 1000000
Options[graph1]: perminute</pre>
<h3 style="color: black;background-color: initial;font-weight: bold;margin-top: 0px;margin-right: 0px;margin-bottom: 0.3em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: initial;border-bottom-style: none;border-bottom-color: initial;font-size: 17px"><span>Sample Target: Total TCP Established Connections</span></h3>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Other protocols such as FTP and SSH create longer established connections while people download large files or stay logged into the server. The tcpCurrEstab MIB object measures the total number of connections in the established state and is a gauge value.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Target[graph1]: tcpCurrEstab.0&amp;tcpCurrEstab.0:&lt;SNMP-password&gt;@&lt;IP-address&gt;
MaxBytes[graph1]: 1000000
Options[graph1]: gauge</pre>
<h3 style="color: black;background-color: initial;font-weight: bold;margin-top: 0px;margin-right: 0px;margin-bottom: 0.3em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: initial;border-bottom-style: none;border-bottom-color: initial;font-size: 17px"><span>Sample Target: Disk Partition Usage</span></h3>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">In this example, you&#8217;ll monitor the /var and /home disk partitions on the system.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">1) First use the df -k command to get a list of the partitions in use.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda8               505605    128199    351302  27% /
/dev/hda1               101089     19178     76692  21% /boot
/dev/hda5              1035660    122864    860188  13% /home
/dev/hda6               505605      8229    471272   2% /tmp
/dev/hda3              3921436    890092   2832140  24% /usr
/dev/hda2              1510060    171832   1261520  73% /var
[root@bigboy tmp]#</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">2) Add two entries to your snmpd.conf file.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">disk  /home
disk  /var</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">3) Restart the SNMP daemon to reload the values.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# service snmpd restart</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">4) Use the snmpwalk command to query the the dskPercent MIB. Object dskPercent.1 refers to the first disk entry in snmpd.conf (/home), and dskPercent.2 refers to the second (/var).</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# snmpwalk -v 1 -c craz33guy localhost dskPercent.1
UCD-SNMP-MIB::dskPercent.1 = INTEGER: 13
[root@bigboy tmp]# snmpwalk -v 1 -c craz33guy localhost dskPercent.2
UCD-SNMP-MIB::dskPercent.2 = INTEGER: 73
[root@bigboy tmp]#</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Your MRTG target for these gauge MIB objects should look like this:</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Target[graph1]: dskPercent.1&amp; dskPercent.1:&lt;SNMP-password&gt;@&lt;IP-address&gt;
options[graph1]: growright,gauge</pre>
<h3 style="color: black;background-color: initial;font-weight: bold;margin-top: 0px;margin-right: 0px;margin-bottom: 0.3em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: initial;border-bottom-style: none;border-bottom-color: initial;font-size: 17px"><span>Defining Global Variables</span></h3>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">You have to make sure MRTG knows where the MIBs you&#8217;re using are located. The default location MRTG uses may not be valid. Specify their locations with the global LoadMIBs parameter. You must also define where the HTML files will be located; the example specifies the default Fedora MRTG HTML directory.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt, /usr/share/snmp/mibs/TCP-MIB.txt
workdir: /var/www/mrtg/</pre>
<h1 style="color: green;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: #048444;font-size: 24px"><span>Implementing Advanced Server Monitoring</span></h1>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">You now can combine all you have learned to create a configuration file that monitors all these variables, and then you can integrate it into the existing MRTG configuration.</p>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>A Complete Sample Configuration</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Here is a sample configuration file that is used to query server localhost for CPU, memory, disk, and TCP connection information.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">#
# File: /etc/mrtg/server-info.cfg
#
# Configuration file for non bandwidth server statistics
#

#
# Define global options
#

LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt,/usr/share/snmp/mibs/TCP-MIB.txt
workdir: /var/www/mrtg/

#
# CPU Monitoring
# (Scaled so that the sum of all three values doesn't exceed 100)
#

Target[server.cpu]:ssCpuRawUser.0&amp;ssCpuRawUser.0:craz33guy@localhost + ssCpuRawSystem.0&amp;ssCpuRawSystem.0:craz33guy@localhost + ssCpuRawNice.0&amp;ssCpuRawNice.0:craz33guy@localhost
Title[server.cpu]: Server CPU Load
PageTop[server.cpu]: &lt; H1 &gt;CPU Load - System, User and Nice Processes&lt; /H1 &gt;
MaxBytes[server.cpu]: 100
ShortLegend[server.cpu]: %
YLegend[server.cpu]: CPU Utilization
Legend1[server.cpu]: Current CPU percentage load
LegendI[server.cpu]: Used
LegendO[server.cpu]:
Options[server.cpu]: growright,nopercent
Unscaled[server.cpu]: ymwd

#
# Memory Monitoring (Total Versus Available Memory)
#

Target[server.memory]: memAvailReal.0&amp;memTotalReal.0:craz33guy@localhost
Title[server.memory]: Free Memory
PageTop[server.memory]: &lt; H1 &gt;Free Memory&lt; /H1 &gt;
MaxBytes[server.memory]: 100000000000
ShortLegend[server.memory]: B
YLegend[server.memory]: Bytes
LegendI[server.memory]: Free
LegendO[server.memory]: Total
Legend1[server.memory]: Free memory, not including swap, in bytes
Legend2[server.memory]: Total memory
Options[server.memory]: gauge,growright,nopercent
kMG[server.memory]: k,M,G,T,P,X

#
# Memory Monitoring (Percentage usage)
#
Title[server.mempercent]: Percentage Free Memory
PageTop[server.mempercent]: &lt; H1 &gt;Percentage Free Memory&lt; /H1 &gt;
Target[server.mempercent]: ( memAvailReal.0&amp;memAvailReal.0:craz33guy@localhost ) * 100 / ( memTotalReal.0&amp;memTotalReal.0:craz33guy@localhost )
options[server.mempercent]: growright,gauge,transparent,nopercent
Unscaled[server.mempercent]: ymwd
MaxBytes[server.mempercent]: 100
YLegend[server.mempercent]: Memory %
ShortLegend[server.mempercent]: Percent
LegendI[server.mempercent]: Free
LegendO[server.mempercent]: Free
Legend1[server.mempercent]: Percentage Free Memory
Legend2[server.mempercent]: Percentage Free Memory

#
# New TCP Connection Monitoring (per minute)
#

Target[server.newconns]: tcpPassiveOpens.0&amp;tcpActiveOpens.0:craz33guy@localhost
Title[server.newconns]: Newly Created TCP Connections
PageTop[server.newconns]: &lt; H1 &gt;New TCP Connections&lt; /H1 &gt;
MaxBytes[server.newconns]: 10000000000
ShortLegend[server.newconns]: c/s
YLegend[server.newconns]: Conns / Min
LegendI[server.newconns]: In
LegendO[server.newconns]: Out
Legend1[server.newconns]: New inbound connections
Legend2[server.newconns]: New outbound connections
Options[server.newconns]: growright,nopercent,perminute

#
# Established TCP Connections
#

Target[server.estabcons]: tcpCurrEstab.0&amp;tcpCurrEstab.0:craz33guy@localhost
Title[server.estabcons]: Currently Established TCP Connections
PageTop[server.estabcons]: &lt; H1 &gt;Established TCP Connections&lt; /H1 &gt;
MaxBytes[server.estabcons]: 10000000000
ShortLegend[server.estabcons]:
YLegend[server.estabcons]: Connections
LegendI[server.estabcons]: In
LegendO[server.estabcons]:
Legend1[server.estabcons]: Established connections
Legend2[server.estabcons]:
Options[server.estabcons]: growright,nopercent,gauge

#
# Disk Usage Monitoring
#

Target[server.disk]: dskPercent.1&amp;dskPercent.2:craz33guy@localhost
Title[server.disk]: Disk Partition Usage
PageTop[server.disk]: &lt; H1 &gt;Disk Partition Usage /home and /var&lt; /H1 &gt;
MaxBytes[server.disk]: 100
ShortLegend[server.disk]: %
YLegend[server.disk]: Utilization
LegendI[server.disk]: /home
LegendO[server.disk]: /var
Options[server.disk]: gauge,growright,nopercent
Unscaled[server.disk]: ymwd</pre>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Testing The Configuration</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The next step is to test that MRTG can load the configuration file correctly.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Restart SNMP to make sure the disk monitoring commands in the snmpd.conf file are activated. Run the /usr/bin/mrtg command followed by the name of the configuration file three times. If all goes well, MRTG will complain only about the fact that certain database files don&#8217;t exist. MRTG then creates the files. By the third run, all the files are created and MRTG should operate smoothly.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# service snmpd restart
[root@bigboy tmp]# env LANG=C /usr/bin/mrtg /etc/mrtg/server-stats.cfg</pre>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Creating A New MRTG Index Page To Include This File</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Use the indexmaker command and include your original MRTG configuration file from Chapter 22, &#8220;<a title="Quick HOWTO : Ch22 : Monitoring Server Performance" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch22_:_Monitoring_Server_Performance">Monitoring Server Performance</a>&#8220;, (/etc/mrtg/mrtg.cfg) plus the new one you created (/etc/mrtg/server-stats.cfg).</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# indexmaker --output=/var/www/mrtg/index.html \
/etc/mrtg/mrtg.cfg /etc/mrtg/server-stats.cfg</pre>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Configuring cron To Use The New MRTG File</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The final step is to make sure that MRTG is configured to poll your server every five minutes using this new configuration file. To do so, add this line to your /etc/cron.d/mrtg file.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">0-59/5 * * * * root env LANG=C /usr/bin/mrtg /etc/mrtg/server-stats.cfg</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Some versions of Linux require you to edit your /etc/crontab file instead. See Chapter 22, &#8220;<a title="Quick HOWTO : Ch22 : Monitoring Server Performance" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch22_:_Monitoring_Server_Performance"> Monitoring Server Performance</a>&#8220;, for more details. You will also have to restart cron with the service crond restart for it to read its new configuration file that tells it to additionally run MRTG every five minutes using the new MRTG configuration file.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# service crond restart</pre>
<h1 style="color: green;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: #048444;font-size: 24px"><span>Monitoring Non Linux MIB Values</span></h1>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">All the MIBs mentioned so far are for Linux systems; other types of systems will need additional MIBs whose correct installation may be unclear in user guides or just not available. In such cases, you&#8217;ll need to know the exact value of the OID.</p>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Scenario</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Imagine that your small company has purchased a second-hand Cisco switch to connect its Web site servers to the Internet. The basic MRTG configuration shown in Chapter 22, &#8220;<a title="Quick HOWTO : Ch22 : Monitoring Server Performance" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch22_:_Monitoring_Server_Performance"> Monitoring Server Performance</a>&#8220;, provides the data bandwidth statistics, but you want to measure the CPU load the traffic is having on the device, as well. Downloading MIBs from Cisco and using them with the snmpget command was not a success. You do not know what to do next. Find The OIDs</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">When MIB values fail, it is best to try to find the exact OID value. Like most network equipment manufacturers, Cisco has an FTP site from which you can download both MIBs and OIDs. The SNMP files for Cisco&#8217;s devices can be found at ftp.cisco.com in the /pub/mibs directory; OIDs are in the oid directory beneath that.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">After looking at all the OID files, you decide that the file CISCO-PROCESS-MIB.oid will contain the necessary values and find these entries inside it.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">"cpmCPUTotalPhysicalIndex"  "1.3.6.1.4.1.9.9.109.1.1.1.1.2"
"cpmCPUTotal5sec"           "1.3.6.1.4.1.9.9.109.1.1.1.1.3"
"cpmCPUTotal1min"           "1.3.6.1.4.1.9.9.109.1.1.1.1.4"
"cpmCPUTotal5min"           "1.3.6.1.4.1.9.9.109.1.1.1.1.5"
"cpmCPUTotal5secRev"        "1.3.6.1.4.1.9.9.109.1.1.1.1.6"
"cpmCPUTotal1minRev"        "1.3.6.1.4.1.9.9.109.1.1.1.1.7"
"cpmCPUTotal5minRev"        "1.3.6.1.4.1.9.9.109.1.1.1.1.8"</pre>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Testing The OIDs</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">As you can see, all the OIDs are a part of the same tree starting with 1.3.6.1.4.1.9.9.109.1.1.1.1. The OIDs provided may be incomplete, so it is best to use the snmpwalk command to try to get all the values below this root first.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# snmpwalk -v1 -c craz33guy cisco-switch 1.3.6.1.4.1..9.9.109.1.1.1.1
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.1 = INTEGER: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.3.1 = Gauge32: 32
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.4.1 = Gauge32: 32
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.5.1 = Gauge32: 32
[root@bigboy tmp]#</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Although listed in the OID file, 1.1.1.1.6, 1.1.1.1.7, and 1.1.1.1.8 are not supported. Notice also how SNMP has determined that the first part of the OID value (1.3.6.1.4.1) in the original OID file maps to the word &#8220;enterprise&#8221;.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Next, you can use one the snmpget command to set only one of the OID values returned by snmpwalk.</p>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# snmpget -v1 -c craz33guy cisco-switch \
enterprises.9.9.109.1.1.1.1.5.1
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.5.1 = Gauge32: 33
[root@bigboy tmp]#</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Success! Now you can use this OID value, enterprises.9.9.109.1.1.1.1.5.1, for your MRTG queries.</p>
<h1 style="color: green;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: #048444;font-size: 24px"><span>Speeding up MRTG with RRDtool</span></h1>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">MRTG is a very useful program but it has a limitation. All the graphs and web pages are recreated each time a device is polled. This can potentially overload your MRTG server especially if you have a large number of monitored devices and the graphs take more than five minutes to generate. RRDtool is an application written by the creator of MRTG that can store general purpose data, but generates graphs on demand. Integrating MRTG with RRDtool can have very noticeable performance benefits. The example that follows will show you how to quickly implement a general purpose solution.</p>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Scenario</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The use of RRDtool is needed to reduce the load on a monitoring server that has been experiencing very sluggish performance due to the amount of MRTG graphs it has to regenerate every polling cycle.</p>
<ul>
<li>Due to space constraints, the RRD database needs to be located in the /var partition.</li>
<li>The server has a default Apache configuration with the CGI files needed for dynamically generated content being located in the /var/www/cgi-bin directory.</li>
<li>A CGI script is required that will read the new MRTG data in RRDtool format.</li>
<li>The MRTG configuration file is /etc/mrtg/mrtg.cfg.</li>
</ul>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Here&#8217;s how to proceed.</p>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Installing RRDtool</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The RRDtool and RRDtool PERL module file can be downloaded from its website at<a href="http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/">http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/</a>, but installation can be tricky as the installation program may look for certain supporting libraries in the wrong directories.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Fortunately the prerequisite rrdtool and rrdtool-perl packages now come as part of most Linux distributions. For more details on installing packages, see Chapter 6, &#8220;<a title="Quick HOWTO : Ch06 : Installing Linux Software" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch06_:_Installing_Linux_Software">Installing Linux Software</a>&#8220;).</p>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>Storing the MRTG Data in RRDtool Format</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">This phase of the integration process can be done in a few minutes, but the steps can be tricky:</p>
<ul>
<li>The first step is to add some new options to your cfgmaker command. The first indicates that MRTG should only store rrdtool formatted data, and the second defines the /var/mrtg directory in which it should be stored. For added security, the directory should be external to your web server&#8217;s document root.</li>
</ul>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">--global 'LogFormat: rrdtool' --global "workdir: /var/mrtg"  --global 'IconDir: /mrtg'</pre>
<dl>
<dd>Finally, you should also specify an icon directory which specifies the location of all miscellaneous MRTG web page icons. The RRD web interface script we&#8217;ll install later uses an incorrect location. The icon directory /mrtg is actually a partial URL location. In this Fedora scenario we are using the default Apache configuration which locates the MRTG icon files in the /var/www/mrtg directory. If you are using a non default Apache MRTG configuration or are using other Linux distributions or versions you may have to copy the icons to the custom directory in which the MRTG PNG format icon files are located.</dd>
</dl>
<dl>
<dd>The cfgmaker program is simple to use and is covered in in Chapter 22, &#8220;<a title="Quick HOWTO : Ch22 : Monitoring Server Performance" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch22_:_Monitoring_Server_Performance">Monitoring Server Performance</a>&#8220;.</dd>
</dl>
<ul>
<li>The next step is to create the data repository directory /var/mrtg and make it be owned by the apache user and process that runs the default Linux web server application.</li>
</ul>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# mkdir /var/mrtg
[root@bigboy tmp]# chown apache /var/mrtg
[root@bigboy tmp]#</pre>
<dl>
<dd><strong>Note:</strong> If you are using SELinux you&#8217;ll have to change the context of this directory to match that of the /var/www/html directory so that the apache process will be able to read the database files when your CGI script needs them. These commands compare the contexts of the both directories and apply the correct set to /var/mrtg.</dd>
</dl>
<dl>
<dd>Please refer to Chapter 20, &#8220;<a title="Quick HOWTO : Ch20 : The Apache Web Server" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch20_:_The_Apache_Web_Server"> The Apache Web Server</a>&#8221; for more details on file contexts with Apache.</dd>
</dl>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# ls -alZ /var/www | grep html
drwxr-xr-x  root     root     system_u:object_r:httpd_sys_content_t html
[root@bigboy tmp]# ls -alZ /var | grep mrtg
drwxr-xr-x  apache   root     root:object_r:var_t              mrtg
[root@bigboy tmp]# chcon -R -u system_u -r object_r -t httpd_sys_content_t /var/mrtg
[root@bigboy tmp]#</pre>
<ul>
<li>We now need to test that the RRD files are being created correctly. Run MRTG using the /etc/mrtg/mrtg.cfg file as the source configuration file then test to see if the contents of the /var/mrtg directory have changed. Success!</li>
</ul>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# ls /var/mrtg/
localhost_192.168.1.100.rrd
[root@bigboy tmp]#</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The files are being created properly. Now we need to find a script to read the new data format and present it in a web format. This will be discussed next.</p>
<h2 style="color: teal;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #aaaaaa;font-size: 19px"><span>The MRTG / RRDtool Integration Script</span></h2>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The MRTG website recommends the script located on the mrtg-rrd website (<a href="http://www.fi.muni.cz/~kas/mrtg-rrd/">http://www.fi.muni.cz/~kas/mrtg-rrd/</a>) as being a good one to use. Let&#8217;s go ahead and install it.</p>
<ul>
<li>Download the script using wget. The site lists several versions; make sure you get the latest one.</li>
</ul>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# wget <a href="ftp://ftp.linux.cz/pub/linux/people/jan_kasprzak/mrtg-rrd/mrtg-rrd-0.7.tar.gz">ftp://ftp.linux.cz/pub/linux/people/jan_kasprzak/mrtg-rrd/mrtg-rrd-0.7.tar.gz</a>
--12:42:12--  <a href="ftp://ftp.linux.cz/pub/linux/people/jan_kasprzak/mrtg-rrd/mrtg-rrd-0.7.tar.gz">ftp://ftp.linux.cz/pub/linux/people/jan_kasprzak/mrtg-rrd/mrtg-rrd-0.7.tar.gz</a>
           =&gt; `mrtg-rrd-0.7.tar.gz'
Resolving ftp.linux.cz... 147.251.48.205
Connecting to ftp.linux.cz|147.251.48.205|:21... connected.
Logging in as anonymous ... Logged in!
...
...
...
15:24:50 (53.53 KB/s) - `mrtg-rrd-0.7.tar.gz' saved [20863]
[root@bigboy tmp]# ls
mrtg-rrd-0.7.tar.gz
[root@bigboy tmp]#</pre>
<ul>
<li>Extract the contents of the tar file.</li>
</ul>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# tar -xzvf mrtg-rrd-0.7.tar.gz
mrtg-rrd-0.7/
mrtg-rrd-0.7/COPYING
mrtg-rrd-0.7/FAQ
mrtg-rrd-0.7/TODO
mrtg-rrd-0.7/Makefile
mrtg-rrd-0.7/mrtg-rrd.cgi
mrtg-rrd-0.7/ChangeLog
[root@bigboy tmp]#</pre>
<ul>
<li>Create the /var/www/cgi-bin/mrtg directory and copy the mrtg-rrd.cgi file to it.</li>
</ul>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[root@bigboy tmp]# mkdir -p /var/www/cgi-bin/mrtg
[root@bigboy tmp]# cp mrtg-rrd-0.7/mrtg-rrd.cgi /var/www/cgi-bin/mrtg/
[root@bigboy tmp]#</pre>
<ul>
<li>Edit the mrtg-rrd.cgi file and make it refer to the /etc/mrtg/mrtg.cfg file for its configuration details, or you can specify all the .cfg files in your /etc/mrtg directory.</li>
</ul>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">#
# File: mrtg-rrd.cgi (Single File)
#

# EDIT THIS to reflect all your MRTG config files
BEGIN { @config_files = qw(/etc/mrtg/mrtg.cfg); }</pre>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">#
# File: mrtg-rrd.cgi (multipl .cfg files)
#

# EDIT THIS to reflect all your MRTG config files
BEGIN { @config_files = &lt;/etc/mrtg/*.cfg&gt;; }</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">
<ul>
<li>You should now be able to access your MRTG RRD graphs by visiting this URL:</li>
</ul>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab"><a href="http://www.my-web-site.org/cgi-bin/mrtg/mrtg-rrd.cgi">http://www.my-web-site.org/cgi-bin/mrtg/mrtg-rrd.cgi</a></pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Once installed, RRDtool operates transparently with MRTG. You&#8217;ll have to remember to add the RRD statements to any new MRTG configurations and also add the configuration file to the CGI script. Our monitoring server can now breathe a little easier.</p>
<h1 style="color: green;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: #048444;font-size: 24px"><span>Troubleshooting</span></h1>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">The troubleshooting techniques for advanced MRTG are similar to those mentioned in Chapter 22, &#8220;<a title="Quick HOWTO : Ch22 : Monitoring Server Performance" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch22_:_Monitoring_Server_Performance">Monitoring Server Performance</a>&#8220;, but because you have done some customizations you&#8217;ll have to go the extra mile.</p>
<ul>
<li>Verify the IP address and community string of the target device you intend to poll.</li>
<li>Make sure you can do an SNMP walk of the target device. If not, revise your access controls on the target device and any firewall rules that may impede SNMP traffic.</li>
<li>Ensure you can do an SNMP get of the specific OID value listed in your MRTG configuration file.</li>
<li>Check your MRTG parameters to make sure they are correct. Gauge values defined as counter and vice versa will cause your graphs to have continuous zero values. Graph results that are eight times what you expect may have the bits parameter set.</li>
<li>There are a few errors common to initial RRDtool integration.</li>
</ul>
<dl>
<dd>Web messages like this where the reference to the MRTG configuration file in the CGI script was incorrect</dd>
</dl>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Error: Cannot open config file: No such file or directory</pre>
<dl>
<dd>&#8220;Permission Denied&#8221; web messages are usually caused by incorrect file permissions and / or SELinux contexts</dd>
</dl>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">Error: RRDs::graph failed, opening '/var/mrtg/localhost_192.168.1.100.rrd': Permission denied</pre>
<dl>
<dd>Errors in the /var/log/httpd/errorlog file referring to files or directories that don&#8217;t exist can be caused by an incorrect IconDir statement in the MRTG configuration file.</dd>
</dl>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">[Wed Jan 04 15:42:13 2006] [error] [client 192.168.1.102] File does not exist: /var/www/html/var,
referer: <a href="http://bigboy/cgi-bin/mrtg/mrtg-rrd.cgi/">http://bigboy/cgi-bin/mrtg/mrtg-rrd.cgi/</a> 

[Wed Jan 04 15:45:46 2006] [error] [client 192.168.1.102] script not found or unable to stat:
 /var/www/cgi-bin/mrtg/mrtg-l.png, referer: <a href="http://bigboy/cgi-bin/mrtg/mrtg-rrd.cgi/">http://bigboy/cgi-bin/mrtg/mrtg-rrd.cgi/</a></pre>
<dl>
<dd>Errors caused by not installing the pre-requisite RRD RPM modules rrdtool, perl-RRD-Simple and rrdtool-perl.</dd>
</dl>
<pre style="color: black;background-color: #f9f9f9;line-height: 1.1em;padding: 1em;border: 1px dashed #2f6fab">ERROR: could not find RRDs.pm. Use LibAdd: in mrtg.cfg to help mrtg find RRDs.pm</pre>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">These quick steps should be sufficient in most cases and will reward you with a more manageable network.</p>
<h1 style="color: green;background-color: initial;font-weight: normal;margin-top: 0px;margin-right: 0px;margin-bottom: 0.6em;margin-left: 0px;padding-top: 0.5em;padding-bottom: 0.17em;border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: #048444;font-size: 24px"><span>Conclusion</span></h1>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">Using the guidelines in this chapter you should be able to graph most SNMP MIB values available on any type of device. MRTG is an excellent, flexible monitoring tool and should be considered as a part of any systems administrator&#8217;s server management plans.</p>
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">
<p style="margin-top: 0.4em;margin-right: 0px;margin-bottom: 0.5em;margin-left: 0px;line-height: 1.5em">SOURCE: <a href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch23_:_Advanced_MRTG_for_Linux">http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch23_:_Advanced_MRTG_for_Linux</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/12/02/advanced-mrtg-configurations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Faster Way To Create New MySQL User</title>
		<link>http://blog.nataprawira.com/tech/2010/10/19/faster-way-to-create-new-mysql-user/</link>
		<comments>http://blog.nataprawira.com/tech/2010/10/19/faster-way-to-create-new-mysql-user/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 11:25:28 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/2010/10/19/faster-way-to-create-new-mysql-user/</guid>
		<description><![CDATA[

Only 3 simple steps 
CREATE USER 'full_priv_username'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'full_priv_username'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F10%2F19%2Ffaster-way-to-create-new-mysql-user%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F10%2F19%2Ffaster-way-to-create-new-mysql-user%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>Only 3 simple steps <img style="vertical-align: bottom" src="http://mail.google.com/mail/im/emoticons/square/smile.png" alt=":)" /></p>
<pre style="padding-left: 30px">CREATE USER 'full_priv_username'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'full_priv_username'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/10/19/faster-way-to-create-new-mysql-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change all fields/tables to a different collation</title>
		<link>http://blog.nataprawira.com/tech/2010/09/22/different-collation/</link>
		<comments>http://blog.nataprawira.com/tech/2010/09/22/different-collation/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 15:58:42 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Collation]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=165</guid>
		<description><![CDATA[

// this script will output the queries need to change all fields/tables to a different collation
// it is HIGHLY suggested you take a MySQL dump prior to running any of the generated
// this code is provided as is and without any warranty
This script will output the queries need to change all fields/tables to a different [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F09%2F22%2Fdifferent-collation%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F09%2F22%2Fdifferent-collation%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<div id="_mcePaste" style="width: 1px;height: 1px">// this script will output the queries need to change all fields/tables to a different collation</div>
<div id="_mcePaste" style="width: 1px;height: 1px">// it is HIGHLY suggested you take a MySQL dump prior to running any of the generated</div>
<div id="_mcePaste" style="width: 1px;height: 1px">// this code is provided as is and without any warranty</div>
<p>This script will output the queries need to change all fields/tables to a different collation.</p>
<p>It is HIGHLY suggested you take a MySQL dump prior to running any of the generated</p>
<p>This code is provided as is and without any warranty</p>
<blockquote><p>&lt;?php</p>
<p>// this script will output the queries need to change all fields/tables to a different collation</p>
<p>// it is HIGHLY suggested you take a MySQL dump prior to running any of the generated</p>
<p>// this code is provided as is and without any warranty</p>
<p>die(&#8221;Make a backup of your MySQL database then remove this line&#8221;);</p>
<p>set_time_limit(0);</p>
<p>// collation you want to change:</p>
<p>$convert_from = &#8216;latin1_swedish_ci&#8217;;</p>
<p>// collation you want to change it to:</p>
<p>$convert_to   = &#8216;utf8_general_ci&#8217;;</p>
<p>// character set of new collation:</p>
<p>$character_set= &#8216;utf8&#8242;;</p>
<p>$show_alter_table = true;</p>
<p>$show_alter_field = true;</p>
<p>// DB login information</p>
<p>$username = &#8216;username&#8217;;</p>
<p>$password = &#8216;password&#8217;;</p>
<p>$database = &#8216;database&#8217;;</p>
<p>$host     = &#8216;localhost&#8217;;</p>
<p>mysql_connect($host, $username, $password);</p>
<p>mysql_select_db($database);</p>
<p>$rs_tables = mysql_query(&#8221; SHOW TABLES &#8220;) or die(mysql_error());</p>
<p>print &#8216;&lt;pre&gt;&#8217;;</p>
<p>while ($row_tables = mysql_fetch_row($rs_tables)) {</p>
<p>$table = mysql_real_escape_string($row_tables[0]);</p>
<p>// Alter table collation</p>
<p>// ALTER TABLE `account` DEFAULT CHARACTER SET utf8</p>
<p>if ($show_alter_table) {</p>
<p>echo(&#8221;ALTER TABLE `$table` DEFAULT CHARACTER SET $character_set;\r\n&#8221;);</p>
<p>}</p>
<p>$rs = mysql_query(&#8221; SHOW FULL FIELDS FROM `$table` &#8220;) or die(mysql_error());</p>
<p>while ($row=mysql_fetch_assoc($rs)) {</p>
<p>if ($row['Collation']!=$convert_from)</p>
<p>continue;</p>
<p>// Is the field allowed to be null?</p>
<p>if ($row['Null']==&#8217;YES&#8217;) {</p>
<p>$nullable = &#8216; NULL &#8216;;</p>
<p>} else {</p>
<p>$nullable = &#8216; NOT NULL&#8217;;</p>
<p>}</p>
<p>// Does the field default to null, a string, or nothing?</p>
<p>if ($row['Default']==&#8217;NULL&#8217;) {</p>
<p>$default = &#8221; DEFAULT NULL&#8221;;</p>
<p>} else if ($row['Default']!=&#8221;) {</p>
<p>$default = &#8221; DEFAULT &#8216;&#8221;.mysql_real_escape_string($row['Default']).&#8221;&#8216;&#8221;;</p>
<p>} else {</p>
<p>$default = &#8221;;</p>
<p>}</p>
<p>// Alter field collation:</p>
<p>// ALTER TABLE `account` CHANGE `email` `email` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL</p>
<p>if ($show_alter_field) {</p>
<p>$field = mysql_real_escape_string($row['Field']);</p>
<p>echo &#8220;ALTER TABLE `$table` CHANGE `$field` `$field` $row[Type] CHARACTER SET $character_set COLLATE $convert_to $nullable $default; \r\n&#8221;;</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>?&gt;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/09/22/different-collation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to DISABLE ipv6 in CentOS5 System</title>
		<link>http://blog.nataprawira.com/tech/2010/07/19/how-to-disable-ipv6-in-centos5-system/</link>
		<comments>http://blog.nataprawira.com/tech/2010/07/19/how-to-disable-ipv6-in-centos5-system/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 09:20:32 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[ipv6]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=163</guid>
		<description><![CDATA[

echo &#8220;NETWORKING_IPV6=no&#8221; &#62;&#62; /etc/sysconfig/network
echo &#8220;alias ipv6 off&#8221; &#62;&#62; /etc/modprobe.conf
echo &#8220;alias net-pf-10 off&#8221; &#62;&#62; /etc/modprobe.conf
reboot
# ifconfig
eth1      Link encap:Ethernet  HWaddr 00:1C:F0:BB:A7:28
inet addr:10.10.10.11  Bcast:10.10.10.255  Mask:255.255.255.0
 inet6 addr: fe80::21c:f0ff:febb:a728/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:470449435 errors:1 dropped:0 overruns:0 frame:0
TX packets:464084402 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2563674692 (2.3 GiB)  TX bytes:2243518951 (2.0 GiB)
Interrupt:225 Base address:0&#215;2800
Don&#8217;t really [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F07%2F19%2Fhow-to-disable-ipv6-in-centos5-system%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F07%2F19%2Fhow-to-disable-ipv6-in-centos5-system%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<div id="_mcePaste" style="width: 1px;height: 1px">echo &#8220;NETWORKING_IPV6=no&#8221; &gt;&gt; /etc/sysconfig/network</div>
<div id="_mcePaste" style="width: 1px;height: 1px">echo &#8220;alias ipv6 off&#8221; &gt;&gt; /etc/modprobe.conf</div>
<div id="_mcePaste" style="width: 1px;height: 1px">echo &#8220;alias net-pf-10 off&#8221; &gt;&gt; /etc/modprobe.conf</div>
<div id="_mcePaste" style="width: 1px;height: 1px">reboot</div>
<p><strong># ifconfig</strong></p>
<blockquote><p>eth1      Link encap:Ethernet  HWaddr 00:1C:F0:BB:A7:28<br />
inet addr:10.10.10.11  Bcast:10.10.10.255  Mask:255.255.255.0<br />
<strong> inet6 addr: fe80::21c:f0ff:febb:a728/64 Scope:Link<br />
</strong> UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
RX packets:470449435 errors:1 dropped:0 overruns:0 frame:0<br />
TX packets:464084402 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:2563674692 (2.3 GiB)  TX bytes:2243518951 (2.0 GiB)<br />
Interrupt:225 Base address:0&#215;2800</p></blockquote>
<div>Don&#8217;t really need of ipv6 to be run on your server. Want to disable it ?</div>
<p><span id="more-163"></span>Just run the following syntax&#8230;</p>
<p><em><span style="color: #993300">Make sure no such entries inside: </span></em><strong><em><span style="color: #333300">/etc/sysconfig/network</span></em></strong><em><span style="color: #993300"> and </span></em><strong><em><span style="color: #333300">/etc/modprobe.conf</span></em></strong><em><span style="color: #993300"> file <img src='http://blog.nataprawira.com/tech/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </span></em></p>
<blockquote><p># echo &#8220;NETWORKING_IPV6=no&#8221; &gt;&gt; /etc/sysconfig/network<br />
# echo &#8220;alias ipv6 off&#8221; &gt;&gt; /etc/modprobe.conf<br />
# echo &#8220;alias net-pf-10 off&#8221; &gt;&gt; /etc/modprobe.conf<br />
# reboot <span style="color: #0000ff"> </span><em><span style="color: #0000ff">(your server to make affect)</span></em></p></blockquote>
<p>Once reboot-ed, do :</p>
<p># ifconfig</p>
<blockquote><p>eth1      Link encap:Ethernet  HWaddr 00:1C:F0:BB:A7:28<br />
inet addr:10.10.10.11  Bcast:10.10.10.255  Mask:255.255.255.0<br />
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
RX packets:470471884 errors:1 dropped:0 overruns:0 frame:0<br />
TX packets:464109169 errors:0 dropped:0 overruns:0 carrier:0<br />
collisions:0 txqueuelen:1000<br />
RX bytes:2574513731 (2.3 GiB)  TX bytes:2255015395 (2.1 GiB)<br />
Interrupt:225 Base address:0&#215;2800</p></blockquote>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/07/19/how-to-disable-ipv6-in-centos5-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripting a MySQL InnoDB Engine Conversion</title>
		<link>http://blog.nataprawira.com/tech/2010/07/11/scripting-a-mysql-innodb-engine-conversion/</link>
		<comments>http://blog.nataprawira.com/tech/2010/07/11/scripting-a-mysql-innodb-engine-conversion/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 19:50:08 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Conversion]]></category>
		<category><![CDATA[InnoDB]]></category>
		<category><![CDATA[MyISAM]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=161</guid>
		<description><![CDATA[

0) Backup your database.
You should probably be doing this already.  Now’s a good time to make sure that your backups ran.
 
1) Create the script.
You’ll need the correct permissions to query the database. Here’s the command.  Be sure to change &#60;DATABASE_NAME&#62; as it fits.
# mysql -p -e "show tables in &#60;DATABASE_NAME&#62;;" &#124; \
tail --lines=+2 &#124; [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F07%2F11%2Fscripting-a-mysql-innodb-engine-conversion%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F07%2F11%2Fscripting-a-mysql-innodb-engine-conversion%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<h3 style="font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, sans-serif;font-weight: bold;font-size: 1.3em;color: #333333;text-decoration: none;margin-top: 30px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;padding: 0px"><span style="color: #000000;font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-weight: normal;font-size: 13px"><strong>0) Backup your database.<br />
</strong>You should probably be doing this already.  Now’s a good time to make sure that your backups ran.</span></h3>
<p><span style="color: #000000;font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-weight: normal;font-size: 13px"> </span></p>
<p><strong>1) Create the script.<br />
</strong>You’ll need the correct permissions to query the database. Here’s the command.  Be sure to change &lt;DATABASE_NAME&gt; as it fits.</p>
<p><code style="font: normal normal normal 1.1em/normal 'Courier New', Courier, Fixed"><strong><span style="color: #0000ff"># mysql -p -e "show tables in &lt;DATABASE_NAME&gt;;" | \<br />
tail --lines=+2 | \<br />
xargs -i echo "ALTER TABLE {} ENGINE=INNODB;" &gt; alter_table.sql</span></strong></code></p>
<p><strong>2) Run the script</strong>.</p>
<p><code style="font: normal normal normal 1.1em/normal 'Courier New', Courier, Fixed"><strong><span style="color: #0000ff"># mysql --database=&lt;DATABASE_NAME&gt; -p &lt; alter_table.sql</span></strong></code></p>
<p><strong>3) Verify</strong> it by running this command in mysql:</p>
<p><code style="font: normal normal normal 1.1em/normal 'Courier New', Courier, Fixed"><strong><span style="color: #0000ff">mysql&gt; show table status;</span></strong></code></p>
<p><span id="more-161"></span></p>
<p><strong><a title="http://technotes.twosmallcoins.com/?cat=268" href="http://technotes.twosmallcoins.com/?cat=268" target="_blank">SOURCE</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/07/11/scripting-a-mysql-innodb-engine-conversion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple MySQL Backup with auto 3 days old file deletion</title>
		<link>http://blog.nataprawira.com/tech/2010/07/04/simple-mysql-backup-with-auto-3-days-old-file-deletion/</link>
		<comments>http://blog.nataprawira.com/tech/2010/07/04/simple-mysql-backup-with-auto-3-days-old-file-deletion/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 13:57:27 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Delete]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=152</guid>
		<description><![CDATA[

/usr/local/bin/mysql.backup.sh

#!/bin/bash
NOW=$(date +"%m-%d-%Y")
OLD=$(date +"%m-%d-%Y" --date="3 days ago")
PROJECT="project_name"
LOCATION="/home/backup"
FILE="$PROJECT.$NOW.sql"
FILE2="$FILE.gz"
FILEOLD="$PROJECT.$OLD.sql.gz"
EMAIL="youremail@domain.com"
$SQLUSER="username"
$SQLPASS="password"
$SQLNAME="database_name"
cd $LOCATION ; \
rm -f $FILEOLD ; \
mysqldump -u $SQLUSER --password=$SQLPASS $SQLNAME &#62; \
$LOCATION/$FILE ; \
gzip $LOCATION/$FILE ; \
echo "Backup location is in $LOCATION/$FILE2" &#124; \
mail -s "[$PROJECT] MySQL Backup" $EMAIL

Then you can put it on your cron (background process)
Below cron will execute the script on Saturday at 12AM:

0 0 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F07%2F04%2Fsimple-mysql-backup-with-auto-3-days-old-file-deletion%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F07%2F04%2Fsimple-mysql-backup-with-auto-3-days-old-file-deletion%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><strong>/usr/local/bin/mysql.backup.sh</strong></p>
<blockquote>
<pre><strong><span style="color: #000080">#!/bin/bash
NOW=$(date +"%m-%d-%Y")
OLD=$(date +"%m-%d-%Y" --date="3 days ago")
PROJECT="project_name"
LOCATION="/home/backup"
FILE="$PROJECT.$NOW.sql"
FILE2="$FILE.gz"
FILEOLD="$PROJECT.$OLD.sql.gz"
EMAIL="youremail@domain.com"
$SQLUSER="username"
$SQLPASS="password"
$SQLNAME="database_name"</span></strong></pre>
<pre><strong><span style="color: #000080">cd $LOCATION ; \
rm -f $FILEOLD ; \
mysqldump -u $SQLUSER --password=$SQLPASS $SQLNAME &gt; \
$LOCATION/$FILE ; \
gzip $LOCATION/$FILE ; \
echo "Backup location is in $LOCATION/$FILE2" | \
mail -s "[$PROJECT] MySQL Backup" $EMAIL</span></strong></pre>
</blockquote>
<p>Then you can put it on your cron (background process)</p>
<p>Below cron will execute the script on <strong>Saturday at 12AM</strong>:</p>
<blockquote>
<pre><strong><span style="color: #000080">0 0 * * 6 /usr/local/bin/mysql.backup.sh</span></strong></pre>
</blockquote>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/07/04/simple-mysql-backup-with-auto-3-days-old-file-deletion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Getting Yesterdays or Tomorrows day with shell date command</title>
		<link>http://blog.nataprawira.com/tech/2010/06/29/how-to-getting-yesterdays-or-tomorrows-day-with-shell-date-command/</link>
		<comments>http://blog.nataprawira.com/tech/2010/06/29/how-to-getting-yesterdays-or-tomorrows-day-with-shell-date-command/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 18:37:22 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Date]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=146</guid>
		<description><![CDATA[

When invoked without arguments, the date command displays the current date and time. Depending on the options specified, date will set the date and time or print it in a user defined way. I’ve seen many people writing a perl script for calculating yesterday or tomorrow. Computer loves numbers but we love relative terms like [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F06%2F29%2Fhow-to-getting-yesterdays-or-tomorrows-day-with-shell-date-command%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F06%2F29%2Fhow-to-getting-yesterdays-or-tomorrows-day-with-shell-date-command%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">When invoked without arguments, the date command displays the current date and time. Depending on the options specified, date will set the date and time or print it in a user defined way. I’ve seen many people writing a perl script for calculating yesterday or tomorrow. Computer loves numbers but we love relative terms like 2 days ago. Luckily GNU date command is designed to handle relative date calculation.<span id="more-146"></span></p>
<h3 style="margin-top: 1.833em;margin-right: 0px;margin-bottom: 0.611em;margin-left: 0px;font-weight: normal;font-size: 1.286em;line-height: 1.222em;padding: 0px">Why use relative date formats?</h3>
<ul style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 1.571em;padding: 0px">
<li>Ease of use</li>
<li>To write your own scripts</li>
<li>Automate task using cron (example run a job on last day of the month or Nth day of the month or 3rd Friday and so on)</li>
</ul>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">First, print today&#8217;s date:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ <strong>date</strong></code><br />
Sun Jun 17 12:17:24 CDT 2007</p>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">Now display Yesterday&#8217;s date:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date --date="1 days ago"</code><br />
OR try:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date --date="yesterday"</code><br />
Sat Jun 16 12:17:20 CDT 2007</p>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">Now display Tomorrow&#8217;s date:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date --date="-1 days ago"</code><br />
Or better try:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date --date="next day"</code><br />
Sat Jun 16 12:17:20 CDT 2007</p>
<h3 style="margin-top: 1.833em;margin-right: 0px;margin-bottom: 0.611em;margin-left: 0px;font-weight: normal;font-size: 1.286em;line-height: 1.222em;padding: 0px">Getting date in the future</h3>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">To get tomorrow and day after tomorrow (tomorrow+N) use <strong>day</strong> word to get date in the future.</p>
<h3 style="margin-top: 1.833em;margin-right: 0px;margin-bottom: 0.611em;margin-left: 0px;font-weight: normal;font-size: 1.286em;line-height: 1.222em;padding: 0px">Getting date in the past</h3>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">To get yesterday and earlier day in the past use string <strong>day ago</strong>:</p>
<h3 style="margin-top: 1.833em;margin-right: 0px;margin-bottom: 0.611em;margin-left: 0px;font-weight: normal;font-size: 1.286em;line-height: 1.222em;padding: 0px">Moving by whole years or months</h3>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">You can add year and months keywords to get more accurate date:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date --date='2 year ago' # past<br />
$ date --date='3 years' # go into future<br />
$ date --date='2 days' # future<br />
$ date --date='1 month ago' # past<br />
$ date --date='2 months' # future</code></p>
<h3 style="margin-top: 1.833em;margin-right: 0px;margin-bottom: 0.611em;margin-left: 0px;font-weight: normal;font-size: 1.286em;line-height: 1.222em;padding: 0px">Moving date using more precise units</h3>
<ul style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 1.571em;padding: 0px">
<li>You can use fortnight for 14 day</li>
<li>Week for 7 days</li>
<li>hour for 60 minutes</li>
<li>minute for 60 seconds</li>
<li>second for one second</li>
<li>You can also use this / now / today keywords to stress the meaning</li>
</ul>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">To print the date of this Friday:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date --date='this Friday'</code><br />
To print the date of the day six months and 15 day<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date --date='6 months 15 day'</code><br />
To print the date of the day two months and 5 days ago:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date --date='2 months 5 day ago'</code></p>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">You can also use relative format to setup date and time. For example to set the system clock forward by 30 minutes, enter:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd"># date --set='+30 minutes'</code></p>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">To display date in <a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a>:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date --date='1970-01-01 00:00:01 UTC +5 hours' +%s</code></p>
<h4 style="font-weight: bold;font-size: 1em;padding: 0px;margin: 0px"><a href="http://www.cyberciti.biz/tips/linux-unix-get-yesterdays-tomorrows-date.html" target="_blank">SOURCE</a></h4>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/06/29/how-to-getting-yesterdays-or-tomorrows-day-with-shell-date-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to format date for display or to use in a shell script</title>
		<link>http://blog.nataprawira.com/tech/2010/06/29/how-to-format-date-for-display-or-to-use-in-a-shell-script/</link>
		<comments>http://blog.nataprawira.com/tech/2010/06/29/how-to-format-date-for-display-or-to-use-in-a-shell-script/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 18:35:12 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Date]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=144</guid>
		<description><![CDATA[

Q. How do I format date to display on screen on for my scripts as per my requirements?
A. You need to use standard date command to format date or time for output or to use in a shell script.
Syntax to specify format
date +FORMAT

Task: Display date in mm-dd-yy format
Type the command as follows:
$ date +"%m-%d-%y"
Output:
02-27-07
Turn on 4 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F06%2F29%2Fhow-to-format-date-for-display-or-to-use-in-a-shell-script%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F06%2F29%2Fhow-to-format-date-for-display-or-to-use-in-a-shell-script%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">Q. How do I format date to display on screen on for my scripts as per my requirements?</p>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">A. You need to use standard date command to format date or time for output or to use in a shell script.</p>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">Syntax to specify format<br />
<strong>date <span style="color: #ff0000;padding: 0px;margin: 0px">+FORMAT<span id="more-144"></span><br />
</span></strong></p>
<h3 style="margin-top: 1.833em;margin-right: 0px;margin-bottom: 0.611em;margin-left: 0px;font-weight: normal;font-size: 1.286em;line-height: 1.222em;padding: 0px">Task: Display date in mm-dd-yy format</h3>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">Type the command as follows:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date +"%m-%d-%y"</code><br />
Output:</p>
<pre style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;background-color: #eeeeee;clear: both;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;line-height: 1.5em;border: 1px solid #dddddd">02-27-07</pre>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">Turn on 4 digit year display:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date +"%m-%d-%Y"</code><br />
Just display date as mm/dd/yy format:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date +"%D"</code></p>
<h3 style="margin-top: 1.833em;margin-right: 0px;margin-bottom: 0.611em;margin-left: 0px;font-weight: normal;font-size: 1.286em;line-height: 1.222em;padding: 0px">Task: Display time only</h3>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">Type the command as follows:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date +"%T"</code><br />
Output:</p>
<pre style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;background-color: #eeeeee;clear: both;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;line-height: 1.5em;border: 1px solid #dddddd">19:55:04</pre>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">Display locale’s 12-hour clock time<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date +"%r"</code><br />
Output:</p>
<pre style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;background-color: #eeeeee;clear: both;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;line-height: 1.5em;border: 1px solid #dddddd">07:56:05 PM</pre>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">Display time in HH:MM format:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ date +"%H-%M"</code></p>
<h3 style="margin-top: 1.833em;margin-right: 0px;margin-bottom: 0.611em;margin-left: 0px;font-weight: normal;font-size: 1.286em;line-height: 1.222em;padding: 0px">How do I save time/date format to a variable?</h3>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">Simply type command as follows at a shell prompt:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ NOW=$(date +"%m-%d-%Y")</code><br />
To display a variable use <a href="http://www.cyberciti.biz/faq/how-to-write-output-to-terminal/" target="_blank">echo / printf command</a>:<br />
<code style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;line-height: 1.5em;background-color: #eeeeee;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;border: 1px solid #dddddd">$ echo $NOW</code><br />
Sample shell script:</p>
<pre style="padding-top: 0.667em;padding-right: 0.917em;padding-bottom: 0.667em;padding-left: 0.917em;margin-top: 0px;margin-right: 0px;margin-bottom: 1.833em;margin-left: 0px;background-color: #eeeeee;clear: both;font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif;font-size: 0.857em;line-height: 1.5em;border: 1px solid #dddddd">#!/bin/bash
NOW=$(date +"%m-%d-%Y")
FILE="backup.$NOW.tar.gz"
# rest of script</pre>
<h3 style="margin-top: 1.833em;margin-right: 0px;margin-bottom: 0.611em;margin-left: 0px;font-weight: normal;font-size: 1.286em;line-height: 1.222em;padding: 0px">Complete list of FORMAT control characters supported by date command</h3>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">FORMAT controls the output.It can be the combination of any one of the following:</p>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">
<dl>
<dt>%%</dt>
<dd>a literal %</dd>
<dt>%a</dt>
<dd>locale&#8217;s abbreviated weekday name (e.g., Sun)</dd>
<dt>%A</dt>
<dd>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">locale&#8217;s full weekday name (e.g., Sunday)</p>
</dd>
<dt>%b</dt>
<dd>locale&#8217;s abbreviated month name (e.g., Jan)</dd>
<dt>%B</dt>
<dd>locale&#8217;s full month name (e.g., January)</dd>
<dt>%c</dt>
<dd>locale&#8217;s date and time (e.g., Thu Mar 3 23:05:25 2005)</dd>
<dt>%C</dt>
<dd>century; like %Y, except omit last two digits (e.g., 21)</dd>
<dt>%d</dt>
<dd>day of month (e.g, 01)</dd>
<dt>%D</dt>
<dd>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">date; same as %m/%d/%y</p>
</dd>
<dt>%e</dt>
<dd>day of month, space padded; same as %_d</dd>
<dt>%F</dt>
<dd>full date; same as %Y-%m-%d</dd>
<dt>%g</dt>
<dd>last two digits of year of ISO week number (see %G)</dd>
<dt>%G</dt>
<dd>year of ISO week number (see %V); normally useful only with %V</dd>
<dt>%h</dt>
<dd>same as %b</dd>
<dt>%H</dt>
<dd>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">hour (00..23)</p>
</dd>
<dt>%I</dt>
<dd>hour (01..12)</dd>
<dt>%j</dt>
<dd>day of year (001..366)</dd>
<dt>%k</dt>
<dd>hour ( 0..23)</dd>
<dt>%l</dt>
<dd>hour ( 1..12)</dd>
<dt>%m</dt>
<dd>month (01..12)</dd>
<dt>%M</dt>
<dd>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">minute (00..59)</p>
</dd>
<dt>%n</dt>
<dd>a newline</dd>
<dt>%N</dt>
<dd>nanoseconds (000000000..999999999)</dd>
<dt>%p</dt>
<dd>locale&#8217;s equivalent of either AM or PM; blank if not known</dd>
<dt>%P</dt>
<dd>like %p, but lower case</dd>
<dt>%r</dt>
<dd>locale&#8217;s 12-hour clock time (e.g., 11:11:04 PM)</dd>
<dt>%R</dt>
<dd>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">24-hour hour and minute; same as %H:%M</p>
</dd>
<dt>%s</dt>
<dd>seconds since 1970-01-01 00:00:00 UTC</dd>
<dt>%S</dt>
<dd>second (00..60)</dd>
<dt>%t</dt>
<dd>a tab</dd>
<dt>%T</dt>
<dd>time; same as %H:%M:%S</dd>
<dt>%u</dt>
<dd>day of week (1..7); 1 is Monday</dd>
<dt>%U</dt>
<dd>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">week number of year, with Sunday as first day of week (00..53)</p>
</dd>
<dt>%V</dt>
<dd>ISO week number, with Monday as first day of week (01..53)</dd>
<dt>%w</dt>
<dd>day of week (0..6); 0 is Sunday</dd>
<dt>%W</dt>
<dd>week number of year, with Monday as first day of week (00..53)</dd>
<dt>%x</dt>
<dd>locale&#8217;s date representation (e.g., 12/31/99)</dd>
<dt>%X</dt>
<dd>locale&#8217;s time representation (e.g., 23:13:48)</dd>
<dt>%y</dt>
<dd>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">last two digits of year (00..99)</p>
</dd>
<dt>%Y</dt>
<dd>year</dd>
<dt>%z</dt>
<dd>+hhmm numeric timezone (e.g., <strong>-0400</strong>)</dd>
<dt>%:z</dt>
<dd>+hh:mm numeric timezone (e.g., <strong>-04</strong>:00)</dd>
<dt>%::z</dt>
<dd>+hh:mm:ss numeric time zone (e.g., <strong>-04</strong>:00:00)</p>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px">
</dd>
<dt>%:::z</dt>
<dd>numeric time zone with : to necessary precision (e.g., <strong>-04</strong>, +05:30)</dd>
<dt>%Z</dt>
<dd>alphabetic time zone abbreviation (e.g., EDT)</dd>
</dl>
<p style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 0px;padding: 0px"><a href="http://www.cyberciti.biz/faq/linux-unix-formatting-dates-for-display/" target="_blank"><strong> SOURCE</strong></a></p>
<h3 style="margin-top: 1.833em;margin-right: 0px;margin-bottom: 0.611em;margin-left: 0px;font-weight: normal;font-size: 1.286em;line-height: 1.222em;padding: 0px">See also:</h3>
<ul style="margin-top: 0px;margin-right: 0px;margin-bottom: 1.571em;margin-left: 1.571em;padding: 0px">
<li><a href="http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html" target="_blank">Shell Scripting: Creating report/log file names with date in filename</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/06/29/how-to-format-date-for-display-or-to-use-in-a-shell-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up DomainKeys on Centos</title>
		<link>http://blog.nataprawira.com/tech/2010/03/09/setting-up-domainkeys-on-centos/</link>
		<comments>http://blog.nataprawira.com/tech/2010/03/09/setting-up-domainkeys-on-centos/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 14:30:22 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[DKIM]]></category>
		<category><![CDATA[DomainKeys]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=140</guid>
		<description><![CDATA[

This is a quick walk through on how to set up domain keys on Centos 5 using sendmail. It should also be very similar for Redhat or Fedora.

Domainkeys is a method mostly used by yahoo to verify that the sender of an email is valid. I did notice that gmail changes the domainkeys header line [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F03%2F09%2Fsetting-up-domainkeys-on-centos%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F03%2F09%2Fsetting-up-domainkeys-on-centos%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<h2><span style="font-weight: normal;font-size: 13px">This is a quick walk through on how to set up domain keys on Centos 5 using sendmail. It should also be very similar for Redhat or Fedora.</span></h2>
<div>
<p>Domainkeys is a method mostly used by yahoo to verify that the sender of an email is valid. I did notice that gmail changes the domainkeys header line to a pass value but I don’t know if they block/accept mail based on that.<span id="more-140"></span></p>
<p>First install some dependencies.</p>
<blockquote><p><strong>yum install sendmail-devel openssl-devel</strong></p></blockquote>
<p>First download the latest version of dk-milter by going to http://sourceforge.net/projects/dk-milter/</p>
<blockquote><p><strong>cd /usr/src/<br />
wget http://downloads.sourceforge.net/dk-milter/dk-milter-1.0.0.tar.gz</strong></p></blockquote>
<p>Then extract it using the command</p>
<blockquote><p><strong>tar xzf dk-milter-1.0.0.tar.gz<br />
cd dk-milter-2.6.0</strong></p></blockquote>
<p>Start by copying the sample config file to the proper directory and the make/make installing</p>
<blockquote><p><strong>cp site.config.m4.dist devtools/Site/site.config.m4<br />
make; make install</strong></p>
<p><span> </span></p></blockquote>
<p>You may see a few errors during the install, as long as they are just about creating the man pages you should be alright. Now change back to a good working directory and create your new keys.</p>
<blockquote><p><strong>cd ~/ssl-gen<br />
openssl genrsa -out rsa.private 768<br />
openssl rsa -in rsa.private -out rsa.public -pubout -outform PEM</strong></p></blockquote>
<p>Make the directory and move the private key into it.</p>
<blockquote><p><strong>mkdir -p /var/db/domainkeys/<br />
cp rsa.private /var/db/domainkeys/mail.key.pem</strong></p></blockquote>
<p>Now we should set up our DNS TXT records with our public key. This is how it should look in a bind zone file. Put the public key only and not the “BEGIN RSA PRIVATE…” or “END RSA…” parts of the key with out parenthesis.</p>
<blockquote><p><strong>mail._domainkey.jkurtzman.com.         IN TXT  “k=rsa; t=y; p=(Paste the public key here)”<br />
_domainkey.jkurtzman.com.                 IN TXT  “t=y; o=~”</strong></p></blockquote>
<p>You can use the following command to verify that your TXT record was set up correctly.</p>
<blockquote><p><strong>dig +short mail._domainkey.jkurtzman.com TXT</strong></p></blockquote>
<p>Now we will need to make the init script so the it starts when the computer reboots. Put the following into a file called <strong>/etc/init.d/domainkeys</strong>. Of course be sure to change the domain to your own domain. Remember to fix any lines that have wrapped when copying. Especially the COMMAND line.</p>
<blockquote><p><strong>#!/bin/sh<br />
#<br />
# “/etc/rc.d/init.d/dk-filter”<br />
# Start/stop script for the dk-filter daemon on RedHat Linux<br />
#<br />
# chkconfig: – 79 31<br />
# description: Acts as the “dk-filter” InputMailFilter (milter) for the \<br />
# Sendmail MTA to provide DomainKeys service</strong></p>
<p><strong>############################################################<br />
#<br />
# Be sure to edit these values:<br />
#<br />
KEYFILE=”/var/db/domainkeys/mail.key.pem”<br />
DOMAIN=”jkurtzman.com”<br />
SELECTOR=”mail”<br />
USER=”domainkeys”<br />
#<br />
############################################################</strong></p>
<p><strong>PIDFILE=”/var/run/dk-milter/pid”<br />
SUBMISSION_DAEMON=”smtp”<br />
PORT=8891</strong></p>
<p><strong># Source function library. Provides the “status” option<br />
. /etc/init.d/functions</strong></p>
<p><strong>test -x `which dk-filter` || exit 0</strong></p>
<p><strong>RETVAL=0</strong></p>
<p><strong>start() {<br />
echo -n $”Starting dk-filter: ”<br />
COMMAND=”dk-filter -u $USER -b s -p inet:$PORT@localhost -l -P $PIDFILE -s $KEYFILE -d $DOMAIN -S $SELECTOR -m$SUBMISSION_DAEMON -c nofws”<br />
# echo -e “Now executing\n”$COMMAND”&#8221;<br />
daemon $COMMAND<br />
RETVAL=$?<br />
echo<br />
[ $RETVAL -eq 0 ] &amp;&amp; touch /var/lock/subsys/dk-filter<br />
return $RETVAL<br />
}</strong></p>
<p><strong>stop() {<br />
echo -n $”Stopping dk-filter: ”<br />
killproc dk-filter<br />
RETVAL=$?<br />
echo<br />
[ $RETVAL -eq 0 ] &amp;&amp; rm -f $PIDFILE /var/lock/subsys/dk-filter<br />
return $RETVAL<br />
}</strong></p>
<p><strong>restart() {<br />
stop<br />
start<br />
}</strong></p>
<p><strong>case “$1″ in<br />
start)<br />
start<br />
;;<br />
stop)<br />
stop<br />
;;<br />
status)<br />
status dk-filter<br />
;;<br />
restart)<br />
restart<br />
;;<br />
*)<br />
echo $”Usage: $0 {start|stop|status|restart}”<br />
exit 1<br />
esac</strong></p>
<p><strong>exit $?</strong></p></blockquote>
<p>Give your new file execute permisions, create a user for domain keys to run as, and start it</p>
<blockquote><p><strong>chmod +x /etc/init.d/domainkeys<br />
useradd domainkeys<br />
service domainkeys start</strong></p></blockquote>
<p>If everything work you should see that the dk-filter has started.<br />
Now run chkconfig so the service starts when you reboot.</p>
<blockquote><p><strong>chkconfig domainkeys on</strong></p></blockquote>
<p>Now add this to your /etc/mail/sendmail.mc file.</p>
<blockquote><p><strong>INPUT_MAIL_FILTER(`dk-filter’, `S=inet:8891@localhost’)</strong></p></blockquote>
<p>And make and restart sendmail.</p>
<blockquote><p><strong>cd /etc/mail<br />
make<br />
service sendmail restart</strong></p></blockquote>
<p>You should now be able to send email and be domainkey verified. If you are relaying mail through the mail server you will need to make sure you are using SMTP Authentication otherwise the  dk-filter will not add the header information.</p>
<p>Try sending an email to a yahoo account and see if you get secure icon.</p>
<p><span style="font-family: 'Trebuchet MS';font-size: x-small"> </span></p>
<h1><span style="font-family: 'Trebuchet MS'">Source:</span></h1>
<h1><span style="font-family: 'Trebuchet MS'"><a href="http://luxio.us/cMZ11e" target="_blank">http://luxio.us/cMZ11e </a></span></h1>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/03/09/setting-up-domainkeys-on-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BlackBerry Bold 9700 (Onyx) Features</title>
		<link>http://blog.nataprawira.com/tech/2010/02/26/blackberry-bold-9700-onyx-features/</link>
		<comments>http://blog.nataprawira.com/tech/2010/02/26/blackberry-bold-9700-onyx-features/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 01:24:23 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Blackberry]]></category>
		<category><![CDATA[9700]]></category>
		<category><![CDATA[Bold]]></category>
		<category><![CDATA[Onyx]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/2010/02/26/blackberry-bold-9700-onyx-features/</guid>
		<description><![CDATA[

Features: Voice-Activated Dialing, MMS Enabled, Global Ready, Video Recording, Color Screen, Bluetooth Enabled, GPS, Calendar, Email Access, Internet Browser, Wi-Fi Capable, SMS-Text Messaging, 3G Data Capable, QWERTY Keyboard, Speakerphone
Camera: 3 Megapixels &#38; Up
Available Features
• Trackpad navigation
• Bright, hi-resolution screen
• Full QWERTY keyboard
• 3G technology
• Wi-Fi® and Bluetooth® enabled
• 256MB flash memory
• 3.2 MP digital camera with video camera
• Multimedia player
• Wireless email
• Organizer
• Browser
• Phone
• SMS/MMS 
Display
• High resolution 480&#215;360 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F02%2F26%2Fblackberry-bold-9700-onyx-features%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F02%2F26%2Fblackberry-bold-9700-onyx-features%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>Features: Voice-Activated Dialing, MMS Enabled, Global Ready, Video Recording, Color Screen, Bluetooth Enabled, GPS, Calendar, Email Access, Internet Browser, Wi-Fi Capable, SMS-Text Messaging, 3G Data Capable, QWERTY Keyboard, Speakerphone<br />
Camera: 3 Megapixels &amp; Up<br />
Available Features<br />
• Trackpad navigation<br />
• Bright, hi-resolution screen<br />
• Full QWERTY keyboard<br />
• 3G technology<br />
• Wi-Fi® and Bluetooth® enabled<br />
• 256MB flash memory<br />
• 3.2 MP digital camera with video camera<br />
• Multimedia player<br />
• Wireless email<br />
• Organizer<br />
• Browser<br />
• Phone<br />
• SMS/MMS <br />
Display<br />
• High resolution 480&#215;360 pixel<br />
color display<br />
• Transmissive TFT LCD<br />
• Supports over 65,000 colors<br />
• 2.44&#8243; (diagonally measured)</p>
<p>Camera &amp; Video Recording<br />
• 3.2 MP Camera<br />
• Auto Focus, Image Stabilization<br />
• Flash<br />
• 2X digital zoom </p>
<p>Video camera recording:<br />
Normal Mode (480 x 352 pixel),<br />
MMS Mode (176 x 144 pixel)<br />
Maps &amp; GPS<br />
• Includes BlackBerry Maps<br />
• Integrated GPS with A-GPS<br />
Data Input &amp; Navigation<br />
• 35 key backlit QWERTY keyboard<br />
• Dedicated Keys: Send, End, VAD (User Customizable), Camera (User Customizable), 2 x Volume/Zoom<br />
• Trackpad &#8211; Located on front face of device, ESC Key to the right, Menu to the left<br />
• Intuitive icons and menus<br />
Voice Input &amp; Output<br />
• Integrated speaker and microphone<br />
• Hands-free headset capable<br />
• Bluetooth headset capable<br />
• Integrated Hands-Free Speakerphone<br />
• Rating for hearing aids (PDF): M3, T3 (in cellular bands only)<br />
Media Player<br />
• Video format support: XviD partially supported, H.263, H.264, WMV3, MPEG4, Sorenson Spark &amp; On2 VP6 (Flash support)<br />
• Audio format support: .3gp, MP3, WMA9 (.wma/.asf), WMA9 Pro / WMA 10, MIDI, AMR-NB, Professional AAC/AAC+/eAAC+<br />
Ringtones &amp; Notifications<br />
• Tone, vibrate, on-screen or LED indicator<br />
• Notification options are user configurable<br />
• 32 Polyphonic Ringtones – MIDI, SP-MDI, MP3, WAV<br />
Bluetooth<br />
• Bluetooth® v2.1<br />
• Mono/Stereo Headset<br />
• Handsfree<br />
• Serial Port Profile<br />
• Bluetooth Stereo Audio (A2DP/AVCRP)<br />
• Bluetooth SIM Access Profile supported<br />
Security<br />
• Password protection<br />
• Screen lock<br />
• Sleep mode<br />
• Optional support for S/MIME<br />
Wi-Fi<br />
802.11 b/g<br />
• UMA support<br />
• Planned Wi-Fi Certifications: WPA, WPA2, WMM, WMM Power Save, Wi-Fi Protected Setup, Cisco CCX<br />
Wireless Networks<br />
3G (HSDPA) compatible<br />
UMTS: 2100/1900/850/800 MHz (Bands 1,2,5/6), 2100/1700/900 MHz (Bands 1,4,8)<br />
GSM: 1900/1800/900/850 MHz<br />
Quad-band support: GSM 850; GSM</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/02/26/blackberry-bold-9700-onyx-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips: Hemat Biaya saat Roaming International</title>
		<link>http://blog.nataprawira.com/tech/2010/02/12/tips-hemat-biaya-saat-roaming-international/</link>
		<comments>http://blog.nataprawira.com/tech/2010/02/12/tips-hemat-biaya-saat-roaming-international/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 05:10:39 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Blackberry]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Biaya]]></category>
		<category><![CDATA[Hemat]]></category>
		<category><![CDATA[Roaming]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=136</guid>
		<description><![CDATA[

Ada kekhawatiran para pengguna BlackBerry akan besarnya biaya roaming penggunaan GPRS saat berada di luar negeri, sehingga mereka tidak mengaktifkan layanan BlackBerry saat berada di luar negeri.
Tentunya solusi ini akhirnya malah merugikan karena aneh jika pengguna BlackBerry tidak update dengan informasi penting, dan sebaliknya karena ketidaktahuan akan biaya roaming seseorang selalu mengaktifkan layanan BlackBerry hampir [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F02%2F12%2Ftips-hemat-biaya-saat-roaming-international%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F02%2F12%2Ftips-hemat-biaya-saat-roaming-international%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>Ada kekhawatiran para pengguna BlackBerry akan besarnya biaya roaming penggunaan GPRS saat berada di luar negeri, sehingga mereka tidak mengaktifkan layanan BlackBerry saat berada di luar negeri.</p>
<p>Tentunya solusi ini akhirnya malah merugikan karena aneh jika pengguna BlackBerry tidak update dengan informasi penting, dan sebaliknya karena ketidaktahuan akan biaya roaming seseorang selalu mengaktifkan layanan BlackBerry hampir tiap detik email, chatting, etc selalu masuk.</p>
<p>Kemudian yang terjadi setelah tiba di Indonesia kaget dengan tagihan bulanan yang fantastis, untuk menghindari 2 hal diatas. Berikut saat ketika kita melakukan perjalanan keluar negeri:</p>
<p>1. Ketika kita tiba di suatu negara namun tidak mendapatkan network roaming partner di area tersebut, maka segera lakukan change network secara manual / update location network dengan cara masuk ke menu Options &#8211; Mobile Network &#8211; Network Selection Mode &#8211; Change from Automatic ke Manual &#8211; Scan Available for Network &#8211; Pilih Roaming Partner Operator Anda &#8211; Save.</p>
<p>2. Matikan layanan pada saat yg tidak tepat (tidur, mandi, makan malam, meeting, etc) dengan masuk ke menu Options &#8211; Mobile Network &#8211; Data Service change from On to Off atau Off When Roaming, atau bisa juga dari Manage Connections -Mobile Network Options &#8211; Data Services set ke : Off When Roaming. Sebagai informasi dengan mematikan layanan data service kita tetap dapat menerima Call, SMS dan MMS.</p>
<p>3. Jika anda pengguna layanan BlackBerry Internet Service (BIS) dan anda ingin layanan data tetap aktif sementara email account yg dipush ke handheld lebih dari 1 bahkan sampai 10 email account (apalagi jika email account tersebut tergabung dalam mailing list seperti yahoogroups), maka untuk sementara email2 yg kurang penting sebaiknya di nonaktifkan dengan cara login di blackberry webclient [operator_anda].blackberry.com pada menu email account lakukan delete email tersebut, lakukan add email account ketika kembali di Indonesia.</p>
<p>4. Non aktifkan semua layanan instant messaging terutama FaceBook. aktifkan layanan tersebut pada saat dibutuhkan.</p>
<p>5. Aktifkan koneksi WiFi ketika anda berada di area Free WiFi, tentunya fasilitas ini dapat dinikmati pada handheld yg ada feature Wifi seperti 8320, 8810, 8820, 9000, 8900, 8220 etc. Caranya Manage Connections &#8211; Setup Wifi &#8211; ikuti step2 berikutnya.</p>
<h6><em>Source: Indosat Mobile</em></h6>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/02/12/tips-hemat-biaya-saat-roaming-international/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook Emoticons (Key ALT usage)</title>
		<link>http://blog.nataprawira.com/tech/2010/01/29/facebook-emoticons-key-alt-usage/</link>
		<comments>http://blog.nataprawira.com/tech/2010/01/29/facebook-emoticons-key-alt-usage/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 03:54:23 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Emoticons]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=131</guid>
		<description><![CDATA[

Facebook symbols are not part of facebook but can be inserted into your facebook name, chat window, messages, status, comments etc..
♪ = Musical note
♫ = Big musical note
♥ = Black heart
☺= Smile face
☻ = Black smile face
There are two ways for use this symbols.
1. Copy from here and paste in your facebook name, status or [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F01%2F29%2Ffacebook-emoticons-key-alt-usage%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2010%2F01%2F29%2Ffacebook-emoticons-key-alt-usage%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>Facebook symbols are not part of facebook but can be inserted into your facebook name, chat window, messages, status, comments etc..</p>
<p>♪ = Musical note<br />
♫ = Big musical note<br />
♥ = Black heart<br />
☺= Smile face<br />
☻ = Black smile face<span id="more-131"></span></p>
<p>There are two ways for use this symbols.</p>
<p>1. Copy from here and paste in your facebook name, status or message.<br />
2. These characters can be typed on your keyboard using the ALT button.</p>
<p>Desktop computer instructions for ALT facebook symbols:<br />
• Press and hold left Alt key on your keyboard.<br />
• While holding Alt key enter one of the codes below to get the corresponding symbol.<br />
• Important note: You need to use numbers on the right side of the keyboard for entering code, not the numbers on top, otherwise they won’t work.</p>
<p>Laptop instructions for ALT facebook symbols:<br />
• Press and hold left Alt key on your keyboard.<br />
• While holding Alt key also press and hold Fn key.<br />
• While holding Alt and Fn key enter one of the codes below to get corresponding symbol.<br />
• Important note: You need to use numbers on the right side of the keyboard for entering code (they are usually written next to letters U, I, O… and in different color), not the numbers on top, otherwise they won’t work.</p>
<p>Alt + 1 ☺<br />
Alt + 2 ☻<br />
Alt + 3 ♥<br />
Alt + 4 ♦<br />
Alt + 5 ♣<br />
Alt + 6 ♠<br />
Alt + 7 •<br />
Alt + 8 ◘<br />
Alt + 9 ○<br />
Alt + 10 ◙<br />
Alt + 11 ♂<br />
Alt + 12 ♀<br />
Alt + 13 ♪<br />
Alt + 14 ♫<br />
Alt + 15 ☼<br />
Alt + 16 ►<br />
Alt + 17 ◄<br />
Alt + 18 ↕<br />
Alt + 19 ‼<br />
Alt + 20 ¶<br />
Alt + 21 §<br />
Alt + 22 ▬<br />
Alt + 23 ↨<br />
Alt + 24 ↑<br />
Alt + 25 ↓<br />
Alt + 26 →<br />
Alt + 27 ←<br />
Alt + 28 ∟<br />
Alt + 29 ↔<br />
Alt + 30 ▲<br />
Alt + 31 ▼</p>
<p>Here is the complete list of symbols Unicode. You can copy and paste these for use in your messages</p>
<p>♠ ♣ ♥<br />
♦ ♪ ♫ ■ □ ▪ ▫ ▬ ▲ ►<br />
▼ ◄ ◊ ○ ● ◘ ◙ ◦ ☺ ☻<br />
☼ ♀ ▪ ▫ ▬ ☻<br />
☺ ◙ ◘ ▀ € ♥<br />
♂ ▒</p>
<p>๏ ๐ ๑ ๒<br />
๓ ๔ ๕๖ ๗ ๘ ๙ ๚ ๛ Ẁ<br />
ẁ Ẃ ẃ Ẅ ẅ Ạ ạ Ả ả Ấ<br />
ấ Ầ ầẨ ẩ Ẫ ẫ Ậ ậ Ắ<br />
ắ Ằ ằ Ẳ ẳ Ẵ ẵ Ặ ặ Ẹ<br />
ẹ Ẻ ẻ Ẽ ẽ Ế ế Ề ề Ể<br />
ể Ễ ễ Ệ ệ Ỉ ỉ Ị ị Ọ<br />
Æ ¢ ™ Ð ¹ º ç Þ ß ÿ æ â ã ¥ ¤ £ ¦ ©<br />
ª « ¬ ­® ¯</p>
<p>Ì Í Î Ï Ð Ñ Ò Ó Ô<br />
Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é<br />
ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ Āā<br />
Ăă Ąą Ć ć ĉ Ċ ċ ő Œ œ Ŕ<br />
ŕ Ŗ ŗ Ř ř Ś ś Ŝ ŝ Ş ş Š<br />
š Ţ ţ Ť ť Ŧ ŧ Ũ ũ Ū ū Ŭ<br />
ŭ Ů ů Ű ű Ų ų Ŵ ŵ Ŷ ŷ Ÿ<br />
Ź ź Ż ż Ž ž ſ ƒ Ǻ ǻ Ǽ ǽ<br />
Ǿ ǿ ˆ ˇ ˉ ˘˙ ˚ ˛ ˜ ˝ ;<br />
΄</p>
<p>₪ ₫ € ℅ l<br />
№ ™ Ω e ⅛ ⅜ ⅝ ⅞ ∂ ∆ ∏<br />
∑ &#8211; / · v 8 ∫ ˜ ≠ = = □ ▪ ▫ ◊<br />
● ◦       <br />
      ﬁ ﬂ ﬠ<br />
שׁ שׂ שּׁ שּׂ אַ אָ אּ בּ גּ<br />
דּהּ וּ זּ טּיּ ךּכּ לּ<br />
מּנּ סּ ףּ פּ צּ קּרּ שּ<br />
תּ וֹ בֿכֿ פֿ ﭏ ﭖ ﭗﭘ<br />
ﭙ ﭺﭻ ﭼ</p>
<p>ﭽ ﮊ ﮋ<br />
ﮎ ﮏ ﮐ ﮑ ﮒ ﮓ ﮔ ﮕ ﮤ<br />
ﮥ ﯼ ﯽ ﯾ ﱞ ﱟ ﱠ ﱡ ﱢ<br />
﴾ ﴿ ﷲ ﺀ ﺁ ﺂ ﺃ ﺄ ﺅ<br />
ﺆ ﺇ ﺈ ﺉ ﺊ ﺋ ﺌ ﺍ ﺎ<br />
ﺏﺐ ﺑ ﺒ ﺓ ﺔ ﺕ ﺖ ﺗ<br />
ﺘ ﺙ ﺚ ﺛﺜ</p>
<p>ﺝ ﺞ ﺟ<br />
ﺠ ﺡ ﺢ ﺣ ﺤ ﺥ ﺦ ﺧ ﺨ<br />
ﺩﺪ ﺫ ﺬ ﺭ ﺮ ﺯ ﺰ<br />
ﺱﺲ ﺳ ﺴ ﺵﺶ ﺷ ﺸﺹ<br />
ﺺ ﺻ ﺼ ﺽﺾ ﺿ ﻀ ﻁ</p>
<p>ﻂ ﻃ<br />
ﻄﻅ ﻆ ﻇ ﻈ ﻉﻊ ﻋ ﻌ<br />
ﻍ ﻎ ﻏﻐ ﻑ ﻒ ﻓ ﻔ ﻕ<br />
ﻖﻗ ﻘ ﻙ ﻚ ﻛ ﻜ ﻝﻞ<br />
ﻟ ﻠ ﻡ ﻢ ﻣﻤ ﻥ ﻦ ﻧ<br />
ﻨﻩ ﻪ ﻫ ﻬ ﻭ ﻮﻯ ﻰ<br />
ﻱ ﻲ ﻳ ﻴﻵ ﻶ ﻷ ﻸﻹ<br />
ﻺ ﻻ ﻼ</p>
<p>لم<br />
ن ه و ى يً ٌ ٍ َ ُ<br />
ِّ ْ % ٤ ٠ ١ ٢ ٣ ٥٦<br />
٧ ٨ ٩ ﾎ 么 ﾒ _ ｬ `<br />
ｦ _ ｶ ｼ ﾆ ♠ ♣<br />
◄ ▬ ☻ ▬ ► ♣ ♠<br />
Л п † ‡</p>
<p>█ ▌<br />
▐ ░░▒▓<br />
▓▒░░ ░░░▒▓<br />
▓▒░░░</p>
<p>░▒▓<br />
▓▒░ ▓▒░ ░▒▓<br />
░░<br />
▀▄▀▄▀▄▀▄▀▄<br />
▄▀▄▀▄▀</p>
<p>═ ╬ ╦ ╩ ╦<br />
╣╝╠ ╧ ╨ ╫ ╪<br />
╥ ╤ ╢╡╟╞ ╜</p>
<p>⌠⌡│┌<br />
┐└ ┘├ ┤┬ ┴ ┼<br />
╛╚╙╘╗╖╕╔╓╒║</p>
<p>╬ ╫ ╪ ╩<br />
╨ ╧ ╦ ╥ ╤ ╣ ╢ ╡ ╠ ╟<br />
╞ ╝ ╜ ╛ ╚ ╙ ╗ ╘ ╗ ╖<br />
╕ ╔ ╓ ╒ ║ ═</p>
<p>Enjoy them!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2010/01/29/facebook-emoticons-key-alt-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup a transparent proxy with 3 easy steps</title>
		<link>http://blog.nataprawira.com/tech/2009/12/18/setup-a-transparent-proxy-with-3-easy-steps/</link>
		<comments>http://blog.nataprawira.com/tech/2009/12/18/setup-a-transparent-proxy-with-3-easy-steps/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 14:57:30 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Squid]]></category>
		<category><![CDATA[Transparent Proxy]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=127</guid>
		<description><![CDATA[

First, Squid server installed (use up2date squid) and configured by adding following directives to file:
# vi /etc/squid/squid.conf


Modify or add following squid directives:
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
acl lan src 192.168.1.1 192.168.2.0/24
http_access allow localhost
http_access allow lan
Where,

httpd_accel_host virtual: Squid as an httpd accelerator
httpd_accel_port 80: 80 is port you want to act as a proxy
httpd_accel_with_proxy on: Squid act as [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F12%2F18%2Fsetup-a-transparent-proxy-with-3-easy-steps%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F12%2F18%2Fsetup-a-transparent-proxy-with-3-easy-steps%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>First, Squid server installed (use up2date squid) and configured by adding following directives to file:<br />
<strong><code># vi /etc/squid/squid.conf</code></strong></p>
<p><strong><span id="more-127"></span><br />
</strong></p>
<p>Modify or add following squid directives:<br />
<strong><code>httpd_accel_host <span style="color: #ff0000">virtual</span><br />
httpd_accel_port <span style="color: #ff0000">80</span><br />
httpd_accel_with_proxy <span style="color: #ff0000">on</span><br />
httpd_accel_uses_host_header <span style="color: #ff0000">on</span><br />
acl lan src <span style="color: #ff0000">192.168.1.1 192.168.2.0/24</span><br />
http_access allow <span style="color: #ff0000">localhost</span><br />
http_access allow <span style="color: #ff0000">lan</span></code></strong></p>
<p>Where,</p>
<ul>
<li>httpd_accel_host <span style="color: #ff0000">virtual</span>: Squid as an httpd accelerator</li>
<li>httpd_accel_port <span style="color: #ff0000">80</span>: 80 is port you want to act as a proxy</li>
<li>httpd_accel_with_proxy <span style="color: #ff0000">on</span>: Squid act as both a local httpd accelerator and as a proxy.</li>
<li>httpd_accel_uses_host_header <span style="color: #ff0000">on</span>: Header is turned on which is the hostname from the URL.</li>
<li>acl lan src <span style="color: #ff0000">192.168.1.1 192.168.2.0/24</span>: Access control list, only allow LAN computers to use squid</li>
<li>http_access allow <span style="color: #ff0000">localhost</span>: Squid access to LAN and localhost ACL only</li>
<li>http_access allow <span style="color: #ff0000">lan</span>: &#8212; same as above &#8211;</li>
</ul>
<p>Here is the complete listing of squid.conf for your reference (grep will remove all comments and sed will remove all empty lines, thanks to David Klein for quick hint ):<br />
<strong><code># grep -v "^#" /etc/squid/squid.conf | sed -e '/^$/d'</code></strong></p>
<p>OR, try out sed (thanks to <a href="http://www.cyberciti.biz/tips/linux-setup-transparent-proxy-squid-howto.html#comment-144">kotnik</a> for small sed trick)<br />
<strong><code># cat /etc/squid/squid.conf | sed '/ *#/d; /^ *$/d'</code></strong></p>
<p>Output:<br />
<strong><code>hierarchy_stoplist cgi-bin ?<br />
acl QUERY urlpath_regex cgi-bin \?<br />
no_cache deny QUERY<br />
hosts_file /etc/hosts<br />
refresh_pattern ^ftp:           1440    20%     10080<br />
refresh_pattern ^gopher:        1440    0%      1440<br />
refresh_pattern .               0       20%     4320<br />
acl all src 0.0.0.0/0.0.0.0<br />
acl manager proto cache_object<br />
acl localhost src 127.0.0.1/255.255.255.255<br />
acl to_localhost dst 127.0.0.0/8<br />
acl purge method PURGE<br />
acl CONNECT method CONNECT<br />
cache_mem 1024 MB<br />
http_access allow manager localhost<br />
http_access deny manager<br />
http_access allow purge localhost<br />
http_access deny purge<br />
http_access deny !Safe_ports<br />
http_access deny CONNECT !SSL_ports<br />
acl lan src 192.168.1.1  192.168.2.0/24<br />
http_access allow localhost<br />
http_access allow lan<br />
http_access deny all<br />
http_reply_access allow all<br />
icp_access allow all<br />
visible_hostname myclient.hostname.com<br />
httpd_accel_host virtual<br />
httpd_accel_port 80<br />
httpd_accel_with_proxy on<br />
httpd_accel_uses_host_header on<br />
coredump_dir /var/spool/squid</code></strong></p>
<h3>Iptables configuration</h3>
<p>Next, I had added following rules to forward all http requests (coming to port 80) to the Squid server port 3128 :<br />
<strong><code>iptables -t nat -A PREROUTING -i  <span style="color: #ff0000">eth1</span> -p tcp --dport <span style="color: #ff0000">80</span> -j DNAT --to 192.168.1.1:3128<br />
iptables -t nat -A PREROUTING -i  <span style="color: #ff0000">eth0</span> -p tcp --dport  <span style="color: #ff0000">80 -j REDIRECT --to-port 3128</span></code></strong></p>
<p>Here is complete shell script. Script first configure Linux system as router and forwards all http request to port 3128 (Download the <a href="http://www.cyberciti.biz/tips/wp-content/uploads/2006/06/fw.proxy.txt">fw.proxy</a> shell script):<br />
<strong><code><em><span style="color: #9a1900">#!/bin/sh</span></em><br />
<em><span style="color: #9a1900"># squid server IP</span></em><br />
SQUID_SERVER<span style="color: #990000">=</span><span style="color: #ff0000">"192.168.1.1"</span><br />
<em><span style="color: #9a1900"># Interface connected to Internet</span></em><br />
INTERNET<span style="color: #990000">=</span><span style="color: #ff0000">"eth0"</span><br />
<em><span style="color: #9a1900"># Interface connected to LAN</span></em><br />
LAN_IN<span style="color: #990000">=</span><span style="color: #ff0000">"eth1"</span><br />
<em><span style="color: #9a1900"># Squid port</span></em><br />
SQUID_PORT<span style="color: #990000">=</span><span style="color: #ff0000">"3128"</span><br />
<em><span style="color: #9a1900"># DO NOT MODIFY BELOW</span></em><br />
<em><span style="color: #9a1900"># Clean old firewall</span></em><br />
iptables <span style="color: #990000">-</span>F<br />
iptables <span style="color: #990000">-</span>X<br />
iptables <span style="color: #990000">-</span>t nat <span style="color: #990000">-</span>F<br />
iptables <span style="color: #990000">-</span>t nat <span style="color: #990000">-</span>X<br />
iptables <span style="color: #990000">-</span>t mangle <span style="color: #990000">-</span>F<br />
iptables <span style="color: #990000">-</span>t mangle <span style="color: #990000">-</span>X<br />
<em><span style="color: #9a1900"># Load IPTABLES modules for NAT and IP conntrack support</span></em><br />
modprobe ip_conntrack<br />
modprobe ip_conntrack_ftp<br />
<em><span style="color: #9a1900"># For win xp ftp client</span></em><br />
<em><span style="color: #9a1900">#modprobe ip_nat_ftp</span></em><br />
echo <span style="color: #993399">1</span> <span style="color: #990000">&gt;</span> /proc/sys/net/ipv4/<span style="color: #0000ff">ip_forward</span><br />
<em><span style="color: #9a1900"># Setting default filter policy</span></em><br />
iptables <span style="color: #990000">-</span>P INPUT DROP<br />
iptables <span style="color: #990000">-</span>P OUTPUT ACCEPT<br />
<em><span style="color: #9a1900"># Unlimited access to loop back</span></em><br />
iptables <span style="color: #990000">-</span>A INPUT <span style="color: #990000">-</span>i lo <span style="color: #990000">-</span>j ACCEPT<br />
iptables <span style="color: #990000">-</span>A OUTPUT <span style="color: #990000">-</span>o lo <span style="color: #990000">-</span>j ACCEPT<br />
<em><span style="color: #9a1900"># Allow UDP, DNS and Passive FTP</span></em><br />
iptables <span style="color: #990000">-</span>A INPUT <span style="color: #990000">-</span>i <span style="color: #009900">$INTERNET</span> <span style="color: #990000">-</span><span style="color: #0000ff">m</span> state <span style="color: #990000">-</span><span style="color: #990000">-</span>state ESTABLISHED<span style="color: #990000">,</span>RELATED <span style="color: #990000">-</span>j ACCEPT<br />
<em><span style="color: #9a1900"># set this system as a router for Rest of LAN</span></em><br />
iptables <span style="color: #990000">-</span><span style="color: #990000">-</span>table nat <span style="color: #990000">-</span><span style="color: #990000">-</span>append POSTROUTING <span style="color: #990000">-</span><span style="color: #990000">-</span>out<span style="color: #990000">-</span>interface <span style="color: #009900">$INTERNET</span> <span style="color: #990000">-</span>j MASQUERADE<br />
iptables <span style="color: #990000">-</span><span style="color: #990000">-</span>append FORWARD <span style="color: #990000">-</span><span style="color: #990000">-</span>in<span style="color: #990000">-</span>interface <span style="color: #009900">$LAN_IN</span> <span style="color: #990000">-</span>j ACCEPT<br />
<em><span style="color: #9a1900"># unlimited access to LAN</span></em><br />
iptables <span style="color: #990000">-</span>A INPUT <span style="color: #990000">-</span>i <span style="color: #009900">$LAN_IN</span> <span style="color: #990000">-</span>j ACCEPT<br />
iptables <span style="color: #990000">-</span>A OUTPUT <span style="color: #990000">-</span>o <span style="color: #009900">$LAN_IN</span> <span style="color: #990000">-</span>j ACCEPT<br />
<em><span style="color: #9a1900"># DNAT port 80 request comming from LAN systems to squid 3128 ($SQUID_PORT) aka transparent proxy</span></em><br />
iptables <span style="color: #990000">-</span>t nat <span style="color: #990000">-</span>A PREROUTING <span style="color: #990000">-</span>i <span style="color: #009900">$LAN_IN</span> <span style="color: #990000">-</span>p tcp <span style="color: #990000">-</span><span style="color: #990000">-</span>dport <span style="color: #993399">80</span> <span style="color: #990000">-</span>j DNAT <span style="color: #990000">-</span><span style="color: #990000">-</span>to <span style="color: #009900">$SQUID_SERVER</span><span style="color: #990000">:</span><span style="color: #009900">$SQUID_PORT</span><br />
<em><span style="color: #9a1900"># if it is same system</span></em><br />
iptables <span style="color: #990000">-</span>t nat <span style="color: #990000">-</span>A PREROUTING <span style="color: #990000">-</span>i <span style="color: #009900">$INTERNET</span> <span style="color: #990000">-</span>p tcp <span style="color: #990000">-</span><span style="color: #990000">-</span>dport <span style="color: #993399">80</span> <span style="color: #990000">-</span>j REDIRECT <span style="color: #990000">-</span><span style="color: #990000">-</span>to<span style="color: #990000">-</span>port <span style="color: #009900">$SQUID_PORT</span><br />
<em><span style="color: #9a1900"># DROP everything and Log it</span></em><br />
iptables <span style="color: #990000">-</span>A INPUT <span style="color: #990000">-</span>j LOG<br />
iptables <span style="color: #990000">-</span>A INPUT <span style="color: #990000">-</span>j DROP</code></strong></p>
<p>Save shell script. Execute script so that system will act as a router and forward the ports:<br />
<strong><code># chmod +x /etc/fw.proxy<br />
# /etc/fw.proxy<br />
# service iptables save<br />
# chkconfig iptables on</code></strong></p>
<p>Start or Restart the squid:<br />
<strong><code># /etc/init.d/squid restart<br />
# chkconfig squid on</code></strong></p>
<h3>Desktop / Client computer configuration</h3>
<p>Point all desktop clients to your eth1 IP address (192.168.2.1) as Router/Gateway (use DHCP to distribute this information). You do not have to setup up individual browsers to work with proxies.</p>
<h3>How do I test my squid proxy is working correctly?</h3>
<p>See access log file /var/log/squid/access.log:<br />
<strong><code># tail -f /var/log/squid/access.log</code></strong></p>
<p>Above command will monitor all incoming request and log them to /var/log/squid/access_log file. Now if somebody accessing a website through browser, squid will log information.</p>
<h3>Problems and solutions</h3>
<h4>(a) Windows XP FTP Client</h4>
<p>All Desktop client FTP session request ended with an error:<br />
Illegal PORT command.</p>
<p>I had loaded the ip_nat_ftp kernel module. Just type the following command press Enter and voila!<br />
<strong><code># modprobe ip_nat_ftp</code></strong></p>
<p>Please note that modprobe command is already added to a shell script (above).</p>
<h4>(b) Port 443 redirection</h4>
<p>I had block out all connection request from our router settings except for our proxy (192.168.1.1) server. So all ports including 443 (https/ssl) request denied. You cannot redirect port 443, from <a href="http://lists.debian.org/debian-user/2004/05/msg01434.html">debian mailing list</a>, &#8220;<em>Long answer: SSL is specifically designed to prevent &#8220;man in the middle&#8221; attacks, and setting up squid in such a way would be the same as such a &#8220;man in the middle&#8221; attack. You might be able to successfully achive this, but not without breaking the encryption and certification that is the point behind SSL</em>&#8220;.</p>
<p>Therefore, I had quickly reopen port 443 (router firewall) for all my LAN computers and problem was solved.</p>
<h4>(c) Squid Proxy authentication in a transparent mode</h4>
<p>You cannot use Squid authentication with a transparently intercepting proxy.</p>
<h3>Further reading:</h3>
<ul>
<li><a href="http://www.cyberciti.biz/nixcraft/vivek/blogger/2005/10/how-do-i-use-iptables-connection.html">How do I use Iptables connection tracking feature? </a></li>
<li><a href="http://www.cyberciti.biz/nixcraft/vivek/blogger/2005/10/how-do-i-build-simple-linux-firewall.html">How do I build a Simple Linux Firewall for DSL/Dial-up connection? </a></li>
<li><strong>Update:</strong> <a href="http://www.cyberciti.biz/nixcraft/forum/viewtopic.php?t=457">Forum topic discussion: Setting up a transparent proxy with Squid peering to ISP squid server</a></li>
<li><a href="http://squid-docs.sourceforge.net/latest/html/book1.html">Squid, a user&#8217;s guide</a></li>
<li><a href="http://www.squid-cache.org/Doc/FAQ/">Squid FAQ</a></li>
<li><a href="http://tldp.org/HOWTO/TransparentProxy.html">Transparent Proxy with Linux and Squid mini-HOWTO</a></li>
</ul>
<p><a title="http://www.cyberciti.biz/tips/linux-setup-transparent-proxy-squid-howto.html" href="http://www.cyberciti.biz/tips/linux-setup-transparent-proxy-squid-howto.html" target="_blank"><strong>Source</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/12/18/setup-a-transparent-proxy-with-3-easy-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimizing Sendmail</title>
		<link>http://blog.nataprawira.com/tech/2009/12/09/optimizing-sendmail/</link>
		<comments>http://blog.nataprawira.com/tech/2009/12/09/optimizing-sendmail/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 15:14:12 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[optimize]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=125</guid>
		<description><![CDATA[

Most of them involve changing the daemon&#8217;s configuration in /etc/sendmail.mc and rebuilding sendmail.cf
Specific things that can affect performance:
dnl # Sendmail, Chap 24.9.13, Page 955
dnl # Disable re-write of queue control file (will result in duplicates
dnl #   if the daemon is interrupted during a delivery)
define(`confCHECKPOINTINTERVAL&#8217;,`0&#8242;)dnl
dnl # Sendmail, Chap 24.9.21, Page 960
dnl # Disable throttling the acceptance [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F12%2F09%2Foptimizing-sendmail%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F12%2F09%2Foptimizing-sendmail%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>Most of them involve changing the daemon&#8217;s configuration in <strong>/etc/sendmail.mc</strong> and <span style="text-decoration: underline">rebuilding</span> <strong>sendmail.cf</strong></p>
<p><span style="text-decoration: underline">Specific things that can affect performance</span>:</p>
<p>dnl # Sendmail, Chap 24.9.13, Page 955<br />
dnl # Disable re-write of queue control file (will result in duplicates<br />
dnl #   if the daemon is interrupted during a delivery)<br />
<strong>define(`confCHECKPOINTINTERVAL&#8217;,`0&#8242;)dnl<span id="more-125"></span></strong></p>
<p>dnl # Sendmail, Chap 24.9.21, Page 960<br />
dnl # Disable throttling the acceptance of new connections<br />
<strong>define(`confCONNECTION_RATE_THROTTLE&#8217;,`0&#8242;)dnl</strong></p>
<p>dnl # Sendmail, Chap 24.9.25, Page 967<br />
dnl # Specify the maximum size, in bytes, of buffered df* files (default is<br />
dnl #   4096 bytes; 0 turns this off and is not recommended)<br />
<strong>define(`confDF_BUFFER_SIZE&#8217;,`16384&#8242;)dnl</strong></p>
<p>dnl # Sendmail, Chap 24.9.60, Page 1011<br />
dnl # Disable limit on the daemon spawning new children<br />
<strong>define(`confMAX_DAEMON_CHILDREN&#8217;,`0&#8242;)dnl </strong></p>
<p>dnl # Sendmail, Chap 24.9.66, Page 1016<br />
dnl # Disbale limit on the number of messages that may be processed<br />
dnl #  during any one queue run<br />
<strong>define(`confMAX_QUEUE_RUN_SIZE&#8217;,`0&#8242;)dnl</strong></p>
<p>dnl # Sendmail, Chap 24.9.19, Page 959<br />
dnl # Turn on connection caching and set maximum number of simultaneous<br />
dnl #  outbound connections kept open to 4; default is 2; this option also<br />
dnl #  depends on MCI_CACHE_TIMEOUT (below)<br />
<strong>define(`confMCI_CACHE_SIZE&#8217;,`4&#8242;)dnl </strong></p>
<p>dnl # Sendmail, Chap 24.9.19, Page 959<br />
dnl # Set time limit on how long a cached outbound connection may be<br />
dnl #  kept open to 120 seconds (2 minutes) &#8211; see MCI_CACHE_SIZE above<br />
<strong>define(`confMCI_CACHE_TIMEOUT&#8217;,`120s&#8217;)dnl</strong></p>
<p>dnl # Sendmail, Chap 24.9.72, Page 1022<br />
dnl # Disable time delay for queued messages not delivered on the first try<br />
<strong>define(`confMIN_QUEUE_AGE&#8217;,`0&#8242;)dnl </strong></p>
<p>dnl # Sendmail, Chapter 24.9.107, Page 1057<br />
dnl # Disable MTA setting that forces MTA to queue each message and to sync<br />
dnl #   to disk before forking (a system crash may result in lost mail)<br />
<strong>define(`confSAFE_QUEUE&#8217;,`false&#8217;)dnl</strong></p>
<p>dnl # Sendmail, Chap 24.9.109.13, Page 1065<br />
dnl # Disable IDENT (RFC 1413) calls/turn off sending user-host verification<br />
<strong>define(`confTO_IDENT&#8217;,`0&#8242;)dnl</strong></p>
<p>dnl # Sendmail, Chap 24.9.120, Page 1077<br />
dnl # Specify the maximum size, in bytes, of buffered xf* files (default is<br />
dnl #   4096 bytes; 0 turns this off and is not recommended)<br />
<strong>define(`confXF_BUFFER_SIZE&#8217;,`16384&#8242;)dnl</strong></p>
<p>dnl # Sendmail, Chap 4.8.28, Page 192<br />
dnl # Turn off E-Mail canonization (should be done by MSA, and this<br />
dnl #     is a mail relay with no local users)<br />
<strong>FEATURE(`nocanonify&#8217;)dnl</strong></p>
<p>I&#8217;m assuming you&#8217;re using a modern version of sendmail &#8211; v8.12.10 or later. These settings may be different, or not exist at all, for older versions.</p>
<p><em><strong><a title="http://www.experts-exchange.com/Software/Server_Software/Email_Servers/SendMail/Q_21598211.html" href="http://www.experts-exchange.com/Software/Server_Software/Email_Servers/SendMail/Q_21598211.html" target="_blank">Source</a></strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/12/09/optimizing-sendmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTPasswd Tutorial</title>
		<link>http://blog.nataprawira.com/tech/2009/11/24/htpasswd-tutorial/</link>
		<comments>http://blog.nataprawira.com/tech/2009/11/24/htpasswd-tutorial/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 02:35:18 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[HTaccess]]></category>
		<category><![CDATA[htpassword]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=119</guid>
		<description><![CDATA[

If you would like to have a set of web pages that are protected, requiring a username/password to gain access, this tutorial will show you how to set it up. This is geared towards the Unix Apache httpd servers used on holly, lamar, and www.colostate.edu. If you are using another web server, you&#8217;ll need to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F11%2F24%2Fhtpasswd-tutorial%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F11%2F24%2Fhtpasswd-tutorial%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<h1><span style="font-weight: normal;font-size: 13px">If you would like to have a set of web pages that are protected, requiring a username/password to gain access, this tutorial will show you how to set it up. This is geared towards the Unix Apache httpd servers used on holly, lamar, and www.colostate.edu. If you are using another web server, you&#8217;ll need to check that server&#8217;s documentation to see how to do this.</span></h1>
<p><span style="font-weight: normal;font-size: 13px"><span id="more-119"></span></span></p>
<p><span style="font-weight: normal;font-size: 13px"><strong>Steps to Password-protect a Directory</strong></span></p>
<p><span style="font-weight: normal;font-size: 13px"><strong><span style="font-weight: normal;font-size: 13px">First, create a subdirectory in your web area. For the sake of this tutorial, I have created the &#8220;protect&#8221; directory. Set the permissions on the directory so that the server has read/execute. I do this by using the local command chgrp-www to set the group to the www group. This is the group that the server runs under at Colorado State University for the lamar, holly and www servers. I have used the -sd flag which sets &#8220;set group id&#8221; for a directory. This will then force any files you create within the protect directory to the www group, so if you ftp files to this directory they will be automatically readable by the server but not by any other user on the system. I then cd into the protect directory. </span></strong></span></p>
<blockquote>
<pre><strong>cd ~ric/public_html
mkdir protect
chmod g+r,g+x,o-r,o-x protect
chgrp-www -sd protect
cd protect</strong></pre>
</blockquote>
<p>Next you must create a .htaccess file inside the directory you want protected. You can use either the vi or pico editors on the supported systems mentioned above or ftp the file to this directory. If you are new to unix or know little about vi then I suggest you use the pico editor or ftp the .htaccess file. The command to edit with pico is &#8220;pico .htaccess&#8221;. The .htaccess file should contain the following lines. The items in <strong>bold</strong> are things you will want to change depending on the location of the AuthUserFile and content of AuthName.</p>
<blockquote>
<pre><strong>AuthUserFile /z/ric/secret/.htpasswd
AuthGroupFile /dev/null
AuthName "Ric's protected files"
AuthType Basic

&lt;Limit GET&gt;
require valid-user
&lt;/Limit&gt;</strong></pre>
</blockquote>
<p>The <strong>AuthName</strong> is what the user will see when they&#8217;re prompted for a password &#8211; something to the effect of &#8220;Enter the username for Ric&#8217;s Protected files&#8221;. The <strong>AuthUserFile</strong> is location of the password file and should be not accessible with a url on the server for security reasons. This is a full unix path and the permissions should be set up like the &#8220;protect&#8221; directory using the chmod and chgrp-www commands above so the only one that can read this file is the owner and the server. To get the full path of a directory, cd to that directory and enter the command &#8220;pwd&#8221; to print the working directory path.</p>
<p>Now you&#8217;ll have to set up the password file. You&#8217;ll need to use the <strong>htpasswd</strong> program. It is included with the Apache httpd server.</p>
<p>First cd to the directory that contains the password file. In this example the password file is called .htpasswd and is in the directory /z/ric/secret/ as indicated by the AuthUserFile file entry in the .htaccess file. For every username you want to add to the password file, enter the following. (the -c is only required the first time; it indicates that you want to create the .htpasswd file).</p>
<blockquote>
<pre><strong>
$~ cd
$~ mkdir secret
$~ cd secret
$~ htpasswd -c .htpasswd pumpkin
<span style="font-weight: normal"><span style="color: #333399">
[ you're prompted for the password for pumpkin]
[ if you have other users enter the following. Don't use the -c]
</span></span>
$~ htpasswd .htpasswd user2
$~ htpasswd .htpasswd user3
</strong></pre>
</blockquote>
<p>Again, make sure the permissions are set up like the &#8220;protect&#8221; directory using the chmod and chgrp-www commands above so the only one that can read files in the &#8220;secret&#8221; directory is the owner and the server.</p>
<p>Here is the <a href="http://www.colostate.edu/~ric/protect/your.html" target="_blank">protected page</a> using the above setup to password protect this page. The username is &#8220;pumpkin&#8221; and password is &#8220;pie&#8221;.</p>
<p>[<a href="http://www.colostate.edu/~ric/htpass.html" target="_blank">source</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/11/24/htpasswd-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Ensure Maximum Uptime For Your High-Traffic Business Website?</title>
		<link>http://blog.nataprawira.com/tech/2009/11/18/how-to-ensure-maximum-uptime-for-your-high-traffic-business-website/</link>
		<comments>http://blog.nataprawira.com/tech/2009/11/18/how-to-ensure-maximum-uptime-for-your-high-traffic-business-website/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 14:08:21 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[High-Traffic]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=117</guid>
		<description><![CDATA[

The word “catastrophic success” holds a lot of meaning here. It means an unusual surge in traffic that can bring a website to a complete halt. You have been successful at bringing traffic to your website but it proved to be catastrophic.

This happens due to unanticipated levels of interest when thousands of users visit the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F11%2F18%2Fhow-to-ensure-maximum-uptime-for-your-high-traffic-business-website%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F11%2F18%2Fhow-to-ensure-maximum-uptime-for-your-high-traffic-business-website%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>The word “catastrophic success” holds a lot of meaning here. It means an unusual surge in traffic that can bring a website to a complete halt. You have been successful at bringing traffic to your website but it proved to be catastrophic.</p>
<p><span id="more-117"></span></p>
<p>This happens due to unanticipated levels of interest when thousands of users visit the website, but the webmaster is unable to cope with them. Sometimes, the service may not go down but gets so slow that it becomes non-responsive. Such problems can be overcome.</p>
<p>Other causes of website failure include DoS attack (denial of service), which can also cause congestion and overload; poorly configured system components and out-of-date updates and patches on web servers.</p>
<p>The occasional outage is understandable and happens to all, but frequent downtime can cause delays in business. As we begin relying more on Web applications, Internet uptime is becoming more critical.</p>
<p>But there are things you can take care of to ensure you pave a smooth superhighway to your company’s website.</p>
<p><strong>Content delivery networks (CDNs)</strong></p>
<p>The public internet depends on content delivery networks to handle large amounts of media on huge sites like Amazon.com. Microsoft recently launched a free CDN to improve website performance. CDNs are made to route traffic onto private networks, thus removing the burden from the public website. In the absence of a CDN, sites with massive media files will be down immediately.</p>
<p><strong>Better caching</strong></p>
<p>One of the best and most popular ways of dealing with internet problems is to cache data that is frequently accessed. You can use Memcache or anything else and you will find several CMS packages that support this. But you must ensure you are careful with dynamic data.</p>
<p>Internet caching is similar to your computer memory caching, which holds the most popular content in a cached storage on the server to provide faster access. There are tier-caching products that help cache content within the website by making sure the content from the database is available even with there is a huge surge of traffic. This is one of the ways Twitter and Facebook deal with traffic surges.</p>
<p><strong>Better programming</strong></p>
<p>One of the new methods of dealing with traffic is to use better programming to withstand the sudden traffic spikes. Experts say that most websites cannot withstand any unanticipated traffic due to poor programming.</p>
<p><strong>Using HTML5</strong></p>
<p>Your website downtime is not always related to the hardware. HTML5 and other new standards have built-in mechanisms for increasing the reliability of websites. These involve advanced programming techniques. HTML5 is considered to be an important advance in browser capabilities.</p>
<p><strong>Content optimization</strong></p>
<p>You can optimize your static content by compressing images in order to make use of every kilobyte, but all the while making sure the visual quality does not get affected. You can also compress the content delivered by your web server. You can optimize your content management system by reducing the number of database calls you need to make for each page request. In Drupal, this is very simply done by disabling some of the modules. It is also advisable to separate the read and write databases.</p>
<p><strong>Expires</strong></p>
<p>One of the most important things is to add “expires” headers to content to ensure the same files are not downloaded continually as a user browses your website.</p>
<p>There is certainly no guarantee that your site will never go down. You will just have to find the right balance and implement what is necessary to ensure it has a high percentage of uptime.<br />
<a href="http://www.alreadyhosting.com/blog/2009/11/ensure-maximum-uptime/" target="_blank">Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/11/18/how-to-ensure-maximum-uptime-for-your-high-traffic-business-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 ways to market your website!</title>
		<link>http://blog.nataprawira.com/tech/2009/11/17/10-ways-to-market-your-website/</link>
		<comments>http://blog.nataprawira.com/tech/2009/11/17/10-ways-to-market-your-website/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 15:40:32 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Marketing]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=112</guid>
		<description><![CDATA[

1. Advertise on the internet!
There is an ocean of opportunities through internet marketing, find what works for you.
- Pay Per Click advertising (Download and read the previous document in this section “What are pay per click search engines” ) is very popular and is becoming easier to use everyday. Here are the top 2 Pay [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F11%2F17%2F10-ways-to-market-your-website%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F11%2F17%2F10-ways-to-market-your-website%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><strong>1. Advertise on the internet!</strong></p>
<p>There is an ocean of opportunities through internet marketing, find what works for you.</p>
<p>- Pay Per Click advertising (Download and read the previous document in this section “What are pay per click search engines” ) is very popular and is becoming easier to use everyday. Here are the top 2 Pay Per Click Pages that you can use to advertise your web page.</p>
<p>Make sure to set a budget limit so that you don’t spend more then you can afford.</p>
<p><span id="more-112"></span></p>
<ul>
<li>Google AdWords</li>
<li>Yahoo! Search Marketing</li>
<li>Microsoft adCenter</li>
</ul>
<p>- Online News Papers. Simply search for your country/citys local news paper and call them for information if you can’t learn how to place your advert from their web page.</p>
<p>-Job search companies</p>
<p><strong>2. Classified Ads, Traditional Phone Number Marketing, Ad your Web Address on all your flyers, advert, posters.</strong></p>
<p>You can choose to have a phone number and your web address or Just the Web Address. I recommend that you do both, many people are still not using computers and we do not want our advertising miss valuable prospect.<strong></strong></p>
<p><strong>3. Signatures, </strong>Place your web address on all of your marketing materials &#8211; including business cards, stationary, your e-mail signature, SMS signature, SKYPE, MSN, Yahoo and other chat programs signature &#8211; any way that you contact potential recruits and customers!</p>
<p><strong>4. Banners,</strong> Trading banners and banner exchanges are very popular. Most banners get horrible click thorough rates. Banners at the top of a page are more effective. Additionally, it is recommended to create a banner that says &#8220;click here&#8221; and is animated. If possible, use a program that allows only one banner ad per page.</p>
<p><strong>5. Ask your friends,</strong> If they want to Link to your page via their page. (ask and you will know, they might say sure why not and a link to your page will appear on their page…. Maybe even for free!</p>
<p><strong>6. Bulletin Boards (Forums)</strong>, If you are active on various bulletin boards, your site will become better known. Offer your service. A standard way is to always end your notes with your Web site name and URL.</p>
<p><strong>7. SMS and Email,</strong> send SMS and Emails to your hot and cold market with a note for them to become interested to look up your web page.</p>
<p>Example:</p>
<blockquote><p>Own a PC? Put it To Work!<br />
Go to www.YourDomainName.com</p></blockquote>
<p><strong>8. Go to a Local Email Café and ask the owner</strong>, if you can have post a note on each PC or if you can change so each PC start up with your Domain Name.</p>
<p><strong>9. Hang a banner from your balcony</strong> with your Domain Name and advert on it (ask the house owner first </p>
<p><strong>10. Advertise on your car</strong>, that is for free.</p>
<p><em>11. <span style="text-decoration: underline">Bonus</span>: <strong>Be Creative!!!!!</strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/11/17/10-ways-to-market-your-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Web/Linux IP Address Lookup</title>
		<link>http://blog.nataprawira.com/tech/2009/10/22/ip-address-lookup/</link>
		<comments>http://blog.nataprawira.com/tech/2009/10/22/ip-address-lookup/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 17:58:01 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[IP Address]]></category>
		<category><![CDATA[Lookup]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=106</guid>
		<description><![CDATA[

If you&#8217;re going to be doing a lot of Geotargeting or IP Address  Lookups, please take a feed instead which will preserve both our bandwidth and  your bandwidth.
Simple GET
That said, there is an easy HTTP oriented API to locate IP  addresses and Geocode them. If you don&#8217;t supply the &#8220;?ip=aa.bb.cc.dd&#8221;  bit, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F10%2F22%2Fip-address-lookup%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F10%2F22%2Fip-address-lookup%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>If you&#8217;re going to be doing a lot of Geotargeting or IP Address  Lookups, please take a feed instead which will preserve both our bandwidth and  your bandwidth.</p>
<h1>Simple GET</h1>
<p>That said, there is an easy HTTP oriented API to locate <strong>IP  addresses</strong> and <strong>Geocode</strong> them. If you don&#8217;t supply the &#8220;?ip=aa.bb.cc.dd&#8221;  bit, then the ip address lookup of the calling machine will be located instead  (here, the aa,bb,cc,dd are decimal digits). If you add &amp;position=true to the  end of the URL then latitude and longitude will be returned also. Both HTML and  XML formats are supplied for your convenience.</p>
<blockquote><p><strong>http://api.hostip.info/country.php</strong><br />
US</p>
<p><strong>http://api.hostip.info/get_html.php?ip=12.215.42.19</strong><br />
Country: UNITED STATES (US)<br />
City: Sugar Grove, IL</p>
<p><strong>http://api.hostip.info/get_html.php?ip=12.215.42.19&amp;position=true</strong><br />
Country: UNITED STATES (US)<br />
City: Sugar Grove, IL<br />
Latitude: 41.7696<br />
Longitude: -88.4588</p>
<p><strong>http://api.hostip.info/?ip=12.215.42.19</strong><br />
[use the URL above for an example - XML too long to paste below]</p></blockquote>
<h1><span id="more-106"></span>Country Flag</h1>
<p>Paste the following code into your HTML to get a country  flag of the ip address. The database is significantly more accurate (it ought to  be 100%) for countries than for cities. It would be nice if y&#8217;all would make the  flag a link to the www.hostip.info home page (http://www.hostip.info/) so they  can come by if they&#8217;re interested &#8211; it&#8217;ll only benefit you in the long run.  After all, the results get more accurate as more visitors submit their IP  addresses!<br />
Flag of visitor&#8217;s location:</p>
<blockquote><p><strong>&lt;A HREF=&#8221;http://www.hostip.info&#8221;&gt;<br />
&lt;IMG SRC=&#8221;http://api.hostip.info/flag.php&#8221; BORDER=&#8221;0&#8243; ALT=&#8221;IP Address Lookup&#8221;&gt;<br />
&lt;/A&gt;</strong></p></blockquote>
<p>Flag of any IP address:</p>
<blockquote><p><strong>&lt;A HREF=&#8221;http://www.hostip.info&#8221;&gt;<br />
&lt;IMG SRC=&#8221;http://api.hostip.info/flag.php?ip=12.215.42.19&#8243; ALT=&#8221;IP Address Lookup&#8221;&gt;<br />
&lt;/A&gt;</strong></p></blockquote>
<h1>Embedded Applet</h1>
<p>The following is designed to be embedded within another HTML page using the OBJECT tag. This will reproduce the zoom-in applet, (or an explanatory message with a link to fix, if the IP address lookup is unknown). Which means you can embed the applet in your own site without needing to have the local database and map data (which runs to a few gigabytes&#8230;)</p>
<p>All you need do is include the OBJECT block below in your HTML.  Note, you can also add &#8220;?ip=aaa.bbb.ccc.ddd&#8221; to the frame.html url below to map a specific IP address.</p>
<blockquote>
<pre>&lt;OBJECT DATA='http://www.hostip.info/map/frame.html'

  TYPE='text/html' BORDER=0

  WIDTH=610 HEIGHT=330 HSPACE=0 VSPACE=0&gt;

&lt;/OBJECT&gt;</pre>
</blockquote>
<h1>*NIX Shell Script</h1>
<p>You can use the following shell script to call in your  favorite *NIX environment.</p>
<blockquote><p><strong>#!/bin/bash<br />
lynx -dump &#8220;http://api.hostip.info/get_html.php?ip=$1&#8243;</strong></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/10/22/ip-address-lookup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Samsung Star &#8211; Admin Code &amp; Configuration (Tested on GT-S5233S)</title>
		<link>http://blog.nataprawira.com/tech/2009/08/21/samsung-star-admin-code-configuration-tested-on-gt-s5233s/</link>
		<comments>http://blog.nataprawira.com/tech/2009/08/21/samsung-star-admin-code-configuration-tested-on-gt-s5233s/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 17:03:54 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Samsung]]></category>
		<category><![CDATA[GT-S5233S]]></category>
		<category><![CDATA[Star]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=93</guid>
		<description><![CDATA[

Source: http://www.kaskus.us/showpost.php?p=103189003&#38;postcount=548
Silahkan disimak..


Quote:




Originally Posted by Abu Zahri 
Bedanya Apa Ya antara star 5230, 5233A dan 5233S ?
Bukannya hanya perbedaan penamaan aja..?
5230 untuk pasar amerika, eropa,
5233A untuk pasar Asia
5233S untuk pasar mana lagi..?
CMIIW




Saya ga bisa memastikan jawaban untuk pertanyaan yang diajukan.. Mungkin yang S5233S itu untuk kawasan Asia Tenggara.. Tapi, kita bisa melihat dari firmware yang [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F08%2F21%2Fsamsung-star-admin-code-configuration-tested-on-gt-s5233s%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F08%2F21%2Fsamsung-star-admin-code-configuration-tested-on-gt-s5233s%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<div id="post_message_103189003"><em><strong>Source: <a href="http://www.kaskus.us/showpost.php?p=103189003&amp;postcount=548">http://www.kaskus.us/showpost.php?p=103189003&amp;postcount=548</a></strong></em></div>
<div>Silahkan disimak..</div>
<div id="post_message_103189003">
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td style="border: 1px inset">
<div>Originally Posted by <strong>Abu Zahri</strong> <a rel="nofollow" href="http://www.kaskus.us/showthread.php?p=103014916#post103014916"><img src="http://www.kaskus.us/images/buttons/viewpost.gif" border="0" alt="View Post" /></a></div>
<div style="font-style: italic"><span style="color: magenta">Bedanya Apa Ya antara star 5230, 5233A dan 5233S ?</span></div>
<p>Bukannya hanya perbedaan penamaan aja..?</p>
<p>5230 untuk pasar amerika, eropa,</p>
<p>5233A untuk pasar Asia</p>
<p>5233S untuk pasar mana lagi..?</p>
<p>CMIIW</td>
</tr>
</tbody>
</table>
</div>
<p><span id="more-93"></span>Saya ga bisa memastikan jawaban untuk pertanyaan yang diajukan.. Mungkin yang S5233S itu untuk kawasan <strong>Asia Tenggara</strong>.. Tapi, kita bisa melihat dari firmware yang ada pada Samsung Star kita..</p>
<p>Berikut akan saya lampirkan arti dari kode yang terdapat dalam firmware Samsung itu sendiri..</p>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px"><strong>Spoiler</strong> for <em>Arti Dari Kode Firmware Samsung</em>:</div>
<div style="border: 1px inset;margin: 0px;padding: 6px">
<div><strong>Contoh</strong> : firmware &#8216;<strong><span style="color: darkorchid"><span style="font-size: x-small">S5233SDXIE5</span></span></strong>&#8216;..</div>
<p>1.) <strong><span style="color: darkred">S5233S</span></strong> = <strong>Model / Tipe HP</strong>.. (Bisa juga menandakan kawasan pemasaran penjualan HP tersebut, ex. <strong>S5230</strong>, <strong>S5233</strong>, <strong>S5233A</strong>, <strong>S5233S</strong>.. <strong><span style="color: red">Sumber</span></strong> : <a href="http://share4gsm.com/index.php?strona=files&amp;act=/Samsung" target="_blank"><span style="color: blue"><span style="font-size: small"><strong>SINI</strong></span></span></a>.. Ada 4 tipe yang berbeda untuk sebutan Samsung Star.. Dan sebenarnya kita bisa mendapatkan juga versi firmware dari yang <strong>lama</strong> sampai yang <strong>baru</strong>, cuman sangat disayangkan <strong>harus bayar</strong>.. Ada versi firmware untuk <strong>S5233S</strong> juga.. )</p>
<p>2.) <strong><span style="color: darkred">DX</span></strong> = <strong>Kode Area Wilayah</strong>.. (Meliputi : <strong>Africa</strong> | <strong>Asia</strong> | <strong>Eropa</strong>)</p>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px"><strong>Spoiler</strong> for <em>Africa | Asia | Eropa</em>:</div>
<div style="border: 1px inset;margin: 0px;padding: 6px">
<div><span style="color: black"><span style="text-decoration: underline"><strong>Kode Area Wilayah</strong></span></span> :</div>
<p><strong>BD</strong> = Cyprus &amp; Greece.</p>
<p><strong>BH</strong> = Central European.</p>
<p><strong>CP</strong> = Finland.</p>
<p><strong>DB</strong> = Vietnam.</p>
<p><strong>DC</strong> = Thailand.</p>
<p><strong>DD</strong> = India.</p>
<p><strong>DT</strong> = Australia.</p>
<p><strong>DX</strong> = Indonesia ; Malaysia ; Philippines ; Singapore ; Thailand ; Vietnam.</p>
<p><strong>DZ</strong> = Malaysia ; Singapore.</p>
<p><strong>JA</strong> = South Africa.</p>
<p><strong>JC</strong> = Algeria ; Morocco ; Nigeria ; South Africa ; Tunisia.</p>
<p><strong>JP</strong> = Algeria ; Egypt ; Iran ; Iraq ; Kuwait ; Morocco ; Nigeria ; Oman ; Pakistan ; Saudi Arabia ; South Africa ; Syria ; Tunisia ; Turkey.</p>
<p><strong>JR</strong> = Saudi Arabia.</p>
<p><strong>JV</strong> = Algeria ; Egypt ; Iran ; Iraq ; Kuwait ; Morocco ; Nigeria ; Oman ; Pakistan ; Saudi Arabia ; South Africa ; Syria ; Tunisia ; Turkey.</p>
<p><strong>MT</strong> = Switzerland.</p>
<p><strong>XA</strong> = Austria ; France ; Germany ; Italy ; Netherlands ; Switzerland ; United Kingdom.</p>
<p><strong>XB</strong> = Denmark ; Norway ; Sweden.</p>
<p><strong>XC</strong> = Portugal ; Spain.</p>
<p><strong>XD</strong> = Croatia, Czech, Hungary, Slovakia.</p>
<p><strong>XE</strong> = Bulgaria ; Estonia ; Kazakhstan ; Latvia ; Lithuania ; Russia ; Ukraine ; Germany.</p>
<p><strong>XF</strong> = Bulgaria ; Croatia ; Romania.</p>
<p><strong>XG</strong> = Germany.</p>
<p><strong>XX</strong> = Austria ; Belgium ; France ; Germany ; Hungary ; Italy ; Spain ; United Kingdom.</p>
<p><strong>ZC</strong> = China ; Hong Kong.</p>
<p><strong>ZH</strong> = Hong Kong.</p>
<p><strong>ZT</strong> = Taiwan.</div>
</div>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td style="border: 1px inset"><strong><span style="color: red">NB</span></strong> : Perbedaan yang mendasar dari kode area wilayah adalah <strong>paket bahasa</strong> yang tersedia dalam HP itu sendiri.. Antara 1 kode area wilayah dengan yang lain belum tentu sama..</td>
</tr>
</tbody>
</table>
</div>
<p>3.) <strong><span style="color: darkred">I</span></strong> = <strong>Tahun</strong>..</p>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px"><strong>Spoiler</strong> for <em>Tahun</em>:</div>
<div style="border: 1px inset;margin: 0px;padding: 6px">
<div><span style="color: black"><span style="text-decoration: underline"><strong>Kode Tahun</strong></span></span> :</div>
<p><strong>A</strong> = 2001.</p>
<p><strong>B</strong> = 2002.</p>
<p><strong>C</strong> = 2003.</p>
<p><strong>D</strong> = 2004.</p>
<p><strong>E</strong> = 2005.</p>
<p><strong>F</strong> = 2006.</p>
<p><strong>G</strong> = 2007.</p>
<p><strong>H</strong> = 2008.</p>
<p><strong>I</strong> = 2009.</p>
<p><strong>J</strong> = 2010.</div>
</div>
<p>4.) <strong><span style="color: darkred">E</span></strong> = <strong>Bulan</strong>..</p>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px"><strong>Spoiler</strong> for <em>Bulan</em>:</div>
<div style="border: 1px inset;margin: 0px;padding: 6px">
<div><span style="color: black"><span style="text-decoration: underline"><strong>Kode Bulan</strong></span></span> :</div>
<p><strong>A</strong> = January.</p>
<p><strong>B</strong> = February.</p>
<p><strong>C</strong> = March.</p>
<p><strong>D</strong> = April.</p>
<p><strong>E</strong> = May.</p>
<p><strong>F</strong> = June.</p>
<p><strong>G</strong> = July.</p>
<p><strong>H</strong> = August.</p>
<p><strong>I</strong> = September.</p>
<p><strong>J</strong> = October.</p>
<p><strong>K</strong> = November.</p>
<p><strong>L</strong> = December.</div>
</div>
<p>5.) <strong><span style="color: darkred">5</span></strong> = <strong>Revisi / Perbaikan</strong>.. (Biasanya setiap bulan ada beberapa kali &#8220;<strong>revisi / perbaikan</strong>&#8221; untuk perbaikan kecil dari bug firmware dengan <strong>versi</strong> yang <strong>sama</strong> dalam 1 bulan tersebut)</p>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td style="border: 1px inset">Dimulai dari angka 1.. Semakin besar angka tersebut, maka versi firmware tersebut akan semakin baru.. (Bulan yang sama)</td>
</tr>
</tbody>
</table>
</div>
<p>6.) Ada kalanya dalam sebuah versi firmware dari beberapa HP Samsung, ada sebuah <strong>huruf</strong> yang berada di <strong>depan kode area wilayah</strong>.. Berikut ini merupakan sedikit penjelasan yang bersangkutan..</p>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td style="border: 1px inset">Ex. <span style="color: darkorchid"><strong><span style="font-size: x-small">S830<span style="font-size: small"><span style="color: darkorchid"><strong>N</strong></span></span>XXIC1</span></strong></span>Arti dari versi firmware tersebut, yaitu :</p>
<p><strong>S830</strong> = Samsung S8300.</p>
<p><strong>N</strong> = Navigation Edition. (Usually includes Route66)</p>
<p><strong>F</strong> = Pink Edition. (Firmware is the color of the device adapted, usually an extra theme and some other little goodies)</p>
<p><strong>G</strong> = Gray Edition. (includes mostly no significant changes)</p>
<p><strong>K</strong> = ?.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<p><strong><span style="color: red">Sumber</span></strong> : <span style="color: blue"><strong><span style="font-size: small"><a href="http://darkforestgroup.com/forum/index.php?topic=14.0" target="_blank">1</a></span></strong></span> | <strong><span style="color: blue"><span style="font-size: small"><a href="http://translate.google.com/translate?js=y&amp;prev=_t&amp;hl=en&amp;ie=UTF-8&amp;u=http://www.mobilfunk-faq.info/samsung-tipps-tricks/19134-howto-erklaerung-der-firmwarecodes-bei-samsung.html&amp;sl=auto&amp;tl=en&amp;history_state0=" target="_blank">2</a></span></span></strong></p>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td style="border: 1px inset">
<div>Originally Posted by <strong>KenDoank</strong> <a rel="nofollow" href="http://www.kaskus.us/showthread.php?p=102871907#post102871907"><img src="http://www.kaskus.us/images/buttons/viewpost.gif" border="0" alt="View Post" /></a></div>
<div style="font-style: italic">agan agan sekalian numpang tanya dunk&#8230;</p>
<p>gw kan abis download aplikasi bolt.jar sama ebuddy.jar n dah gw transfer ke hpnya, nah pas mw diinstall itu kuar tulisan content not signed n akhirnya ga bisa keinstall deh&#8230;, itu gara&#8221; apa yah ??</p></div>
</td>
</tr>
</tbody>
</table>
</div>
<p>Saya langsung saja memberikan <strong>beberapa cara</strong> yang berkaitan dengan <strong>JAVA</strong>..</p>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px"><strong>Spoiler</strong> for <em>JAVA</em>:</div>
<div style="border: 1px inset;margin: 0px;padding: 6px">
<div><strong>Cara 1</strong> : <a href="http://darkforestgroup.com/blog/?p=130" target="_blank"><span style="color: blue"><strong><span style="font-size: small">A</span></strong></span></a> | <a href="http://darkforestgroup.com/forum/index.php?topic=76.0" target="_blank"><strong><span style="color: blue"><span style="font-size: small">B</span></span></strong></a> | <strong><span style="color: blue"><span style="font-size: small"><a href="http://darkforestgroup.com/forum/index.php?topic=424.0" target="_blank">C</a></span></span></strong>.. Harap 1 halaman tersebut dibaca sampai selesai, biar jelas..</p>
<p><strong>Cara 2</strong> :</div>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td style="border: 1px inset">- Download via wap (<a href="http://m.getjar.com/" target="_blank">http://m.getjar.com</a>) application LITE FTP (<strong>Bluetooth File Transfer LITE</strong>) to your S5230 / S5233. Bagi yang mau via <strong>PC</strong>, silahkan ke<a href="http://www.getjar.com/products/25405/BluetoothFileTransferLITE" target="_blank"><strong><span style="color: blue"><span style="font-size: small">SINI</span></span></strong></a>..</p>
<p>- Browse down and you will see &#8220;<strong>Quick Download</strong>&#8220;.</p>
<p>- Click it. Then enter quick download code as <strong>51799</strong>.</p>
<p>- Download and install it. Exit from browse.</p>
<p>- Open <strong>Samsung PC studio</strong>.</p>
<p>- Browse to memory card.</p>
<p>- Create new folder for game.</p>
<p>- Copy-paste .jad and .jar to that folder.</p>
<p>- Kalo ga ada file <strong>.jad</strong>.. Coba dibuat memakai <strong>JADMaker</strong>.. Silahkan berkunjung ke<strong><span style="color: blue"><span style="font-size: small"><a href="http://www.4shared.com/file/96027662/76ab7da5/JADmaker.html" target="_blank">SINI</a></span></span></strong>..</p>
<p>- Close PC studio.</p>
<p>- Disconect usb.</p>
<p>- Open LITE FTP on your phone.</p>
<p>- Browse to memory card and find your game in folder you created earlier.</p>
<p>- Copy that folder.</p>
<p>- Browse to filesystem of your phone.</p>
<p>- Its empty, because files are hidden.</p>
<p>- Paste game here.</p>
<p>- Exit from FTP lite.</p>
<p>- *#6984125*# (Admin Setting)</p>
<p>- Pilih No. 4. Internals.</p>
<p>- *#9072641*#</p>
<p>- Storage settings</p>
<p>- Update media database</p>
<p>- Update Java DB</p>
<p>- Create AX Dat File</p>
<p>- Exit</p>
<p>- Open your GAMES folder.Rename yor folder game as you wish.</p>
<p>- AND PLAY.<strong><span style="color: red">Sumber</span></strong> : <strong><span style="color: blue"><span style="font-size: small"><a href="http://www.gsmarena.com/samsung_s5230_star-reviews-2739p5.php" target="_blank">SINI</a></span></span></strong>..</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><strong>Tip&#8217;s &amp; Trick</strong> yang ada untuk Samsung S5233S, yaitu :</p>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td style="border: 1px inset"><a href="http://darkforestgroup.com/forum/index.php?topic=195.0" target="_blank"><strong><span style="color: blue"><span style="font-size: small">HOW TO : Increasing Sound of Speaker (Calls &amp; MP3)</span></span></strong></a>..<strong><span style="color: red">NB</span></strong> : Silahkan dicoba terlebih dahulu..</td>
</tr>
</tbody>
</table>
</div>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px"><strong>Spoiler</strong> for <em>Factory Code for Samsung</em>:</div>
<div style="border: 1px inset;margin: 0px;padding: 6px">
<div>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td style="border: 1px inset"><strong><span style="color: indigo"><span style="text-decoration: underline">Some basic Factory Code for Samsung</span></span></strong> :</p>
<p>Admin Setting : <strong>*#6984125*#</strong></p>
<p>No. 2. Pre-configuration &#8211; Operator Code : <strong>*#73561*#</strong></p>
<p>No. 4. Internals &#8211; Master Code : <strong>*#9072641*#</strong> (Use at your own risk, don&#8217;t simply change)Check IMEI : <strong>*#06#</strong></p>
<p>Check SW Version : <strong>*#1234#</strong></p>
<p>Check FTA SW Version : <strong>*#1111#</strong></p>
<p>Check FTA HW Version : <strong>*#2222#</strong></p>
<p>Check SW|Tune|HW-Version, RF Cal Date &amp; D/L Date : <strong>*#0206*8376263#</strong></p>
<p>Check Battery Status : <strong>*#0228#</strong></p>
<p>Check Bluetooth Device Address : <strong>*#232337#</strong> (Need to power off once access this)</p>
<p>Test Mode : <strong>*#0*#</strong></p>
<p>HSDPA|3G|EDGE|GPRS Power On Attach : <strong>*#4777*8665#</strong></p>
<p>Factory / Hard Reset : <strong>*2767*3855#</strong> (All data &amp; setting in phone erase &amp; reset to factory default automatically without warning)</p>
<p>This code has something to do with phone locking : <strong>*#7465625#</strong></p>
<p>This code <strong>*#0002*28346#</strong> has</p>
<p>[1] Debug Screen</p>
<p>[2] Version Information</p>
<p>[3] RF test</p>
<p>[4] UMTS rf nv</p>
<p>[5] Read gsm rf nv</p>
<p>[6] Write gsm rf nv</p>
<p>[7] Base Band</p>
<p>[8] Audio</p>
<p>[9] Common</td>
</tr>
</tbody>
</table>
</div>
<p><strong><span style="color: red">Sumber</span></strong> : <span style="color: blue"><strong><span style="font-size: small"><a href="http://darkforestgroup.com/forum/index.php?topic=187.0" target="_blank">SINI</a></span></strong></span>..</div>
</div>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px"><strong>Spoiler</strong> for <em>EDGE Icon</em>:</div>
<div style="border: 1px inset;margin: 0px;padding: 6px">
<div>Bagi yang mengalami masalah / keluhan dengan lambang &#8220;<strong>EDGE</strong>&#8221; yang selalu muncul ketika <strong>selesai upgrade firmware</strong> ke versi [<strong><span style="color: sienna">S5230XEIG2</span></strong>], bisa mengikuti <strong>tip&#8217;s</strong> berikut ini untuk mengatasinya..</div>
<div style="margin: 5px 20px 20px">
<div style="margin-bottom: 2px">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td style="border: 1px inset">- Buka keypad &amp; ketik di keypad : <strong>*#4777*8665#</strong></p>
<p>- Hilangkan tanda &#8216;<strong>contreng</strong>&#8216; pada pilihan &#8220;<strong>Power On Attach</strong>&#8220;..</p>
<p>- Restart HP Anda &amp; tanda (E) &#8220;<strong>EDGE</strong>&#8221; Icon akan hilang..<strong><span style="color: red">NB</span></strong> : Apabila Anda mengikuti cara ini, maka tanda (E) &#8220;<strong>EDGE</strong>&#8221; Icon hanya akan muncul pada waktu Anda memerlukannya..</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<p>Selamat mencoba..</p>
<p>Trim&#8217;s..</p>
<p>*<strong>MeTaNoIa</strong>*</p>
<p><!-- / message --><!-- edit note --></p>
<div>
<hr size="1" /><em>Last edited by Meta_noia; 02-08-2009 at <span>12:11 AM</span>.. Reason: Info Tambahan !!! </em></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/08/21/samsung-star-admin-code-configuration-tested-on-gt-s5233s/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to manually install DKIM-Filter with Sendmail</title>
		<link>http://blog.nataprawira.com/tech/2009/08/15/how-to-manually-install-dkim-filter-with-sendmail/</link>
		<comments>http://blog.nataprawira.com/tech/2009/08/15/how-to-manually-install-dkim-filter-with-sendmail/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 19:32:32 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[DKIM]]></category>
		<category><![CDATA[Filter]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=89</guid>
		<description><![CDATA[

Source: [click here]

Max 30 mins work.

However, life is rarely so simple.
yum search dkim didn't find anything.

So, based on what I could find, I ended up here. Downloaded dkim-filter
2.4.1 and went on an epic voyage of discovery into the RFCs and other stuff.
I just want to install, configure and run the thing!

Anyway. I thought compilation would [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F08%2F15%2Fhow-to-manually-install-dkim-filter-with-sendmail%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F08%2F15%2Fhow-to-manually-install-dkim-filter-with-sendmail%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<pre>Source: [<a href="http://www.mail-archive.com/dkim-milter-discuss@lists.sourceforge.net/msg00535.html" target="_blank">click here</a>]

Max 30 mins work.

However, life is rarely so simple.
yum search dkim didn't find anything.

So, based on what I could find, I ended up here. Downloaded dkim-filter
2.4.1 and went on an epic voyage of discovery into the RFCs and other stuff.
I just want to install, configure and run the thing!
<span id="more-89"></span>
Anyway. I thought compilation would be straightforward, but no. More
unfamiliar stuff to read. I dutifully read the site.config.m4.dist, copied
to devtools/Site/site.config.m4 and hoped to make some intelligent decisions
on what options to enable.

 # ./Build
...
&gt;Making all in:
&gt;/etc/mail/dkim/dkim-milter-2.4.1/dkim-filter
&gt;Configuration: pfx=, os=Linux, rel=2.6.23.1-10.fc7, rbase=2,
&gt;rroot=2.6.23.1-10, arch=x86_64, sfx=, variant=optimized
&gt;Using M4=/usr/bin/m4
&gt;Creating
&gt;/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter
&gt;using /etc/mail/dkim/dkim-milter-2.4.1/devtools/OS/Linux
&gt;Making dependencies in
&gt;/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter
&gt;make[1]: Entering directory
&gt;`/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter'
&gt;rm -f sm_os.h
&gt;ln -f -s ../../include/sm/os/sm_os_linux.h sm_os.h
&gt;cc -M -I. -I../../include  -I../libdkim/   -D_REENTRANT config.c dkim-ar.c
&gt;dkim-filter.c stats.c test.c util.c   dkim-testkey.c   dkim-testssp.c    &gt;&gt;
&gt;Makefile
&gt;In file included from config.h:23,
&gt;                 from config.c:20:
&gt;dkim-filter.h:22:29: error: libmilter/mfapi.h: No such file or directory
&gt;In file included from dkim-ar.h:19,
&gt;                 from dkim-ar.c:23:
&gt;dkim-filter.h:22:29: error: libmilter/mfapi.h: No such file or directory
&gt;dkim-filter.c:59:29: error: libmilter/mfapi.h: No such file or directory
&gt;In file included from config.h:23,
&gt;                 from dkim-filter.c:78:
&gt;dkim-filter.h:22:29: error: libmilter/mfapi.h: No such file or directory
&gt;In file included from test.c:31:
&gt;test.h:24:29: error: libmilter/mfapi.h: No such file or directory
&gt;In file included from util.c:49:
&gt;dkim-filter.h:22:29: error: libmilter/mfapi.h: No such file or directory
&gt;make[1]: *** [depend] Error 1
&gt;make[1]: Leaving directory
&gt;`/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter'
&gt;Making in
&gt;/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter
&gt;make[1]: Entering directory
&gt;`/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter'
&gt;cc -O2 -I. -I../../include  -I../libdkim/   -D_REENTRANT -DXP_MT   -c -o
&gt;config.o config.c
&gt;In file included from config.h:23,
&gt;                 from config.c:20:
&gt;dkim-filter.h:22:29: error: libmilter/mfapi.h: No such file or directory
&gt;In file included from config.h:23,
&gt;                 from config.c:20:
&gt;dkim-filter.h:86: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_connect’
&gt;dkim-filter.h:87: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_envfrom’
&gt;dkim-filter.h:88: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_header’
&gt;dkim-filter.h:89: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_eoh’
&gt;dkim-filter.h:90: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_body’
&gt;dkim-filter.h:91: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_eom’
&gt;dkim-filter.h:92: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_abort’
&gt;dkim-filter.h:93: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
&gt;before ‘mlfi_close’
&gt;make[1]: *** [config.o] Error 1
&gt;make[1]: Leaving directory
&gt;`/etc/mail/dkim/dkim-milter-2.4.1/obj.Linux.2.6.23.1-10.fc7.x86_64/dkim-filter'
&gt;make: *** [all] Error 2

After some googling, a "yum install sendmail-devel" fixed this problem, and
a ./Build -c completed successfully.
I copied /devtools/OS/Linux to /devtools/Site/site.Linux.m4

./Build install was successful after manually creating dirs /usr/man/man15
and /usr/man/man18
Fedora manuals are in /usr/share/man
The files /usr/bin/dk* should have ownership root:root instead of bin.

Sendmail of Fedora 7 is currently 8.14.1:
# sendmail -d0.1
Version 8.14.1
Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX
 MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6
 NETUNIX NEWDB NIS PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS
 TCPWRAPPERS USERDB USE_LDAP_INIT

I created the keys, updated the dns zone files and decided to use user smmsp
instead of creating yet another user.

I created:
/var/db/dkim :
-rw-r----- 1 smmsp smmsp 887 2008-01-01 08:30 jan2008.admin.key.pem
-rw-r--r-- 1 smmsp smmsp 272 2008-01-01 08:30 jan2008.admin.public.pem

/var/run :
drwxr-xr-x 2 smmsp   smmsp   4096 2008-01-04 09:23 milter

and created this basic start/stop init script:
/etc/init.d/dkim-filter
then:
chkconfig --add dkim-filter
chkconfig dkim-filter on

contents:
&gt;#
&gt;# dkim-filter        Starts /usr/bin/dkim-filter
&gt;#
&gt;# chkconfig: 2345 67 33
&gt;#
&gt;# description: Domain Keys Milter
&gt;# processname: dkim-filter
&gt;#
&gt;# Source function library.
&gt;. /etc/init.d/functions
&gt;
&gt;[ -f /usr/bin/dkim-filter ] || exit 0
&gt;RETVAL=0
&gt;
&gt;umask 077
&gt;
&gt;start() {
&gt;        echo -n $"Starting dkim-filter: "
&gt;        /usr/bin/dkim-filter -x /etc/mail/dkim.conf
&gt;        RETVAL=$?
&gt;        if [ $RETVAL -eq 0 ]
&gt;        then
&gt;                echo_success
&gt;                touch /var/lock/subsys/dkim-filter
&gt;        else
&gt;                echo_failure
&gt;        fi
&gt;        echo
&gt;}
&gt;stop() {
&gt;        echo -n $"Shutting down dkim-filter: "
&gt;        /bin/kill `cat /var/run/milter/dkim-filter.pid 2&gt; /dev/null ` &gt;
&gt; /dev/null 2&gt;&amp;1
&gt;        RETVAL=$?
&gt;        sleep 3
&gt;        if [ $RETVAL -eq 0 ]
&gt;        then
&gt;                echo_success
&gt;                rm -f /var/lock/subsys/dkim-filter
&gt;                rm -f /var/run/milter/dkim-filter.pid
&gt;        else
&gt;                echo_failure
&gt;        fi
&gt;        echo
&gt;}
&gt;rhstatus() {
&gt;        status dkim-filter
&gt;}
&gt;restart() {
&gt;        stop
&gt;        start
&gt;}
&gt;
&gt;case "$1" in
&gt;  start)
&gt;        start
&gt;        ;;
&gt;  stop)
&gt;        stop
&gt;        ;;
&gt;  status)
&gt;        rhstatus
&gt;        ;;
&gt;  restart|reload)
&gt;        restart
&gt;        ;;
&gt;  condrestart)
&gt;        [ -f /var/lock/subsys/dkim-filter ] &amp;&amp; restart || :
&gt;        ;;
&gt;  *)
&gt;        echo $"Usage: $0 {start|stop|status|restart|condrestart}"
&gt;        exit 1
&gt;esac
&gt;
&gt;exit $?

Now for configuration files:

/etc/mail/dkim.conf :
Canonicalization        relaxed/simple
Domain                  /etc/mail/domains
KeyFile                 /var/db/dkim/jan2008.admin.key.pem
#MTA                    MTA
Selector                jan2008.admin
SignatureAlgorithm      rsa-sha256
Socket                  inet:[EMAIL PROTECTED]
#Socket                 /var/run/milter/dkim-filter.sock
Syslog                  Yes
SyslogSuccess           Yes
Userid                  smmsp
PidFile                 /var/run/milter/dkim-filter.pid
SubDomains              Yes
X-Header                No
SendReports             No

/etc/mail/domains contains just one domain on one line.

and added to sendmail.rc:
INPUT_MAIL_FILTER(`dkim-filter', `S=inet:[EMAIL PROTECTED]')

I started the script with
/etc/init.d/dkim-filter start
and it worked, eg:
&gt;Jan  4 10:58:10 gaia dkim-filter[6033]: Sendmail DKIM Filter v2.4.1 starting
&gt;(args: -x /etc/mail/dkim.conf)

It even adds signatures to my messages (hopefully to this one), but silently
crashes regularly without any indication on processing a simple locally
generated mail from a perl script and/or/exor from logwatch or virus
notification from MailScanner. eg:

DKIMDEBUG=ct :
&gt;Jan  3 02:57:18 gaia sendmail[12260]: m031vIL6012260: from=&lt;[EMAIL
&gt;PROTECTED]&gt;, size=1780,, nrcpts=1, msgid=&lt;[EMAIL PROTECTED]&gt;,
&gt;proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
&gt;Jan  3 02:57:18 gaia dkim-filter[6926]: thread 0x41e02950 header
&gt;Jan  3 02:57:18 gaia last message repeated 6 times
&gt;Jan  3 02:57:18 gaia dkim-filter[6926]: thread 0x41e02950 eoh
&gt;Jan  3 02:57:18 gaia sendmail[12260]: m031vIL6012260:
&gt;milter_sys_read(dkim-filter): cmd read returned 0, expecting 5
&gt;Jan  3 02:57:18 gaia sendmail[12260]: m031vIL6012260: Milter (dkim-filter): to
&gt;error state
&gt;Jan  3 02:57:18 gaia sendmail[12260]: m031vIL6012260: to=&lt;[EMAIL PROTECTED]&gt;,
&gt;delay=00:00:00, mailer=esmtp, pri=31780, stat=queued

I have spent the last couple of days trying to solve this
The only relevant information I found was Jim Hermann's useful message and
thread last month
<a rel="nofollow" href="http://www.mail-archive.com/dkim-milter-discuss@lists.sourceforge.net/msg00409.html">http://www.mail-archive.com/dkim-milter-discuss@lists.sourceforge.net/msg00409.html</a>

I'm disappointed, disillusioned and frustrated in trying to nail jelly to a
wall... This doesn't say anything useful at all!
&gt;milter_sys_read(dkim-filter): cmd read returned 0, expecting 5

It only seems to happen by locally generated mail, sometimes it even seemed
as if having a Reply-To: field influenced its crash frequency, but without
real diagnostic tools, skills and a lot of time, I can't solve it. I'm an
experienced sysadmin, not a C programmer! Programmers should try to make all
our lives easier! <img src='http://blog.nataprawira.com/tech/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> 

I want to get this working reliably and dependably on a few production
systems, and know what options to compile with and what settings to use for
Fedora, but I'm now stumped.

When it does work, another gripe is this padding too short error, which may
or may not be a reason for the verification failure:
&gt;Jan  4 08:14:35 gaia dkim-filter[8389]: m047EY6O010080 SSL error:04067069:rsa
&gt;routines:RSA_EAY_PUBLIC_DECRYPT:pkcs1 padding too short; error:04077068:rsa
&gt;routines:RSA_verify:bad signature
&gt;Jan  4 08:14:35 gaia dkim-filter[8389]: m047EY6O010080: bad signature data
&gt;Jan  4 08:14:35 gaia sendmail[10080]: m047EY6O010080: Milter insert (1):
&gt;header: Authentication-Results:  gaia.haveland.com; dkim=neutral (verification
&gt;failed) [EMAIL PROTECTED]

How can a gmail signature fail verification? What did it fail on? What is
the "i" in  "header.i" ?
It was a mysql mailing list, so perhaps other headers got in the way, but
this isn't what I would call a robust solution! Omitheaders command in
dkim.conf seems to be a blanket fudge.

If we are to stand a chance of defeating spammers, then we have to make DKIM
easier to install and configure so mere mortals can install and use it, and
encourage adoption.  I'm sure many would like to see dkim-filter available
in rpm for various distros.

However, Network Solutions, amongst others need to wake up and allow people
to modify their DNS TXT attributes... Here's what their completely
ridiculous FAQ says on the subject:
<a rel="nofollow" href="http://customersupport.networksolutions.com/article.php?id=369">http://customersupport.networksolutions.com/article.php?id=369</a>

&gt;"Can I Make Changes To The TXT Record
&gt;
&gt; Network Solutions does not currently support changes to the
&gt; TXT record for a domain name registration.
&gt;
&gt; The TXT Record is strictly informational, not functional."

What planet are they living on?

Cheers,
Andy.</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/08/15/how-to-manually-install-dkim-filter-with-sendmail/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hotmail Delivery Tips for Sender ID and SPF</title>
		<link>http://blog.nataprawira.com/tech/2009/08/11/hotmail-delivery-tips-for-sender-id-and-spf/</link>
		<comments>http://blog.nataprawira.com/tech/2009/08/11/hotmail-delivery-tips-for-sender-id-and-spf/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 18:12:55 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=86</guid>
		<description><![CDATA[



Original Post: http://www.clickz.com/3627253
By Stefan Pollard, ClickZ, Oct 10, 2007


With authentication quickly gaining acceptance among both e-mail receivers, like ISPs, and senders, like marketers and publishers, now&#8217;s a good time to examine how changes at Hotmail might affect your use of Sender ID and SPF records.
Authentication is the process by which you identify yourself to an e-mail [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F08%2F11%2Fhotmail-delivery-tips-for-sender-id-and-spf%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F08%2F11%2Fhotmail-delivery-tips-for-sender-id-and-spf%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<div id="article_header">
<div id="article_details" style="width: 620px">
<p>Original Post: <a href="http://www.clickz.com/3627253" target="_blank">http://www.clickz.com/3627253</a></p>
<p>By <a href="/3622928">Stefan Pollard</a>, ClickZ, <span>Oct 10, 2007</span></p>
<p><!--   OAS AD 'Position3' begin   --><a href="http://oasc05024.247realmedia.com/RealMedia/ads/click_lx.ads/clickz.com/experts/em_mkt/email_delivery/L40/1972851120/Position3/Incisive/Goodmail_EMD_text_July09/Goodmail_EMD_text.html/6661484f62307141594c5141436e486c?" target="_top"></a><!--   OAS AD 'Position3' end   --></div>
</div>
<p>With authentication quickly gaining acceptance among both e-mail receivers, like ISPs, and senders, like marketers and publishers, now&#8217;s a good time to examine how changes at Hotmail might affect your use of <a href="http://www.clickz.com/3482506">Sender ID</a> and <a href="http://clickz.com/3465711">SPF</a> records.<span id="more-86"></span></p>
<p>Authentication is the process by which you identify yourself to an e-mail receiver, such as an ISP, and verify which IP addresses are allowed to send e-mail from your domains. You can do this multiple ways, but I&#8217;ll focus here on how to make it easier for an ISP to look up your authentication record and to improve your chances of being properly identified as a legitimate sender. In fact, last week, Yahoo and eBay <a href="http://clickz.com/3627236">announced a partnership</a> to use e-mail authentication measures to block phishing (define) attempts.</p>
<p>You may think: &#8220;Why do I need to know this geek stuff? That&#8217;s my IT department&#8217;s issue, not mine.&#8221; It&#8217;s like comprehending what goes on under your car&#8217;s hood. You can drive without knowing the sparkplug-firing pattern or the piston-compression rate, but when something goes wrong, you can help your mechanic find the problem faster if you have a clue about where to look first.</p>
<p>Same thing goes for e-mail authentication. If an increasing number of messages are blocked by an ISP, check your authentication records before tearing down your entire program.</p>
<p>Today, I&#8217;ll outline how Hotmail implements Sender ID and SPF, because this e-mail service has made a high-profile effort to help senders understand what it looks for and what it checks when authenticating a sender. Knowing this information might help you deliver more e-mail messages to Hotmail addresses, which is important for consumer marketers.</p>
<p><strong>Sender ID vs. SPF: What&#8217;s the Difference?</strong></p>
<p>These two methods, called protocols, are almost identical in syntax. They differ in how the receiver domain looks up your authentication record, which is a line of code inserted in your DNS (<a href="http://www.webopedia.com/TERM/D/DNS.html" target="_new">define</a>) record that appears in your e-mail message headers.</p>
<p>SPF checks are performed against the domain from the envelope&#8217;s return-path address, typically called the bounce address. Sender ID checks are performed against the purported responsible address (PRA), that is, the visible sender address in the message.</p>
<p>Let&#8217;s say the domains in those addresses are the same. Then you as the sender can pass a Sender ID check with only an SPF record. If the domains are different, you should create both records and place them in the corresponding domains.</p>
<p>When in doubt, place your SPF record in all domains you have control over. This increases the chance the record will be placed where the receiver is checking. That&#8217;s what I mean by making it easy for your receiver.</p>
<p>Here&#8217;s a shorthand way to see the difference:</p>
<p><a title="table" name="table"></a></p>
<table border="0" cellspacing="1" cellpadding="3" width="420" bgcolor="#5a739c">
<tbody>
<tr bgcolor="#ffe084">
<th align="center" valign="top"><span style="color: #000000;font-size: x-small"> </span></th>
<th align="center" valign="top"><span style="color: #000000;font-size: x-small">Sender ID</span></th>
<th align="center" valign="top"><span style="color: #000000;font-size: x-small">SPF</span></th>
</tr>
<tr bgcolor="#ffffff">
<td align="center" valign="top"><span style="font-size: x-small">Address checked</span></td>
<td align="center" valign="top"><span style="font-size: x-small">PRA</span></td>
<td align="center" valign="top"><span style="font-size: x-small">Envelope domain (return-path address)</span></td>
</tr>
<tr bgcolor="#ffffff">
<td align="center" valign="top"><span style="font-size: x-small">Where check&#8217;s made</span></td>
<td align="center" valign="top"><span style="font-size: x-small">Visible message-body header in sender line</span></td>
<td align="center" valign="top"><span style="font-size: x-small">Root and subdomains</span></td>
</tr>
<tr bgcolor="#ffffff">
<td align="center" valign="top"><span style="font-size: x-small">Example</span></td>
<td align="center" valign="top"><span style="font-size: x-small">example.com (as in firstname.lastname@example.com)</span></td>
<td align="center" valign="top"><span style="font-size: x-small">mail.example.com (subdomain) and example.com (root domain)</span></td>
</tr>
</tbody>
</table>
<p><a title="table" name="table"></a>Sender ID&#8217;s and SPF&#8217;s syntax differs only slightly. SPF records begin with &#8220;v=spf1,&#8221; while typical Sender ID records begin &#8220;SPF2.0/PRA.&#8221; The rest of the records are identical. The basic, most ISP-friendly SPF entry is &#8220;v=spf1 a mx IP4:XXX.XXX.XX.XX –all.&#8221; For Sender ID, it would be &#8220;spf2.0/pra a mx IP4:XXX.XXX.XX.XX -all.&#8221;</p>
<p><a title="table" name="table"></a><strong>Hotmail: Getting Authenticated</strong></p>
<p><a title="table" name="table"></a>Hotmail has been the most vocal Sender ID advocate. Recently, it issued <a href="http://postmaster.msn.com/Guidelines.aspx" target="_new">guidelines</a> for creating a record and the mechanisms to avoid. Hotmail has specifically requested senders not to use the PTR (<a href="http://en.wikipedia.org/wiki/PTR_record#Types_of_DNS_records" target="_new">define</a>) mechanism. It also recently asked senders to use a hard fail &#8221; -all&#8221; at the end of their records to indicate their e-mail infrastructure is secure.</p>
<p>The syntax your record should use to indicate your level of e-mail security:</p>
<p><a title="table" name="table"></a></p>
<table border="0" cellspacing="1" cellpadding="3" width="420" bgcolor="#5a739c">
<tbody>
<tr bgcolor="#ffe084">
<th align="center" valign="top"><span style="color: #000000;font-size: x-small">Syntax</span></th>
<th align="center" valign="top"><span style="color: #000000;font-size: x-small">Type</span></th>
<th align="center" valign="top"><span style="color: #000000;font-size: x-small">Meaning</span></th>
</tr>
<tr bgcolor="#ffffff">
<td align="center" valign="top"><span style="font-size: x-small">-all</span></td>
<td align="center" valign="top"><span style="font-size: x-small">Fail</span></td>
<td align="center" valign="top"><span style="font-size: x-small">Fail all servers not listed here (recommended option)</span></td>
</tr>
<tr bgcolor="#ffffff">
<td align="center" valign="top"><span style="font-size: x-small">~all</span></td>
<td align="center" valign="top"><span style="font-size: x-small">Soft fail</span></td>
<td align="center" valign="top"><span style="font-size: x-small">Give extra scrutiny to servers not listed here</span></td>
</tr>
<tr bgcolor="#ffffff">
<td align="center" valign="top"><span style="font-size: x-small">?all</span></td>
<td align="center" valign="top"><span style="font-size: x-small">Neutral</span></td>
<td align="center" valign="top"><span style="font-size: x-small">Unsure whether e-mail infrastructure is secure</span></td>
</tr>
<tr bgcolor="#ffffff">
<td align="center" valign="top"><span style="font-size: x-small">+all</span></td>
<td align="center" valign="top"><span style="font-size: x-small">Pass</span></td>
<td align="center" valign="top"><span style="font-size: x-small">There&#8217;s no infrastructure security at all</span></td>
</tr>
</tbody>
</table>
<p><a title="table" name="table"></a>One last note on implementing Sender ID and SPF: It&#8217;s not uncommon for a sender to change IP addresses or providers. Most ISPs will perform authentication checks on inbound e-mail by directly querying your DNS zone.</p>
<p><a title="table" name="table"></a>Hotmail asks senders to notify it when they make changes, allowing it to cache the records. This makes authenticating senders and applying reputation scoring easier for Hotmail.</p>
<p><a title="table" name="table"></a>If you&#8217;ve changed your Sender ID and SPF records recently, use the following URL to update Hotmail: <a href="http://support.msn.com/default.aspx?productKey=senderid&amp;mkt=en-us" target="_new">http://support.msn.com/default.aspx?productKey=senderid&amp;mkt=en-us</a>.</p>
<p>In some cases, if the Sender ID/SPF record contains syntax errors, Hotmail will even send an e-mail to alert you of the problem so you can make corrections before you have delivery problems.</p>
<p><strong>Test Your Record Setup First</strong></p>
<p>You can use free tools to test your authentication record, but I often prefer to view results that come directly from the receivers by checking the posted results in the e-mail headers.</p>
<p>Both Gmail and Hotmail provide this detail and are easy to test for compliance. You always want to see &#8220;pass&#8221; as your result, never &#8220;fail&#8221; or &#8220;neutral.&#8221; In some e-mail services, a &#8220;neutral&#8221; result might mean your e-mail gets rerouted to the bulk folder or blocked; a &#8220;fail&#8221; result always denies entry to your e-mail.</p>
<p>For example, an SPF Gmail headers might look like this:</p>
<blockquote><p>Authentication-Results: mx.google.com; spf=pass (google.com: domain of postmaster@policycircle.com designates XX.XX.XX.XXX as permitted sender)</p></blockquote>
<p>A Sender ID Hotmail header might look like this:</p>
<blockquote><p>X-SID-PRA: FirstName LastName</p>
<p>X-SID-Result: Pass</p></blockquote>
<p>Until next time, keep on deliverin&#8217;!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/08/11/hotmail-delivery-tips-for-sender-id-and-spf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to tune Apache and Mysql</title>
		<link>http://blog.nataprawira.com/tech/2009/07/25/how-to-tune-apache-and-mysql/</link>
		<comments>http://blog.nataprawira.com/tech/2009/07/25/how-to-tune-apache-and-mysql/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 17:29:43 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[tune]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=66</guid>
		<description><![CDATA[

By default, Apache comes preconfigured to serve a maximum of 256 clients simultaneously. This particular configuration setting can be found in the file /etc/httpd/conf/httpd.conf
If your server has 2 GB of RAM, and you’re sharing your server with MySQL(true in my case), you’ll want to reserve about half of it for Apache (1 GB)

MaxClients: here is [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F07%2F25%2Fhow-to-tune-apache-and-mysql%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F07%2F25%2Fhow-to-tune-apache-and-mysql%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>By default, Apache comes preconfigured to serve a maximum of 256 clients simultaneously. This particular configuration setting can be found in the file <strong>/etc/httpd/conf/httpd.conf</strong></p>
<p>If your server has 2 GB of RAM, and you’re sharing your server with MySQL(true in my case), you’ll want to reserve about half of it for Apache (1 GB)</p>
<p><span id="more-66"></span></p>
<p>MaxClients: here is the process of determining MaxClients. type<strong> </strong></p>
<p style="padding-left: 30px"><strong>ps -U apache -u apache u</strong></p>
<p>See the number of apache process running in you command prompt.<strong></strong></p>
<p style="padding-left: 30px"><strong>USER       PID %CPU %MEM    VSZ     RSS  TTY    STAT START   TIME COMMAND<br />
apache     7694     0.0     0.3       42704  6680    ?        S       18:30   0:00 /usr/sbin/httpd</strong></p>
<p>The above indicates that a single httpd process is using 6.6 MB of RSS (Resident Set Size) memory (or non-swapped physical memory) and that it is using 42 MB of VSZ (Virtual Size) memory. This depends on the number of modules you have loaded and running in Apache.</p>
<p>As shared libraries are included in this number, it’s not 100 percent accurate. We can assume that half the RSS number is “real” memory. Let’s assume that each httpd process is using (6.6/2=3.3) 4 MB of memory. So if you have 1 GB ram then divide it with 4 MB of memory, which leaves room for around 256 concurrent httpd processes.</p>
<p style="padding-left: 30px"><strong>Set MaxClients 256</strong></p>
<p>Or</p>
<p>Somebody prefers to set MaxClients using following rule<strong></strong></p>
<p style="padding-left: 30px"><strong>MaxClients = 150 x RAM (GB) </strong></p>
<p>So for example if you have 2 GB RAM (dedicated for apache) set this value to 300. In my case IT WILL BE 150</p>
<p>Or</p>
<p>Some individuals maintain that each httpd thread uses about 5 MB of “real” memory. So they determine by the following way..</p>
<p>Or</p>
<p style="padding-left: 30px"><code>MaxClients = RAM(MB)/5</code></p>
<p><code>So for example if you have 2 GB RAM (dedicated for apache) set this value to 409. In my case IT WILL BE 204(1 GB for apache)</code><em></em></p>
<p><em>Note:</em> There is no reason for you to set it any higher unless you have a specific problem with this value. A high value can lead to a complete server hang in case of a DOS attack. A value too low can create timeout problems for your clients if the limit is reached</p>
<p><strong>StartServers</strong> &#8211; Sets the number of child server processes created on startup. This setting depends greatly on the type of webserver you run. If you run low traffic websites on that server set it low to something like 5. If you have resource intensive websites on that server you should set it close to MaxClients.</p>
<p><strong>MaxRequestsPerChild</strong> &#8211; Controls the number of request the a child serves before the child is killed. This should not be set too low as it will put an unnecessary load on the apache server to recreate the child. I suggest setting it to 1000.</p>
<p>But we are going to use 2000 for handling heavy traffic load properly.</p>
<p><strong>MinSpareServers and MaxSpareServers</strong> &#8211; MaxSpareServers and MinSpareServers control how many spare (unused) child-processes Apache will keep alive while waiting for more requests to put them to use. Each child-process consumes resources, so having MaxSpareServers set too high can cause resource problems. On the other hand, if the number of unused servers drops below MinSpareServers, Apache will fork. Leave those values to: MinSpareServers 5 MaxSpareServers 10</p>
<p><strong>ServerLimit</strong>: Its better to keep Server limit same as the value of MaxClients.<strong></strong></p>
<p><strong>MaxRequestsPerChild</strong>: I’ve Kept default apache value for this one.</p>
<p>So few changes need to be made in httpd.conf file which is located in /etc/httpd/conf/ directory<strong></strong></p>
<p style="padding-left: 30px"><strong>&lt;IfModule prefork.c&gt;<br />
StartServers     140<br />
MinSpareServers    5<br />
MaxSpareServers   10<br />
ServerLimit      150<br />
MaxClients       150<br />
MaxRequestsPerChild  4000<br />
&lt;/IfModule&gt;</strong></p>
<p>[Note]: Response time depends on MaxClients. If you increase the MaxClients number, server will response more quickly for each request but  a high value can lead to a complete server hang.</p>
<p>Ab is a tool for benchmarking the performance of your Apache HyperText Transfer Protocol (HTTP) server. It does this by giving you an indication of how many requests per second your Apache installation can serve.</p>
<p>uptime command in your root login should not yield a load average above 1, and the server should respond to commands quickly<strong></strong></p>
<p style="padding-left: 30px"><strong>ab -n 10000 -c 200 -k http://your_url<br />
-c = concurrent connections<br />
-t = time limit<br />
-n = # of requests</strong></p>
<p>Keep tuning until you hit your maximum desired load average. For servers used interactively often, having a load above 3 is way too much to use the server comfortably. For servers used mostly as real servers, a maximum load average of 10 should be acceptable. More than that, and you’ll find yourself needing to reboot the server when experiencing heavy traffic conditions, because no terminal or remote console will respond quickly to commands, and managing the server will be impossible.</p>
<p><strong>How to configure few things in php.ini file for supporting huge traffic</strong></p>
<p>* Enable the compression of HTML by putting in your php.ini:<strong></strong></p>
<p style="padding-left: 30px"><strong>output_handler = ob_gzhandler</strong></p>
<p>** Switch from file based sessions to shared memory sessions. Compile PHP with the –with-mm option and<strong></strong></p>
<p style="padding-left: 30px"><strong>set session.save_handler=mm</strong></p>
<p><strong>Configure mysql. Change my.cnf file for better performance.</strong></p>
<p>The database parameters are tuned for systems with 1 GB RAM (for ISO CD images). If you have higher RAM, please change the following in the “my.cnf” MySQL configuration file under /etc/mysql or /etc directory.<strong></strong></p>
<p><strong>For a machine running with 512 MB of RAM, you can set these to:</strong></p>
<p style="padding-left: 30px"><strong>key_buffer=128M table_cache=1024 sort_buffer=64M read_buffer=2M record_buffer=4M</strong></p>
<p><strong>For a machine running with 1 GB of RAM, you can set these to:</strong></p>
<p style="padding-left: 30px"><strong>key_buffer=256M table_cache=2048 sort_buffer=128M read_buffer=2M record_buffer=8M</strong></p>
<p><strong>For a machine running with 2 GB of RAM, you can set these to:</strong></p>
<p style="padding-left: 30px"><strong>key_buffer=512M table_cache=3072 sort_buffer=256M read_buffer=2M record_buffer=8M</strong></p>
<p><strong>For a machine running with 4 GB of RAM, you can set these to:</strong></p>
<p style="padding-left: 30px"><strong>key_buffer=1G table_cache=4096 sort_buffer=512M read_buffer=2M record_buffer=8M</strong></p>
<p><strong><a title="http://blog.shabuz.com/?p=54" href="http://blog.shabuz.com/?p=54" target="_blank">Original Post</a><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/07/25/how-to-tune-apache-and-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Necessary commands (tips) to tune apache</title>
		<link>http://blog.nataprawira.com/tech/2009/07/25/necessary-commands-tips-to-tune-apache/</link>
		<comments>http://blog.nataprawira.com/tech/2009/07/25/necessary-commands-tips-to-tune-apache/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 17:24:26 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=64</guid>
		<description><![CDATA[

To search in the current directory and all sub directories for a file named httpd.conf
find . -name “httpd.conf” -print
To find some string or text, type
find . -exec grep “MaxClients” ‘{}’ \; -print
This command will search in the current directory and all sub directories. All files that contain the string with the path.
If you want to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F07%2F25%2Fnecessary-commands-tips-to-tune-apache%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F07%2F25%2Fnecessary-commands-tips-to-tune-apache%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>To search in the current directory and all sub directories for a file named httpd.conf</p>
<p style="padding-left: 30px"><strong>find . -name “httpd.conf” -print</strong></p>
<p>To find some string or text, type</p>
<p style="padding-left: 30px"><strong>find . -exec grep “MaxClients” ‘{}’ \; -print</strong></p>
<p><span id="more-64"></span>This command will search in the current directory and all sub directories. All files that contain the string with the path.</p>
<p>If you want to just find each file then pass it on for processing use the -q grep option. This finds the first occurrance of the search string. It then signals success to find and find continues searching for more files.</p>
<p style="padding-left: 30px"><strong>find . -exec grep -q “www.athabasca” ‘{}’ \; -print</strong></p>
<p>Send 1000 Request to apache using apache benchmark</p>
<p style="padding-left: 30px"><strong>ab -n 1000 -c 200 -k YOUR_URL</strong></p>
<p>To view error log of httpd. type</p>
<p style="padding-left: 30px"><strong>grep -i maxclient /var/log/httpd/error_log*</strong></p>
<p>To view Process status type and load average type top and uptime respectively.</p>
<p>To open a file and search something(Here Example is: MaxClients) from there type</p>
<p style="padding-left: 30px"><strong>vi +/MaxClients /etc/httpd/conf/httpd.conf</strong></p>
<p>To view total memory used by httpd, type</p>
<p style="padding-left: 30px"><strong>ps -ylC httpd –sort:rss</strong></p>
<p><strong><a title="http://blog.shabuz.com/?p=55" href="http://blog.shabuz.com/?p=55" target="_blank">Original Post</a></p>
<p></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/07/25/necessary-commands-tips-to-tune-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Create SVN Repository</title>
		<link>http://blog.nataprawira.com/tech/2009/06/30/how-to-create-svn-repository/</link>
		<comments>http://blog.nataprawira.com/tech/2009/06/30/how-to-create-svn-repository/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 11:52:42 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[Repository]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=58</guid>
		<description><![CDATA[

How to get help with svn?
If you are looking for svn reference in man pages, you have gone to the wrong place. To check the references of svn commands, simple do this:
svn help

This will make svn list all the available functions, to get the function reference, let say checkout
svn help checkout
The same thing goes to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F06%2F30%2Fhow-to-create-svn-repository%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F06%2F30%2Fhow-to-create-svn-repository%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><strong>How to get help with svn?</strong></p>
<p>If you are looking for svn reference in man pages, you have gone to the wrong place. To check the references of svn commands, simple do this:</p>
<p style="padding-left: 30px"><strong>svn help</strong></p>
<p><span id="more-58"></span></p>
<p>This will make svn list all the available functions, to get the function reference, let say checkout</p>
<p style="padding-left: 30px"><strong>svn help checkout</strong></p>
<p>The same thing goes to other svn related commands, such as svnadmin<strong></strong></p>
<p style="padding-left: 30px"><strong>svnadmin help</strong><strong></strong></p>
<p><strong>How to create a svn repository?</strong></p>
<p>First of all what is repository? It is a core file for svn, or you can call it a centralized svn backup database. After created it, it is just a directory with its files. IMPORTANT! Do NOT try to modify or add something into the repository, unless you know what are you doing.</p>
<p>To create a svn repo, let say I wanna create a repo to store all my programming codes, I do this<strong></strong></p>
<p style="padding-left: 30px"><strong>svnadmin create /home/mysurface/repo/programming_repo</strong></p>
<p>Remember try to use absolute path for everything, sometimes the relative path is not going to work.</p>
<p><strong>How to import my existing directories into the new repo?</strong><strong></strong></p>
<p style="padding-left: 30px"><strong>svn import /home/mysurface/programming file:///home/mysurface/repo/programming_repo -m &#8220;Initial import&#8221;</strong></p>
<p>-m stand for log message, the first revision was created with log as “Initial import”. You need to specified URL for the repo, URL is the standard argument for svn. Therefore for local file, you need to specified with file://</p>
<p><strong>How to see what is inside the repo?</strong></p>
<p style="padding-left: 30px"><strong>svn list file:///home/mysurface/repo/programming_repo</strong></p>
<p>Another way of listing all the files and folder in the tree view, I use svnlook</p>
<p style="padding-left: 30px"><strong>svnlook tree programming_repo </strong></p>
<p>The difference between svn list and svnlook tree is one expect URL another one do not.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/06/30/how-to-create-svn-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto: HTACCESS Authentication restriction, but allow some IPs to get thru</title>
		<link>http://blog.nataprawira.com/tech/2009/06/22/howto-htaccess-authentication-restriction-but-allow-some-ips-to-get-thru/</link>
		<comments>http://blog.nataprawira.com/tech/2009/06/22/howto-htaccess-authentication-restriction-but-allow-some-ips-to-get-thru/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 11:29:55 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[HTaccess]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=57</guid>
		<description><![CDATA[

Easy part, just create like below .htaccess file on your web folder :
AuthName &#8220;My Protected Site&#8221;
AuthUserFile /home/apache/.htpasswd
AuthType basic
Require valid-user
Order Deny,Allow
Deny from all
Allow from 192.168.1. 192.168.2.
Satisfy Any
Good luck!
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F06%2F22%2Fhowto-htaccess-authentication-restriction-but-allow-some-ips-to-get-thru%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F06%2F22%2Fhowto-htaccess-authentication-restriction-but-allow-some-ips-to-get-thru%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>Easy part, just create like below .htaccess file on your web folder :</p>
<p style="padding-left: 30px">AuthName &#8220;My Protected Site&#8221;<br />
AuthUserFile /home/apache/.htpasswd<br />
AuthType basic<br />
Require valid-user<br />
Order Deny,Allow<br />
Deny from all<br />
Allow from 192.168.1. 192.168.2.<br />
Satisfy Any</p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/06/22/howto-htaccess-authentication-restriction-but-allow-some-ips-to-get-thru/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Check IP with PHP</title>
		<link>http://blog.nataprawira.com/tech/2009/06/16/simple-check-ip-with-php/</link>
		<comments>http://blog.nataprawira.com/tech/2009/06/16/simple-check-ip-with-php/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 18:37:27 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Internet Protocol]]></category>
		<category><![CDATA[IP]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=56</guid>
		<description><![CDATA[

You can use below simple PHP scripting to check IP address
&#60;?php
if(!empty($_SERVER["HTTP_X_FORWARDED_FOR"])){
echo &#8220;&#60;title&#62;&#8221;.$_SERVER["HTTP_X_FORWARDED_FOR"].&#8221; via &#8220;.$_SERVER["REMOTE_ADDR"].&#8221;&#60;/title&#62;\n\n&#8221;;
echo &#8220;Your IP: &#8220;.$_SERVER["HTTP_X_FORWARDED_FOR"] . &#8220;&#60;br /&#62;\n&#8221;;
echo &#8220;Proxy IP: &#8220;.$_SERVER["REMOTE_ADDR"] . &#8220;&#60;br /&#62;\n&#8221;;
$ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
}else{
echo &#8220;&#60;title&#62;&#8221;.$_SERVER["REMOTE_ADDR"].&#8221;&#60;/title&#62;\n\n&#8221;;
echo &#8220;Your IP: &#8220;.$_SERVER["REMOTE_ADDR"] . &#8220;&#60;br /&#62;\n&#8221;;
$ip = $_SERVER["REMOTE_ADDR"];
}
echo &#8220;Date Time: &#8221; . date(&#8221;Y-m-d H:i:s&#8221;) . &#8220;&#60;br /&#62;\n&#8221;;
?&#62;
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F06%2F16%2Fsimple-check-ip-with-php%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F06%2F16%2Fsimple-check-ip-with-php%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><strong>You can use below simple PHP scripting to check IP address</strong></p>
<p>&lt;?php<br />
if(!empty($_SERVER["HTTP_X_FORWARDED_FOR"])){<br />
echo &#8220;&lt;title&gt;&#8221;.$_SERVER["HTTP_X_FORWARDED_FOR"].&#8221; via &#8220;.$_SERVER["REMOTE_ADDR"].&#8221;&lt;/title&gt;\n\n&#8221;;<br />
echo &#8220;Your IP: &#8220;.$_SERVER["HTTP_X_FORWARDED_FOR"] . &#8220;&lt;br /&gt;\n&#8221;;<br />
echo &#8220;Proxy IP: &#8220;.$_SERVER["REMOTE_ADDR"] . &#8220;&lt;br /&gt;\n&#8221;;<br />
$ip = $_SERVER["HTTP_X_FORWARDED_FOR"];<br />
}else{<br />
echo &#8220;&lt;title&gt;&#8221;.$_SERVER["REMOTE_ADDR"].&#8221;&lt;/title&gt;\n\n&#8221;;<br />
echo &#8220;Your IP: &#8220;.$_SERVER["REMOTE_ADDR"] . &#8220;&lt;br /&gt;\n&#8221;;<br />
$ip = $_SERVER["REMOTE_ADDR"];<br />
}<br />
echo &#8220;Date Time: &#8221; . date(&#8221;Y-m-d H:i:s&#8221;) . &#8220;&lt;br /&gt;\n&#8221;;<br />
?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/06/16/simple-check-ip-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This is what you called, (Telkom) SPEEDY?!</title>
		<link>http://blog.nataprawira.com/tech/2009/06/09/this-is-what-you-called-telkom-speedy/</link>
		<comments>http://blog.nataprawira.com/tech/2009/06/09/this-is-what-you-called-telkom-speedy/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 04:18:56 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[RTO]]></category>
		<category><![CDATA[Speedy]]></category>
		<category><![CDATA[Telkom]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=55</guid>
		<description><![CDATA[

Hello TELKOM SPEEDY!
Its been (almost) 1 month, the connections were like this.
I NEED MY FAST CONNECTION BACK!!!!!!

Here are my ping result:
Reply from 209.131.36.158: bytes=32 time=914ms TTL=52
Reply from 209.131.36.158: bytes=32 time=1051ms TTL=52
Reply from 209.131.36.158: bytes=32 time=993ms TTL=52
Reply from 209.131.36.158: bytes=32 time=939ms TTL=52
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Reply from 209.131.36.158: bytes=32 time=763ms TTL=52
Reply from [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F06%2F09%2Fthis-is-what-you-called-telkom-speedy%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F06%2F09%2Fthis-is-what-you-called-telkom-speedy%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><strong>Hello <a href="http://www.telkomspeedy.com/" target="_blank">TELKOM SPEEDY</a>!</strong></p>
<p>Its been (almost) 1 month, the connections were like this.</p>
<p><strong>I NEED MY FAST CONNECTION BACK!!!!!!</strong></p>
<p><span id="more-55"></span></p>
<p><span style="text-decoration: underline"><strong>Here are my ping result:</strong></span><br />
Reply from 209.131.36.158: bytes=32 time=914ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=1051ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=993ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=939ms TTL=52<br />
<strong>Request timed out.<br />
Request timed out.<br />
Request timed out.<br />
Request timed out.</strong><br />
Reply from 209.131.36.158: bytes=32 time=763ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=1280ms TTL=52<br />
<strong>Request timed out.<br />
Request timed out.</strong><br />
Reply from 209.131.36.158: bytes=32 time=1386ms TTL=52<br />
<strong>Request timed out.</strong><br />
Reply from 209.131.36.158: bytes=32 time=772ms TTL=52<br />
<strong>Request timed out.</strong><br />
Reply from 209.131.36.158: bytes=32 time=936ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=627ms TTL=52<br />
<strong>Request timed out.<br />
Request timed out.</strong><br />
Reply from 209.131.36.158: bytes=32 time=881ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=923ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=990ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=746ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=819ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=1006ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=642ms TTL=52<br />
<strong>Request timed out.<br />
Request timed out.<br />
Request timed out.</strong><br />
Reply from 209.131.36.158: bytes=32 time=923ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=917ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=861ms TTL=52<br />
<strong>Request timed out.</strong><br />
Reply from 209.131.36.158: bytes=32 time=985ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=787ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=1057ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=746ms TTL=52<br />
<strong>Request timed out.<br />
Request timed out.</strong><br />
Reply from 209.131.36.158: bytes=32 time=789ms TTL=52<br />
Reply from 209.131.36.158: bytes=32 time=708ms TTL=52</p>
<p><strong>Ping statistics for 209.131.36.158:<br />
Packets: Sent = 3713, Received = 3498, Lost = 215 (5% loss),<br />
Approximate round trip times in milli-seconds:<br />
Minimum = 275ms, Maximum = 2174ms, Average = 557ms</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/06/09/this-is-what-you-called-telkom-speedy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Master-Slave Replication</title>
		<link>http://blog.nataprawira.com/tech/2009/06/08/mysql-master-slave-replication/</link>
		<comments>http://blog.nataprawira.com/tech/2009/06/08/mysql-master-slave-replication/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 16:20:43 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Master-Slave]]></category>
		<category><![CDATA[Replication]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=53</guid>
		<description><![CDATA[

To setup Master-Slave Replication the first thing you need to do is create a user on the Master server that allows replication.

 # mysql -u root -p
mysql&#62; grant replication slave on *.* TO repl@&#8221;%&#8221; identified by &#8216;[repl password]&#8216;;
mysql&#62; quit

Be sure to replace [repl password] with the actual password you want to use. Also, you must [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F06%2F08%2Fmysql-master-slave-replication%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F06%2F08%2Fmysql-master-slave-replication%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>To setup Master-Slave Replication the first thing you need to do is create a user on the Master server that allows replication.</p>
<p><span id="more-53"></span></p>
<p><strong> # mysql -u root -p<br />
mysql&gt; grant replication slave on *.* TO repl@&#8221;%&#8221; identified by &#8216;[repl password]&#8216;;<br />
mysql&gt; quit<br />
</strong><br />
Be sure to replace [repl password] with the actual password you want to use. Also, you must ensure that your firewall has port 3306:tcp open, the default port for the mysql server service.</p>
<p>Next, exit your ini file (typically /etc/my.cnf on Linux servers) to start binary logging of the Master server. You may or may not want to use the last line to ignore changes to the mysql database since that is the database used for mysql configuration and permissions.</p>
<p>Under the [mysqld] heading add the following lines:</p>
<p><strong> log-bin=mysql-bin<br />
server-id=1<br />
binlog-ignore-db=&#8221;mysql&#8221;<br />
</strong><br />
<em>Restart your mysql server service.</em></p>
<p>Before we start copying changes, we want to make sure the data on each server is the same, so dump the data from the Master server and add it to the Slave server. This can easily be performed using mysqldump as follows:</p>
<p><strong> # mysqldump -u root -p[password] [database]&gt;/home/[user]/[database].sql<br />
</strong><br />
Be sure again to replace [password] with the actual password, [database] with the actual name of each database, one at a time.</p>
<p>Now that you have a snapshot of the data, get the binary position of the log file.</p>
<p><strong> # mysql -u root -p[plain-text password]<br />
mysql&gt; SHOW MASTER STATUS;<br />
</strong><br />
The output should look something like this:</p>
<p><strong> +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
| File             | Position  | Binlog_Do_DB | Binlog_Ignore_DB |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
| mysql-bin.000112 |        79 |              | mysql            |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
1 row in set (0.00 sec)<br />
</strong><br />
Write down the filename and log position for use on the Slave server.</p>
<p>Next, copy the databases to your Slave server.</p>
<p><strong> # scp /home/[user]/*.sql [Slave IP]:/home/[user]/<br />
</strong><br />
At this point we are done with the Master server. Now for the Slave.</p>
<p>Edit the Slave server&#8217;s mysql configuation file (typically /etc/my.cnf on Linux servers) to identify its server number, master host and user.</p>
<p>Under the [mysqld] heading add the following lines:</p>
<p><strong> server-id=2<br />
master-host = [IP of Master Server]<br />
master-user = repl<br />
master-password = [repl password]<br />
master-port = 3306<br />
</strong><br />
Again, ensure you replace [repl password] with the actual repl user password, and [IP of Master Server] with the IP address of the Master server.</p>
<p>Insert the data from the Master server into the Slave server databases for each of the databases.</p>
<p><strong> # mysql -p[password] [database] &lt; /home/[user]/[database].sql<br />
</strong><br />
Be sure to replace [password] with the root users password, and [database] with each database&#8217;s name, one at a time.</p>
<p><em>Restart the mysql server service.<br />
</em><br />
Now log in to Mysql and configure the Slave replication.</p>
<p><strong> # mysql -u root -p<br />
mysql&gt; CHANGE MASTER TO MASTER_LOG_FILE=&#8217;[Filename written down]&#8216;,<br />
MASTER_LOG_POS=[Position written down];<br />
mysql&gt; START SLAVE;<br />
mysql&gt; SHOW SLAVE STATUS\G<br />
</strong><br />
Slave_IO_State status information should identify &#8220;Waiting for master to send event&#8221;. If it stops at &#8220;Connecting to Master&#8221; check your log file.</p>
<p>By default it is located in /var/log/mysqld.log but may be different on your system. Check your my.cnf file for the exact location of your log file.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/06/08/mysql-master-slave-replication/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To Add Godaddy SSL Site Seal Image</title>
		<link>http://blog.nataprawira.com/tech/2009/06/01/how-to-add-godaddy-ssl-site-seal-image/</link>
		<comments>http://blog.nataprawira.com/tech/2009/06/01/how-to-add-godaddy-ssl-site-seal-image/#comments</comments>
		<pubDate>Sun, 31 May 2009 17:26:40 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Godaddy]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Site Seal]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=52</guid>
		<description><![CDATA[

We have 2 ways, to get this done. You just need to choose, which way is suitable for you  

Long Way:
1. Log in to your Account Manager.
2. Visit: https://certs.godaddy.com/ManageProducts.do
3. On &#8220;Manage SSL Certificates&#8221;, click on your domain name.
4. Click on &#8220;SITE SEAL&#8221; tab to manage your site seal
5. Choose &#8220;Site Seal Image Size&#8221;
6. Click [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F06%2F01%2Fhow-to-add-godaddy-ssl-site-seal-image%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F06%2F01%2Fhow-to-add-godaddy-ssl-site-seal-image%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>We have 2 ways, to get this done. You just need to choose, which way is suitable for you <img src='http://blog.nataprawira.com/tech/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-52"></span></p>
<p><span style="text-decoration: underline"><strong>Long Way:</strong></span></p>
<p>1. Log in to your Account Manager.</p>
<p>2. Visit: <a href="https://certs.godaddy.com/ManageProducts.do" target="_blank"><strong>https://certs.godaddy.com/ManageProducts.do</strong></a></p>
<p>3. On &#8220;Manage SSL Certificates&#8221;, click on your domain name.</p>
<p>4. Click on &#8220;SITE SEAL&#8221; tab to manage your site seal</p>
<p>5. Choose &#8220;Site Seal Image Size&#8221;</p>
<p>6. Click on Submit button.</p>
<p>7. On the right side box, copy-paste the javascript provided, into your sidebar website.</p>
<p>8. Done.</p>
<p><span style="text-decoration: underline"><strong>Easy way:</strong></span></p>
<p>1. Log in to your Account Manager.</p>
<p>2. Visit Manage Site Seal page: <a href="https://certs.godaddy.com/ManageSiteSeal.do" target="_blank"><strong>https://certs.godaddy.com/ManageSiteSeal.do</strong></a></p>
<p>3. Choose &#8220;Site Seal Image Size&#8221;</p>
<p>4. Click on Submit button.</p>
<p>5. On the right side box, copy-paste the javascript provided, into your sidebar website.</p>
<p>6. Done.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/06/01/how-to-add-godaddy-ssl-site-seal-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to configure YUM/WGET to get through using PROXY ?</title>
		<link>http://blog.nataprawira.com/tech/2009/05/26/how-to-configure-yumwget-to-get-through-using-proxy/</link>
		<comments>http://blog.nataprawira.com/tech/2009/05/26/how-to-configure-yumwget-to-get-through-using-proxy/#comments</comments>
		<pubDate>Tue, 26 May 2009 10:01:43 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[wget]]></category>
		<category><![CDATA[Yum]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=51</guid>
		<description><![CDATA[


Better answer &#8211; use /etc/profile.d/proxy.[csh,sh]


You just need to create the following files in /etc/profile.d, and then this will work in *any* shell for *any* user of the system:
#proxy.sh
export http_proxy=http://host.com:port/
export ftp_proxy=http://host.com:port/
export no_proxy=.domain.com
export HTTP_PROXY=http://host.com:port/
export FTP_PROXY=http://host.com:port/
#proxy.csh
setenv http_proxy http://host.com:port/
setenv ftp_proxy http://host.com:port/
setenv no_proxy .domain.com
setenv HTTP_PROXY http://host.com:port/
setenv FTP_PROXY http://host.com:port/




After that, you can run YUM/WGET  
 
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F05%2F26%2Fhow-to-configure-yumwget-to-get-through-using-proxy%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F05%2F26%2Fhow-to-configure-yumwget-to-get-through-using-proxy%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<div id="post_message_4089">
<div class="smallfont"><strong>Better answer &#8211; use /etc/profile.d/proxy.[csh,sh]</strong></div>
<div class="smallfont">
</div>
<div id="post_message_4089">You just need to create the following files in /etc/profile.d, and then this will work in *any* shell for *any* user of the system:</div>
<p>#proxy.sh<br />
export http_proxy=http://host.com:port/<br />
export ftp_proxy=http://host.com:port/<br />
export no_proxy=.domain.com<br />
export HTTP_PROXY=http://host.com:port/<br />
export FTP_PROXY=http://host.com:port/</p>
<p>#proxy.csh<br />
setenv http_proxy <a href="http://host.com/" target="_blank">http://host.com:port/</a><br />
setenv ftp_proxy <a href="http://host.com/" target="_blank">http://host.com:port/</a><br />
setenv no_proxy .domain.com<br />
setenv HTTP_PROXY <a href="http://host.com/" target="_blank">http://host.com:port/</a><br />
setenv FTP_PROXY <a href="http://host.com/" target="_blank">http://host.com:port/</a></p>
</div>
<div></div>
<div>
</div>
<div>After that, you can run YUM/WGET <img src='http://blog.nataprawira.com/tech/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
<p><!-- / message --> <!-- edit note --></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/05/26/how-to-configure-yumwget-to-get-through-using-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SEO Warning for DEVELOPERS &amp; WEBMASTERS</title>
		<link>http://blog.nataprawira.com/tech/2009/05/08/seo-warning-for-developers-webmasters/</link>
		<comments>http://blog.nataprawira.com/tech/2009/05/08/seo-warning-for-developers-webmasters/#comments</comments>
		<pubDate>Fri, 08 May 2009 03:36:57 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tech News]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Webmaster]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=50</guid>
		<description><![CDATA[

Avoiding Top SEO Mistakes
Following are the 9 Biggest SEO Mistakes which Web Designers &#38; Web Developers should avoid.
Splash Page
I&#8217;ve seen this mistake many times where people put up just a big banner image and a link &#8220;Click here to enter&#8221; on their homepage. The worst case &#8212; the &#8220;enter&#8221; link is embedded in the Flash [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F05%2F08%2Fseo-warning-for-developers-webmasters%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F05%2F08%2Fseo-warning-for-developers-webmasters%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><strong>Avoiding Top SEO Mistakes</strong></p>
<p>Following are the 9 Biggest SEO Mistakes which Web Designers &amp; Web Developers should avoid.</p>
<p><strong>Splash Page</strong></p>
<p>I&#8217;ve seen this mistake many times where people put up just a big banner image and a link &#8220;Click here to enter&#8221; on their homepage. The worst case &#8212; the &#8220;enter&#8221; link is embedded in the Flash object, which makes it impossible for the spiders to follow the link.</p>
<p>This is fine if you don&#8217;t care about what a search engine knows about your site; otherwise, you&#8217;re making a BIG mistake. Your homepage is probably your website&#8217;s highest ranking page and gets crawled frequently by web spiders. Your internal pages will not appear in the search engine index without the proper linking structure to internal pages for the spider to follow.</p>
<p>Your homepage should include (at minimum) target keywords and links to important pages.</p>
<p><span id="more-50"></span></p>
<p><strong>Non-spiderable Flash Menus</strong></p>
<p>Many designers make this mistake by using Flash menus such as those fade-in and animated menus. They might look cool to you but they can&#8217;t be seen by the search engines; and thus the links in the Flash menu will not be followed.<strong></strong></p>
<p><strong>Image and Flash Content</strong></p>
<p>Web spiders are like a text-based browser, they can&#8217;t read the text embedded in the graphic image or Flash. Most designers make this mistake by embedding the important content (such as target keywords) in Flash and image.<strong></strong></p>
<p><strong>Overuse of Ajax</strong></p>
<p>A lot of developers are trying to impress their visitor by implementing massive Ajax features (particularly for navigation purposes), but did you know that it is a big SEO mistake? Because, ajax content is loaded dynamically, so it is not spiderable or indexable by search engines.</p>
<p>Another disadvantage of Ajax &#8212; since the address URL doesn&#8217;t reload, your visitor can not send the current page to their friends.<strong></strong></p>
<p><strong>Versioning of Theme Design</strong></p>
<p>For some reason, some designers love to version their theme design into sub level folders (i.e. domain.com/v2, v3, v4) and redirect to the new folder. Constantly changing the main root location may cause you to lose backlink counts and ranking.<strong></strong></p>
<p><strong>&#8220;Click Here&#8221; Link Anchor Text</strong></p>
<p>You probably see this a lot where people use &#8220;Click here&#8221; or &#8220;Learn more&#8221; as the linking text. This is great if you want to be ranked high for &#8220;Click Here&#8221;. But, if you want to tell the search engine that your page is important for a topic, than use, that topic/keyword in your link anchor text. It&#8217;s much more descriptive (and relevant) to say &#8220;learn more about {keyword topic}&#8221;</p>
<p>Warning: Don&#8217;t use the EXACT same anchor text everywhere on your website. This can sometimes be seen as search engine spam too.<strong></strong></p>
<p><strong>Common Title Tag Mistakes</strong><strong><em></em></strong></p>
<p><strong><em>Same or similar title text:</em></strong><br />
Every page on your site should have a unique &lt;title&gt; tag with the target keywords in it. Many developers make the mistake of having the same or similar title tags throughout the entire site. That&#8217;s like telling the search engine that EVERY page on your site refers to the same topic and one isn&#8217;t any more unique than the other.</p>
<p>One good example of bad Title Tag use would be the default WordPress theme. In case you didn&#8217;t know, the title tag of the default WordPress theme isn&#8217;t that useful: Site Name &gt; Blog Archive &gt; Post Title. Why isn&#8217;t this search engine friendly? Because, every single blog post will have the same text &#8220;Site Name &gt; Blog Archive &gt;&#8221; at the beginning of the Title Tag. If you really want to include the site name in the title tag, it should be at the end: Post Title | Site Name.<em><strong></strong></em></p>
<p><em><strong>Exceeding the 65 character limit:</strong></em><br />
Many bloggers write very long post titles. So what? In search engine result pages, your title tag is used as the link heading. You have about 65 characters (including spaces) to get your message across or risk it getting cutoff.<em><strong></strong></em></p>
<p><em><strong>Keyword stuffing the title:</strong></em><br />
Another common mistake people tend to make is overfilling the title tag with keywords. Saying the same thing 3 times doesn&#8217;t make you more relevant. Keyword stuffing in the Title Tag is looked at as search engine spam (not good). But it might be smart to repeat the same word in different ways:</p>
<p>&#8220;Photo Tips &amp; Photography Techniques for Great Pictures&#8221; &#8220;Photo&#8221; and &#8220;Photography&#8221; are the same word repeated twice but in different ways because your audience might use either one when performing a search query.<strong></strong></p>
<p><strong>Empty Image Alt Attribute</strong></p>
<p>You should always describe your image in the alt attribute. The alt attribute is what describes your image to a blind web user. Guess what? Search engines can&#8217;t see images so your alt attribute is a factor in illustrating what your page is relevant for.</p>
<p><em>Hint: Properly describing your images can help your ranking in the image search results. For example, Google image search brings me hundreds of referrals everyday for the search terms &#8220;abstract&#8221; and &#8220;dj&#8221;.</em><strong></strong></p>
<p><strong>Unfriendly URLs</strong></p>
<p>Most blog or CMS platforms have a friendly URL feature built-in, however, not every blogger is taking advantage of this. Friendly URL&#8217;s are good for both your human audience and the search engines. The URL is also an important spot where your keywords should appear.</p>
<p>Example of Friendly URL: domain.com/page-title<br />
Example of Dynamic URL: domain.com/?p=12356</p>
<p>These things are the pillars of Search Engine Optimization and so to your web site&#8217;s success path.</p>
<p><em>About the Author: Robin Dale is the publisher for www.teeky.org, we offer useful &amp; quality articles and news about Search Engine Optimization, Internet Marketing, Dedicated Server Hosting, Windows VPS Hosting UK, Linux VPS Hosting UK, e-commerce hosting, cPanel Hosting, hosting tips &amp; UK Web Hosting.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/05/08/seo-warning-for-developers-webmasters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Blackberry Pearl 8100 as a bluetooth modem under Vista RTM (explained)</title>
		<link>http://blog.nataprawira.com/tech/2009/04/23/using-blackberry-pearl-8100-as-a-bluetooth-modem-under-vista-rtm-explained/</link>
		<comments>http://blog.nataprawira.com/tech/2009/04/23/using-blackberry-pearl-8100-as-a-bluetooth-modem-under-vista-rtm-explained/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 01:02:14 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Blackberry]]></category>
		<category><![CDATA[8100]]></category>
		<category><![CDATA[Bluetooth]]></category>
		<category><![CDATA[Modem]]></category>
		<category><![CDATA[Pearl]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=49</guid>
		<description><![CDATA[

Originally Posted by antineutrino  View Post
1. First, set up pairing between your PC (or laptop) and your BB:
Right-click on the bluetooth icon on the taskbar-&#62;Open Bluetooth settings-&#62;Add&#8230;-&#62;read instructions and set up a password if you want. Then look at your phone, it should ask you if you allow this connections, (and for the password.)
2. Make [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F04%2F23%2Fusing-blackberry-pearl-8100-as-a-bluetooth-modem-under-vista-rtm-explained%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F04%2F23%2Fusing-blackberry-pearl-8100-as-a-bluetooth-modem-under-vista-rtm-explained%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><strong><em>Originally Posted by antineutrino  <a href="http://www.blackberryforums.com/bluetooth-connection/73455-using-blackberry-pearl-8100-bluetooth-modem-under-vista-explained-post513740.html#post513740" target="_blank">View Post</a></em></strong></p>
<p><strong>1. First, set up pairing between your PC (or laptop) and your BB:</strong></p>
<p>Right-click on the bluetooth icon on the taskbar-&gt;Open Bluetooth settings-&gt;Add&#8230;-&gt;read instructions and set up a password if you want. Then look at your phone, it should ask you if you allow this connections, (and for the password.)</p>
<p><strong>2. Make sure you have the latest BlackBerry Desktop Manager (4.2 SP1 as of the time this was written.)</strong></p>
<p>Start it up, go to options -&gt; connection settings, check &#8220;Enable bluetooth support,&#8221; click on configure bluetooth -&gt; add&#8230; and add your device.</p>
<p>Then click ok, make sure your phone has bluetooth on. Your desktop manager should be now &#8220;connected&#8221; with the BB.</p>
<p><span id="more-49"></span></p>
<p><strong>3. Go back to the windows bluetooth settings (step 1.)</strong></p>
<p>Select the device, click Properties -&gt; Services and put a checkmark on &#8220;Dial-Up Networking.&#8221; Windows should be installing the drivers for the BT modem now automatically.</p>
<p><strong>4. Go to Control Panel -&gt; Hardware and Sound -&gt; Phone and Modem options -&gt; Modems</strong></p>
<p>select the Bluetooth modem, click on Properties, then click on &#8220;Change settings&#8221;, wait for the annoying popup, click Allow. Go to Advanced and put this in the field:</p>
<p><em><strong>** Provider specific from here on ***</strong></em></p>
<blockquote><p><em><strong></strong></em><strong>+cgdcont=1,&#8221;IP&#8221;,&#8221;wap.voicestream.com&#8221;</strong><br />
<em>(for T-Mobile. Please search other threads for different providers)</em></p></blockquote>
<p><strong>5. Set up a Dial-up connection. Go to Control Panel -&gt; Network and Internet -&gt; Network and Sharing Center -&gt; Set up a connection or a network &#8211; &gt; Set up a dial-up connection.</strong></p>
<p>Use &#8220;Standard modem over Bluetooth link.&#8221;<br />
Phone # <strong>*99#</strong><br />
Username/password are <strong>empty</strong>.</p>
<p><strong>6. Go back to Control panel -&gt; network and sharing center.</strong></p>
<p>Click on &#8220;Manage network connections&#8221; and right-click-&gt;properties on the one that you just created. Click on the modem -&gt; Configure -&gt; Uncheck &#8220;Enable hardware flow control&#8221; and uncheck &#8220;Enable speaker.&#8221; Click ok.</p>
<p>Go to &#8220;Networking Tab&#8221;, select Internet Protocol Version 4 and click on Properties-&gt;Advanced and uncheck &#8220;Use IP Header Compression&#8221;</p>
<p><strong>7. Dial and it should work.</strong></p>
<blockquote><p>If you have any questions, <strong><a href="http://www.blackberryforums.com/bluetooth-connection/73455-using-blackberry-pearl-8100-bluetooth-modem-under-vista-explained-2.html" target="_blank">reply to this thread</a></strong>.</p></blockquote>
<blockquote><p><em><strong>* Original Post : <a href="http://www.blackberryforums.com/bluetooth-connection/73455-using-blackberry-pearl-8100-bluetooth-modem-under-vista-explained-2.html" target="_blank">CLICK HERE</a><br />
* Relatively Post : <a href="http://www.blackberryforums.com/blackberry-guides/2019-user-howto-use-blackberry-modem-laptop.html" target="_blank">CLICK HERE</a></strong></em></p>
<p><em><strong>* More to Seach : <a href="http://www.google.com/search?q=blackberry+8100+bluetooth+drivers" target="_blank">GOOGLE</a></strong></em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/04/23/using-blackberry-pearl-8100-as-a-bluetooth-modem-under-vista-rtm-explained/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing Linux</title>
		<link>http://blog.nataprawira.com/tech/2009/04/12/securing-linux/</link>
		<comments>http://blog.nataprawira.com/tech/2009/04/12/securing-linux/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 00:49:07 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Secure]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=48</guid>
		<description><![CDATA[



Mod_security(ModSecurity is an open source intrusion detection and prevention engine for web applications)
Features 
•	filtering POST and GET requests (including hearders)
•	filters inheritance and ability to add filters in each vhosts configuration file, and    per directory
•	include a way to chroot apache in an easiest way
•	ability to fake apache output (like telling &#8220;Microsoft IIS&#8221; on error page or [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F04%2F12%2Fsecuring-linux%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F04%2F12%2Fsecuring-linux%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<div id="matter_container">
<div class="matter_matter">
<h1 class="title">Mod_security(ModSecurity is an open source intrusion detection and prevention engine for web applications)</h1>
<h2><span class="content_title_blue">Features </span></h2>
<p><span class="content_text">•	filtering POST and GET requests (including hearders)<br />
•	filters inheritance and ability to add filters in each vhosts configuration file, and    per directory<br />
•	include a way to chroot apache in an easiest way<br />
•	ability to fake apache output (like telling &#8220;Microsoft IIS&#8221; on error page or whatever    you want to display)<br />
•	can store uploaded files in a tmp directory and call an anti-virus scan like clamav on     these files </span></p>
<p><span id="more-48"></span></p>
<h2><span class="content_title_blue">Installation</span></h2>
<p class="content_text">wget http://www.modsecurity.org/download/modsecurity-apache_1.9.4.tar.gz<br />
tar zxvf modsecurity-apache_1.9.4.tar.gz<br />
cd modsecurity-apache_1.9.4<br />
/usr/local/apache/bin/apxs -cia mod_security.c<br />
/usr/local/apache/bin/apachectl stop<br />
/usr/local/apache/bin/apachectl start</p>
<p class="content_text">Add required modsecurity directives in httpd.conf</p>
<h1 class="title">Mod_evasive( mod_evasive is intended to avoid DDOS attacks by baning IPs that have reached a configured limit of requests during a laps of time)</h1>
<h2><span class="content_title_blue">Features </span></h2>
<p><span class="content_text">•	Its quite easy to deploy on a webserver and can be very usefull.<br />
•	IP addresses of trusted clients can be whitelisted to insure they are never denied<br />
• This tool is excellent at fending off request-based DoS attacks or scripted<br />
attacks, and brute force attack </span></p>
<h2><span class="content_title_blue">Installation</span></h2>
<p class="content_text">wget http://www.zdziarski.com/projects/mod_evasive/mod_evasive_1.10.1.tar.gz<br />
1. Extract this archive into src/modules in the Apache source tree<br />
2. Run ./configure &#8211;add-module=src/modules/evasive/mod_evasive.c<br />
3. make, install<br />
4. Restart Apache<br />
With DSO Support, Ensim, or CPanel:<br />
1. /usr/local/apache/bin/apxs -iac mod_evasive.c<br />
2. Restart Apache</p>
<p class="content_text">Add required directive in httpd.conf</p>
<h1 class="title">Mod_limitipconn(mod_limitipconn allows web server administrators to limit the number of simultaneous downloads permitted from a single IP address)</h1>
<h2><span class="content_title_blue">Features </span></h2>
<p class="content_text">•	Allows inclusion and exclusion of files based on MIME type.<br />
•	Partially fixes the problem of dangling browser connections counting towards the    download limit</p>
<h2><span class="content_title_blue">Installation</span></h2>
<p class="content_text">wget<br />
http://dominia.org/djao/limit/mod_limitipctar xzvf mod_limitipconn-0.04.tar.gz<br />
tar xzvf mod_limitipconn-0.04.tar.gz<br />
cd apache_1.3.27<br />
patch -p1 &lt; /root/mod_limitipconn-0.04/apachesrc.diff<br />
cp /root/mod_limitipconn-0.04/mod_limitipconn.c src/modules/extra/<br />
./configure &#8211;activate-module=src/modules/extra/mod_limitipconn.c &#8211;with-forward<br />
make ,install</p>
<p class="content_text"><strong>With DSO Support, Ensim, or CPanel:</strong><br />
1.cd mod_limitipconn-0.04<br />
2.make<br />
3.make install</p>
<p class="content_text">add required directives in httpd.conf</p>
<h1 class="title">APF (Advanced Policy Firewall is a policy based iptables firewall system designed for ease of use and configuration)</h1>
<h2><span class="content_title_blue">Features</span></h2>
<p class="content_text">- detailed and well commented configuration file<br />
- granular inbound and outbound network filtering<br />
- user id based outbound network filtering<br />
- application based network filtering<br />
- trust based rule files with an optional advanced syntax<br />
- global trust system where rules can be downloaded from a central management<br />
server<br />
- debug mode provided for testing new features and configuration setups<br />
- fast load feature that allows for 1000+ rules to load in under 1 second<br />
- inbound and outbound network interfaces can be independently configured<br />
- global tcp/udp port &amp; icmp type filtering with multiple methods of excuting<br />
filters (drop, reject, prohibit)<br />
- configurable policies for each ip on the system with convenience variables to<br />
import settings<br />
- packet flow rate limiting that prevents abuse on the most widely abused<br />
protocol, icmp<br />
- prerouting and postrouting rules for optimal network performance<br />
- dshield.org block list support to ban networks exhibiting suspicious activity<br />
- spamhaus Don&#8217;t Route Or Peer List support to ban known &#8220;hijacked zombie&#8221; IP<br />
blocks<br />
- antidos subsystem to stop attacks before they become a significant threat<br />
- any number of additional interfaces may be configured as firewalled<br />
(untrusted) or trusted (not firewalled)<br />
- additional firewalled interfaces can have there own unique firewall policies<br />
applied<br />
- intelligent route verification to prevent embarrassing configuration errors<br />
- advanced packet sanity checks to make sure traffic coming and going meets<br />
- filter attacks such as fragmented UDP, port zero floods, stuffed routing,<br />
arp poisoning and more<br />
- configurable type of service options to dictate the priority of different types<br />
of network traffic<br />
- intelligent default settings to meet every day server setups<br />
- dynamic configuration of your servers local DNS revolvers into the firewall<br />
- optional filtering of common p2p applications<br />
- optional filtering of private &amp; reserved IP address space<br />
- optional implicit blocks of the ident service<br />
- configurable connection tracking settings to scale the firewall to the size of<br />
your network<br />
- configurable kernel hooks (ties) to harden the system further to syn-flood<br />
attacks &amp; routing abuses<br />
- advanced network control such as explicit congestion notification and overflow<br />
control<br />
- special chains that are aware of the state of FTP DATA and SSH connections to<br />
prevent client side issues<br />
- control over the rate of logged events, want only 30 filter events a minute?<br />
300 a minute? &#8211; you are the boss<br />
- logging subsystem that allows for logging data to user space programs or<br />
standard syslog files<br />
- logging that details every rule added and a comprehensive set of error checks<br />
to prevent config errors<br />
- if you are familiar with netfilter you can create your own rules in any of<br />
the policy files<br />
- pluggable and ready advanced use of QoS algorithms provided by the Linux</p>
<h2><span class="content_title_blue">Installation</span></h2>
<p class="content_text">wget http://www.rfxnetworks.com/downloads/apf-current.tar.gz<br />
tar -xvzf apf-current.tar.gz<br />
cd apf-0.9.6-2/<br />
./install.sh</p>
<p class="content_text">configure apf(/etc/apf/conf.apf) upon requrements</p>
<p class="content_text">then  start apf<br />
/usr/local/sbin/apf -s</p>
<h1 class="title">BFD( Brute Force Detection is a modular shell script for parsing applicable logs and checking for authentication</h1>
<h2><span class="content_title_blue">Installation</span></h2>
<p class="content_text">wget http://www.rfxnetworks.com/downloads/bfd-current.tar.gz<br />
tar -xvzf bfd-current.tar.gz<br />
cd bfd-0.7<br />
./install.sh</p>
<p>configure bfd (/usr/local/bfd/conf.bfd ) upon requirements</p>
<p>to start bdf running<br />
/usr/local/sbin/bfd -s</p>
<h1 class="title">SIM (System Integrity Monitor is a system and services monitor for ‘SysVinit’ systems. It is designed to be intuitive and modular in nature)</h1>
<h2><span class="content_title_blue">Features </span></h2>
<p><span class="content_text">- Service monitoring of HTTP, FTP, DNS, SSH, MYSQL &amp; more<br />
- Event tracking and alert system<br />
- Auto restart ability for downed services<br />
- Checks against network sockets &amp; process list to ensure services are online<br />
- HTTP log size monitor, to avoid segfaults from apache due to large logs<br />
- URL Aware monitoring, to ensure HTTP does not &#8216;lockup&#8217;<br />
- System load monitor with customizable warning levels, actions, and more&#8230;<br />
- Informative command line status display<br />
- Easily customizable configuration file<br />
- Auto configuration script<br />
- Auto cronjob setup feature<br />
- Caching feature for ps/netstat output, to ease on runtime load<br />
- Simple &amp; Informative installation script<br />
- Integrated auto-update feature</span></p>
<h2><span class="content_title_blue">Installation</span></h2>
<p class="content_text">wget http://www.r-fx.org/downloads/sim-current.tar.gz<br />
tar -xzvf sim-current.tar.gz<br />
cd sim-2.5-4/<br />
./setup -i<br />
Then press &#8220;Enter&#8221;<br />
Then when it says MORE press the &#8220;space bar&#8221;<br />
Then press &#8220;Enter&#8221;<br />
Then when it says MORE press the &#8220;space bar&#8221;<br />
Now you will press ENTER one more time to do the auto-configuration script for SIM</p>
<p class="content_text">To add a cron.<br />
Type: ./setup -c<br />
If it says &#8220;Removed SIM cronjob.&#8221; then you must type it again.<br />
Type: ./setup -c</p>
<h1 class="title">Portsentry(  PortSentry is a tcpwrapper that listens for port scans, which can be used to send back fake ping replys)</h1>
<h2><span class="content_title_blue">Features</span></h2>
<p class="content_text">-help us to protect our network from unsolicited intrusions<br />
-we can choose which ports we want to be open and which one&#8217;s we dont</p>
<h2><span class="content_title_blue">Installation</span></h2>
<p class="content_text">wget http://www.macosxunleashed.com/downloads/portsentry-1.0.tar.gz<br />
tar zxvfx portsentry-1.0.tar.gz<br />
cd  portsentry-1.0<br />
make linux<br />
make install</p>
<p class="content_text">conf file( /usr/local/psionic/portsentry/portsentry.conf)make relevant changes</p>
<h1 class="title">chkrootkit (it is a tool to locally check for signs of a rootkit)</h1>
<h2><span class="content_title_blue">Features</span></h2>
<p class="content_text"><strong>*</strong> chkrootkit: shell script that checks system binaries for rootkit modification.<br />
<strong>*</strong> ifpromisc.c: checks if the interface is in promiscuous mode.<br />
<strong>*</strong> chklastlog.c: checks for lastlog deletions.<br />
<strong>*</strong> chkwtmp.c: checks for wtmp deletions.<br />
<strong>*</strong> check_wtmpx.c: checks for wtmpx deletions. (Solaris only)<br />
<strong>* </strong>chkproc.c: checks for signs of LKM trojans.<br />
<strong>*</strong> chkdirs.c: checks for signs of LKM trojans.<br />
<strong>*</strong> strings.c: quick and dirty strings replacement.<br />
<strong>*</strong> chkutmp.c: checks for utmp deletions.</p>
<h2><span class="content_title_blue">Installation</span></h2>
<p class="content_text">wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz<br />
tar zxvf chkrootkit.tar.gz<br />
cd chkrootkit-0.47/<br />
make sense<br />
./chkrootkit</p>
<p class="content_text">configure reporting cronjob:-</p>
<p class="content_text">cd /etc/cron.daily<br />
vi chkrootkit.cron<br />
#!/bin/bash<br />
cd /root/chkrootkit-0.47/<br />
./chkrootkit 2&gt;&amp;1 | mail –s “chkrootkit daily report” ndztest@gmail.com</p>
<p class="content_text">Save &amp; exit<br />
chmod +x chkrootkit.cron</p>
<h1 class="title">RKHunter (RootKit Hunter Is a security scanning tool which will scan for rootkits, backdoors, and local exploits)</h1>
<h2><span class="content_title_blue">Features</span></h2>
<p class="content_text">It runs many tests, including MD5 hash comparisons, default filenames used by rootkits, wrong file permissions for binaries, and suspicious strings in LKM and KLD modules</p>
<h2><span class="content_title_blue">Installation</span></h2>
<p class="content_text">wget http://downloads.rootkit.nl/rkhunter-1.1.4.tar.gz<br />
tar -xzvf rkhunter-1.1.4.tar.gz<br />
cd rkhunter<br />
./installer.sh</p>
<p class="content_text">configure reporting cronjob:-<br />
cd /etc/cron.daily<br />
vi rkhunter.cron<br />
#!/bin/bash<br />
/usr/local/bin/rkhunter -c &#8211;cronjob 2&gt;&amp;1 | mail -s &#8220;RKhunter Scan Details&#8221; ndztest@gmail.com</p>
<p class="content_text">Save  &amp; exit<br />
chmod +x rkhunter.cron</p>
<h1 class="title">Snort(Snort is an open source network intrusion detection and prevention system)</h1>
<h2><span class="content_title_blue">Features</span></h2>
<p class="content_text">* capable of performing real-time traffic analysis, alerting, blocking and packet    logging on IP networks<br />
* Protocol Analysis<br />
* Content searching / matching<br />
* Real-time alerting capability<br />
* Can read in a TCPDump trace and run against a rule set<br />
* Flexible rules language to describe traffic that it should collect or pass</p>
<h2><span class="content_title_blue">Installation</span></h2>
<p class="content_text">wget http://www.snort.org/dl/current/snort-2.6.1.5.tar.gz<br />
tar zxvf snort-2.6.1.5.tar.gz<br />
cd snort-2.6.1.5<br />
./configure<br />
make<br />
make install</p>
<p class="content_text">mkdir /etc/snort<br />
cp -rf etc/* /etc/snort</p>
<p class="content_text">change /etc/snort/snort.conf according to your requirements</p>
<h1 class="title">Tripwire(Tripwire data integrity assurance software monitors the reliability of critical system files and directories by identifying changes made to them)</h1>
<h2><span class="content_title_blue">Features</span></h2>
<p class="content_text">*  Centralized management console with web interface<br />
*  Centralized database that stores historical changes<br />
*  Tailorable reports and dashboards<br />
*  Customizable roles and permissions to ensure a secure audit trail<br />
*  Integration with change management systems, providing automated change     reconciliation</p>
<h2><span class="content_title_blue">Installation</span></h2>
<p class="content_text">yum install tripwire</p>
<p class="content_text">/usr/sbin/tripwire-setup-keyfiles</p>
<p class="content_text">To generate database<br />
/usr/sbin/tripwire &#8211;init</p>
<p class="content_text">To view Tripwire database<br />
/usr/sbin/twprint -m d &#8211;print-dbfile | less</p>
<h1 class="title">libsafe(Libsafe is a library that try to prevent buffer overflow attack)</h1>
<h2><span class="content_title_blue">Features</span></h2>
<p class="content_text">* Detection and protection against stack smashing attacks</p>
<h2><span class="content_title_blue">Installation</span></h2>
<p class="content_text">wget http://fresh.t-systems-sfr.com/linux/src/libsafe-2.0-16.tgz<br />
tar zxvfp libsafe-2.0-16.tgz<br />
cd libsafe-2.0-16<br />
make<br />
make install<br />
cd exploits<br />
make<br />
./int.sh t1<br />
- hit carraige return  and watch</p>
<p class="content_text">./int.sh t3<br />
- hit carraige return  and watch</p>
<p class="content_text">./int.sh t4<br />
- hit carraige return  and watch</p>
<p class="content_text">./xlock -nolock</p>
<p class="content_text">./canary-exploit</p>
<p class="content_text">./exploit-non-exec-stack</p>
<p class="content_text">Enable libsafe</p>
<p class="content_text">export LD_PRELOAD=/lib/libsafe.so.2</p>
<p class="content_text">Permanently install libsafe</p>
<p class="content_text">vi  /etc/profile<br />
export LD_PRELOAD=/lib/libsafe.so.2</p>
<h1 class="title">PHP mail() header patch(This patch attempts to address this weakness by inserting an informational header to messages sent from PHP via the mail() function)</h1>
<h2><span class="content_title_blue">Features</span></h2>
<p class="content_text">* The header identifies both the script and the apparent IP address that called it<br />
* This can make it difficult to trace misuse, even if you have comprehensive mail and    webserver logs</p>
<h2><span class="content_title_blue">Installation</span></h2>
<p class="content_text">wget http://www.lancs.ac.uk/~steveb/patches/php-mail-header-patch/php5-mail-header.patch</p>
<p class="content_text">cd /root/php-5.2.1<br />
patch -p1 &lt; ../php5-mail-header.patch</p>
<p class="content_text">Recompile Php</p>
<h1 class="title">Limit compiler and fetch utilities access to root only</h1>
<p class="content_text">chmod 700 /usr/bin/gcc<br />
chmod 700 /usr/bin/wget</p>
<h1 class="title">Ensure OpenSSH protocol is only using protocol 2</h1>
<p class="content_text">vi /etc/ssh/ssh_config<br />
Find the line #Protocol 2, 1 and change it to Protocol 2</p>
<h1 class="title">Disable DNS recursion</h1>
<p class="content_text">vi /etc/named.conf<br />
Give &#8220;recursion no;&#8221; in the &#8220;options&#8221; clause</p>
<p class="content_text">If you need to enable recursion for your local network<br />
give  allow-recursion { 192.168.1.1;192.168.1.20;192.168.1.21;192.168.1.59;192.168.1.22; } in &#8220;options&#8221; section</p>
<h1 class="title">Disable used services(eg:telnet)</h1>
<p class="content_text">vi /etc/xinetd.d/telnet<br />
replace &#8220;disable = no&#8221; and with &#8220;disable = yes&#8221;<br />
/etc/init.d/xinetd restart<br />
chkconfig telnet off<br />
chkconfig &#8211;del telnet<br />
Scan server to ensure port 23 is closed<br />
nmap -sT -O localhost</p>
<h1 class="title">Disable IP source routing</h1>
<p class="content_text">vi /etc/sysctl.conf</p>
<p class="content_text">net.ipv4.conf.default.accept_source_route = 0</p>
<h1 class="title">Ensure cannot SSH directly to root. Must SSH to admin first</h1>
<p class="content_text">For cPanel make sure you add your admin user to the ‘wheel’ group so that you will be able to ’su -’ to root<br />
After that<br />
vi /etc/ssh/sshd_config<br />
PermitRootLogin no</p>
<h1 class="title">Disable ICMP Redirect Acceptance  <span class="content_title_hash">(When hosts use a non-optimal or defunct route to a particular destination, an ICMP redirect packet is used by routers to inform the hosts what the correct route should be. If an attacker is able to forge ICMP redirect packets, he or she can alter the routing tables on the host and possibly subvert the security of the host by causing traffic to flow via a path you didn&#8217;t intend. It&#8217;s strongly recommended to disable ICMP Redirect Acceptance to protect your server from this hole.)</span></h1>
<p class="content_text">vi /etc/sysctl.conf<br />
net.ipv4.conf.all.accept_redirects = 0<br />
/etc/init.d/network restart</p>
<h1 class="title">Enforce noexec &amp; nosuid on temporary directories /tmp and /var/tmp</h1>
<p class="content_text">vi /etc/fstab<br />
LABEL=/tmp /tmp ext3 noexec,nosuid,rw 0 0<br />
/dev/shm /dev/shm tmpfs   noexec,nosuid defaults 0 0</p>
<p class="content_text">chmod 0777 /tmp</p>
<p class="content_text">umount /dev/shm<br />
mount /dev/shm<br />
rm -rf /var/tmp/<br />
ln -s /tmp/ /var/</p>
<h1 class="title">Enable IP spoofing protection( The spoofing protection prevents your network from being the source of spoofed i.e. forged communications that are often used in DoS attacks)</h1>
<p class="content_text">vi /etc/sysctl.conf<br />
net.ipv4.conf.all.rp_filter = 1<br />
/etc/init.d/network restart</p>
<h1 class="title">Enable syncookie protection</h1>
<p class="content_text">vi /etc/sysctl.conf<br />
net.ipv4.tcp_syncookies = 1<br />
/etc/init.d/network restart</p>
<h1 class="title">Disable certain php functions (system, exec, shell_exec)</h1>
<p class="content_text">vi /usr/local/lib/php.ini<br />
disable_functions = system, exec, shell_exec</p>
<h1 class="title">Harden host.conf</h1>
<p class="content_text">vi /etc/host.conf<br />
order hosts,bind<br />
nospoof on<br />
/etc/init.d/network restart</p>
<h1 class="title">Email spoofing prevention ( Email spoofing is the practice of changing your name in email so that it looks like the email came from somewhere or someone else.)</h1>
<p class="content_text"><strong>Router filtering</strong><br />
Putting a filter on your router is the first preventive step. By using an Access Control List, you can block private IP addresses.</p>
<p class="content_text"><strong>Encryption and authentication</strong><br />
By using encryption and authentication, you can reduce spoofing attacks. Ensuring the right authentication procedures are in place with a secure network will make it much more difficult for an attack to take place.</p>
<h1 class="title">Upgrade kernal to latest OS release</h1>
<p class="content_text">wget http://download.openvz.org/kernel/branches/2.6.20/2.6.20-ovz005.1<br />
//kernel-2.6.20-ovz005.1.i686.rpm<br />
rpm -ivh kernel-2.6.20-ovz005.1.i686.rpm</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/04/12/securing-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Syntax to block an IP address under Linux</title>
		<link>http://blog.nataprawira.com/tech/2009/04/03/syntax-to-block-an-ip-address-under-linux/</link>
		<comments>http://blog.nataprawira.com/tech/2009/04/03/syntax-to-block-an-ip-address-under-linux/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 12:44:13 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Block IP]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=47</guid>
		<description><![CDATA[



iptables -A INPUT -s IP-ADDRESS -j DROP

Replace IP-ADDRESS with actual IP address. For example if you wish to block ip address 65.55.44.100 for whatever reason then type command as follows:
iptables -A INPUT -s 65.55.44.100  -j DROP
If you have IP tables firewall script, add above rule to your script.
If you just want to block access [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F04%2F03%2Fsyntax-to-block-an-ip-address-under-linux%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F04%2F03%2Fsyntax-to-block-an-ip-address-under-linux%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<h2></h2>
<blockquote>
<pre><strong>iptables -A INPUT -s IP-ADDRESS -j DROP</strong></pre>
</blockquote>
<p>Replace IP-ADDRESS with actual IP address. For example if you wish to block ip address 65.55.44.100 for whatever reason then type command as follows:</p>
<blockquote><p><strong><code>iptables -A INPUT -s 65.55.44.100  -j DROP</code></strong></p></blockquote>
<p>If you have IP tables firewall script, add above rule to your script.</p>
<p>If you just want to block access to one port from an ip 65.55.44.100 to port 25 then type command:</p>
<blockquote><p><strong><code>iptables -A INPUT -s 65.55.44.100 -p tcp --destination-port 25 -j DROP</code></strong></p></blockquote>
<p>The above rule will drop all packets coming from IP  65.55.44.100 to port mail server port 25.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/04/03/syntax-to-block-an-ip-address-under-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An IDIOT trying to hack wordpress</title>
		<link>http://blog.nataprawira.com/tech/2009/04/03/an-idiot-trying-to-hack-wordpress/</link>
		<comments>http://blog.nataprawira.com/tech/2009/04/03/an-idiot-trying-to-hack-wordpress/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 12:35:08 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=46</guid>
		<description><![CDATA[

[Fri Apr 03 20:31:30 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog
71.205.176.113 &#8211; - [03/Apr/2009:20:31:30 +0800] &#8220;POST /blog/alton4533734/wp-signup.php HTTP/1.1&#8243; 403 233 &#8220;-&#8221; &#8220;curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3&#8243;
[Fri Apr 03 20:31:31 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog
71.205.176.113 &#8211; - [03/Apr/2009:20:31:31 +0800] &#8220;GET /blog/calandra8457410/wp-signup.php HTTP/1.1&#8243; 403 236 &#8220;-&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 5.01; [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F04%2F03%2Fan-idiot-trying-to-hack-wordpress%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F04%2F03%2Fan-idiot-trying-to-hack-wordpress%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>[Fri Apr 03 20:31:30 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:30 +0800] &#8220;POST /blog/alton4533734/wp-signup.php HTTP/1.1&#8243; 403 233 &#8220;-&#8221; &#8220;curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3&#8243;<br />
[Fri Apr 03 20:31:31 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:31 +0800] &#8220;GET /blog/calandra8457410/wp-signup.php HTTP/1.1&#8243; 403 236 &#8220;-&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)&#8221;<br />
[Fri Apr 03 20:31:31 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:31 +0800] &#8220;GET /blog/alton4533734/wp-signup.php HTTP/1.1&#8243; 403 233 &#8220;-&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)&#8221;</p>
<p><span id="more-46"></span><br />
[Fri Apr 03 20:31:32 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:32 +0800] &#8220;POST /blog/calandra8457410/wp-signup.php HTTP/1.1&#8243; 403 236 &#8220;-&#8221; &#8220;curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3&#8243;<br />
[Fri Apr 03 20:31:32 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:32 +0800] &#8220;POST /blog/alton4533734/wp-signup.php HTTP/1.1&#8243; 403 233 &#8220;-&#8221; &#8220;curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3&#8243;<br />
[Fri Apr 03 20:31:33 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:33 +0800] &#8220;POST /blog/quyen3136999/wp-signup.php HTTP/1.1&#8243; 403 233 &#8220;-&#8221; &#8220;curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3&#8243;<br />
[Fri Apr 03 20:31:33 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:33 +0800] &#8220;GET /blog/quyen3136999/wp-signup.php HTTP/1.1&#8243; 403 233 &#8220;-&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)&#8221;<br />
[Fri Apr 03 20:31:34 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:34 +0800] &#8220;POST /blog/quyen3136999/wp-signup.php HTTP/1.1&#8243; 403 233 &#8220;-&#8221; &#8220;curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3&#8243;<br />
[Fri Apr 03 20:31:44 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:44 +0800] &#8220;POST /blog/williams1444475/wp-signup.php HTTP/1.1&#8243; 403 236 &#8220;-&#8221; &#8220;curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3&#8243;<br />
[Fri Apr 03 20:31:45 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:45 +0800] &#8220;GET /blog/williams1444475/wp-signup.php HTTP/1.1&#8243; 403 236 &#8220;-&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)&#8221;<br />
[Fri Apr 03 20:31:45 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:45 +0800] &#8220;POST /blog/williams1444475/wp-signup.php HTTP/1.1&#8243; 403 236 &#8220;-&#8221; &#8220;curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3&#8243;<br />
[Fri Apr 03 20:31:58 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:58 +0800] &#8220;POST /blog/huey9479157/wp-signup.php HTTP/1.1&#8243; 403 232 &#8220;-&#8221; &#8220;curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3&#8243;<br />
[Fri Apr 03 20:31:59 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:59 +0800] &#8220;GET /blog/huey9479157/wp-signup.php HTTP/1.1&#8243; 403 232 &#8220;-&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)&#8221;<br />
[Fri Apr 03 20:31:59 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:31:59 +0800] &#8220;POST /blog/huey9479157/wp-signup.php HTTP/1.1&#8243; 403 232 &#8220;-&#8221; &#8220;curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3&#8243;<br />
[Fri Apr 03 20:32:01 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:32:01 +0800] &#8220;POST /blog/cliff4256743/wp-signup.php HTTP/1.1&#8243; 403 233 &#8220;-&#8221; &#8220;curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3&#8243;<br />
[Fri Apr 03 20:32:01 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:32:01 +0800] &#8220;GET /blog/cliff4256743/wp-signup.php HTTP/1.1&#8243; 403 233 &#8220;-&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)&#8221;<br />
[Fri Apr 03 20:32:02 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:32:02 +0800] &#8220;POST /blog/cliff4256743/wp-signup.php HTTP/1.1&#8243; 403 233 &#8220;-&#8221; &#8220;curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3&#8243;<br />
[Fri Apr 03 20:32:03 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:32:03 +0800] &#8220;POST /blog/karlene8971285/wp-signup.php HTTP/1.1&#8243; 403 235 &#8220;-&#8221; &#8220;curl/7.18.2 (i386-pc-win32) libcurl/7.18.2 zlib/1.2.3&#8243;<br />
[Fri Apr 03 20:32:03 2009] [error] [client 71.205.176.113] client denied by server configuration: /home/yeo/public_html/blog<br />
71.205.176.113 &#8211; - [03/Apr/2009:20:32:03 +0800] &#8220;GET /blog/karlene8971285/wp-signup.php HTTP/1.1&#8243; 403 235 &#8220;-&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/04/03/an-idiot-trying-to-hack-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mixing PHP and SSI</title>
		<link>http://blog.nataprawira.com/tech/2009/03/24/mixing-php-and-ssi/</link>
		<comments>http://blog.nataprawira.com/tech/2009/03/24/mixing-php-and-ssi/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 03:54:53 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SSI]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Mixing PHP and SSI]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=45</guid>
		<description><![CDATA[

This information is ONLY relevant to PHP4 and Apache 1.3. (BUT possible can be work also in PHP 5.x and Apache 2.x ) We historically used PHP for all our web work. We have decided to migrate to ruby for lots of reasons for all our new web development but we still have lots of [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F03%2F24%2Fmixing-php-and-ssi%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F03%2F24%2Fmixing-php-and-ssi%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><strong>This information is ONLY relevant to PHP4 and Apache 1.3</strong>. <em><strong>(BUT possible can be work also in PHP 5.x and Apache 2.x )</strong></em> We historically used PHP for all our web work. We have decided to migrate to <a href="http://www.zytrax.com/tech/lang/ruby/" target="_blank">ruby</a> for lots of reasons for all our new web development but we still have lots of PHP stuff hanging around.</p>
<h3>Background</h3>
<p>We regularly mix PHP and SSIs for the following reasons:</p>
<ul>
<li>Laziness &#8211; we have a lot of historic SSI stuff lying around and do not want to change it. We prefer evolution to revolution.</li>
<li>Appropriateness. Not all systems are good at everything. We find that conditionally selecting &#8216;lumps&#8217; of code to deliver browser specific pages (see <a href="http://www.zytrax.com/tech/web/browser_sniffing.html" target="_blank">server side browser sniffing</a>) is a lot cleaner and easier with SSI. That does not take away from either technology.</li>
</ul>
<h3>Nesting PHP and SSI</h3>
<p>The rules go like this (PHP4 and Apache 1.3 &#8211; we understand that Apache 2 is more flexible but have not yet made the transition):</p>
<ol>
<li>You can invoke SSI files from within PHP but must use the PHP <strong>virtual()</strong> function not <strong>include()</strong>. Variables set within PHP are NOT available to SSI so our favorite &#8216;wheeze&#8217; of supplying last modified dates to a standard footer do not work.</li>
<li>You can include SSI files using the <a href="http://www.zytrax.com/tech/web/ssi.htm#include" target="_blank">include virtual</a> SSI directive but the SSI filename must have a .shtml extension even if the XBitHack is being used.</li>
<li>You cannot include PHP files using the <a href="http://www.zytrax.com/tech/web/ssi.htm#include" target="_blank">include virtual</a> SSI directive.</li>
<li>Variables set within the General Apache section (we use this <a href="http://www.zytrax.com/tech/web/browser_sniffing.html" target="_blank">technique for server side bowser sniffing</a>) are available to both .php and .shtml files no matter how they are called.</li>
</ol>
<p><strong>Note:</strong> We would guess that the Apache environment for each type of file (.php and .shtml) is initialised to the same state as when the page is first called, whereas a nested .php files uses the same php environment and therefore reflects any dynamic changes.</p>
<p><span id="more-45"></span></p>
<h2>Examples</h2>
<p>The following is our standard level 1 template implemented in SSI first and then PHP.</p>
<h3>SSI Version</h3>
<pre>&lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Language" content="en-us"&gt;
&lt;meta http-equiv="Content-Type" content="text/html"&gt;
&lt;meta name="GENERATOR" content="company"&gt;
&lt;!--#include virtual="/templates/meta.html" --&gt;
&lt;title&gt;Level 1 template&lt;/title&gt;
&lt;!-- conditionally generated style sheet --&gt;
&lt;!--#include virtual="/templates/styles.shtml" --&gt;
&lt;!-- conditionally generated javascript code --&gt;
&lt;!--#include virtual="/scripts/javascript.shtml" --&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;!-- banner/page headings --&gt;
&lt;!--#include virtual="/templates/level_1.shtml" --&gt;
&lt;div class="page-content"&gt;

&lt;!-- unique page contents go here --&gt;

&lt;/div&gt;
&lt;!--#config timefmt="%B %d %Y" --&gt;
&lt;!--#set var="real_date" value="$LAST_MODIFIED" --&gt;
&lt;!--#include virtual="/templates/footer.shtml" --&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>PHP Version</h3>
<pre>&lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Language" content="en-us"&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=windows-1252"&gt;
&lt;meta name="GENERATOR" content="company"&gt;
&lt;meta name="keywords" content="blah, blah"&gt;
&lt;title&gt;Cool Tools&lt;/title&gt;
&lt;?php
&lt;!-- conditionally generated style sheet --&gt;
  virtual ("/templates/styles.shtml");
&lt;!-- conditionally generated javascript code --&gt;
  virtual ("/scripts/javascript.shtml");
?&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
&lt;!-- banner/page headings --&gt;
  virtual ("/templates/level_1.shtml");
?&gt;
&lt;div class="page-content"&gt;

&lt;!-- unique page contents go here --&gt;

&lt;/div&gt;
&lt;?php
  $real_date = date("F d, Y.", getlastmod());
  include ("../templates/footer.php");
?&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong>Notes:</strong></p>
<ol>
<li>You will notice that the styles, javascript and standard page navigation header use the PHP <strong>virtual()</strong> function because they contain SSI directives but the files are otherwise unchanged.</li>
<li>Our SSI &#8216;last modified&#8217; date &#8216;wheeze&#8217; for the footer does not work in a mixed PHP/SSI environment (because you cannot pass variables between PHP and SSI). Instead we have to create a &#8220;footer.php&#8221; file and set the variable &#8216;real_date&#8217; using the PHP <strong>date()</strong> and  <strong>getlastmod()</strong> functions. This file is invoked with the <strong>include()</strong> function because it is a standard PHP file. In &#8216;footer.php&#8217; we just use &#8216;echo $real_date&#8217; to place our last modified date in the output stream. Yes its simpler in PHP but now we have to maintain two versions of our standard footer.</li>
</ol>
<p><strong><a title="http://www.zytrax.com/tech/php/php_ssi.htm" href="http://www.zytrax.com/tech/php/php_ssi.htm" target="_blank">Original</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/03/24/mixing-php-and-ssi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use .htaccess to block a range of IP</title>
		<link>http://blog.nataprawira.com/tech/2009/03/21/use-htaccess-to-block-a-range-of-ip/</link>
		<comments>http://blog.nataprawira.com/tech/2009/03/21/use-htaccess-to-block-a-range-of-ip/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 10:05:46 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Block IP]]></category>
		<category><![CDATA[HTaccess]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=44</guid>
		<description><![CDATA[

Question:
I am having troubles with serverpronto bots attacking my site in droves.
How would I block this range of ip address in .htaccess using deny:
69.60.114.0 &#8211; 69.60.125.255
for example, to block one ip I would have:
Deny from 64.251.14.99
But how would I block the whole range given?
Thank you in advance
jdMorgan
Answer:

Denying 69.60.114.0 &#8211; 69.60.125.255
Any of the following:
Deny from 64.251.114
Deny [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F03%2F21%2Fuse-htaccess-to-block-a-range-of-ip%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F03%2F21%2Fuse-htaccess-to-block-a-range-of-ip%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><strong>Question:</strong></p>
<blockquote><p>I am having troubles with serverpronto bots attacking my site in droves.</p>
<p>How would I block this range of ip address in .htaccess using deny:</p>
<p>69.60.114.0 &#8211; 69.60.125.255</p>
<p>for example, to block one ip I would have:<br />
Deny from 64.251.14.99</p>
<p>But how would I block the whole range given?</p>
<p>Thank you in advance<br />
jdMorgan</p></blockquote>
<p><strong>Answer:</strong></p>
<p><span id="more-44"></span></p>
<p>Denying 69.60.114.0 &#8211; 69.60.125.255</p>
<p>Any of the following:</p>
<blockquote><p>Deny from 64.251.114<br />
Deny from 64.251.115<br />
Deny from 64.251.116<br />
Deny from 64.251.117<br />
Deny from 64.251.118<br />
Deny from 64.251.119<br />
Deny from 64.251.120<br />
Deny from 64.251.121<br />
Deny from 64.251.122<br />
Deny from 64.251.123<br />
Deny from 64.251.124<br />
Deny from 64.251.125</p></blockquote>
<p>-or-</p>
<blockquote><p># Deny 69.60.114.0 &#8211; 69.60.115.255 (512 addresses)<br />
Deny from 69.60.114.0/23<br />
# Deny 69.60.116.0 &#8211; 69.60.119.255 (1024 addresses)<br />
Deny from 69.60.116.0/22<br />
# Deny 69.60.120.0 &#8211; 69.60.123.255 (1024 addresses)<br />
Deny From 69.60.120.0/22<br />
# Deny 69.60.124.0 &#8211; 69.60.125.255 (512 addresses)<br />
Deny from 69.60.124.0/23</p></blockquote>
<p>-or-</p>
<blockquote><p># Deny 69.60.114.0 &#8211; 69.60.115.255 (512 addresses)<br />
Deny from 69.60.114.0/255.255.254.0<br />
# Deny 69.60.116.0 &#8211; 69.60.119.255 (1024 addresses)<br />
Deny from 69.60.116.0/255.255.252.0<br />
# Deny 69.60.120.0 &#8211; 69.60.123.255 (1024 addresses)<br />
Deny From 69.60.120.0/255.255.252.0<br />
# Deny 69.60.124.0 &#8211; 69.60.125.255 (512 addresses)<br />
Deny from 69.60.124.0/255.255.254.0</p></blockquote>
<p>-or-</p>
<blockquote><p>Setenvif Remote-Addr &#8220;^69\.60\.1(1[4-9]¦2[0-5])\.&#8221; getout<br />
Deny from getout</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/03/21/use-htaccess-to-block-a-range-of-ip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP configuration inside httpd.conf</title>
		<link>http://blog.nataprawira.com/tech/2009/03/13/php-configuration-inside-httpdconf/</link>
		<comments>http://blog.nataprawira.com/tech/2009/03/13/php-configuration-inside-httpdconf/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 13:53:34 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[httpd.conf]]></category>
		<category><![CDATA[PHP Configuration]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=43</guid>
		<description><![CDATA[

How to set PHP error notice hidden in httpd.conf (vhost):

&#60;VirtualHost *:80&#62;
  ...
  php_flag display_startup_errors off
  php_flag display_errors off
  php_flag html_errors off
  ...
&#60;/VirtualHost&#62;

How to set individual php.ini in httpd.conf (vhost):

&#60;VirtualHost *:80&#62;
  ...
  PHPIniDir '/path/to/php/conf/php-foo.ini'
  ...
&#60;/VirtualHost&#62;

How to set individual PHPError.log in httpd.conf (vhost):

&#60;VirtualHost *:80&#62;
  ...
  php_flag  [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F03%2F13%2Fphp-configuration-inside-httpdconf%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F03%2F13%2Fphp-configuration-inside-httpdconf%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><strong>How to set PHP error notice hidden in httpd.conf (vhost):</strong></p>
<blockquote>
<pre>&lt;VirtualHost *:80&gt;
  ...
  php_flag display_startup_errors off
  php_flag display_errors off
  php_flag html_errors off
  ...
&lt;/VirtualHost&gt;</pre>
</blockquote>
<p><strong>How to set individual php.ini in httpd.conf (vhost):</strong></p>
<blockquote>
<pre>&lt;VirtualHost *:80&gt;
  ...
  PHPIniDir '/path/to/php/conf/php-foo.ini'
  ...
&lt;/VirtualHost&gt;</pre>
</blockquote>
<p><strong>How to set individual PHPError.log in httpd.conf (vhost):</strong></p>
<blockquote>
<pre>&lt;VirtualHost *:80&gt;
  ...
  php_flag  log_errors on
  php_value error_log  /path/to/site/PHPerror.log
  ...
&lt;/VirtualHost&gt;</pre>
</blockquote>
<p><a title="http://perishablepress.com/press/2007/12/17/how-to-enable-php-error-logging-via-htaccess/" rel="nofollow" href="http://perishablepress.com/press/2007/12/17/how-to-enable-php-error-logging-via-htaccess/" target="_blank">Complete Information</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/03/13/php-configuration-inside-httpdconf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install FFmpeg in Linux (RPM Version)</title>
		<link>http://blog.nataprawira.com/tech/2009/02/27/install-ffmpeg-in-linux-rpm-version/</link>
		<comments>http://blog.nataprawira.com/tech/2009/02/27/install-ffmpeg-in-linux-rpm-version/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 10:57:06 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[RPM]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[DAG]]></category>
		<category><![CDATA[FFMPEG]]></category>
		<category><![CDATA[FFMPEG-PHP]]></category>
		<category><![CDATA[FlvTool2]]></category>
		<category><![CDATA[GLIBC]]></category>
		<category><![CDATA[Mencoder]]></category>
		<category><![CDATA[Mplayer]]></category>
		<category><![CDATA[Repo]]></category>
		<category><![CDATA[RPM Installation]]></category>
		<category><![CDATA[RPMFORGE]]></category>
		<category><![CDATA[RUBY]]></category>
		<category><![CDATA[Yum]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=42</guid>
		<description><![CDATA[

How to Install FFmpeg in Linux ~The Easy Way~
Original Post
FFmpeg is so important    if you are planning to run a video website with streaming with conversion of    video files to different video formats. This tutorial is intended for Centos/Redhat    versions of Linux where any novice user [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F27%2Finstall-ffmpeg-in-linux-rpm-version%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F27%2Finstall-ffmpeg-in-linux-rpm-version%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<h1>How to Install FFmpeg in Linux ~The Easy Way~</h1>
<p><strong><a title="http://www.mysql-apache-php.com/ffmpeg-install.htm" href="http://www.mysql-apache-php.com/ffmpeg-install.htm" target="_blank"><em>Original Post</em></a></strong></p>
<p><a href="http://ffmpeg.mplayerhq.hu/" target="_blank">FFmpeg</a> is so important    if you are planning to run a video website with streaming with conversion of    video files to different video formats. This tutorial is intended for Centos/Redhat    versions of Linux where any novice user can install ffmpeg without compiling    the source which is a more traditional way of installing the FFmpeg software    on linux servers. In this tutorial i will show you the easy way to install ffmpeg    and ffmpeg-php (php extension) with just yum rather than compiling ffmpeg from    source files.</p>
<blockquote><p>FFmpeg (<a href="http://ffmpeg.mplayerhq.hu/" target="_blank">http://ffmpeg.mplayerhq.hu</a>)<br />
Mplayer + Mencoder (<a href="http://www.mplayerhq.hu/design7/dload.html" target="_blank">http://www.mplayerhq.hu/design7/dload.html</a>)<br />
Flv2tool (<a href="http://inlet-media.de/flvtool2" target="_blank">http://inlet-media.de/flvtool2</a>)<br />
Libogg + Libvorbis (<a href="http://www.xiph.org/downloads" target="_blank">http://www.xiph.org/downloads</a>)<br />
LAME MP3 Encoder (<a href="http://lame.sourceforge.net/" target="_blank">http://lame.sourceforge.net</a>)<br />
FlowPlayer &#8211; A Free Flash Video Player &#8211; <a href="http://flowplayer.org/" target="_blank">http://flowplayer.org/</a></p></blockquote>
<h1>Installing FFMpeg</h1>
<p><span id="more-42"></span></p>
<blockquote><p><strong>yum install ffmpeg ffmpeg-devel</strong></p></blockquote>
<p>If you get <strong>package not found, </strong>then you will need to add few    lines in the yum repository for dag packages installation. Create a file named    <strong>dag.repo</strong> in <strong>/etc/yum.repos.d</strong> with the following    contents on it</p>
<blockquote><p><strong>[dag]<br />
name=Dag RPM Repository for Red Hat Enterprise Linux<br />
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag<br />
gpgcheck=1<br />
enabled=1</strong></p></blockquote>
<p>then</p>
<blockquote><p><strong>yum install ffmpeg ffmpeg-devel</strong></p></blockquote>
<p>If everything is fine, then the installation should proceed smoothly. If not    you will get something like warning GPG public key missing .</p>
<h2>Common Errors</h2>
<p><strong>To fix rpmforge GPG key warning: </strong></p>
<blockquote><p><strong>rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm</strong></p></blockquote>
<p>For more information refer to <a href="http://dag.wieers.com/rpm/FAQ.php#B4" target="_blank"><strong>this    faq </strong></a>depending on Centos version</p>
<p><strong>Missing Dependency Error:</strong></p>
<p>If you get missing dependency error like shown below, in the middle of ffmpeg    installation</p>
<blockquote><p><strong><span class="box">Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed    by package ffmpeg<br />
Error: Missing Dependency: libtheora.so.0(libtheora.so.1.0) is needed by package    ffmpeg<br />
Error: Missing Dependency: rtld(GNU_HASH) is needed by package ffmpeg<br />
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package imlib2<br />
Error: Missing Dependency: rtld(GNU_HASH) is needed by package a52dec<br />
Error: Missing Dependency: rtld(GNU_HASH) is needed by package imlib2<br />
Error: Missing Dependency: rtld(GNU_HASH) is needed by package gsm<br />
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package x264<br />
Error: Missing Dependency: rtld(GNU_HASH) is needed by package xvidcore<br />
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package lame<br />
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package a52dec<br />
Error: Missing Dependency: rtld(GNU_HASH) is needed by package faad2<br />
Error: Missing Dependency: rtld(GNU_HASH) is needed by package x264<br />
Error: Missing Dependency: rtld(GNU_HASH) is needed by package lame<br />
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package xvidcore<br />
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package faac<br />
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package faad2<br />
Error: Missing Dependency: libgif.so.4 is needed by package imlib2<br />
Error: Missing Dependency: rtld(GNU_HASH) is needed by package faac<br />
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package gsm<br />
Error: Missing Dependency: libpng12.so.0(PNG12_0) is needed by package imlib2<br />
Error: Missing Dependency: rtld(GNU_HASH) is needed by package libmp4v2<br />
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package libmp4v2</span></strong></p></blockquote>
<p>then most commonly you have GLIB 2.3 installed instead of GLIB 2.4 version.    To check the current GLIB version installed on your server. just use:</p>
<blockquote><p><strong>yum list glib*</strong></p></blockquote>
<p>and it should list the latest GLIB package version.</p>
<p>The reason i was getting this error was my rpmforge packages was pointed to    centos 5 versions instead of centos 4.6.</p>
<p><strong>To fix dependency error:</strong></p>
<p>To fix this error, you might need to check your rpmforge packages compatible    to the release of your existing CentOS version.<br />
Check the file <strong>/etc/yum.repos.d/rpmforge.repo </strong>and it should    look like for Centos 4.6(Final). If you have lines like <strong>http://apt.sw.be/redhat/<span style="color: #0000ff">el5</span>/en/mirrors-rpmforge </strong> you might need to make changes to the <strong>rpmforge.repos</strong> like shown below</p>
<blockquote><p><strong>Note:</strong> Backup the original<strong> rpmforge.repo</strong> file    before you edit its content.</p></blockquote>
<blockquote><p><strong><span class="box">[rpmforge]<br />
name = Red Hat Enterprise $releasever &#8211; RPMforge.net &#8211; dag<br />
#baseurl = http://apt.sw.be/redhat/<span style="color: #0000ff">el4</span>/en/$basearch/dag<br />
mirrorlist = http://apt.sw.be/redhat/<span style="color: #0000ff">el4</span>/en/mirrors-rpmforge<br />
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge<br />
enabled = 1<br />
protect = 0<br />
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag<br />
gpgcheck = 1</span></strong></p></blockquote>
<p><strong>To know what linux type and version you are running </strong></p>
<blockquote><p><strong>cat /etc/redhat-release</strong></p></blockquote>
<p>Once this is done, do again:  <strong>yum install ffmpeg. </strong></p>
<p>This trick resolved the problem in my linux box running Centos 4.6 and this    is the <em>only way</em> i found to install ffmpeg using yum.</p>
<h2>To check the FFmpeg working:</h2>
<p>Finally, check the ffmpeg whether it is working or not.</p>
<blockquote><p><strong>&gt; ffmpeg<br />
&gt; ffmpeg -formats<br />
&gt; ffmpeg &#8211;help<br />
</strong>// This lists path of mpeg, its modules and other path information</p></blockquote>
<blockquote><p><strong> ffmpeg -i Input.file Output.file</strong></p></blockquote>
<h2>To check what audi/video formats are supported</h2>
<blockquote><p><strong>ffmpeg -formats &gt; ffmpeg-format.txt</strong></p></blockquote>
<p>Open the <strong>ffmpeg-formats.txt</strong> to see the ooutput</p>
<blockquote><p><strong>D means decode<br />
E means encode<br />
V means video<br />
A means audio<br />
T = Truncated</strong></p></blockquote>
<h1>Install FFMPEG-PHP Extension</h1>
<p><a href="http://ffmpeg-php.sourceforge.net/" target="_blank">FFmpeg-php</a> is a very good extension and wrapper for PHP which can pull useful information    about video through API interface. Inorder to install it you will need to download    the source file and then compile and install extension in your server. You can    download the source tarball : <a href="http://ffmpeg-php.sourceforge.net/" target="_blank">http://ffmpeg-php.sourceforge.net/</a></p>
<blockquote><p><strong>wget /path/to/this/file/ffmpeg-php-0.5.2.1.tbz2</strong></p>
<p><strong>tar -xjf ffmpeg-0.5.2.1.tbz2</strong></p>
<p><strong>phpize</strong></p>
<p><strong>./configure<br />
make<br />
make install</strong></p></blockquote>
<p><strong>Common Errors</strong></p>
<p><strong>1.</strong> If you get <strong>command not found error</strong> for    phpize, then you will need to do <strong>yum install php-devel</strong></p>
<p><strong>2.</strong> If you get error like <strong>&#8220;ffmpeg headers not    found&#8221;</strong> while configuring the source.</p>
<blockquote><p><strong>configure: error: ffmpeg headers not found. Make sure ffmpeg is    compiled as shared libraries using the &#8211;enable-shared option</strong></p></blockquote>
<p>then it means you have not installed<strong> ffmpeg-devel</strong> packages.</p>
<p><strong>To Fix:</strong> Just install <strong>ffmpeg-devel</strong> using</p>
<blockquote><p><strong>yum install ffmpeg-devel</strong></p></blockquote>
<p><strong>3. </strong>If you get an error like shared libraries not found problem    and the program halts in the middle, then you must specify the ffmpeg installed    path explicitly to the ./configure.</p>
<blockquote><p><strong>configure: error: ffmpeg shared libraries not found. Make sure    ffmpeg is compiled as shared libraries using the &#8211;enable-shared option</strong></p></blockquote>
<p><strong>To Fix:</strong></p>
<p>1. First find out the ffmpeg path with <strong>ffmpeg &#8211;help</strong> command.    The prefix default path should be like <strong>/usr/local/cpffmpeg</strong><br />
2. Configure the FFmpeg-php with &#8211;with-ffmpeg option</p>
<blockquote><p><strong>./configure &#8211;with-ffmpeg=/usr/local/cpffmpeg</strong></p></blockquote>
<p>That should resolve the problem!</p>
<h2>Editing PHP.INI</h2>
<p>Once you have done that without any problems then you will see the php extension    file <strong>/usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so</strong> and you will need mention that extension in php.ini file</p>
<blockquote><p><strong>nano /usr/local/lib/php.ini</strong></p></blockquote>
<p>Put the below two lines at the end of the <strong>php.ini</strong> file</p>
<blockquote><p><strong>[ffmpeg]<br />
extension=ffmpeg.so</strong></p></blockquote>
<p>Then restart the server <strong>service httpd restart</strong></p>
<p>To check whether <strong>ffmpeg enabled with php</strong>, point your browser    to <strong>test.php</strong> file. It should show the confirmation of installed    ffmpeg php extension</p>
<blockquote><p><strong>// #test.php</strong></p>
<p><strong> &lt;?php</strong></p>
<p><strong>phpinfo()</strong></p>
<p><strong>?&gt;</strong></p></blockquote>
<p>If any case the ffmpeg does not show in the phpinfo() test make sure that php.ini    path to ffmpeg.so is correct. Still the problem occurs, the reason could be    you might be using older versions of ffmpeg-php which is buggy. Just download    the latest version of ffmpeg-php source then compile it.</p>
<h1>Installing Mplayer + Mencoder</h1>
<p>Just issue the following yum commands to install the rest of the packages.</p>
<blockquote><p><strong>yum install mplayer mencoder</strong></p></blockquote>
<h1>Installing FlvTool2</h1>
<p>Flvtool2 is a flash video file manipulation tool. It can calculate metadata    and can cut and edit cue points for flv files.</p>
<p>If you are on Centos 5 try <strong>yum install flvtool2</strong> with dag    repository and if you get package not found you will need to manually download    and compile the flvtool2. You can download latest version of flvtool2 here:    <a href="http://rubyforge.org/projects/flvtool2/" target="_blank">http://rubyforge.org/projects/flvtool2/</a></p>
<blockquote><p><strong>wget &lt;url-link&gt;</strong></p>
<p><strong>ruby setup.rb config<br />
ruby setup.rb setup<br />
sudo ruby setup.rb install</strong></p></blockquote>
<p>If you get <strong>command not found</strong> error, it probably means that    you dont have ruby installed.</p>
<blockquote><p><strong>yum install ruby</strong></p></blockquote>
<p>Thats it! Once ffmpeg works fine with php extension, download a sample video,    convert to .flv format in the command line and plug it to <strong><a href="http://flowplayer.org/" target="_blank">flowplayer</a></strong> to see it work on your web browser. Try also to download the video file offline    and see whether the converted flv file works well with both audio and video.</p>
<h2>Useful Links</h2>
<ul>
<li>FFmpeg (<a href="http://ffmpeg.mplayerhq.hu/" target="_blank">http://ffmpeg.mplayerhq.hu</a>)</li>
<li>Mplayer + Mencoder (<a href="http://www.mplayerhq.hu/design7/dload.html" target="_blank">http://www.mplayerhq.hu/design7/dload.html</a>)</li>
<li>Flv2tool (<a href="http://inlet-media.de/flvtool2" target="_blank">http://inlet-media.de/flvtool2</a>)</li>
<li>Libogg + Libvorbis (<a href="http://www.xiph.org/downloads" target="_blank">http://www.xiph.org/downloads</a>)</li>
<li>LAME MP3 Encoder (<a href="http://lame.sourceforge.net/" target="_blank">http://lame.sourceforge.net</a>)</li>
<li>FlowPlayer &#8211; A Free Flash Video Player &#8211; <a href="http://flowplayer.org/" target="_blank">http://flowplayer.org/</a></li>
<li>Install FFmpeg from Compiling Source (<a href="http://rshagrawal.blogspot.com/2007/12/howt-o-for-installing-ffmpeg.html" target="_blank">Tutorial    Link</a>)</li>
<li>Nice FFmpeg Installation Tutorial (<a href="http://forums.theplanet.com/index.php?showtopic=64541" target="_blank">click    here</a>)</li>
<li>Important Audio Codecs (<a href="http://www.mplayerhq.hu/DOCS/HTML/en/audio-codecs.html" target="_blank">http://www.mplayerhq.hu/DOCS/HTML/en/audio-codecs.html</a>)</li>
<li>Common Errors &amp; Fixes while Installing FFmpeg (<a href="http://www.webmasterpals.com/forumdisplay.php?f=6" target="_blank">click    here</a>)</li>
</ul>
<p><!-- Kontera ContentLink(TM);--></p>
<p><!-- Kontera ContentLink(TM) --></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/02/27/install-ffmpeg-in-linux-rpm-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling PHP 5.2.x / cannot find -lltdl</title>
		<link>http://blog.nataprawira.com/tech/2009/02/26/compiling-php-52x-cannot-find-lltdl/</link>
		<comments>http://blog.nataprawira.com/tech/2009/02/26/compiling-php-52x-cannot-find-lltdl/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 10:35:11 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[cannot find -lltdl]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=41</guid>
		<description><![CDATA[

 When compiling PHP from source, some of the CentOS users reported that they getting errors like below:

/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status

What you need to do, is just follow the below steps.

Verify that the libtool and libtool-ltdl packages are installed.
Symlink libltdl.so to libltdl.so.x.x.x

If libtool and libtool-ltdl already exist, you may go [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F26%2Fcompiling-php-52x-cannot-find-lltdl%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F26%2Fcompiling-php-52x-cannot-find-lltdl%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<hr size="1" /><!-- / icon and title --> <!-- message -->When compiling PHP from source, some of the CentOS users reported that they getting errors like below:</p>
<div style="margin: 5px 20px 20px">
<pre style="border: 1px inset;margin: 0px;padding: 6px;width: 640px;height: 50px;text-align: left"><strong>/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status</strong></pre>
</div>
<p>What you need to do, is just follow the below steps.</p>
<ol>
<li><strong>Verify that the libtool and libtool-ltdl packages are installed.</strong></li>
<li><strong>Symlink libltdl.so to libltdl.so.x.x.x</strong></li>
</ol>
<p>If libtool and libtool-ltdl already exist, you may go to Step Two.<br />
<strong> Step One</strong></p>
<div style="margin: 5px 20px 20px">
<pre style="border: 1px inset;margin: 0px;padding: 6px;width: 640px;height: 34px;text-align: left">[root@banzaibill ~]# <strong>yum install libtool-ltdl libtool</strong></pre>
</div>
<p>Now you have <strong>libtool</strong> installed. To check it out, do:</p>
<div style="margin: 5px 20px 20px">
<pre style="border: 1px inset;margin: 0px;padding: 6px;width: 640px;height: 34px;text-align: left">[root@banzaibill ~]# <strong>yum info libtool*</strong></pre>
</div>
<p><strong> Step Two</strong></p>
<p>PHP looks for the libltdl library only at <strong>/usr/lib/libltdl.so</strong></p>
<p>The symlink to this file is not included in the libtool packages. Do below commands:</p>
<div style="margin: 5px 20px 20px">
<pre style="border: 1px inset;margin: 0px;padding: 6px;width: 640px;height: 50px;text-align: left">[root@banzaibill ~]# <strong>cd /usr/lib</strong>
[root@banzaibill lib]# <strong>ln -s libltdl.so.3.1.4 libltdl.so</strong></pre>
</div>
<p>And that&#8217;s it. PHP should configure and compile without error.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/02/26/compiling-php-52x-cannot-find-lltdl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Firewalls with IPTABLES (Good Tutorials)</title>
		<link>http://blog.nataprawira.com/tech/2009/02/23/linux-firewalls-with-iptables-good-tutorials/</link>
		<comments>http://blog.nataprawira.com/tech/2009/02/23/linux-firewalls-with-iptables-good-tutorials/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 14:39:06 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[IPTables]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=38</guid>
		<description><![CDATA[

I found good examples for this.
- Quick HOWTO (from LinuxHomeNetworking.com) &#8211; download
- Sample IPTABLES Configuration (RedHat/CentOS) &#8211; download
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F23%2Flinux-firewalls-with-iptables-good-tutorials%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F23%2Flinux-firewalls-with-iptables-good-tutorials%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>I found good examples for this.</p>
<p>- <strong><a title="Quick HOWTO" href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptables" target="_blank">Quick HOWTO</a></strong> (from LinuxHomeNetworking.com) &#8211; <a title="DOWNLOAD" href="http://blog.nataprawira.com/tech/files/2009/02/linux-firewalls-using-iptables.pdf" target="_blank">download</a></p>
<p>- <strong><a title="Sample IPTables Configuration" href="http://www.liniac.upenn.edu/sysadmin/security/iptables.html" target="_blank">Sample IPTABLES Configuration</a></strong> (RedHat/CentOS) &#8211; <a title="DOWNLOAD" href="http://blog.nataprawira.com/tech/files/2009/02/sample-iptables-configuration-redhat.pdf" target="_blank">download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/02/23/linux-firewalls-with-iptables-good-tutorials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RPM failed to start</title>
		<link>http://blog.nataprawira.com/tech/2009/02/20/rpm-failed-to-start/</link>
		<comments>http://blog.nataprawira.com/tech/2009/02/20/rpm-failed-to-start/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 08:49:34 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[RPM]]></category>
		<category><![CDATA[Failed]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=37</guid>
		<description><![CDATA[

When you&#8217;re running REDHAT/CENTOS platform for your server, sometimes the RPM wont run normally or become stuck. This caused by the RPM database not properly builded or been corrupted.
Errors would be like : 
rpmdb: Program version 4.3 doesn&#8217;t match environment version
error: db4 error(-30974) from dbenv-&#62;open: DB_VERSION_MISMATCH: Database environment version mismatch
error: cannot open Packages index using [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F20%2Frpm-failed-to-start%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F20%2Frpm-failed-to-start%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>When you&#8217;re running REDHAT/CENTOS platform for your server, sometimes the RPM wont run normally or become stuck. This caused by the RPM database not properly builded or been corrupted.</p>
<p>Errors would be like :<strong> </strong></p>
<blockquote><p><strong>rpmdb: Program version 4.3 doesn&#8217;t match environment version<br />
error: db4 error(-30974) from dbenv-&gt;open: DB_VERSION_MISMATCH: Database environment version mismatch<br />
error: cannot open Packages index using db3 &#8211; (-30974)<br />
error: cannot open Packages database in /var/lib/rpm</strong></p>
<p><strong>rpmdb: Program version 4.3 doesn&#8217;t match environment version<br />
error: db4 error(-30974) from dbenv-&gt;open: DB_VERSION_MISMATCH: Database environment version mismatch<br />
error: cannot open Packages database in /var/lib/rpm</strong></p></blockquote>
<p>So, to solve those issues,<br />
you can run these commands from <strong>ROOT </strong>access:</p>
<blockquote><p><strong>rm -f /var/lib/rpm/__db*<br />
rpm -vv &#8211;rebuilddb</strong></p></blockquote>
<p><em>The &#8216;-vv&#8217; parameter on rpm, will STDOUT.</em></p>
<p>To run it as background process, do:</p>
<blockquote><p><strong>rpm &#8211;rebuilddb &amp;</strong></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/02/20/rpm-failed-to-start/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to protect your website using simple PHP scripts</title>
		<link>http://blog.nataprawira.com/tech/2009/02/20/how-to-protect-your-website-using-simple-php-scripts/</link>
		<comments>http://blog.nataprawira.com/tech/2009/02/20/how-to-protect-your-website-using-simple-php-scripts/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 04:51:10 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Protection]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=36</guid>
		<description><![CDATA[

Just put below on your top line of the scripts :
$ips = array(&#8221;127.0.0.1&#8243;,&#8221;aaa.bbb.ccc&#8221;,&#8221;xxx.yyy.zzz&#8221;);
$userip = $_SERVER['REMOTE_ADDR'];
foreach ($ips as $ip) {
if (!preg_match(&#8221;/$ip/i&#8221;, $userip)) {
echo &#8220;Access Denied!&#8221;;
exit;
}
}
Notes:
$ips is the allowed IP address range
Other way, you can use .htaccess to protect directories/files.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F20%2Fhow-to-protect-your-website-using-simple-php-scripts%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F20%2Fhow-to-protect-your-website-using-simple-php-scripts%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p>Just put below on your top line of the scripts :</p>
<p><strong>$ips = array(&#8221;127.0.0.1&#8243;,&#8221;aaa.bbb.ccc&#8221;,&#8221;xxx.yyy.zzz&#8221;);<br />
$userip = $_SERVER['REMOTE_ADDR'];<br />
foreach ($ips as $ip) {<br />
if (!preg_match(&#8221;/$ip/i&#8221;, $userip)) {<br />
echo &#8220;Access Denied!&#8221;;<br />
exit;<br />
}<br />
}</strong></p>
<p><span style="text-decoration: underline">Notes</span>:<br />
$ips is the allowed IP address range</p>
<p>Other way, you can use .htaccess to protect directories/files.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/02/20/how-to-protect-your-website-using-simple-php-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML Color Codes (Charts)</title>
		<link>http://blog.nataprawira.com/tech/2009/02/19/html-color-codes-charts/</link>
		<comments>http://blog.nataprawira.com/tech/2009/02/19/html-color-codes-charts/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 08:08:14 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Charts]]></category>
		<category><![CDATA[Color Code]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=35</guid>
		<description><![CDATA[

Major hexadecimal color codes



Color
Color Code
Color
Color Code


Red
#FF0000
White
#FFFFFF


Turquoise
#00FFFF
Light Grey
#C0C0C0


Light Blue
#0000FF
Dark Grey
#808080


Dark Blue
#0000A0
Black
#000000


Light Purple
#FF0080
Orange
#FF8040


Dark Purple
#800080
Brown
#804000


Yellow
#FFFF00
Burgundy
#800000


Pastel Green
#00FF00
Forest Green
#808000


Pink
#FF00FF
Grass Green
#408080



Color code chart




COLOR NAME
CODE
COLOR


Black
#000000
Black


Gray0
#150517
Gray0


Gray18
#250517
Gray18


Gray21
#2B1B17
Gray21


Gray23
#302217
Gray23


Gray24
#302226
Gray24


Gray25
#342826
Gray25


Gray26
#34282C
Gray26


Gray27
#382D2C
Gray27


Gray28
#3b3131
Gray28


Gray29
#3E3535
Gray29


Gray30
#413839
Gray30


Gray31
#41383C
Gray31


Gray32
#463E3F
Gray32


Gray34
#4A4344
Gray34


Gray35
#4C4646
Gray35


Gray36
#4E4848
Gray36


Gray37
#504A4B
Gray37


Gray38
#544E4F
Gray38


Gray39
#565051
Gray39


Gray40
#595454
Gray40


Gray41
#5C5858
Gray41


Gray42
#5F5A59
Gray42


Gray43
#625D5D
Gray43


Gray44
#646060
Gray44


Gray45
#666362
Gray45


Gray46
#696565
Gray46


Gray47
#6D6968
Gray47


Gray48
#6E6A6B
Gray48


Gray49
#726E6D
Gray49


Gray50
#747170
Gray50


Gray
#736F6E
Gray


Slate Gray4
#616D7E
Slate Gray4


Slate Gray
#657383
Slate Gray


Light Steel Blue4
#646D7E
Light Steel Blue4


Light Slate Gray
#6D7B8D
Light Slate Gray


Cadet Blue4
#4C787E
Cadet Blue4


Dark Slate Gray4
#4C7D7E
Dark Slate Gray4


Thistle4
#806D7E
Thistle4


Medium Slate Blue
#5E5A80
Medium Slate Blue


Medium Purple4
#4E387E
Medium Purple4


Midnight Blue
#151B54
Midnight Blue


Dark Slate Blue
#2B3856
Dark Slate Blue


Dark Slate Gray
#25383C
Dark Slate Gray


Dim Gray
#463E41
Dim Gray


Cornflower Blue
#151B8D
Cornflower [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F19%2Fhtml-color-codes-charts%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F19%2Fhtml-color-codes-charts%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><strong>Major hexadecimal color codes</strong></p>
<table class="mtable" style="width: 100%" border="0" cellspacing="1" cellpadding="5">
<tbody>
<tr class="tcb wt">
<td>Color</td>
<td>Color Code</td>
<td>Color</td>
<td>Color Code</td>
</tr>
<tr class="tcw">
<td><span style="color: #ff0000">Red</span></td>
<td>#FF0000</td>
<td>White</td>
<td>#FFFFFF</td>
</tr>
<tr class="tcw">
<td><span style="color: #00ffff">Turquoise</span></td>
<td>#00FFFF</td>
<td><span class="rg">Light Grey</span></td>
<td>#C0C0C0</td>
</tr>
<tr class="tcw">
<td><span style="color: #0000ff">Light Blue</span></td>
<td>#0000FF</td>
<td><span style="color: #808080">Dark Grey</span></td>
<td>#808080</td>
</tr>
<tr class="tcw">
<td><span style="color: #0000a0">Dark Blue</span></td>
<td>#0000A0</td>
<td>Black</td>
<td>#000000</td>
</tr>
<tr class="tcw">
<td><span style="color: #ff0080">Light Purple</span></td>
<td>#FF0080</td>
<td><span style="color: #ff8040">Orange</span></td>
<td>#FF8040</td>
</tr>
<tr class="tcw">
<td><span style="color: #800080">Dark Purple</span></td>
<td>#800080</td>
<td><span style="color: #804000">Brown</span></td>
<td>#804000</td>
</tr>
<tr class="tcw">
<td><span style="color: #ffff00">Yellow</span></td>
<td>#FFFF00</td>
<td><span style="color: #800000">Burgundy</span></td>
<td>#800000</td>
</tr>
<tr class="tcw">
<td><span style="color: #00ff00">Pastel Green</span></td>
<td>#00FF00</td>
<td><span style="color: #808000">Forest Green</span></td>
<td>#808000</td>
</tr>
<tr class="tcw">
<td><span style="color: #ff00ff">Pink</span></td>
<td>#FF00FF</td>
<td><span style="color: #408080">Grass Green</span></td>
<td>#408080</td>
</tr>
</tbody>
</table>
<p><strong><span class="nb"><a name="03"></a>Color code chart</span></strong></p>
<p><span id="more-35"></span></p>
<table class="mtable" border="0" cellspacing="1" cellpadding="5" width="100%">
<tbody>
<tr class="tcb wt">
<td width="25%">COLOR NAME</td>
<td width="25%">CODE</td>
<td class="wt" width="25%">COLOR</td>
</tr>
<tr>
<td class="tcw" width="25%">Black</td>
<td class="tcw" width="25%">#000000</td>
<td class="tcbl" width="25%"><strong>Black</strong></td>
</tr>
<tr>
<td class="tcw">Gray0</td>
<td class="tcw">#150517</td>
<td class="wt" bgcolor="#150517"><strong>Gray0</strong></td>
</tr>
<tr>
<td class="tcw">Gray18</td>
<td class="tcw">#250517</td>
<td class="wt" bgcolor="#250517"><strong>Gray18</strong></td>
</tr>
<tr>
<td class="tcw">Gray21</td>
<td class="tcw">#2B1B17</td>
<td class="wt" bgcolor="#2b1b17"><strong>Gray21</strong></td>
</tr>
<tr>
<td class="tcw">Gray23</td>
<td class="tcw">#302217</td>
<td class="wt" bgcolor="#302217"><strong>Gray23</strong></td>
</tr>
<tr>
<td class="tcw">Gray24</td>
<td class="tcw">#302226</td>
<td class="wt" bgcolor="#302226"><strong>Gray24</strong></td>
</tr>
<tr>
<td class="tcw">Gray25</td>
<td class="tcw">#342826</td>
<td class="wt" bgcolor="#342826"><strong>Gray25</strong></td>
</tr>
<tr>
<td class="tcw">Gray26</td>
<td class="tcw">#34282C</td>
<td class="wt" bgcolor="#34282c"><strong>Gray26</strong></td>
</tr>
<tr>
<td class="tcw">Gray27</td>
<td class="tcw">#382D2C</td>
<td class="wt" bgcolor="#382d2c"><strong>Gray27</strong></td>
</tr>
<tr>
<td class="tcw">Gray28</td>
<td class="tcw">#3b3131</td>
<td class="wt" bgcolor="#3b3131"><strong>Gray28</strong></td>
</tr>
<tr>
<td class="tcw">Gray29</td>
<td class="tcw">#3E3535</td>
<td class="wt" bgcolor="#3e3535"><strong>Gray29</strong></td>
</tr>
<tr>
<td class="tcw">Gray30</td>
<td class="tcw">#413839</td>
<td class="wt" bgcolor="#413839"><strong>Gray30</strong></td>
</tr>
<tr>
<td class="tcw">Gray31</td>
<td class="tcw">#41383C</td>
<td class="wt" bgcolor="#41383c"><strong>Gray31</strong></td>
</tr>
<tr>
<td class="tcw">Gray32</td>
<td class="tcw">#463E3F</td>
<td class="wt" bgcolor="#463e3f"><strong>Gray32</strong></td>
</tr>
<tr>
<td class="tcw">Gray34</td>
<td class="tcw">#4A4344</td>
<td class="wt" bgcolor="#4a4344"><strong>Gray34</strong></td>
</tr>
<tr>
<td class="tcw">Gray35</td>
<td class="tcw">#4C4646</td>
<td class="wt" bgcolor="#4c4646"><strong>Gray35</strong></td>
</tr>
<tr>
<td class="tcw">Gray36</td>
<td class="tcw">#4E4848</td>
<td class="wt" bgcolor="#4e4848"><strong>Gray36</strong></td>
</tr>
<tr>
<td class="tcw">Gray37</td>
<td class="tcw">#504A4B</td>
<td class="wt" bgcolor="#504a4b"><strong>Gray37</strong></td>
</tr>
<tr>
<td class="tcw">Gray38</td>
<td class="tcw">#544E4F</td>
<td class="wt" bgcolor="#544e4f"><strong>Gray38</strong></td>
</tr>
<tr>
<td class="tcw">Gray39</td>
<td class="tcw">#565051</td>
<td class="wt" bgcolor="#565051"><strong>Gray39</strong></td>
</tr>
<tr>
<td class="tcw">Gray40</td>
<td class="tcw">#595454</td>
<td class="wt" bgcolor="#595454"><strong>Gray40</strong></td>
</tr>
<tr>
<td class="tcw">Gray41</td>
<td class="tcw">#5C5858</td>
<td class="wt" bgcolor="#5c5858"><strong>Gray41</strong></td>
</tr>
<tr>
<td class="tcw">Gray42</td>
<td class="tcw">#5F5A59</td>
<td class="wt" bgcolor="#5f5a59"><strong>Gray42</strong></td>
</tr>
<tr>
<td class="tcw">Gray43</td>
<td class="tcw">#625D5D</td>
<td class="wt" bgcolor="#625d5d"><strong>Gray43</strong></td>
</tr>
<tr>
<td class="tcw">Gray44</td>
<td class="tcw">#646060</td>
<td class="wt" bgcolor="#646060"><strong>Gray44</strong></td>
</tr>
<tr>
<td class="tcw">Gray45</td>
<td class="tcw">#666362</td>
<td class="wt" bgcolor="#666362"><strong>Gray45</strong></td>
</tr>
<tr>
<td class="tcw">Gray46</td>
<td class="tcw">#696565</td>
<td class="wt" bgcolor="#696565"><strong>Gray46</strong></td>
</tr>
<tr>
<td class="tcw">Gray47</td>
<td class="tcw">#6D6968</td>
<td class="wt" bgcolor="#6d6968"><strong>Gray47</strong></td>
</tr>
<tr>
<td class="tcw">Gray48</td>
<td class="tcw">#6E6A6B</td>
<td class="wt" bgcolor="#6e6a6b"><strong>Gray48</strong></td>
</tr>
<tr>
<td class="tcw">Gray49</td>
<td class="tcw">#726E6D</td>
<td class="wt" bgcolor="#726e6d"><strong>Gray49</strong></td>
</tr>
<tr>
<td class="tcw">Gray50</td>
<td class="tcw">#747170</td>
<td class="wt" bgcolor="#747170"><strong>Gray50</strong></td>
</tr>
<tr>
<td class="tcw">Gray</td>
<td class="tcw">#736F6E</td>
<td class="wt" bgcolor="#736f6e"><strong>Gray</strong></td>
</tr>
<tr>
<td class="tcw">Slate Gray4</td>
<td class="tcw">#616D7E</td>
<td class="wt" bgcolor="#616d7e"><strong>Slate Gray4</strong></td>
</tr>
<tr>
<td class="tcw">Slate Gray</td>
<td class="tcw">#657383</td>
<td class="wt" bgcolor="#657383"><strong>Slate Gray</strong></td>
</tr>
<tr>
<td class="tcw">Light Steel Blue4</td>
<td class="tcw">#646D7E</td>
<td class="wt" bgcolor="#646d7e"><strong>Light Steel Blue4</strong></td>
</tr>
<tr>
<td class="tcw">Light Slate Gray</td>
<td class="tcw">#6D7B8D</td>
<td class="wt" bgcolor="#6d7b8d"><strong>Light Slate Gray</strong></td>
</tr>
<tr>
<td class="tcw">Cadet Blue4</td>
<td class="tcw">#4C787E</td>
<td class="wt" bgcolor="#4c787e"><strong>Cadet Blue4</strong></td>
</tr>
<tr>
<td class="tcw">Dark Slate Gray4</td>
<td class="tcw">#4C7D7E</td>
<td class="wt" bgcolor="#4c7d7e"><strong>Dark Slate Gray4</strong></td>
</tr>
<tr>
<td class="tcw">Thistle4</td>
<td class="tcw">#806D7E</td>
<td class="wt" bgcolor="#806d7e"><strong>Thistle4</strong></td>
</tr>
<tr>
<td class="tcw">Medium Slate Blue</td>
<td class="tcw">#5E5A80</td>
<td class="wt" bgcolor="#5e5a80"><strong>Medium Slate Blue</strong></td>
</tr>
<tr>
<td class="tcw">Medium Purple4</td>
<td class="tcw">#4E387E</td>
<td class="wt" bgcolor="#4e387e"><strong>Medium Purple4</strong></td>
</tr>
<tr>
<td class="tcw">Midnight Blue</td>
<td class="tcw">#151B54</td>
<td class="wt" bgcolor="#151b54"><strong>Midnight Blue</strong></td>
</tr>
<tr>
<td class="tcw">Dark Slate Blue</td>
<td class="tcw">#2B3856</td>
<td class="wt" bgcolor="#2b3856"><strong>Dark Slate Blue</strong></td>
</tr>
<tr>
<td class="tcw">Dark Slate Gray</td>
<td class="tcw">#25383C</td>
<td class="wt" bgcolor="#25383c"><strong>Dark Slate Gray</strong></td>
</tr>
<tr>
<td class="tcw">Dim Gray</td>
<td class="tcw">#463E41</td>
<td class="wt" bgcolor="#463e41"><strong>Dim Gray</strong></td>
</tr>
<tr>
<td class="tcw">Cornflower Blue</td>
<td class="tcw">#151B8D</td>
<td class="wt" bgcolor="#151b8d"><strong>Cornflower Blue</strong></td>
</tr>
<tr>
<td class="tcw">Royal Blue4</td>
<td class="tcw">#15317E</td>
<td class="wt" bgcolor="#15317e"><strong>Royal Blue4</strong></td>
</tr>
<tr>
<td class="tcw">Slate Blue4</td>
<td class="tcw">#342D7E</td>
<td class="wt" bgcolor="#342d7e"><strong>Slate Blue4</strong></td>
</tr>
<tr>
<td class="tcw">Royal Blue</td>
<td class="tcw">#2B60DE</td>
<td class="wt" bgcolor="#2b60de"><strong>Royal Blue</strong></td>
</tr>
<tr>
<td class="tcw">Royal Blue1</td>
<td class="tcw">#306EFF</td>
<td class="wt" bgcolor="#306eff"><strong>Royal Blue1</strong></td>
</tr>
<tr>
<td class="tcw">Royal Blue2</td>
<td class="tcw">#2B65EC</td>
<td class="wt" bgcolor="#2b65ec"><strong>Royal Blue2</strong></td>
</tr>
<tr>
<td class="tcw">Royal Blue3</td>
<td class="tcw">#2554C7</td>
<td class="wt" bgcolor="#2554c7"><strong>Royal Blue3</strong></td>
</tr>
<tr>
<td class="tcw">Deep Sky Blue</td>
<td class="tcw">#3BB9FF</td>
<td class="wt" bgcolor="#3bb9ff"><strong>Deep Sky Blue</strong></td>
</tr>
<tr>
<td class="tcw">Deep Sky Blue2</td>
<td class="tcw">#38ACEC</td>
<td class="wt" bgcolor="#38acec"><strong>Deep Sky Blue2</strong></td>
</tr>
<tr>
<td class="tcw">Slate Blue</td>
<td class="tcw">#3574EC7</td>
<td class="wt" bgcolor="#357ec7"><strong>Slate Blue</strong></td>
</tr>
<tr>
<td class="tcw">Deep Sky Blue3</td>
<td class="tcw">#3090C7</td>
<td class="wt" bgcolor="#3090c7"><strong>Deep Sky Blue3</strong></td>
</tr>
<tr>
<td class="tcw">Deep Sky Blue4</td>
<td class="tcw">#25587E</td>
<td class="wt" bgcolor="#25587e"><strong>Deep Sky Blue4</strong></td>
</tr>
<tr>
<td class="tcw">Dodger Blue</td>
<td class="tcw">#1589FF</td>
<td class="wt" bgcolor="#1589ff"><strong>Dodger Blue</strong></td>
</tr>
<tr>
<td class="tcw">Dodger Blue2</td>
<td class="tcw">#157DEC</td>
<td class="wt" bgcolor="#157dec"><strong>Dodger Blue2</strong></td>
</tr>
<tr>
<td class="tcw">Dodger Blue3</td>
<td class="tcw">#1569C7</td>
<td class="wt" bgcolor="#1569c7"><strong>Dodger Blue3</strong></td>
</tr>
<tr>
<td class="tcw">Dodger Blue4</td>
<td class="tcw">#153E7E</td>
<td class="wt" bgcolor="#153e7e"><strong>Dodger Blue4</strong></td>
</tr>
<tr>
<td class="tcw">Steel Blue4</td>
<td class="tcw">#2B547E</td>
<td class="wt" bgcolor="#2b547e"><strong>Steel Blue4</strong></td>
</tr>
<tr>
<td class="tcw">Steel Blue</td>
<td class="tcw">#4863A0</td>
<td class="wt" bgcolor="#4863a0"><strong>Steel Blue</strong></td>
</tr>
<tr>
<td class="tcw">Slate Blue2</td>
<td class="tcw">#6960EC</td>
<td class="wt" bgcolor="#6960ec"><strong>Slate Blue2</strong></td>
</tr>
<tr>
<td class="tcw">Violet</td>
<td class="tcw">#8D38C9</td>
<td class="wt" bgcolor="#8d38c9"><strong>Violet</strong></td>
</tr>
<tr>
<td class="tcw">Medium Purple3</td>
<td class="tcw">#7A5DC7</td>
<td class="wt" bgcolor="#7a5dc7"><strong>Medium Purple3</strong></td>
</tr>
<tr>
<td class="tcw">Medium Purple</td>
<td class="tcw">#8467D7</td>
<td class="wt" bgcolor="#8467d7"><strong>Medium Purple</strong></td>
</tr>
<tr>
<td class="tcw">Medium Purple2</td>
<td class="tcw">#9172EC</td>
<td class="wt" bgcolor="#9172ec"><strong>Medium Purple2</strong></td>
</tr>
<tr>
<td class="tcw">Medium Purple1</td>
<td class="tcw">#9E7BFF</td>
<td class="wt" bgcolor="#9e7bff"><strong>Medium Purple1</strong></td>
</tr>
<tr>
<td class="tcw">Light Steel Blue</td>
<td class="tcw">#728FCE</td>
<td class="wt" bgcolor="#728fce"><strong>Light Steel Blue</strong></td>
</tr>
<tr>
<td class="tcw">Steel Blue3</td>
<td class="tcw">#488AC7</td>
<td class="wt" bgcolor="#488ac7"><strong>Steel Blue3</strong></td>
</tr>
<tr>
<td class="tcw">Steel Blue2</td>
<td class="tcw">#56A5EC</td>
<td class="wt" bgcolor="#56a5ec"><strong>Steel Blue2</strong></td>
</tr>
<tr>
<td class="tcw">Steel Blue1</td>
<td class="tcw">#5CB3FF</td>
<td class="wt" bgcolor="#5cb3ff"><strong>Steel Blue1</strong></td>
</tr>
<tr>
<td class="tcw">Sky Blue3</td>
<td class="tcw">#659EC7</td>
<td class="wt" bgcolor="#659ec7"><strong>Sky Blue3</strong></td>
</tr>
<tr>
<td class="tcw">Sky Blue4</td>
<td class="tcw">#41627E</td>
<td class="wt" bgcolor="#41627e"><strong>Sky Blue4</strong></td>
</tr>
<tr>
<td class="tcw">Slate Blue</td>
<td class="tcw">#737CA1</td>
<td class="wt" bgcolor="#737ca1"><strong>Slate Blue</strong></td>
</tr>
<tr>
<td class="tcw">Slate Blue</td>
<td class="tcw">#737CA1</td>
<td class="wt" bgcolor="#737ca1"><strong>Slate Blue</strong></td>
</tr>
<tr>
<td class="tcw">Slate Gray3</td>
<td class="tcw">#98AFC7</td>
<td class="wt" bgcolor="#98afc7"><strong>Slate Gray3</strong></td>
</tr>
<tr>
<td class="tcw">Violet Red</td>
<td class="tcw">#F6358A</td>
<td class="wt" bgcolor="#f6358a"><strong>Violet Red</strong></td>
</tr>
<tr>
<td class="tcw">Violet Red1</td>
<td class="tcw">#F6358A</td>
<td class="wt" bgcolor="#f6358a"><strong>Violet Red1</strong></td>
</tr>
<tr>
<td class="tcw">Violet Red2</td>
<td class="tcw">#E4317F</td>
<td class="wt" bgcolor="#e4317f"><strong>Violet Red2</strong></td>
</tr>
<tr>
<td class="tcw">Deep Pink</td>
<td class="tcw">#F52887</td>
<td class="wt" bgcolor="#f52887"><strong>Deep Pink</strong></td>
</tr>
<tr>
<td class="tcw">Deep Pink2</td>
<td class="tcw">#E4287C</td>
<td class="wt" bgcolor="#e4287c"><strong>Deep Pink2</strong></td>
</tr>
<tr>
<td class="tcw">Deep Pink3</td>
<td class="tcw">#C12267</td>
<td class="wt" bgcolor="#c12267"><strong>Deep Pink3</strong></td>
</tr>
<tr>
<td class="tcw">Deep Pink4</td>
<td class="tcw">#7D053F</td>
<td class="wt" bgcolor="#7d053f"><strong>Deep Pink4</strong></td>
</tr>
<tr>
<td class="tcw">Medium Violet Red</td>
<td class="tcw">#CA226B</td>
<td class="wt" bgcolor="#ca226b"><strong>Medium Violet Red</strong></td>
</tr>
<tr>
<td class="tcw">Violet Red3</td>
<td class="tcw">#C12869</td>
<td class="wt" bgcolor="#c12869"><strong>Violet Red3</strong></td>
</tr>
<tr>
<td class="tcw">Firebrick</td>
<td class="tcw">#800517</td>
<td class="wt" bgcolor="#800517"><strong>Firebrick</strong></td>
</tr>
<tr>
<td class="tcw">Violet Red4</td>
<td class="tcw">#7D0541</td>
<td class="wt" bgcolor="#7d0541"><strong>Violet Red4</strong></td>
</tr>
<tr>
<td class="tcw">Maroon4</td>
<td class="tcw">#7D0552</td>
<td class="wt" bgcolor="#7d0552"><strong>Maroon4</strong></td>
</tr>
<tr>
<td class="tcw">Maroon</td>
<td class="tcw">#810541</td>
<td class="wt" bgcolor="#810541"><strong>Maroon</strong></td>
</tr>
<tr>
<td class="tcw">Maroon3</td>
<td class="tcw">#C12283</td>
<td class="wt" bgcolor="#c12283"><strong>Maroon3</strong></td>
</tr>
<tr>
<td class="tcw">Maroon2</td>
<td class="tcw">#E3319D</td>
<td class="wt" bgcolor="#e3319d"><strong>Maroon2</strong></td>
</tr>
<tr>
<td class="tcw">Maroon1</td>
<td class="tcw">#F535AA</td>
<td class="wt" bgcolor="#f535aa"><strong>Maroon1</strong></td>
</tr>
<tr>
<td class="tcw">Magenta</td>
<td class="tcw">#FF00FF</td>
<td class="wt" bgcolor="#ff00ff"><strong>Magenta</strong></td>
</tr>
<tr>
<td class="tcw">Magenta1</td>
<td class="tcw">#F433FF</td>
<td class="wt" bgcolor="#f433ff"><strong>Magenta1</strong></td>
</tr>
<tr>
<td class="tcw">Magenta2</td>
<td class="tcw">#E238EC</td>
<td class="wt" bgcolor="#e238ec"><strong>Magenta2</strong></td>
</tr>
<tr>
<td class="tcw">Magenta3</td>
<td class="tcw">#C031C7</td>
<td class="wt" bgcolor="#c031c7"><strong>Magenta3</strong></td>
</tr>
<tr>
<td class="tcw">Medium Orchid</td>
<td class="tcw">#B048B5</td>
<td class="wt" bgcolor="#b048b5"><strong>Medium Orchid</strong></td>
</tr>
<tr>
<td class="tcw">Medium Orchid1</td>
<td class="tcw">#D462FF</td>
<td class="wt" bgcolor="#d462ff"><strong>Medium Orchid1</strong></td>
</tr>
<tr>
<td class="tcw">Medium Orchid2</td>
<td class="tcw">#C45AEC</td>
<td class="wt" bgcolor="#c45aec"><strong>Medium Orchid2</strong></td>
</tr>
<tr>
<td class="tcw">Medium Orchid3</td>
<td class="tcw">#A74AC7</td>
<td class="wt" bgcolor="#a74ac7"><strong>Medium Orchid3</strong></td>
</tr>
<tr>
<td class="tcw">Medium Orchid4</td>
<td class="tcw">#6A287E</td>
<td class="wt" bgcolor="#6a287e"><strong>Medium Orchid4</strong></td>
</tr>
<tr>
<td class="tcw">Purple</td>
<td class="tcw">#8E35EF</td>
<td class="wt" bgcolor="#8e35ef"><strong>Purple</strong></td>
</tr>
<tr>
<td class="tcw">Purple1</td>
<td class="tcw">#893BFF</td>
<td class="wt" bgcolor="#893bff"><strong>Purple1</strong></td>
</tr>
<tr>
<td class="tcw">Purple2</td>
<td class="tcw">#7F38EC</td>
<td class="wt" bgcolor="#7f38ec"><strong>Purple2</strong></td>
</tr>
<tr>
<td class="tcw">Purple3</td>
<td class="tcw">#6C2DC7</td>
<td class="wt" bgcolor="#6c2dc7"><strong>Purple3</strong></td>
</tr>
<tr>
<td class="tcw">Purple4</td>
<td class="tcw">#461B7E</td>
<td class="wt" bgcolor="#461b7e"><strong>Purple4</strong></td>
</tr>
<tr>
<td class="tcw">Dark Orchid4</td>
<td class="tcw">#571B7e</td>
<td class="wt" bgcolor="#571b7e"><strong>Dark Orchid4</strong></td>
</tr>
<tr>
<td class="tcw">Dark Orchid</td>
<td class="tcw">#7D1B7E</td>
<td class="wt" bgcolor="#7d1b7e"><strong>Dark Orchid</strong></td>
</tr>
<tr>
<td class="tcw">Dark Violet</td>
<td class="tcw">#842DCE</td>
<td class="wt" bgcolor="#842dce"><strong>Dark Violet</strong></td>
</tr>
<tr>
<td class="tcw">Dark Orchid3</td>
<td class="tcw">#8B31C7</td>
<td class="wt" bgcolor="#8b31c7"><strong>Dark Orchid3</strong></td>
</tr>
<tr>
<td class="tcw">Dark Orchid2</td>
<td class="tcw">#A23BEC</td>
<td class="wt" bgcolor="#a23bec"><strong>Dark Orchid2</strong></td>
</tr>
<tr>
<td class="tcw">Dark Orchid1</td>
<td class="tcw">#B041FF</td>
<td class="wt" bgcolor="#b041ff"><strong>Dark Orchid1</strong></td>
</tr>
<tr>
<td class="tcw">Plum4</td>
<td class="tcw">#7E587E</td>
<td class="wt" bgcolor="#7e587e"><strong>Plum4</strong></td>
</tr>
<tr>
<td class="tcw">Pale Violet Red</td>
<td class="tcw">#D16587</td>
<td class="wt" bgcolor="#d16587"><strong>Pale Violet Red</strong></td>
</tr>
<tr>
<td class="tcw">Pale Violet Red1</td>
<td class="tcw">#F778A1</td>
<td class="wt" bgcolor="#f778a1"><strong>Pale Violet Red1</strong></td>
</tr>
<tr>
<td class="tcw">Pale Violet Red2</td>
<td class="tcw">#E56E94</td>
<td class="wt" bgcolor="#e56e94"><strong>Pale Violet Red2</strong></td>
</tr>
<tr>
<td class="tcw">Pale Violet Red3</td>
<td class="tcw">#C25A7C</td>
<td class="wt" bgcolor="#c25a7c"><strong>Pale Violet Red3</strong></td>
</tr>
<tr>
<td class="tcw">Pale Violet Red4</td>
<td class="tcw">#7E354D</td>
<td class="wt" bgcolor="#7e354d"><strong>Pale Violet Red4</strong></td>
</tr>
<tr>
<td class="tcw">Plum</td>
<td class="tcw">#B93B8F</td>
<td class="wt" bgcolor="#b93b8f"><strong>Plum</strong></td>
</tr>
<tr>
<td class="tcw">Plum1</td>
<td class="tcw">#F9B7FF</td>
<td class="wt" bgcolor="#f9b7ff"><strong>Plum1</strong></td>
</tr>
<tr>
<td class="tcw">Plum2</td>
<td class="tcw">#E6A9EC</td>
<td class="wt" bgcolor="#e6a9ec"><strong>Plum2</strong></td>
</tr>
<tr>
<td class="tcw">Plum3</td>
<td class="tcw">#C38EC7</td>
<td class="wt" bgcolor="#c38ec7"><strong>Plum3</strong></td>
</tr>
<tr>
<td class="tcw">Thistle</td>
<td class="tcw">#D2B9D3</td>
<td class="wt" bgcolor="#d2b9d3"><strong>Thistle</strong></td>
</tr>
<tr>
<td class="tcw">Thistle3</td>
<td class="tcw">#C6AEC7</td>
<td class="wt" bgcolor="#c6aec7"><strong>Thistle3</strong></td>
</tr>
<tr>
<td class="tcw">Lavendar Blush2</td>
<td class="tcw">#EBDDE2</td>
<td class="wt" bgcolor="#ebdde2"><strong>Lavender Blush2</strong></td>
</tr>
<tr>
<td class="tcw">Lavendar Blush3</td>
<td class="tcw">#C8BBBE</td>
<td class="wt" bgcolor="#c8bbbe"><strong>Lavender Blush3</strong></td>
</tr>
<tr>
<td class="tcw">Thistle2</td>
<td class="tcw">#E9CFEC</td>
<td class="wt" bgcolor="#d9cfec"><strong>Thistle2</strong></td>
</tr>
<tr>
<td class="tcw">Thistle1</td>
<td class="tcw">#FCDFFF</td>
<td class="wt" bgcolor="#fcdfff"><strong>Thistle1</strong></td>
</tr>
<tr>
<td class="tcw">Lavendar</td>
<td class="tcw">#E3E4FA</td>
<td class="wt" bgcolor="#e3e4fa"><strong>Lavender</strong></td>
</tr>
<tr>
<td class="tcw">Lavendar Blush</td>
<td class="tcw">#FDEEF4</td>
<td class="wt" bgcolor="#fdeef4"><strong>Lavender Blush</strong></td>
</tr>
<tr>
<td class="tcw">Light Steel Blue1</td>
<td class="tcw">#C6DEFF</td>
<td class="wt" bgcolor="#c6deff"><strong>Light Steel Blue1</strong></td>
</tr>
<tr>
<td class="tcw">Light Blue</td>
<td class="tcw">#ADDFFF</td>
<td class="wt" bgcolor="#addfff"><strong>Light Blue</strong></td>
</tr>
<tr>
<td class="tcw">Light Blue1</td>
<td class="tcw">#BDEDFF</td>
<td class="wt" bgcolor="#bdedff"><strong>Light Blue1</strong></td>
</tr>
<tr>
<td class="tcw">Light Cyan</td>
<td class="tcw">#E0FFFF</td>
<td bgcolor="#e0ffff"><strong>Light Cyan</strong></td>
</tr>
<tr>
<td class="tcw">Slate Gray1</td>
<td class="tcw">#C2DFFF</td>
<td class="wt" bgcolor="#c2dfff"><strong>Slate Gray1</strong></td>
</tr>
<tr>
<td class="tcw">Slate Gray2</td>
<td class="tcw">#B4CFEC</td>
<td class="wt" bgcolor="#b4cfec"><strong>Slate Gray2</strong></td>
</tr>
<tr>
<td class="tcw">Light Steel Blue2</td>
<td class="tcw">#B7CEEC</td>
<td class="wt" bgcolor="#b7ceec"><strong>Light Steel Blue2</strong></td>
</tr>
<tr>
<td class="tcw">Turquoise1</td>
<td class="tcw">#52F3FF</td>
<td class="wt" bgcolor="#52f3ff"><strong>Turquoise1</strong></td>
</tr>
<tr>
<td class="tcw">Cyan</td>
<td class="tcw">#00FFFF</td>
<td class="wt" bgcolor="#00ffff"><strong>Cyan</strong></td>
</tr>
<tr>
<td class="tcw">Cyan1</td>
<td class="tcw">#57FEFF</td>
<td class="wt" bgcolor="#57feff"><strong>Cyan1</strong></td>
</tr>
<tr>
<td class="tcw">Cyan2</td>
<td class="tcw">#50EBEC</td>
<td class="wt" bgcolor="#50ebec"><strong>Cyan2</strong></td>
</tr>
<tr>
<td class="tcw">Turquoise2</td>
<td class="tcw">#4EE2EC</td>
<td class="wt" bgcolor="#4ee2ec"><strong>Turquoise2</strong></td>
</tr>
<tr>
<td class="tcw">Medium Turquoise</td>
<td class="tcw">#48CCCD</td>
<td class="wt" bgcolor="#48cccd"><strong>Medium Turquoise</strong></td>
</tr>
<tr>
<td class="tcw">Turquoise</td>
<td class="tcw">#43C6DB</td>
<td class="wt" bgcolor="#43c6db"><strong>Turquoise</strong></td>
</tr>
<tr>
<td class="tcw">Dark Slate Gray1</td>
<td class="tcw">#9AFEFF</td>
<td class="wt" bgcolor="#9afeff"><strong>Dark Slate Gray1</strong></td>
</tr>
<tr>
<td class="tcw">Dark Slate Gray2</td>
<td class="tcw">#8EEBEC</td>
<td class="wt" bgcolor="#8eebec"><strong>Dark slate Gray2</strong></td>
</tr>
<tr>
<td class="tcw">Dark Slate Gray3</td>
<td class="tcw">#78c7c7</td>
<td class="wt" bgcolor="#78c7c7"><strong>Dark Slate Gray3</strong></td>
</tr>
<tr>
<td class="tcw">Cyan3</td>
<td class="tcw">#46C7C7</td>
<td class="wt" bgcolor="#46c7c7"><strong>Cyan3</strong></td>
</tr>
<tr>
<td class="tcw">Turquoise3</td>
<td class="tcw">#43BFC7</td>
<td class="wt" bgcolor="#43bfc7"><strong>Turquoise3</strong></td>
</tr>
<tr>
<td class="tcw">Cadet Blue3</td>
<td class="tcw">#77BFC7</td>
<td class="wt" bgcolor="#77bfc7"><strong>Cadet Blue3</strong></td>
</tr>
<tr>
<td class="tcw">Pale Turquoise3</td>
<td class="tcw">#92C7C7</td>
<td class="wt" bgcolor="#92c7c7"><strong>Pale Turquoise3</strong></td>
</tr>
<tr>
<td class="tcw">Light Blue2</td>
<td class="tcw">#AFDCEC</td>
<td class="wt" bgcolor="#afdcec"><strong>Light Blue2</strong></td>
</tr>
<tr>
<td class="tcw">Dark Turquoise</td>
<td class="tcw">#3B9C9C</td>
<td class="wt" bgcolor="#3b9c9c"><strong>Dark Turquoise</strong></td>
</tr>
<tr>
<td class="tcw">Cyan4</td>
<td class="tcw">#307D7E</td>
<td class="wt" bgcolor="#307d7e"><strong>Cyan4</strong></td>
</tr>
<tr>
<td class="tcw">Light Sea Green</td>
<td class="tcw">#3EA99F</td>
<td class="wt" bgcolor="#3ea99f"><strong>Light Sea Green</strong></td>
</tr>
<tr>
<td class="tcw">Light Sky Blue</td>
<td class="tcw">#82CAFA</td>
<td class="wt" bgcolor="#82cafa"><strong>Light Sky Blue</strong></td>
</tr>
<tr>
<td class="tcw">Light Sky Blue2</td>
<td class="tcw">#A0CFEC</td>
<td class="wt" bgcolor="#a0cfec"><strong>Light Sky Blue2</strong></td>
</tr>
<tr>
<td class="tcw">Light Sky Blue3</td>
<td class="tcw">#87AFC7</td>
<td class="wt" bgcolor="#87afc7"><strong>Light Sky Blue3</strong></td>
</tr>
<tr>
<td class="tcw">Sky Blue</td>
<td class="tcw">#82CAFF</td>
<td class="wt" bgcolor="#82caff"><strong>Sky Blue</strong></td>
</tr>
<tr>
<td class="tcw">Sky Blue2</td>
<td class="tcw">#79BAEC</td>
<td class="wt" bgcolor="#79baec"><strong>Sky Blue2</strong></td>
</tr>
<tr>
<td class="tcw">Light Sky Blue4</td>
<td class="tcw">#566D7E</td>
<td class="wt" bgcolor="#566d7e"><strong>Light Sky Blue4</strong></td>
</tr>
<tr>
<td class="tcw">Sky Blue</td>
<td class="tcw">#6698FF</td>
<td class="wt" bgcolor="#6698ff"><strong>Sky Blue</strong></td>
</tr>
<tr>
<td class="tcw">Light Slate Blue</td>
<td class="tcw">#736AFF</td>
<td class="wt" bgcolor="#736aff"><strong>Light Slate Blue</strong></td>
</tr>
<tr>
<td class="tcw">Light Cyan2</td>
<td class="tcw">#CFECEC</td>
<td bgcolor="#cfecec"><strong>Light Cyan2</strong></td>
</tr>
<tr>
<td class="tcw">Light Cyan3</td>
<td class="tcw">#AFC7C7</td>
<td class="wt" bgcolor="#afc7c7"><strong>Light Cyan3</strong></td>
</tr>
<tr>
<td class="tcw">Light Cyan4</td>
<td class="tcw">#717D7D</td>
<td class="wt" bgcolor="#717d7d"><strong>Light Cyan4</strong></td>
</tr>
<tr>
<td class="tcw">Light Blue3</td>
<td class="tcw">#95B9C7</td>
<td class="wt" bgcolor="#95b9c7"><strong>Light Blue3</strong></td>
</tr>
<tr>
<td class="tcw">Light Blue4</td>
<td class="tcw">#5E767E</td>
<td class="wt" bgcolor="#5e767e"><strong>Light Blue4</strong></td>
</tr>
<tr>
<td class="tcw">Pale Turquoise4</td>
<td class="tcw">#5E7D7E</td>
<td class="wt" bgcolor="#5e7d7e"><strong>Pale Turquoise4</strong></td>
</tr>
<tr>
<td class="tcw">Dark Sea Green4</td>
<td class="tcw">#617C58</td>
<td class="wt" bgcolor="#617c58"><strong>Dark Sea Green4</strong></td>
</tr>
<tr>
<td class="tcw">Medium Aquamarine</td>
<td class="tcw">#348781</td>
<td class="wt" bgcolor="#348781"><strong>Medium Aquamarine</strong></td>
</tr>
<tr>
<td class="tcw">Medium Sea Green</td>
<td class="tcw">#306754</td>
<td class="wt" bgcolor="#306754"><strong>Medium Sea Green</strong></td>
</tr>
<tr>
<td class="tcw">Sea Green</td>
<td class="tcw">#4E8975</td>
<td class="wt" bgcolor="#4e8975"><strong>Sea Green</strong></td>
</tr>
<tr>
<td class="tcw">Dark Green</td>
<td class="tcw">#254117</td>
<td class="wt" bgcolor="#254117"><strong>Dark Green</strong></td>
</tr>
<tr>
<td class="tcw">Sea Green4</td>
<td class="tcw">#387C44</td>
<td class="wt" bgcolor="#387c44"><strong>Sea Green4</strong></td>
</tr>
<tr>
<td class="tcw">Forest Green</td>
<td class="tcw">#4E9258</td>
<td class="wt" bgcolor="#4e9258"><strong>Forest Green</strong></td>
</tr>
<tr>
<td class="tcw">Medium Forest Green</td>
<td class="tcw">#347235</td>
<td class="wt" bgcolor="#347235"><strong>Medium Forest Green</strong></td>
</tr>
<tr>
<td class="tcw">Spring Green4</td>
<td class="tcw">#347C2C</td>
<td class="wt" bgcolor="#347c2c"><strong>Spring Green4</strong></td>
</tr>
<tr>
<td class="tcw">Dark Olive Green4</td>
<td class="tcw">#667C26</td>
<td class="wt" bgcolor="#667c26"><strong>Dark Olive Green4</strong></td>
</tr>
<tr>
<td class="tcw">Chartreuse4</td>
<td class="tcw">#437C17</td>
<td class="wt" bgcolor="#437c17"><strong>Chartreuse4</strong></td>
</tr>
<tr>
<td class="tcw">Green4</td>
<td class="tcw">#347C17</td>
<td class="wt" bgcolor="#347c17"><strong>Green4</strong></td>
</tr>
<tr>
<td class="tcw">Medium Spring Green</td>
<td class="tcw">#348017</td>
<td class="wt" bgcolor="#348017"><strong>Medium Spring Green</strong></td>
</tr>
<tr>
<td class="tcw">Spring Green</td>
<td class="tcw">#4AA02C</td>
<td class="wt" bgcolor="#4aa02c"><strong>Spring Green</strong></td>
</tr>
<tr>
<td class="tcw">Lime Green</td>
<td class="tcw">#41A317</td>
<td class="wt" bgcolor="#41a317"><strong>Lime Green</strong></td>
</tr>
<tr>
<td class="tcw">Spring Green</td>
<td class="tcw">#4AA02C</td>
<td class="wt" bgcolor="#4aa02c"><strong>Spring Green</strong></td>
</tr>
<tr>
<td class="tcw">Dark Sea Green</td>
<td class="tcw">#8BB381</td>
<td class="wt" bgcolor="#8bb381"><strong>Dark Sea Green</strong></td>
</tr>
<tr>
<td class="tcw">Dark Sea Green3</td>
<td class="tcw">#99C68E</td>
<td class="wt" bgcolor="#99c68e"><strong>Dark Sea Green3</strong></td>
</tr>
<tr>
<td class="tcw">Green3</td>
<td class="tcw">#4CC417</td>
<td class="wt" bgcolor="#4cc417"><strong>Green3</strong></td>
</tr>
<tr>
<td class="tcw">Chartreuse3</td>
<td class="tcw">#6CC417</td>
<td class="wt" bgcolor="#6cc417"><strong>Chartreuse3</strong></td>
</tr>
<tr>
<td class="tcw">Yellow Green</td>
<td class="tcw">#52D017</td>
<td class="wt" bgcolor="#52d017"><strong>Yellow Green</strong></td>
</tr>
<tr>
<td class="tcw">Spring Green3</td>
<td class="tcw">#4CC552</td>
<td class="wt" bgcolor="#4cc552"><strong>Spring Green3</strong></td>
</tr>
<tr>
<td class="tcw">Sea Green3</td>
<td class="tcw">#54C571</td>
<td class="wt" bgcolor="#54c571"><strong>Sea Green3</strong></td>
</tr>
<tr>
<td class="tcw">Spring Green2</td>
<td class="tcw">#57E964</td>
<td class="wt" bgcolor="#57e964"><strong>Spring Green2</strong></td>
</tr>
<tr>
<td class="tcw">Spring Green1</td>
<td class="tcw">#5EFB6E</td>
<td class="wt" bgcolor="#5efb6e"><strong>Spring Green1</strong></td>
</tr>
<tr>
<td class="tcw">Sea Green2</td>
<td class="tcw">#64E986</td>
<td class="wt" bgcolor="#64e986"><strong>Sea Green2</strong></td>
</tr>
<tr>
<td class="tcw">Sea Green1</td>
<td class="tcw">#6AFB92</td>
<td class="wt" bgcolor="#6afb92"><strong>Sea Green1</strong></td>
</tr>
<tr>
<td class="tcw">Dark Sea Green2</td>
<td class="tcw">#B5EAAA</td>
<td class="wt" bgcolor="#b5eaaa"><strong>Dark Sea Green2</strong></td>
</tr>
<tr>
<td class="tcw">Dark Sea Green1</td>
<td class="tcw">#C3FDB8</td>
<td class="wt" bgcolor="#c3fdb8"><strong>Dark Sea Green1</strong></td>
</tr>
<tr>
<td class="tcw">Green</td>
<td class="tcw">#00FF00</td>
<td class="wt" bgcolor="#00ff00"><strong>Green</strong></td>
</tr>
<tr>
<td class="tcw">Lawn Green</td>
<td class="tcw">#87F717</td>
<td class="wt" bgcolor="#87f717"><strong>Lawn Green</strong></td>
</tr>
<tr>
<td class="tcw">Green1</td>
<td class="tcw">#5FFB17</td>
<td class="wt" bgcolor="#5ffb17"><strong>Green1</strong></td>
</tr>
<tr>
<td class="tcw">Green2</td>
<td class="tcw">#59E817</td>
<td class="wt" bgcolor="#59e817"><strong>Green2</strong></td>
</tr>
<tr>
<td class="tcw">Chartreuse2</td>
<td class="tcw">#7FE817</td>
<td class="wt" bgcolor="#7fe817"><strong>Chartreuse2</strong></td>
</tr>
<tr>
<td class="tcw">Chartreuse</td>
<td class="tcw">#8AFB17</td>
<td class="wt" bgcolor="#8afb17"><strong>Chartreuse</strong></td>
</tr>
<tr>
<td class="tcw">Green Yellow</td>
<td class="tcw">#B1FB17</td>
<td class="wt" bgcolor="#b1fb17"><strong>Green Yellow</strong></td>
</tr>
<tr>
<td class="tcw">Dark Olive Green1</td>
<td class="tcw">#CCFB5D</td>
<td class="wt" bgcolor="#ccfb5d"><strong>Dark Olive Green1</strong></td>
</tr>
<tr>
<td class="tcw">Dark Olive Green2</td>
<td class="tcw">#BCE954</td>
<td class="wt" bgcolor="#bce954"><strong>Dark Olive Green2</strong></td>
</tr>
<tr>
<td class="tcw">Dark Olive Green3</td>
<td class="tcw">#A0C544</td>
<td class="wt" bgcolor="#a0c544"><strong>Dark Olive Green3</strong></td>
</tr>
<tr>
<td class="tcw">Yellow</td>
<td class="tcw">#FFFF00</td>
<td class="wt" bgcolor="#ffff00"><strong>Yellow</strong></td>
</tr>
<tr>
<td class="tcw">Yellow1</td>
<td class="tcw">#FFFC17</td>
<td class="wt" bgcolor="#fffc17"><strong>Yellow1</strong></td>
</tr>
<tr>
<td class="tcw">Khaki1</td>
<td class="tcw">#FFF380</td>
<td class="wt" bgcolor="#fff380"><strong>Khaki1</strong></td>
</tr>
<tr>
<td class="tcw">Khaki2</td>
<td class="tcw">#EDE275</td>
<td class="wt" bgcolor="#ede275"><strong>Khaki2</strong></td>
</tr>
<tr>
<td class="tcw">Goldenrod</td>
<td class="tcw">#EDDA74</td>
<td class="wt" bgcolor="#edda74"><strong>Goldenrod</strong></td>
</tr>
<tr>
<td class="tcw">Gold2</td>
<td class="tcw">#EAC117</td>
<td class="wt" bgcolor="#eac117"><strong>Gold2</strong></td>
</tr>
<tr>
<td class="tcw">Gold1</td>
<td class="tcw">#FDD017</td>
<td class="wt" bgcolor="#fdd017"><strong>Gold1</strong></td>
</tr>
<tr>
<td class="tcw">Goldenrod1</td>
<td class="tcw">#FBB917</td>
<td class="wt" bgcolor="#fbb917"><strong>Goldenrod1</strong></td>
</tr>
<tr>
<td class="tcw">Goldenrod2</td>
<td class="tcw">#E9AB17</td>
<td class="wt" bgcolor="#e9ab17"><strong>Goldenrod2</strong></td>
</tr>
<tr>
<td class="tcw">Gold</td>
<td class="tcw">#D4A017</td>
<td class="wt" bgcolor="#d4a017"><strong>Gold</strong></td>
</tr>
<tr>
<td class="tcw">Gold3</td>
<td class="tcw">#C7A317</td>
<td class="wt" bgcolor="#c7a317"><strong>Gold3</strong></td>
</tr>
<tr>
<td class="tcw">Goldenrod3</td>
<td class="tcw">#C68E17</td>
<td class="wt" bgcolor="#c68e17"><strong>Goldenrod3</strong></td>
</tr>
<tr>
<td class="tcw">Dark Goldenrod</td>
<td class="tcw">#AF7817</td>
<td class="wt" bgcolor="#af7817"><strong>Dark Goldenrod</strong></td>
</tr>
<tr>
<td class="tcw">Khaki</td>
<td class="tcw">#ADA96E</td>
<td class="wt" bgcolor="#ada96e"><strong>Khaki</strong></td>
</tr>
<tr>
<td class="tcw">Khaki3</td>
<td class="tcw">#C9BE62</td>
<td class="wt" bgcolor="#c9be62"><strong>Khaki3</strong></td>
</tr>
<tr>
<td class="tcw">Khaki4</td>
<td class="tcw">#827839</td>
<td class="wt" bgcolor="#827839"><strong>Khaki4</strong></td>
</tr>
<tr>
<td class="tcw">Dark Goldenrod1</td>
<td class="tcw">#FBB117</td>
<td class="wt" bgcolor="#fbb117"><strong>Dark Goldenrod1</strong></td>
</tr>
<tr>
<td class="tcw">Dark Goldenrod2</td>
<td class="tcw">#E8A317</td>
<td class="wt" bgcolor="#e8a317"><strong>Dark Goldenrod2</strong></td>
</tr>
<tr>
<td class="tcw">Dark Goldenrod3</td>
<td class="tcw">#C58917</td>
<td class="wt" bgcolor="#c58917"><strong>Dark Goldenrod3</strong></td>
</tr>
<tr>
<td class="tcw">Sienna1</td>
<td class="tcw">#F87431</td>
<td class="wt" bgcolor="#f87431"><strong>Sienna1</strong></td>
</tr>
<tr>
<td class="tcw">Sienna2</td>
<td class="tcw">#E66C2C</td>
<td class="wt" bgcolor="#e66c2c"><strong>Sienna2</strong></td>
</tr>
<tr>
<td class="tcw">Dark Orange</td>
<td class="tcw">#F88017</td>
<td class="wt" bgcolor="#f88017"><strong>Dark Orange</strong></td>
</tr>
<tr>
<td class="tcw">Dark Orange1</td>
<td class="tcw">#F87217</td>
<td class="wt" bgcolor="#f87217"><strong>Dark Orange1</strong></td>
</tr>
<tr>
<td class="tcw">Dark Orange2</td>
<td class="tcw">#E56717</td>
<td class="wt" bgcolor="#e56717"><strong>Dark Orange2</strong></td>
</tr>
<tr>
<td class="tcw">Dark Orange3</td>
<td class="tcw">#C35617</td>
<td class="wt" bgcolor="#c35617"><strong>Dark Orange3</strong></td>
</tr>
<tr>
<td class="tcw">Sienna3</td>
<td class="tcw">#C35817</td>
<td class="wt" bgcolor="#c35817"><strong>Sienna3</strong></td>
</tr>
<tr>
<td class="tcw">Sienna</td>
<td class="tcw">#8A4117</td>
<td class="wt" bgcolor="#8a4117"><strong>Sienna</strong></td>
</tr>
<tr>
<td class="tcw">Sienna4</td>
<td class="tcw">#7E3517</td>
<td class="wt" bgcolor="#7e3517"><strong>Sienna4</strong></td>
</tr>
<tr>
<td class="tcw">Indian Red4</td>
<td class="tcw">#7E2217</td>
<td class="wt" bgcolor="#7e2217"><strong>Indian Red4</strong></td>
</tr>
<tr>
<td class="tcw">Dark Orange3</td>
<td class="tcw">#7E3117</td>
<td class="wt" bgcolor="#7e3117"><strong>Dark Orange3</strong></td>
</tr>
<tr>
<td class="tcw">Salmon4</td>
<td class="tcw">#7E3817</td>
<td class="wt" bgcolor="#7e3817"><strong>Salmon4</strong></td>
</tr>
<tr>
<td class="tcw">Dark Goldenrod4</td>
<td class="tcw">#7F5217</td>
<td class="wt" bgcolor="#7f5217"><strong>Dark Goldenrod4</strong></td>
</tr>
<tr>
<td class="tcw">Gold4</td>
<td class="tcw">#806517</td>
<td class="wt" bgcolor="#806517"><strong>Gold4</strong></td>
</tr>
<tr>
<td class="tcw">Goldenrod4</td>
<td class="tcw">#805817</td>
<td class="wt" bgcolor="#805817"><strong>Goldenrod4</strong></td>
</tr>
<tr>
<td class="tcw">Light Salmon4</td>
<td class="tcw">#7F462C</td>
<td class="wt" bgcolor="#7f462c"><strong>Light Salmon4</strong></td>
</tr>
<tr>
<td class="tcw">Chocolate</td>
<td class="tcw">#C85A17</td>
<td class="wt" bgcolor="#c85a17"><strong>Chocolate</strong></td>
</tr>
<tr>
<td class="tcw">Coral3</td>
<td class="tcw">#C34A2C</td>
<td class="wt" bgcolor="#c34a2c"><strong>Coral3</strong></td>
</tr>
<tr>
<td class="tcw">Coral2</td>
<td class="tcw">#E55B3C</td>
<td class="wt" bgcolor="#e55b3c"><strong>Coral2</strong></td>
</tr>
<tr>
<td class="tcw">Coral</td>
<td class="tcw">#F76541</td>
<td class="wt" bgcolor="#f76541"><strong>Coral</strong></td>
</tr>
<tr>
<td class="tcw">Dark Salmon</td>
<td class="tcw">#E18B6B</td>
<td class="wt" bgcolor="#e18b6b"><strong>Dark Salmon</strong></td>
</tr>
<tr>
<td class="tcw">Salmon1</td>
<td class="tcw">#F88158</td>
<td class="wt" bgcolor="#f88158"><strong>Pale Turquoise4</strong></td>
</tr>
<tr>
<td class="tcw">Salmon2</td>
<td class="tcw">#E67451</td>
<td class="wt" bgcolor="#e67451"><strong>Salmon2</strong></td>
</tr>
<tr>
<td class="tcw">Salmon3</td>
<td class="tcw">#C36241</td>
<td class="wt" bgcolor="#c36241"><strong>Salmon3</strong></td>
</tr>
<tr>
<td class="tcw">Light Salmon3</td>
<td class="tcw">#C47451</td>
<td class="wt" bgcolor="#c47451"><strong>Light Salmon3</strong></td>
</tr>
<tr>
<td class="tcw">Light Salmon2</td>
<td class="tcw">#E78A61</td>
<td class="wt" bgcolor="#e78a61"><strong>Light Salmon2</strong></td>
</tr>
<tr>
<td class="tcw">Light Salmon</td>
<td class="tcw">#F9966B</td>
<td class="wt" bgcolor="#f9966b"><strong>Light Salmon</strong></td>
</tr>
<tr>
<td class="tcw">Sandy Brown</td>
<td class="tcw">#EE9A4D</td>
<td class="wt" bgcolor="#ee9a4d"><strong>Sandy Brown</strong></td>
</tr>
<tr>
<td class="tcw">Hot Pink</td>
<td class="tcw">#F660AB</td>
<td class="wt" bgcolor="#f660ab"><strong>Hot Pink</strong></td>
</tr>
<tr>
<td class="tcw">Hot Pink1</td>
<td class="tcw">#F665AB</td>
<td class="wt" bgcolor="#f665ab"><strong>Hot Pink1</strong></td>
</tr>
<tr>
<td class="tcw">Hot Pink2</td>
<td class="tcw">#E45E9D</td>
<td class="wt" bgcolor="#e45e9d"><strong>Hot Pink2</strong></td>
</tr>
<tr>
<td class="tcw">Hot Pink3</td>
<td class="tcw">#C25283</td>
<td class="wt" bgcolor="#c25283"><strong>Hot Pink3</strong></td>
</tr>
<tr>
<td class="tcw">Hot Pink4</td>
<td class="tcw">#7D2252</td>
<td class="wt" bgcolor="#7d2252"><strong>Hot Pink4</strong></td>
</tr>
<tr>
<td class="tcw">Light Coral</td>
<td class="tcw">#E77471</td>
<td class="wt" bgcolor="#e77471"><strong>Light Coral</strong></td>
</tr>
<tr>
<td class="tcw">Indian Red1</td>
<td class="tcw">#F75D59</td>
<td class="wt" bgcolor="#f75d59"><strong>Indian Red1</strong></td>
</tr>
<tr>
<td class="tcw">Indian Red2</td>
<td class="tcw">#E55451</td>
<td class="wt" bgcolor="#e55451"><strong>Indian Red2</strong></td>
</tr>
<tr>
<td class="tcw">Indian Red3</td>
<td class="tcw">#C24641</td>
<td class="wt" bgcolor="#c24641"><strong>Indian Red3</strong></td>
</tr>
<tr>
<td class="tcw">Red</td>
<td class="tcw">#FF0000</td>
<td class="wt" bgcolor="#ff0000"><strong>Red</strong></td>
</tr>
<tr>
<td class="tcw">Red1</td>
<td class="tcw">#F62217</td>
<td class="wt" bgcolor="#f62217"><strong>Red1</strong></td>
</tr>
<tr>
<td class="tcw">Red2</td>
<td class="tcw">#E41B17</td>
<td class="wt" bgcolor="#e41b17"><strong>Red2</strong></td>
</tr>
<tr>
<td class="tcw">Firebrick1</td>
<td class="tcw">#F62817</td>
<td class="wt" bgcolor="#f62817"><strong>Firebrick1</strong></td>
</tr>
<tr>
<td class="tcw">Firebrick2</td>
<td class="tcw">#E42217</td>
<td class="wt" bgcolor="#e42217"><strong>Firebrick2</strong></td>
</tr>
<tr>
<td class="tcw">Firebrick3</td>
<td class="tcw">#C11B17</td>
<td class="wt" bgcolor="#c11b17"><strong>Firebrick3</strong></td>
</tr>
<tr>
<td class="tcw">Pink</td>
<td class="tcw">#FAAFBE</td>
<td class="wt" bgcolor="#faafbe"><strong>Pink</strong></td>
</tr>
<tr>
<td class="tcw">Rosy Brown1</td>
<td class="tcw">#FBBBB9</td>
<td class="wt" bgcolor="#fbbbb9"><strong>Rosy Brown1</strong></td>
</tr>
<tr>
<td class="tcw">Rosy Brown2</td>
<td class="tcw">#E8ADAA</td>
<td class="wt" bgcolor="#e8adaa"><strong>Rosy Brown2</strong></td>
</tr>
<tr>
<td class="tcw">Pink2</td>
<td class="tcw">#E7A1B0</td>
<td class="wt" bgcolor="#e7a1b0"><strong>Pink2</strong></td>
</tr>
<tr>
<td class="tcw">Light Pink</td>
<td class="tcw">#FAAFBA</td>
<td class="wt" bgcolor="#faafba"><strong>Light Pink</strong></td>
</tr>
<tr>
<td class="tcw">Light Pink1</td>
<td class="tcw">#F9A7B0</td>
<td class="wt" bgcolor="#f9a7b0"><strong>Light Pink1</strong></td>
</tr>
<tr>
<td class="tcw">Light Pink2</td>
<td class="tcw">#E799A3</td>
<td class="wt" bgcolor="#e799a3"><strong>Light Pink2</strong></td>
</tr>
<tr>
<td class="tcw">Pink3</td>
<td class="tcw">#C48793</td>
<td class="wt" bgcolor="#c48793"><strong>Pink3</strong></td>
</tr>
<tr>
<td class="tcw">Rosy Brown3</td>
<td class="tcw">#C5908E</td>
<td class="wt" bgcolor="#c5908e"><strong>Rosy Brown3</strong></td>
</tr>
<tr>
<td class="tcw">Rosy Brown</td>
<td class="tcw">#B38481</td>
<td class="wt" bgcolor="#b38481"><strong>Rosy Brown</strong></td>
</tr>
<tr>
<td class="tcw">Light Pink3</td>
<td class="tcw">#C48189</td>
<td class="wt" bgcolor="#c48189"><strong>Light Pink3</strong></td>
</tr>
<tr>
<td class="tcw">Rosy Brown4</td>
<td class="tcw">#7F5A58</td>
<td class="wt" bgcolor="#7f5a58"><strong>Rosy Brown4</strong></td>
</tr>
<tr>
<td class="tcw">Light Pink4</td>
<td class="tcw">#7F4E52</td>
<td class="wt" bgcolor="#7f4e52"><strong>Light Pink4</strong></td>
</tr>
<tr>
<td class="tcw">Pink4</td>
<td class="tcw">#7F525D</td>
<td class="wt" bgcolor="#7f525d"><strong>Pink4</strong></td>
</tr>
<tr>
<td class="tcw">Lavender Blush4</td>
<td class="tcw">#817679</td>
<td class="wt" bgcolor="#817679"><strong>Lavendar Blush4</strong></td>
</tr>
<tr>
<td class="tcw">Light Goldenrod4</td>
<td class="tcw">#817339</td>
<td class="wt" bgcolor="#817339"><strong>Light Goldenrod4</strong></td>
</tr>
<tr>
<td class="tcw">Lemon Chiffon4</td>
<td class="tcw">#827B60</td>
<td class="wt" bgcolor="#827b60"><strong>Lemon Chiffon4</strong></td>
</tr>
<tr>
<td class="tcw">Lemon Chiffon3</td>
<td class="tcw">#C9C299</td>
<td class="wt" bgcolor="#c9c299"><strong>Lemon Chiffon3</strong></td>
</tr>
<tr>
<td class="tcw">Light Goldenrod3</td>
<td class="tcw">#C8B560</td>
<td class="wt" bgcolor="#c8b560"><strong>Light Goldenrod3</strong></td>
</tr>
<tr>
<td class="tcw">Light Golden2</td>
<td class="tcw">#ECD672</td>
<td class="wt" bgcolor="#ecd672"><strong>Light Golden2</strong></td>
</tr>
<tr>
<td class="tcw">Light Goldenrod</td>
<td class="tcw">#ECD872</td>
<td class="wt" bgcolor="#ecd872"><strong>Light Goldenrod</strong></td>
</tr>
<tr>
<td class="tcw">Light Goldenrod1</td>
<td class="tcw">#FFE87C</td>
<td class="wt" bgcolor="#ffe87c"><strong>Light Goldenrod1</strong></td>
</tr>
<tr>
<td class="tcw">Lemon Chiffon2</td>
<td class="tcw">#ECE5B6</td>
<td class="wt" bgcolor="#ece5b6"><strong>Lemon Chiffon2</strong></td>
</tr>
<tr>
<td class="tcw">Lemon Chiffon</td>
<td class="tcw">#FFF8C6</td>
<td bgcolor="#fff8c6"><strong>Lemon Chiffon</strong></td>
</tr>
<tr>
<td class="tcw">Light Goldenrod Yellow</td>
<td class="tcw">#FAF8CC</td>
<td bgcolor="#faf8cc"><strong>Light Goldenrod Yellow</strong></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.nataprawira.com/tech/2009/02/19/html-color-codes-charts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be your own Certificate Authority (CA)</title>
		<link>http://blog.nataprawira.com/tech/2009/02/18/be-your-own-certificate-authority-ca/</link>
		<comments>http://blog.nataprawira.com/tech/2009/02/18/be-your-own-certificate-authority-ca/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 05:04:10 +0000</pubDate>
		<dc:creator>Denie</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CA]]></category>
		<category><![CDATA[Certificate Authority]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://blog.nataprawira.com/tech/?p=34</guid>
		<description><![CDATA[

I declare from the beginning that I am no authority on digital certificates.
This document is a summary of all the articles I have read about openssl. It describes in short how to become your own Certificate Authority (CA) and how to create and sign your own certificate requests. Make no mistake, these certificates are good [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F18%2Fbe-your-own-certificate-authority-ca%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.nataprawira.com%2Ftech%2F2009%2F02%2F18%2Fbe-your-own-certificate-authority-ca%2F" height="61" width="51" /></a></div>
<!-- ALL ADSENSE ADS DISABLED -->
<p><a title="ORIGINAL POST" href="http://www.g-loaded.eu/2005/11/10/be-your-own-ca/" target="_blank">I declare from the beginning that I am no authority on digital <strong>certificates</strong>.</a></p>
<blockquote><p>This document is a summary of all the articles I have read about <strong>openssl</strong>. It describes in short how to become your own <strong>Certificate Authority</strong> (CA) and how to create and sign your own <strong>certificate requests</strong>. Make no mistake, these certificates are good only for personal use or for use in your intranet in order to provide a secure way to login or communicate with your services, so that passwords or other data is not transmitted in the clear. Noone else will or should trust these certificates.</p></blockquote>
<h4>Prerequisites</h4>
<p>The package <strong>openssl</strong> should be installed in the machine you will use to manage your certificates or create the certificate requests.</p>
<h4>First things first…</h4>
<p><span id="more-34"></span></p>
<p>The <strong>openssl</strong> package comes with some scripts that can help you create your server certificates fast, but here I will describe how to set things up from scratch in a new directory, so that you can customize things later if you like or delete everything without touching openssl’s or the system’s default files. This article is based on a Fedora installation, but will do for all distributions.</p>
<h5>Creating the necessary directories</h5>
<p>First of all we will create a directory tree where all certificate stuff will be kept. Fedora’s default directory is <strong>/etc/pki/tls/</strong>. So, as root, we create our own directories:</p>
<pre># mkdir -m 0755 /etc/pki_jungle</pre>
<p>And then we create our CA’s directory tree:</p>
<pre># mkdir -m 0755 \
     /etc/pki_jungle/myCA \
     /etc/pki_jungle/myCA/private \
     /etc/pki_jungle/myCA/certs \
     /etc/pki_jungle/myCA/newcerts \
     /etc/pki_jungle/myCA/crl</pre>
<ul>
<li><strong>myCA</strong> is our Certificate Authority’s directory.</li>
<li><strong>myCA/certs</strong> directory is where our server certificates will be placed.</li>
<li><strong>myCA/newcerts</strong> directory is where openssl puts the created certificates in PEM (unencrypted) format and in the form <em>cert_serial_number.pem</em> (eg 07.pem). Openssl needs this directory, so we create it.</li>
<li><strong>myCA/crl</strong> is where our certificate revokation list is placed.</li>
<li><strong>myCA/private</strong> is the directory where our private keys are placed. Be sure that you set restrictive permissions to all your private keys so that they can be read only by root, or the user with whose priviledges a server runs. If anyone steals your private keys, then things get really bad.</li>
</ul>
<h5>Initial openssl configuration</h5>
<p>We are going to copy the default openssl configuration file (<strong>openssl.cnf</strong>) to our CA’s directory. In Fedora, this file exists in <strong>/etc/pki/tls</strong>. So, we copy it to our CA’s dir and name it <strong>openssl.my.cnf</strong>. As root:</p>
<pre># cp /etc/pki/tls/openssl.cnf /etc/pki_jungle/myCA/openssl.my.cnf</pre>
<p>This file does not need to be world readable, so we change its attributes:</p>
<pre># chmod 0600 /etc/pki_jungle/myCA/openssl.my.cnf</pre>
<p>We also need to create two other files. This file serves as a database for openssl:</p>
<pre># touch /etc/pki_jungle/myCA/index.txt</pre>
<p>The following file contains the next certificate’s serial number. Since we have not created any certificates yet, we set it to &#8220;<strong>01</strong>&#8220;:</p>
<pre># echo '01' &gt; /etc/pki_jungle/myCA/serial</pre>
<h4>Things to remember</h4>
<p>Here is a small legend with <strong>file extensions</strong> we will use for the created files and their meaning. All files that will be created will have one of these extensions:</p>
<ul>
<li><strong>KEY</strong> &#8211; Private key (Restrictive permissions should be set on this)</li>
<li><strong>CSR</strong> &#8211; Certificate Request (This will be signed by our CA in order to create the server certificates. Afterwards it is not needed and can be deleted)</li>
<li><strong>CRT</strong> &#8211; Certificate (This can be publicly distributed)</li>
<li><strong>PEM</strong> &#8211; We will use this extension for files that contain both the Key and the server Certificate (Some servers need this). Permissions should be restrictive on these files.</li>
<li><strong>CRL</strong> &#8211; Certificate Revokation List (This can be publicly distributed)</li>
</ul>
<h4>Create the CA Certificate and Key</h4>
<p>Now, that all initial configuration is done, we may create a self-signed certificate, that will be used as our CA’s certificate. In other words, we will use this to sign other certificate requests.</p>
<p>Change to our CA’s directory. <span style="text-decoration: underline">This is where we should issue all the openssl commands because here is our openssl’s configuration file (openssl.my.cnf).</span> As root:</p>
<pre># cd /etc/pki_jungle/myCA/</pre>
<p>And then create your CA’s Certificate and Private Key. As root:</p>
<pre># openssl req -config openssl.my.cnf -new -x509 -extensions v3_ca -keyout private/myca.key -out certs/myca.crt -days 1825</pre>
<p>This creates a self-signed certificate with the default CA extensions which is valid for 5 years. You will be prompted for a <strong>passphrase</strong> for your CA’s private key. <span style="text-decoration: underline">Be sure that you set a strong passphrase.</span> Then you will need to provide some info about your CA. Fill in whatever you like. Here is an example:</p>
<pre>Country Name (2 letter code) [GB]:GR
State or Province Name (full name) [Berkshire]:Greece
Locality Name (eg, city) [Newbury]:Thessaloniki
Organization Name (eg, company) [My Company Ltd]:My Network
Organizational Unit Name (eg, section) []:My Certificate Authority
Common Name (eg, your name or your server's hostname) []:server.example.com
Email Address []:whatever@server.example.com</pre>
<p>Two files are created:</p>
<ul>
<li><strong>certs/myca.crt</strong> &#8211; This is your CA’s certificate and can be publicly available and of course world readable.</li>
<li><strong>private/myca.key</strong> &#8211; This is your CA’s private key. Although it is protected with a passphrase you should restrict access to it, so that only root can read it:
<pre># chmod 0400 /etc/pki_jungle/myCA/private/myca.key</pre>
</li>
</ul>
<h4>More openssl configuration (mandatory)</h4>
<p>Because we use a custom directory for our certificates’ management, some modifications to <strong>/etc/pki_jungle/myCA/openssl.my.cnf</strong> are necessary. Open it in your favourite text editor as root and find the following part (around line 35):</p>
<pre>[ CA_default ]

dir     = ../../CA      # Where everything is kept
certs       = $dir/certs        # Where the issued certs are kept
crl_dir     = $dir/crl      # Where the issued crl are kept
database    = $dir/index.txt    # database index file.
#unique_subject = no            # Set to 'no' to allow creation of
                    # several ctificates with same subject.
new_certs_dir   = $dir/newcerts     # default place for new certs.

certificate = $dir/cacert.pem   # The CA certificate
serial      = $dir/serial       # The current serial number
#crlnumber  = $dir/crlnumber    # the current crl number must be
                    # commented out to leave a V1 CRL
crl     = $dir/crl.pem      # The current CRL
private_key = $dir/private/cakey.pem    # The private key
RANDFILE    = $dir/private/.rand    # private random number file

x509_extensions = usr_cert      # The extentions to add to the cert</pre>
<p>You should modify the following settings in order to coform to our custom directory and our custom CA key and certificate:</p>
<pre>[ CA_default ]

dir     = <strong>.</strong>                # <strong>&lt;--CHANGE THIS</strong>
certs       = $dir/certs
crl_dir     = $dir/crl
database    = $dir/index.txt
#unique_subject = no

new_certs_dir   = $dir/newcerts

certificate = $dir/<strong>certs/myca.crt</strong>   # <strong>&lt;--CHANGE THIS</strong>
serial      = $dir/serial
#crlnumber  = $dir/crlnumber

crl     = $dir/crl.pem
private_key = $dir/private/<strong>myca.key</strong>    # <strong>&lt;--CHANGE THIS</strong>
RANDFILE    = $dir/private/.rand

x509_extensions = usr_cert</pre>
<h4>Create a Server certificate</h4>
<p>Further openssl.my.cnf file’s customization is possible, so that we define our policy for certificate creation and signing or define our desired extensions for the new certificates. I may add this info to a future version of this document. It’s easy though, just try to familiarize yourself with the openssl.cnf’s structure and you’ll figure it out.</p>
<p>Anyway, the certificates we are going to create, without customizing openssl.my.cnf any further, are <strong>general purpose certificates</strong> and their usage in not restricted to server authentication only. One thing that you should take a note of is that <strong>the private keys will not be protected by a passphrase</strong>, so that when the services are restarted they do not ask for a passphrase. This means that you should <strong>set restrictive permissions on the private keys</strong>, so that only root or the user under whose priviledges a server runs can read these files.</p>
<h5>Generate a Certificate Request</h5>
<p>First, we change to our CA’s directory:</p>
<pre># cd /etc/pki_jungle/myCA/</pre>
<p>Then we create the certificate request:</p>
<pre># openssl req -config openssl.my.cnf -new -nodes -keyout private/server.key -out server.csr -days 365</pre>
<p>The <strong>-nodes</strong> option is needed so that the private key is not protected with a passphrase. If you do not intend to use the certificate for server authentication, you should not include it in the above command.<br />
You can customize the number of days you want this certificate to be valid for.</p>
<p>You will be prompted for the certificate’s info. Here is an example:</p>
<pre>Country Name (2 letter code) [GB]:GR
State or Province Name (full name) [Berkshire]:Greece
Locality Name (eg, city) [Newbury]:Thessaloniki
Organization Name (eg, company) [My Company Ltd]:My Network
Organizational Unit Name (eg, section) []:My Web Server
Common Name (eg, your name or your server's hostname) []:www.server.example.com
Email Address []:whatever@server.example.com</pre>
<p>The <strong>Common Name (CN)</strong> is the info that uniquely distinguishes your service, so be sure that you type it correctly.</p>
<p>When prompted for some extra attributes (challenge password, optional company name) just hit the [Enter] key.<br />
Two files are created:</p>
<ul>
<li><strong>server.csr</strong> &#8211; this is the certificate request.</li>
<li><strong>private/server.key</strong> &#8211; this is the private key, which is not protected with a passphrase.</li>
</ul>
<p>Set restrictive permissions on the private key. Only root or the user that is used to run the server should be able to read it. For example:</p>
<pre># chown root.root /etc/pki_jungle/myCA/private/server.key
# chmod 0400 /etc/pki_jungle/myCA/private/server.key</pre>
<p>Or:</p>
<pre># chown root.apache /etc/pki_jungle/myCA/private/server.key
# chmod 0440 /etc/pki_jungle/myCA/private/server.key</pre>
<h5>Sign the Certificate Request</h5>
<p>Now we are going to sign the certificate request and generate the server’s certificate.</p>
<p>First, we change to our CA’s directory:</p>
<pre># cd /etc/pki_jungle/myCA/</pre>
<p>Then we sign the certificate 
