<?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>Imthiaz Blog &#187; Linux</title>
	<atom:link href="http://imthi.com/blog/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://imthi.com</link>
	<description>me and stupid works....!!!</description>
	<lastBuildDate>Fri, 19 Aug 2011 21:04:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Apache Log Format for Amazon EC2 with Elastic Load Balancer</title>
		<link>http://imthi.com/blog/linux/apache-log-format-for-amazon-ec2-with-elastic-load-balancer.php</link>
		<comments>http://imthi.com/blog/linux/apache-log-format-for-amazon-ec2-with-elastic-load-balancer.php#comments</comments>
		<pubDate>Mon, 20 Jun 2011 19:04:31 +0000</pubDate>
		<dc:creator>Imthiaz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[ec2]]></category>

		<guid isPermaLink="false">http://imthi.com/?p=1618</guid>
		<description><![CDATA[The journey through the Amazon Cloud (AWS) is quite amazing. Recently I had to use two EC2 instance with Elastic Load balancer. Once the website was served with load balancer only the load balancer IP was logged as remote IP. After Googling for few hour and with trial and error method I got the correct [...]]]></description>
			<content:encoded><![CDATA[
<p>The journey through the Amazon Cloud (<a href="http://imthi.in/oItvOD">AWS</a>) is quite amazing. Recently I had to use two EC2 instance with Elastic Load balancer. Once the website was served with load balancer only the load balancer IP was logged as remote IP. </p>
<p>After Googling for few hour and with trial and error method I got the correct Apache log format so that the real remote IP is logged.</p>
<p>I created a custom log format with a name “<strong>combined_new</strong>” and used it in all the virtual host configured in Apache. But you can use the format however you want.</p>
<pre class="brush: plain; title: ; notranslate">
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "\"%{X-Forwarded-For}i\" %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_new
#....

#...
#
# START_HOST example.com
&lt;VirtualHost *:80&gt;
	ServerName example.com
	DocumentRoot "/var/www/example.com/html"
	&lt;Directory "/var/www/example.com/html"&gt;
		Options Includes FollowSymLinks
		AllowOverride All
		Order allow,deny
		Allow from all
	&lt;/Directory&gt;
	CustomLog /var/www/logs/example.com/access_log combined_new
	ErrorLog /var/www/logs/example.com/error_log
&lt;/VirtualHost&gt;
# END_HOST example.com
</pre>
<p>Before you make any changes to httpd.conf please go through <a href="http://imthi.in/ndNak6">Apache log module</a>. </p>
<p>I hope this small tip helps <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_wink.gif" alt=";-)" class="wp-smiley"></p>
<blockquote><p>Note: Always backup your original httpd.conf before you make any changes.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://imthi.com/blog/linux/apache-log-format-for-amazon-ec2-with-elastic-load-balancer.php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Download &amp; Process Amazon Cloudfront Logs with Awstats</title>
		<link>http://imthi.com/blog/linux/download-process-amazon-cloudfront-logs-with-awstats.php</link>
		<comments>http://imthi.com/blog/linux/download-process-amazon-cloudfront-logs-with-awstats.php#comments</comments>
		<pubDate>Fri, 10 Jun 2011 23:01:40 +0000</pubDate>
		<dc:creator>Imthiaz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[cloud]]></category>

		<guid isPermaLink="false">http://imthi.com/?p=1604</guid>
		<description><![CDATA[These days we use Amazon Cloudfront for content delivery. Amazon has made it very easy to deliver files in a Amazon Simple Storage Service (S3) bucket using Amazon Cloudfront distribution. If you are using Cloudfront as Content Delivery Network (CDN) your next task will be monitoring the usage. For this Amazon Cloudfront has a provision [...]]]></description>
			<content:encoded><![CDATA[
<p>These days we use <a href="http://imthi.in/qgscPP">Amazon Cloudfront</a> for content delivery. Amazon has made it very easy to deliver files in a <a href="http://imthi.in/n0Cblg">Amazon Simple Storage Service</a> (S3) bucket using Amazon Cloudfront distribution. If you are using Cloudfront as Content Delivery Network (CDN) your next task will be monitoring the usage. For this Amazon Cloudfront has a provision to store access logs to a S3 bucket. My hurdle was to process the log files stored by Cloudfront. For sites hosted with apache I use <a href="http://imthi.in/r61WT2">Awstats</a> for reading the logs. So my vote was for awstats. Please follow the steps one by one <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_wink.gif" alt=";-)" class="wp-smiley"></p>
<p>1. Need to download the log files stored in the S3 bucket. For this I had to use the a python script done by <a href="http://bit.ly/k3bDb5">wpstorm.net</a> but I had to make some modification so that it worked for me. Please follow the <a href="http://bit.ly/k3bDb5">blog post</a> if you need any help setting up the required libraries.</p>
<p>get-aws-logs.py</p>
<pre class="brush: python; title: ; notranslate">#! /usr/bin/env python
"""Download and delete log files for AWS S3 / CloudFront

Usage: python get-aws-logs.py [options]

Options:
  -b ..., --bucket=...    AWS Bucket
  -p ..., --prefix=...    AWS Key Prefix
  -a ..., --access=...    AWS Access Key ID
  -s ..., --secret=...    AWS Secret Access Key
  -l ..., --local=...     Local Download Path
  -h, --help              Show this help
  -d                      Show debugging information while parsing

Examples:
  get-aws-logs.py -b eqxlogs
  get-aws-logs.py --bucket=eqxlogs
  get-aws-logs.py -p logs/cdn.example.com/
  get-aws-logs.py --prefix=logs/cdn.example.com/

This program requires the boto module for Python to be installed.
"""

__author__ = "Johan Steen (http://www.artstorm.net/)"
__version__ = "0.5.0"
__date__ = "28 Nov 2010"

import boto
import getopt
import sys, os
from boto.s3.key import Key

_debug = 0

class get_logs:
    """Download log files from the specified bucket and path and then delete them from the bucket.
    Uses: http://boto.s3.amazonaws.com/index.html
    """
    # Set default values
    AWS_BUCKET_NAME = '{AWS_BUCKET_NAME}'
    AWS_KEY_PREFIX = ''
    AWS_ACCESS_KEY_ID = '{AWS_ACCESS_KEY_ID}'
    AWS_SECRET_ACCESS_KEY = '{AWS_SECRET_ACCESS_KEY}'
    LOCAL_PATH = '/tmp'
    # Don't change below here
    s3_conn = None
    bucket = None
    bucket_list = None

    def __init__(self):
        s3_conn = None
        bucket_list = None
        bucket = None

    def start(self):
        """Connect, get file list, copy and delete the logs"""
        self.s3Connect()
        self.getList()
        self.copyFiles()

    def s3Connect(self):
        """Creates a S3 Connection Object"""
        self.s3_conn = boto.connect_s3(self.AWS_ACCESS_KEY_ID, self.AWS_SECRET_ACCESS_KEY)

    def getList(self):
        """Connects to the bucket and then gets a list of all keys available with the chosen prefix"""
        self.bucket = self.s3_conn.get_bucket(self.AWS_BUCKET_NAME)
        self.bucket_list = self.bucket.list(self.AWS_KEY_PREFIX)

    def copyFiles(self):
        """Creates a local folder if not already exists and then download all keys and deletes them from the bucket"""
        # Using makedirs as it's recursive
        if not os.path.exists(self.LOCAL_PATH):
            os.makedirs(self.LOCAL_PATH)
        for key_list in self.bucket_list:
            key = str(key_list.key)
            # Get the log filename (L[-1] can be used to access the last item in a list).
            filename = key.split('/')[-1]
            # check if file exists locally, if not: download it
            if not os.path.exists(self.LOCAL_PATH+filename):
                key_list.get_contents_to_filename(self.LOCAL_PATH+filename)
                print "Downloaded				"+filename
            # check so file is downloaded, if so: delete from bucket
            if os.path.exists(self.LOCAL_PATH+filename):
                key_list.copy(self.bucket,'archive/'+key_list.key)
                print "Moved					"+filename
                key_list.delete()
                print "Deleted					"+filename

def usage():
    print __doc__

def main(argv):
    try:
        opts, args = getopt.getopt(argv, "hb:p:l:a:s:d", ["help", "bucket=", "prefix=", "local=", "access=", "secret="])
    except getopt.GetoptError:
        usage()
        sys.exit(2)
    logs = get_logs()
    for opt, arg in opts:
        if opt in ("-h", "--help"):
            usage()
            sys.exit()
        elif opt == '-d':
            global _debug
            _debug = 1
        elif opt in ("-b", "--bucket"):
            logs.AWS_BUCKET_NAME = arg
        elif opt in ("-p", "--prefix"):
            logs.AWS_KEY_PREFIX = arg
        elif opt in ("-a", "--access"):
            logs.AWS_ACCESS_KEY_ID = arg
        elif opt in ("-s", "--secret"):
            logs.AWS_SECRET_ACCESS_KEY = arg
        elif opt in ("-l", "--local"):
            logs.LOCAL_PATH = arg
    logs.start()

if __name__ == "__main__":
    main(sys.argv[1:])
</pre>
<blockquote><p><strong>Note: </strong>The above script will download the s3 logs to specified folder. Please make sure you put your Amazon access keys.</p></blockquote>
<p>2. Now we have bash script which will uses the above python script to download the log files and combine all of them into a single log file and then it will be analyzed by awstats. </p>
<blockquote><p><strong>Warning:</strong> Please read through the script files and make necessary changes needed.<br><strong>Note:</strong> You should have awstats installed on your system. The bellow script uses <a href="http://imthi.in/r61WT2">awstats</a>.<br><strong>Note:</strong> You can download the script files at the end of this blog post where awstats configuration with custom setup for cloudfront log format is also provided.</p></blockquote>
<p>get-aws-logs.sh</p>
<pre class="brush: bash; title: ; notranslate">#!/bin/bash
# Initial, cron script to download and merge AWS logs
# 29/11 - 2010, Johan Steen

# 1. Setup variables
date=`date +%Y-%m-%d`
static_folder="/tmp/log_static_$date/"

mkdir -pv $static_folder
python /var/www/scripts/get-aws-logs.py --prefix=logs/www.imthi.com --local=$static_folder
gunzip --quiet  ${static_folder}*

/usr/local/awstats/tools/logresolvemerge.pl ${static_folder}* | sed -r -e 's/([0-9]{4}-[0-9]{2}-[0-9]{2})\t([0-9]{2}:[0-9]{2}:[0-9]{2})/\1 \2/g'  &gt;&gt; /var/www/logs/www.imthi.com.log

rm -vrf $static_folder
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=imthi -update
</pre>
<p>I would suggest you to test run the above scripts on a staging / testing environment before moving to a production. Again please change the scripts with your domain details and Amazon access keys.</p>
<p><a href="http://cdn.imthi.com/18ecfe/wp-content/uploads/2011/06/log_scripts.zip">Download the scripts to download and process Amazon Cloudfront Logs with Awstats.</a></p>
<p>Have a nice journey exploring the cloud <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_wink.gif" alt=";-)" class="wp-smiley"></p>
]]></content:encoded>
			<wfw:commentRss>http://imthi.com/blog/linux/download-process-amazon-cloudfront-logs-with-awstats.php/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>UAE lug meetup group featured on homepage</title>
		<link>http://imthi.com/blog/linux/uae-lug-meetup-group-featured-on-homepage.php</link>
		<comments>http://imthi.com/blog/linux/uae-lug-meetup-group-featured-on-homepage.php#comments</comments>
		<pubDate>Thu, 03 Sep 2009 07:24:57 +0000</pubDate>
		<dc:creator>Imthiaz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[meetup]]></category>
		<category><![CDATA[uaelug]]></category>

		<guid isPermaLink="false">http://imthi.com/?p=1226</guid>
		<description><![CDATA[Looks good to see our Linux user group being featured on meetup website homepage. Way to go guys and thanks to all the member who took so much effort to make this group an active one. They must have liked Alexander picture very much LOL !!!]]></description>
			<content:encoded><![CDATA[
<p>Looks good to see our <a href="http://imthi.in/psCOBz">Linux user group</a> being featured on <a href="http://imthi.in/oXr8Rw">meetup website</a> homepage. Way to go guys and thanks to all the member who took so much effort to make this group an active one.</p>
<p><a href="http://imthi.in/nzSz6C"><img src="http://cdn.imthi.com/18ecfe/wp-content/uploads/2009/09/UAE-lug-meetup-group-featured-on-homepage.png" alt="UAE lug meetup group featured on homepage" title="UAE lug meetup group featured on homepage" width="628" height="501" class="aligncenter size-full wp-image-1228"></a></p>
<p>They must have liked <a href="http://imthi.in/pMAjSd">Alexander</a> picture very much  LOL !!! <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_wink.gif" alt=";-)" class="wp-smiley"></p>
]]></content:encoded>
			<wfw:commentRss>http://imthi.com/blog/linux/uae-lug-meetup-group-featured-on-homepage.php/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ubuntu 9.04 remote desktop using vncserver without monitor</title>
		<link>http://imthi.com/blog/linux/ubuntu-904-remote-desktop-using-vncserver-without-monitor.php</link>
		<comments>http://imthi.com/blog/linux/ubuntu-904-remote-desktop-using-vncserver-without-monitor.php#comments</comments>
		<pubDate>Sat, 18 Apr 2009 20:38:17 +0000</pubDate>
		<dc:creator>Imthiaz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://imthi.com/?p=1046</guid>
		<description><![CDATA[Only few more days for Ubuntu team to release 9.04 but I couldn’t wait so I downloaded RC version and installed on torrent download server . The task is to install the ubuntu 9.04 RC and to completely manage the server remotely. The installation was completely smooth and there was no issues. The installation completely [...]]]></description>
			<content:encoded><![CDATA[
<p>Only few more days for Ubuntu team to release 9.04 but I couldn’t wait so I downloaded RC version and installed on torrent download server <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_wink.gif" alt=";-)" class="wp-smiley">  . The task is to install the ubuntu 9.04 RC and to completely manage the server remotely. The installation was completely smooth and there was no issues. The installation completely detected all the hardware and everything worked perfectly like a dream come true.</p>
<p>Next step is to install secure shell <a href="http://imthi.in/qucNB3">ssh</a>.<br><code><br>
#sudo apt-get install ssh<br></code><br>
Ubuntu comes with remote desktop manager. I tested the same and it would not work when there is no monitor connected to the system. I tried different methods and nothing worked out for me. So I decided to ditch the built in remote desktop and installed vncserver.<br><code><br>
#sudo apt-get install vnc4server<br></code><br>
After it is installed you should be logged as normal user and not root.<br><code><br>
#vncserver :1 -geometry 1024x768 -depth 16<br></code><br>
Once you issue the above command it will prompt for password. This password will be used for connecting to the server. Once it is complete we can change the setting for the server. Before we do that we have to kill the server.<br><code><br>
#vncserver -kill :1<br></code><br>
The configuration is kept in the file /home/userxx/.vnc/xstartup I edited this file so that I can start the server with gnome. My file looks exactly like below.<br><code><br>
#!/bin/sh</code></p>
<p># Uncomment the following two lines for normal desktop:<br>
unset SESSION_MANAGER<br>
# exec /etc/X11/xinit/xinitrc</p>
<p>gnome-session &amp;</p>
<p>[ -x /etc/vnc/xstartup ] &amp;&amp; exec /etc/vnc/xstartup<br>
[ -r $HOME/.Xresources ] &amp;&amp; xrdb $HOME/.Xresources<br>
xsetroot -solid grey<br>
vncconfig -iconic &amp;<br>
# xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &amp;<br>
twm &amp;<br><br>
Now everything is done. All you have to do is to restart the system which is good for the setting to work properly. One you have restarted please start the vnc server.<br><code><br>
#vncserver<br></code><br>
I used <a href="http://imthi.in/pNRYUE">chicken of the vnc</a> to connect from mac.<br><img src="http://cdn.imthi.com/18ecfe/wp-content/uploads/2009/04/chicken-of-the-vnc-connection-setup.png" alt="chicken-of-the-vnc-connection-setup" title="chicken-of-the-vnc-connection-setup" width="523" height="319" class="aligncenter size-full wp-image-1053"><br>
After connecting you get gnome session which you can keep it alive even if the chicken vnc is closed.<br><a href="http://cdn.imthi.com/18ecfe/wp-content/uploads/2009/04/gnome-session-using-remote-desktop.png" rel="lightbox[1046]" title="gnome-session-using-remote-desktop"><img src="http://cdn.imthi.com/18ecfe/wp-content/uploads/2009/04/gnome-session-using-remote-desktop-300x229.png" alt="gnome-session-using-remote-desktop" title="gnome-session-using-remote-desktop" width="300" height="229" class="aligncenter size-medium wp-image-1055"></a><br>
Now all set and I don’t want my server to start gnome session during boot. To avoid that I have to disable gdm server.<br><a href="http://cdn.imthi.com/18ecfe/wp-content/uploads/2009/04/gnome-service-manager.png" rel="lightbox[1046]" title="gnome-service-manager"><img src="http://cdn.imthi.com/18ecfe/wp-content/uploads/2009/04/gnome-service-manager.png" alt="gnome-service-manager" title="gnome-service-manager" width="447" height="427" class="aligncenter size-full wp-image-1057"></a><br>
That’s all folks have a nice day <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_wink.gif" alt=";-)" class="wp-smiley"></p>
<p>Update: Amy Rinehart from <a href="http://imthi.in/nkap7I">remotedesktopmac.com</a> has done a great <a href="http://imthi.in/oqlxxD">comparison chart for remote desktop softwares</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://imthi.com/blog/linux/ubuntu-904-remote-desktop-using-vncserver-without-monitor.php/feed</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Compile and install PHP 5.2.8 on Mac OS X 10.5.6 (Leopard)</title>
		<link>http://imthi.com/blog/linux/compile-and-install-php-528-on-mac-os-x-1056-leopard.php</link>
		<comments>http://imthi.com/blog/linux/compile-and-install-php-528-on-mac-os-x-1056-leopard.php#comments</comments>
		<pubDate>Mon, 23 Feb 2009 20:51:03 +0000</pubDate>
		<dc:creator>Imthiaz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://imthi.com/?p=909</guid>
		<description><![CDATA[Due to some limitation I faced with Xampp I finally decided to compile PHP5 native on my mac. Entropy was a best option for mac till Leopard was released. Since Leopard came with php built in entropy was no more available. After Googling for a long time and breaking my head with errors for 7 [...]]]></description>
			<content:encoded><![CDATA[
<p>Due to some limitation I faced with <a href="http://imthi.in/q2f2c2" title="apache friends - xampp for macos x">Xampp</a> I finally decided to compile PHP5 native on my mac. <a href="http://imthi.in/ow33Zb" title="Marc Liyanage - Software - Mac OS X Packages - PHP">Entropy</a> was a best option for mac till Leopard was released. Since Leopard came with php built in entropy was no more available. After Googling for a long time and breaking my head with errors for 7 long hours I finally got it working perfectly like how I wanted it. These are some of the steps I followed to compile the same. I tested the same steps in 2 macs and it was working fine. I cannot guarantee that these steps would work for everyone. </p>
<p><strong>Step 1</strong></p>
<p>You need to have Xcode installed on your mac. In my case I had Xcode 3.1.2 installed. You can install from your Leopard DVD or you can install iPhone SDK.</p>
<p><strong>Step 2</strong></p>
<p>Download and install the <a href="http://imthi.in/p4Cw5q" title="MySQL ::  MySQL 5.1 Downloads — Generally Available (GA) release for production use">latest</a> <a href="http://imthi.in/pyY8Kb" title="MySQL ::  The world's most popular open source database">Mysql</a> database server.</p>
<p><strong>Step 3</strong></p>
<p>Install <a href="http://imthi.in/r5RQof" title="Fink - Home">Fink</a>. You can download the version 0.9.0 which I used for compiling from <a href="http://imthi.in/pooqqM" title="SourceForge.net: Fink: Downloading ...">here</a>. Once you have installed open terminal and issue the following commands.<br><code><br>
# sudo fink selfupdate<br>
# sudo fink update-all</code></p>
<p>The above two commands will update the needed files for fink library to work properly. Once this is done you can install needed libraries for php by issuing the following command<br><code><br>
# sudo fink install libjpeg libtiff libpng3 libxml t1lib5 libmcrypt libmhash mysql15-dev curl wget</code></p>
<p><strong>Step 4</strong> </p>
<p>Install FrontBase if it is needed for you. It is installer file you can download it from <a href="http://imthi.in/pdjjZw" title="Frontbase">here</a>. If you don’t want to use this database system you can remove the option ‘–with-fbsql’ from the php configure command.</p>
<p><strong>Step 5</strong></p>
<p>Install <a href="http://imthi.in/pk1Fq3" title="FreeTDS.org">Freetds</a> if you want use <a href="http://imthi.in/quDO1M" title="SQL Server 2008 Overview, data platform, store data | Microsoft">MS-SQL</a> in PHP5.<br><code><br>
# sudo su<br>
# curl -O http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz<br>
# tar xvzf freetds-stable.tgz<br>
# cd freetds-0.82/<br>
# ./configure &amp;&amp; make &amp;&amp; sudo make install</code></p>
<p>Incase if you feel this is not needed for your installation you can remove the option ‘–with-mssql’ and ‘–enable-dbase’ from the php configure command.</p>
<p><strong>Step 6</strong></p>
<p>Install Imap Client libraries files. You need this lib to be installed if you wish to compile imap. If you don’t want you can remove the option ‘–with-imap’ and ‘–with-imap-ssl’. Further reading on this topic visit <a href="http://imthi.in/pdkkZe">here</a>.<br><code><br>
# sudo su<br>
# curl -O ftp://ftp.cac.washington.edu/imap/c-client.tar.Z<br>
# tar xvzf c-client.tar.Z<br>
# cd imap-2007e/<br>
# make oxp<br>
# cd c-client/<br>
# cp *.h /usr/local/include<br>
# cp *.c /usr/local/lib<br>
# cp c-client.a /usr/local/lib/libc-client.a</code></p>
<p><strong>Step 7</strong></p>
<p>Install <a href="http://imthi.in/pYvKHF" title="gettext - GNU Project - Free Software Foundation (FSF)">gettext</a>. This is a must for lot of open source projects and for localization.<br><code><br>
# sudo su<br>
# curl -O ftp://ftp.gnu.org/gnu/gettext/gettext-0.17.tar.gz<br>
# tar xvzf gettext-0.17.tar.gz<br>
# cd gettext-0.17<br>
# cd gettext-tools/<br>
# ./configure<br>
# make<br>
# make install</code></p>
<p><strong>Step 8</strong></p>
<p>Install <a href="http://imthi.in/ppfbJP" title="The FreeType Project">freetype</a>. You need if you wish to load free type fonts in GD.<br><code><br>
#sudo su<br>
# wget http://mirrors.zerg.biz/nongnu/freetype/freetype-2.3.8.tar.gz<br>
# tar xvzf freetype-2.3.8.tar.gz<br>
# cd freetype-2.3.8<br>
# ./configure<br>
# make<br>
# make install</code></p>
<p><strong>Step 9</strong></p>
<p>I think we are pretty there and now it is time to compile the big boss the PHP itself.<br><code><br>
# sudo su<br>
# wget http://www.php.net/get/php-5.2.8.tar.gz/from/in.php.net/mirror<br>
# tar xvzf php-5.2.8.tar.gz<br>
# cd php-5.2.8<br>
# ./configure --prefix=/usr/local/php5.2.8 --with-apxs2 --with-config-file-scan-dir=/usr/local/php5.2.8/php.d --with-openssl=/usr --with-zlib=/usr --with-gd --enable-gd-native-ttf --with-jpeg-dir=/sw  --with-jpeg-dir=/sw --with-png-dir=/sw --with-zlib-dir=/usr --with-ldap --with-xmlrpc --with-iconv-dir=/usr --with-snmp=/usr --enable-exif  --enable-soap  --enable-ftp --enable-sockets --enable-mbstring --enable-calendar --enable-bcmath --with-bz2=/usr --with-curl --with-kerberos=/usr  --with-libxml-dir=/sw --with-xsl --with-t1lib=/sw  --with-mcrypt=/sw --with-mhash=/sw --with-mysql=/sw --with-mysqli --with-pdo-mysql=/sw  --enable-zip  --with-imap --with-imap-ssl --with-gettext  --with-curl=/sw  --with-pear --with-regex --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-iconv=shared,/opt/local  --enable-dbase --enable-sqlite-utf8 --with-fbsql<br>
# make<br>
# make install</code></p>
<p>If you have completed till the above step without any error means that you have successfully installed PHP5. If you restart your apache server from system settings the server might not work for you. Since it might conflict a bit due to various architecture problems in apache and php build. To over come this issue you need to re-compile apache. You can do it by issuing the following commands. Further reading on this <a href="http://imthi.in/nB2P2O">issue</a>.</p>
<p><strong>Step 10</strong> </p>
<p>Recompile <a href="http://imthi.in/qTjQsH">Apache 2</a>.<br><code><br>
# sudo su<br>
# wget http://apache.siamwebhosting.com/httpd/httpd-2.2.11.tar.gz<br>
# tar xvzf httpd-2.2.11.tar.gz<br>
# cd httpd-2.2.11/<br>
# ./configure --enable-layout=Darwin --enable-mods-shared=all<br>
# make<br>
# make install</code></p>
<p><a href="http://cdn.imthi.com/18ecfe/wp-content/uploads/2009/02/screenshot1.png" rel="lightbox[909]" title="screenshot1"><img src="http://cdn.imthi.com/18ecfe/wp-content/uploads/2009/02/screenshot1-150x150.png" alt="screenshot1" title="screenshot1" width="150" height="150"></a><a href="http://cdn.imthi.com/18ecfe/wp-content/uploads/2009/02/screenshot2.png" rel="lightbox[909]" title="screenshot2"><img src="http://cdn.imthi.com/18ecfe/wp-content/uploads/2009/02/screenshot2-150x150.png" alt="screenshot2" title="screenshot2" width="150" height="150"></a></p>
<p>Once everything is done you should be able to run PHP. Have fun compiling your own native PHP on your mac <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_wink.gif" alt=";-)" class="wp-smiley">  .!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://imthi.com/blog/linux/compile-and-install-php-528-on-mac-os-x-1056-leopard.php/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Fedora 9 Sulphur on VMware Fusion</title>
		<link>http://imthi.com/blog/linux/fedora-9-sulphur-on-vmware-fusion.php</link>
		<comments>http://imthi.com/blog/linux/fedora-9-sulphur-on-vmware-fusion.php#comments</comments>
		<pubDate>Fri, 16 May 2008 08:26:51 +0000</pubDate>
		<dc:creator>Imthiaz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://imthi.com/?p=552</guid>
		<description><![CDATA[I have been always a very big fan on Fedora Linux distribution. In recent times I have moved very much into Ubuntu. Three days back Fedora team had released the new version 9 named sulphur. I really wanted to test it how well it is working with VMware. So the hunt began. Downloaded the i686 [...]]]></description>
			<content:encoded><![CDATA[
<p>I have been always a very big fan on Fedora Linux distribution. In recent times I have moved very much into Ubuntu. Three days back Fedora team had released the new version 9 named sulphur. I really wanted to test it how well it is working with VMware. So the hunt began.</p>
<p>Downloaded the i686 DVD version and started the installation. In VMware OS list there was no fedora so I had to select red hat Linux as option. The installation went very smooth and no issues or error. I felt the installater was little heavy when compared to Ubuntu installation.</p>
<p>Fedora booted up well and detected most of the hardware of VMware. But It was not as smooth as Ubuntu was on VMware.</p>
<p style="text-align: center;"><a rel="lightbox" href="http://cdn.imthi.com/18ecfe/wp-content/uploads/2008/05/fedora-9-sulphur-on-vmware-fusion.png" title="Fedora 9 Sulphur on VMware Fusion"><img class="alignnone size-medium wp-image-553 aligncenter" title="Fedora 9 Sulphur on VMware Fusion" src="http://cdn.imthi.com/18ecfe/wp-content/uploads/2008/05/fedora-9-sulphur-on-vmware-fusion-300x253.png" alt="" width="300" height="253"></a></p>
<p>I heard there is lot of improvement and enhancements. But Ubuntu is very far ahead when it comes to Desktop Linux. I prefer sticking with Ubuntu than Fedora sulphur <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_biggrin.gif" alt=":D" class="wp-smiley"></p>
]]></content:encoded>
			<wfw:commentRss>http://imthi.com/blog/linux/fedora-9-sulphur-on-vmware-fusion.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BSD, SSH and PHP on my iPhone</title>
		<link>http://imthi.com/blog/linux/bsd-ssh-and-php-on-my-iphone.php</link>
		<comments>http://imthi.com/blog/linux/bsd-ssh-and-php-on-my-iphone.php#comments</comments>
		<pubDate>Tue, 13 Nov 2007 22:08:11 +0000</pubDate>
		<dc:creator>Imthiaz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://imthi.com/blog/linux/bsd-ssh-and-php-on-my-iphone.php</guid>
		<description><![CDATA[Tonight I installed BSD system on my iPhone. Once that is complete I installed openSSH, Term-vt100. I opened terminal and changed my root password using the command passwd. I found the ip of the iPhone using the command ifconfig. Latter I was able to connect to the iPhone using ssh from my laptop . I [...]]]></description>
			<content:encoded><![CDATA[
<p>Tonight I installed BSD system on my iPhone. Once that is complete I installed openSSH, Term-vt100. I opened terminal and changed my root password using the command passwd.</p>
<p>I found the ip of the iPhone using the command ifconfig. Latter I was able to connect to the iPhone using ssh from my laptop <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_wink.gif" alt=";-)" class="wp-smiley"> . I was even able to ftp files to my iphone over SSH.</p>
<p>I Installed apache, php edited httpd.conf and I was able to run php scripts from my iPhone. It has all the basic modules that is needed to write a simple powerful application with sqlite. Taken a screenshot too <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_wink.gif" alt=";-)" class="wp-smiley"></p>
<p style="text-align: center"><img src="http://cdn.imthi.com/18ecfe/wp-content/uploads/2007/11/php_iphone.png" alt="BSD, SSH and PHP on my iPhone"></p>
<p>Wow this gadget is really amazing <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_biggrin.gif" alt=":-D" class="wp-smiley"></p>
]]></content:encoded>
			<wfw:commentRss>http://imthi.com/blog/linux/bsd-ssh-and-php-on-my-iphone.php/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Fedora Core 8 on Lenovo 3000</title>
		<link>http://imthi.com/blog/linux/fedora-core-8-on-lenovo-3000.php</link>
		<comments>http://imthi.com/blog/linux/fedora-core-8-on-lenovo-3000.php#comments</comments>
		<pubDate>Sat, 10 Nov 2007 12:05:07 +0000</pubDate>
		<dc:creator>Imthiaz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[lenovo]]></category>

		<guid isPermaLink="false">http://imthi.com/blog/linux/fedora-core-8-on-lenovo-3000.php</guid>
		<description><![CDATA[We got a brand new IBM Lenovo laptop without any operating system installed. These days most of the new laptops comes with Windows Vista installed and which sucks majorly. Then we decided we will install Linux on the laptop for a difference. Then I installed Ubuntu 7.10 on it and it worked perfect. The live [...]]]></description>
			<content:encoded><![CDATA[
<p>We got a brand new IBM Lenovo laptop without any operating system installed. These days most of the new laptops comes with Windows Vista installed and which sucks majorly. Then we decided we will install Linux on the laptop for a difference. Then I installed Ubuntu 7.10 on it and it worked perfect. The live cd was able to detect all the hardware on a single go.</p>
<p>I am such a fan of fedora and wanted to test fedora so checked out the website it had new release fedora 8 werewolf. It had live cd so downloaded it and tested on the laptop. To my surprise even fedora live cd detected everything. So reinstalled the laptop operating system with fedora 8.</p>
<p>I installed all the need software using yum as usual <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_wink.gif" alt=";-)" class="wp-smiley">  . Then I installed the Quake 3 and wanted burn test my laptop for performance. I opened couple of movies, music player and quake running auto demo on 800×600. The processor usage was around 90 to 95%. Everything worked amazing fast and in another workspace I was able to do normal installation and browsing. I ran the test for more than 3 hours and the laptop temperature was so normal. No overheating and no issues. I was totally amazed by the laptop performance over Linux.</p>
<p><a href="http://cdn.imthi.com/18ecfe/wp-content/uploads/2007/11/fedora-8-lenovo.png" rel="lightbox" title="Fedora Core 8 on Lenovo 3000"><img src="http://cdn.imthi.com/18ecfe/wp-content/uploads/2007/11/fedora-8-lenovo.thumbnail.png" alt="Fedora Core 8 on Lenovo 3000" border="0"></a></p>
<p>I am really happy to see such a stable fedora core which is now capable of detected all hardware. Lenovo laptop performance was amazingly superb <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_biggrin.gif" alt=":-D" class="wp-smiley"></p>
]]></content:encoded>
			<wfw:commentRss>http://imthi.com/blog/linux/fedora-core-8-on-lenovo-3000.php/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Linux based router solution</title>
		<link>http://imthi.com/blog/linux/linux-based-router-solution.php</link>
		<comments>http://imthi.com/blog/linux/linux-based-router-solution.php#comments</comments>
		<pubDate>Mon, 10 Sep 2007 15:39:00 +0000</pubDate>
		<dc:creator>Imthiaz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[router]]></category>

		<guid isPermaLink="false">http://imthi.com/blog/linux/linux-based-router-solution.php</guid>
		<description><![CDATA[The task for the day was to make a router based on Linux. All I wanted to do is to replace the stupid home based router and do a fully Linux based one. Round one we need to buy hardware for the router. I know Linux can run on very low configuration hardware but those [...]]]></description>
			<content:encoded><![CDATA[
<p>The task for the day was to make a router based on Linux. All I wanted to do is to replace the stupid home based router and do a fully Linux based one. Round one we need to buy hardware for the router. I know Linux can run on very low configuration hardware but those are very hard to find in the market. So I decided to go with shuttle computers. Basically shuttle computers are small and compact when compared to normal desktops. The model number used to make this one was SD32G2. You can read the complete specification of the hardware form this <a href="http://imthi.in/nmDOry">website</a>. There is an on board gigabyte Ethernet controller.</p>
<p style="text-align: center"><img src="http://cdn.imthi.com/18ecfe/wp-content/uploads/2007/09/shuttle_computer.jpg" alt="shuttle computers."></p>
<p>Other than that I used the following</p>
<ul>
<li>Pentium 4 3.2 HT processor</li>
<li>80 GB Sata hard disk</li>
<li>1 GB RAM</li>
<li>Realtek gigabyte Ethernet card</li>
<li>DVD drive (mainly used for installing purpose).</li>
</ul>
<p>Now the system is ready to rock and roll. The next big step was to install some flavor of linux and test the firewall. I was thinking of fedora latter my friend <a href="http://imthi.in/ph3ztP">Lijeesh</a> showed me some new variant of linux which are there only for this purpose routing and firewall solution. Some distribution which are done for routing purpose are</p>
<ul>
<li>
<a href="http://imthi.in/re3lSX">IPCOP</a> an open source distribution.</li>
<li>
<a href="http://imthi.in/pkVvX8">Smoothwall</a> has both both open source and commercial solution</li>
<li>
<a href="http://imthi.in/n8kBI9">Clarkconnect</a> is commercial solution.</li>
</ul>
<p>I installed and tested in the same above mentioned order. And I found some issues with each installation. Let me explain the hurdles I faced in each.</p>
<p>IPCOP – The installation was smooth. I had some issues in setting up my on board Ethernet card. Basically it was marvell chipset. I tried installing sk98lin drivers for it and it wont work. Then the firewall not supporting NAT.</p>
<p>Smoothwall – The installation was smooth. It even detected the on board Ethernet and it worked. It had really a good web interface with funky ajax effects. Like live bandwidth monitor, live messenger chat viewer etc. But when it comes to routing features the was very much limited <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_sad.gif" alt=":-(" class="wp-smiley">  . One such problem was it didn’t NAT routing.</p>
<p>Clarkconnet – It is a commercial solution. It is based on red hat distribution. I had some issues with my onboard ethernet card. It was detecting it but the drivers was not working. I had to issue command “modprobe sk98lin” and everything worked well. It had all the routing features please features. I tested it well and it was stable. Currently I am using this for my routing solution.</p>
<p>It took me 4 days to figure out the best options for routing solution based on Linux. I am not sure that the above conclusion are 100% correct. May be I have screwed it up somewhere. But it was fun experimenting <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_wink.gif" alt=";-)" class="wp-smiley"></p>
]]></content:encoded>
			<wfw:commentRss>http://imthi.com/blog/linux/linux-based-router-solution.php/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Howto track cpanel+exim server outgoing mails</title>
		<link>http://imthi.com/blog/linux/howto-track-cpanelexim-server-outgoing-mails.php</link>
		<comments>http://imthi.com/blog/linux/howto-track-cpanelexim-server-outgoing-mails.php#comments</comments>
		<pubDate>Thu, 08 Mar 2007 04:31:05 +0000</pubDate>
		<dc:creator>Imthiaz</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://imthi.com/blog/linux/howto-track-cpanel-eximail-server-outgoing-mails.php</guid>
		<description><![CDATA[I wanted to track some outgoing mails in my servers. Initially I was using IMAP to solve this issue. Then It was becoming slow everyday. They started complaining that the mail was really slow. I was forced to move to POP3 which is much faster compared to IMAP. Once I activated POP3 tracking was out [...]]]></description>
			<content:encoded><![CDATA[
<p>I wanted to track some outgoing mails in my servers. Initially I was using IMAP to solve this issue. Then It was becoming slow everyday. They started complaining that the mail was really slow. I was forced to move to POP3 which is much faster compared to IMAP. Once I activated POP3 tracking was out of my hands. I search a lot on how to play with <a href="http://imthi.in/n0xugP">filters in exim mail</a>.</p>
<p>It is quite powerful and give total control on incoming and outgoing mails. To solve my problem I need to play only with outgoing mails. There is a file named /etc/antivirus.exim is the file we need to play with.  I edited the file and added the below lines to make it work for me.</p>
<pre>
if first_delivery
and ( ("$h_from:" contains "test1@imthi.com")
or ("$h_from:" contains "test2@imthi.com")
or ("$h_from:" contains "test3@imthi.com")
)
then
unseen deliver "tracker@imthi.com"
endif</pre>
<p>The above block checks if the outgoing mail is on first delivery and who is the sender. Based on the sender I am sending a bcc copy to another mailbox. You can play more by studying the exim filter commands more <img src="http://cdn.imthi.com/18ecfe/wp-includes/images/smilies/icon_wink.gif" alt=";-)" class="wp-smiley"></p>
]]></content:encoded>
			<wfw:commentRss>http://imthi.com/blog/linux/howto-track-cpanelexim-server-outgoing-mails.php/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

