<?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>Bin-Blog &#187; Linux</title>
	<atom:link href="http://www.bin-co.com/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bin-co.com/blog</link>
	<description>Learn about the latest in Web Development - as soon as I do.</description>
	<lastBuildDate>Tue, 13 Oct 2009 18:55:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Error Connecting to MySQL using Ruby on Rails in Linux &#8211; and its Solution</title>
		<link>http://www.bin-co.com/blog/2009/04/error-connection-mysql-ruby-rails-linux-solution/</link>
		<comments>http://www.bin-co.com/blog/2009/04/error-connection-mysql-ruby-rails-linux-solution/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 18:22:52 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[troubleshoot]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=249</guid>
		<description><![CDATA[I am currently working on a new Rails project. Its been a while since I worked with rails - so I updated Rails using the command '<code>sudo gem update --system</code>'. I started the inbuilt server and tried to open a page - and to my surprise, I found that <strong class="highlight">Rails is having trouble connecting to the MySQL</strong> server. It was apparent that the <strong class="highlight">mysql gem was missing</strong>. So I tried to install it using the command '<code>sudo gem install mysql</code>'. That failed too - this is the error I got...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/05/ruby_logo.gif" alt="Ruby Logo" title="Ruby Logo" width="105" height="109" class="alignnone size-full wp-image-105 intro" align="right" /></p>
<p class="intro">I am currently working on a new Rails project. Its been a while since I worked with rails &#8211; so I updated Rails using the command &#8216;<code>sudo gem update --system</code>&#8216;. I started the inbuilt server and tried to open a page &#8211; and to my surprise, I found that <strong class="highlight">Rails is having trouble connecting to the MySQL</strong> server. It was apparent that the <strong class="highlight">mysql gem was missing</strong>. So I tried to install it using the command &#8216;<code>sudo gem install mysql</code>&#8216;. That failed too &#8211; this is the error I got&#8230;</p>
<pre>Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby
        --with-mysql-config
        --without-mysql-config
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-mlib
        --without-mlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-zlib
        --without-zlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-socketlib
        --without-socketlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-nsllib
        --without-nsllib
        --with-mysqlclientlib
        --without-mysqlclientlib

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out</pre>
<p>After a couple of hours on Google, I managed to fix the issue &#8211; and I am posting the solution here for others who might run into the same problem.</p>
<h2>Install the necessary Libraries</h2>
<p>First, you must <strong class="highlight">install a couple of mysql libraries</strong>(I am assuming that you have MySQL server already installed). If you are on <strong class="highlight">Red Hat/Fedora/CentOS</strong> etc., run the command&#8230;</p>
<pre><code class="cli">sudo yum install ruby-mysql mysql-devel</code></pre>
<p>If you are on <strong class="highlight">Debian/Ubuntu</strong>/etc., run this command&#8230;</p>
<pre><code class="cli">sudo apt-get install libmysqlclient15-dev libmysqlclient15off libmysql-ruby</code></pre>
<h2>Install the gem</h2>
<p>Once the installation is done, enter this <strong class="highlight">command to install mysql gem</strong>&#8230;</p>
<pre><code class="cli">sudo gem install mysql -- --with-mysql-config=/usr/bin/mysql_config</code></pre>
<p>If your mysql_config is not in the standard location, update the command with the right path.</p>
<p>The mysql gem should be installed now. These commands worked for me &#8211; your milage may vary. If you still have trouble, try one of the following links&#8230;</p>
<h2>More Resources</h2>
<ul>
<li><a href="http://rails.aizatto.com/2007/05/19/connecting-to-mysql-using-ruby/">Connecting To MySQL using Ruby</a></li>
<li><a href="http://wiki.rubyonrails.org/database-support/mysql">MySQL =&gt; Rails Wiki</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2009/04/error-connection-mysql-ruby-rails-linux-solution/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using Linux for a better Windows Experience</title>
		<link>http://www.bin-co.com/blog/2009/01/using-linux-for-a-better-windows-experience/</link>
		<comments>http://www.bin-co.com/blog/2009/01/using-linux-for-a-better-windows-experience/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 16:05:50 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[stability]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=220</guid>
		<description><![CDATA[If you are a Windows user who want more stability(but unwilling to switch to Linux completely), this post is for you. Basically, you have to <strong class="highlight">create a dual boot system with Linux and Windows - and use Linux for doing the more 'unsafe' operations</strong>. The end result is windows remains stable - and you will be able to do things that are potentially dangerous.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2009/01/windows_logo.jpg" alt="" title="Windows Logo" width="119" height="106" class="alignnone size-full wp-image-213 intro" align="right" /></p>
<p class="intro">If you are a Windows user who want more stability(but unwilling to switch to Linux completely), this post is for you. Basically, you have to <strong class="highlight">create a dual boot system with Linux and Windows &#8211; and use Linux for doing the more &#8216;unsafe&#8217; operations</strong>. The end result is windows remains stable &#8211; and you will be able to do things that are potentially dangerous.</p>
<h2>Dual Boot System</h2>
<p>Install a Linux distro on your system. I would recommend Ubuntu if you are a beginner and Fedora if you are not. There are many tutorials on the net that will take you through the process of installing &#8211; so I am not going into it. Now boot into Linux when ever you wish to do stuff that might run the risk of infecting your system&#8230;</p>
<h3>Browsing</h3>
<p>Unfortunately, the net is currently the number one source of virus infection. So, <strong class="highlight">if you want to browse, boot into linux and browse</strong> &#8211; this will make it impossible for virus to infect the system. But there are some problems with this approach&#8230;</p>
<ul>
<li>Might be impractical for full time broadband users</li>
<li>Some special applications might not have linux alternatives(eg. Online games, Yahoo Video Chat software etc.</li>
<li>Some ISP&#8217;s dialup applications might not work on Linux</li>
</ul>
<p>My brother uses this method &#8211; and he swears by it. It will cut down virus infections by about 75%.</p>
<h3>Using Pen Drives/External Hard Drives</h3>
<p>Another method that virus use to propagate itself is pen drives. Everytime you connect a pen drive to your system, you run the risk of getting a virus infection. <strong class="highlight">Using linux to check out pen drives will make sure you will not get infected</strong> this way. Its so effective that my brother prefers to check the pen drive in linux over checking it with a anti-virus.</p>
<h3>Troubleshooting Help</h3>
<p>Another advantage of having Linux in your system is that you can use it to troubleshoot hardware. Say that you mouse stops working &#8211; now you have to decide if its a hardware or a software issue. It could be a symptom of a virus &#8211; or it could be a problem with the mouse. If you just have windows, the only way to find out is to connect a different mouse &#8211; not the most convenient way. But if you have linux, just boot into it. <strong class="highlight">If the mouse is working in Linux, its a software issue. If not, then the hardware is to blame</strong>.</p>
<h3>Emergency Computing</h3>
<p>When disaster strikes(in case of windows, once every six months) and <strong class="highlight">your windows system is rendered unbootable, you have a bailout mechanism. You can use Linux</strong> to work on that urgent presentation, or backup the files, or send that email, etc. Point is, you have a working system &#8211; until you re-install Windows &#8211; or choose to abandon it for Linux.</p>
<h2>Linux Live CD/DVD</h2>
<p>If you don&#8217;t want to install linux due to some(propably invalid) reason, then your next best bet is to have a Linux Live CD handy. <strong class="highlight">Live CDs enable you to have a complete OS that boots directly from the CD/DVD</strong>. I would recommend Knopix for this. Just make sure that it works on your system &#8211; and you are able to mount your partitions and do read/write operations using the Live CD.</p>
<p>You can use the live CD to troubleshoot hardware and to backup the files in case your &#8216;Window is broken&#8217;. It might not be practical for the other reasons outlined above &#8211; because its slower than a permanent solution.</p>
<p>Ironically, we have reached a point that, <strong class="highlight">if you want a stable Windows system, you need to have Linux</strong> installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2009/01/using-linux-for-a-better-windows-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing lighttpd Web Server in Linux with PHP and MySQL</title>
		<link>http://www.bin-co.com/blog/2008/11/installing-lighttpd-web-server-in-linux-with-php-and-mysql/</link>
		<comments>http://www.bin-co.com/blog/2008/11/installing-lighttpd-web-server-in-linux-with-php-and-mysql/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 17:48:21 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=161</guid>
		<description><![CDATA[After <a href="http://www.bin-co.com/blog/2008/09/installing-lampapache-web-serverphpmysql-in-debian/" title="Installing LAMP(Apache Web Server/PHP/MySQL) in Debian">two articles</a> on <a href="http://www.bin-co.com/blog/2008/09/compile-install-lamp-linux-apache-mysql-php-server-from-source/" title="Compile and Install a LAMP(Linux/Apache/MySQL/PHP) Server from Source">installing Apache</a>, lets take a look at <strong class="highlight">installing and configuring lighttpd web server on a linux system</strong>. <a href="http://www.lighttpd.net/">lighttpd</a> (pronounced "lighty") is a web server designed to be secure, fast, standards-compliant and flexible while having a low memory footprint.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/11/lighttpd_logo.png" alt="lighttpd Web Server" title="Lighttpd Logo" width="200" height="197" class="alignnone size-full wp-image-160 intro" align="right" /></p>
<p class="intro">After <a href="http://www.bin-co.com/blog/2008/09/installing-lampapache-web-serverphpmysql-in-debian/" title="Installing LAMP(Apache Web Server/PHP/MySQL) in Debian">two articles</a> on <a href="http://www.bin-co.com/blog/2008/09/compile-install-lamp-linux-apache-mysql-php-server-from-source/" title="Compile and Install a LAMP(Linux/Apache/MySQL/PHP) Server from Source">installing Apache</a>, lets take a look at <strong class="highlight">installing and configuring lighttpd web server on a linux system</strong>. <a href="http://www.lighttpd.net/">lighttpd</a> (pronounced &#8220;lighty&#8221;) is a web server designed to be secure, fast, standards-compliant and flexible while having a low memory footprint.</p>
<p>Before installation, a few points to remember. These <strong class="highlight">instruction are not for a production environment &#8211; this is for a development environment</strong>. To install the software, <strong class="highlight">you need root access</strong>. You can get that using this command&#8230;</p>
<pre><code class="cli">su -
[Enter root password]</code></pre>
<p>or by prefixing &#8216;<code>sudo</code>&#8216; before each command.</p>
<h2>Installing the Server</h2>
<p>First install lighttpd and PHP &#8211; use your distro&#8217;s package management(yum, apt-get) system to do this.</p>
<h3>Install lighttpd</h3>
<p>You can use this command in Red Hat based systems(Fedora, Cent OS, etc.) to install lighttpd. Debian/Ubuntu systems might the same package name &#8211; could someone post the package name of lighttpd in the comments?</p>
<pre><code class="cli">yum install lighttpd lighttpd-fastcgi</code></pre>
<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/09/php-logo.png" alt="PHP Logo" title="PHP Logo" width="179" height="98" class="alignnone size-full wp-image-123" align="right" /></p>
<h3>Install PHP</h3>
<p>If you don&#8217;t have PHP, you can install it using the command&#8230;</p>
<pre><code class="cli">yum install php php-cli php-common</code></pre>
<p>In Debian/Ubuntu systems, the command is&#8230;</p>
<pre><code class="cli">apt-get install php5-cli php5-common php5-cgi</code></pre>
<p>You can make sure you have php-cgi(needed for working with lighttpd) by running this command&#8230;</p>
<pre><code class="cli">php-cgi -v</code></pre>
<h3>Installing MySQL</h3>
<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/09/mysql_logo.gif" alt="" title="MySQL Logo" width="150" height="98" class="alignnone size-full wp-image-127" align="right" /></p>
<p>If MySQL is not yet installed, use this command to install it&#8230;</p>
<pre><code class="cli">yum install mysql-server php-mysql mysql mysql-libs</code></pre>
<p>Debian/Ubuntu Command&#8230;</p>
<pre><code class="cli">apt-get install mysql-client mysql-common mysql-server php5-mysql</code></pre>
<h2>Configuring lighttpd</h2>
<p>lighttpd configuration is done by <strong class="highlight">editing the text file &#8216;/etc/lighttpd/lighttpd.conf&#8217;.</strong></p>
<p><strong class="highlight">Enable some lighttpd modules</strong> by removing the comment character(#) from the beginning of the line. I have enabled the following modules&#8230;</p>
<pre><code class="conf">server.modules              = (
                                "mod_rewrite",
                                "mod_redirect",
                                "mod_access",
                                "mod_fastcgi",
                                "mod_accesslog" )
</code></pre>
<p><strong class="highlight">Configure lighttpd&#8217;s document root</strong> &#8211; if you already have Apache, I would recommend using the same document root as Apache(applicable for development servers only). </p>
<pre><code class="conf">server.document-root        = "/var/www/"</code></pre>
<p>I find it helpful to <strong class="highlight">enable folder listing</strong> in my server.</p>
<pre><code class="conf">## virtual directory listings
dir-listing.activate       = "enable"</code></pre>
<h3>Turn On FastCGI PHP Support</h3>
<p>Now, make sure lighttpd works with PHP &#8211; first get the path of php-cgi using the command..</p>
<pre><code class="cli">$ whereis php-cgi
php-cgi: /usr/bin/php-cgi #Might be different on your system.</code></pre>
<p>Then <strong class="highlight">add the path to the configuration file</strong> of lighttpd&#8230;</p>
<pre><code class="conf">#### fastcgi module
## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
fastcgi.server             = ( ".php" =>
                               ( "localhost" =>
                                 (
                                   "socket" => "/tmp/php.socket",
                                   <strong class="highlight">"bin-path" => "/usr/bin/php-cgi"</strong>
                                 )
                               )
                            )</code></pre>
<p>Make sure you <strong class="highlight">uncomment the above lines</strong> by removing the &#8216;#&#8217; characters.</p>
<p>After you are done, <strong class="highlight">save the file</strong>. Time to try out the server.</p>
<h2>Starting the lighttpd Server</h2>
<p>First stop Apache if it is running&#8230;</p>
<pre><code class="cli">/etc/init.d/httpd stop</code></pre>
<p>Now start lighttpd using the command</p>
<pre><code class="cli">/etc/init.d/lighttpd start</code></pre>
<p>Go to your document root(<code>/var/www</code>) and <strong class="highlight">create a php files called &#8216;info.php&#8217; and put this code</strong> inside it&#8230;</p>
<pre><code class="php">&lt;?php
php<!-- wordpress bug workaround -->Info();</code></pre>
<p>Now fire up a browser and <strong class="highlight">go to <a href="http://localhost/" title="Might not work if the preceding instructions where not followed">localhost</a></strong> &#8211; you should see a file listing page with a ‘info.php’ in the list. Click on that link &#8211; if you see a PHP information page, your web server is setup correctly.</p>
<p>To make sure MySQL-PHP connection is working, <a href="http://www.bin-co.com/database/clients/phpmyadmin/installing_phpmyadmin.php" title="Installing phpMyAdmin 2.8">install phpMyAdmin</a> &#8211; or write a database connection script &#8211; whatever is easier for you.</p>
<h2>Related Links</h2>
<ul>
<li><a href="http://www.lighttpd.net/">lighttpd fly light</a></li>
<li><a href="http://en.wikipedia.org/wiki/Lighttpd">lighttpd &#8211; Wikipedia</a></li>
<li><a href="http://cssgallery.info/lighttpd-install-perl-mysql-support-in-chrooted-jail/">Lighttpd install perl, mysql support in chrooted jail</a></li>
<li><a href="http://www.cyberciti.biz/tips/lighttpd-php-fastcgi-configuration.html">Lighttpd PHP fastcgi configuration</a></li>
<li><a href="http://www.cyberciti.biz/tips/howto-install-lighttpd-on-freebsd.html">FreeBSD Install Lighttpd Web Server</a></li>
<li><a href="http://fandar-it.com/content/view/35/32/">Install lighttpd with php</a></li>
<li><a href="http://wiki.vpslink.com/Install_and_Configure_lighttpd">Install and Configure lighttpd</a></li>
<li><a href="http://www.howtoforge.com/lighttpd_php5_mysql_fedora7">Installing Lighttpd With PHP5 And MySQL Support On Fedora 7</a></li>
</ul>
<p><strong class="highlight">Shameless Plug</strong>: If you are a Linux user, you may want to check out my <a href="http://lindesk.com/" title="Lindesk - Linux on the Desktop">Linux Blog &#8211; LinDesk</a> &#8211; its about Linux on the Desktop &#8211; Articles, Application Reviews and Tutorials about many aspects of Linux included configuration and scripting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2008/11/installing-lighttpd-web-server-in-linux-with-php-and-mysql/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing LAMP(Apache Web Server/PHP/MySQL) in Debian/Ubuntu</title>
		<link>http://www.bin-co.com/blog/2008/09/installing-lampapache-web-serverphpmysql-in-debian/</link>
		<comments>http://www.bin-co.com/blog/2008/09/installing-lampapache-web-serverphpmysql-in-debian/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 19:10:07 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=125</guid>
		<description><![CDATA[Installing the <abbr title="Linux Apache MySQL PHP">LAMP</abbr> environment on a Linux system is easy if you are comfortable with using the native package management software. If you on a Red Hat/Fedora/CentOS system, that will be yum - and for Debian/Ubuntu systems, that will be apt. This tutorial shows you how to install Apache 2, PHP 5 and MySQL 5 in Debian using apt.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/09/lava_lamp.jpg" alt="LAMP - Linux, Apache, MySQL, PHP" title="Lamp" width="232" height="294" class="size-full wp-image-128 intro" align="right" /></p>
<p class="intro">Installing the <abbr title="Linux Apache MySQL PHP">LAMP</abbr> environment on a Linux system is easy if you are comfortable with using the native package management software. If you on a Red Hat/Fedora/CentOS system, that will be yum &#8211; and for Debian/Ubuntu systems, that will be apt. This tutorial shows you how to install Apache 2, PHP 5 and MySQL 5 in Debian using apt.</p>
<p>Before installation, a few points to remember. These instruction are not for a production environment &#8211; this is for a development environment. To install the software, you need root access. You can get that using this command&#8230;</p>
<pre><code class="cli">su -
[Enter root password]</code></pre>
<h2>Installing Apache 2</h2>
<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/09/apache.png" alt="" title="Apache Logo" width="230" height="90" class="alignnone size-full wp-image-126" align="right" /></p>
<p>Use this command to install Apache 2.</p>
<pre><code class="javascript">apt-get install apache2</code></pre>
<p>Make sure you specify &#8216;apache2&#8242; &#8211; or else, apache 1.3 will be installed.</p>
<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/09/php-logo.png" alt="PHP Logo" title="PHP Logo" width="179" height="98" class="alignnone size-full wp-image-123" align="right" /></p>
<h2>Install PHP 5</h2>
<p>Now, install the PHP 5 packages&#8230;</p>
<pre><code class="javascript">apt-get install libapache2-mod-php5 php5-cli php5-common php5-cgi</code></pre>
<p>No go to the folder <code>/etc/apache2/sites-enabled/</code> and edit the file in that directory(usually 000-default). Find the line that says<br />
<code>RedirectMatch ^/$ /apache2-default/</code><br />
and remove it.</p>
<p>Now your document root is <code>/var/www/</code> &#8211; place all your HTML documents and scripts in this folder. If you want to make some other configuration changes, edit the configuration files at <code>/etc/apache2/apache2.conf</code></p>
<p>I also had to make the following changes&#8230;</p>
<ul>
<li>Changed the owner of <code>/var/log/apache2</code> to www-data &#8211; I used the command <code>chown www-data:www-data apache2</code></li>
<li>Created an empty file at <code>/etc/apache2/httpd.conf</code></li>
</ul>
<p>This was to fix a few errors I saw on my system &#8211; you may not have to do it.</p>
<h2>Install MySQL</h2>
<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/09/mysql_logo.gif" alt="" title="MySQL Logo" width="150" height="98" class="alignnone size-full wp-image-127" align="right" /></p>
<p>This is the command to install MySQL server, its client and PHP&#8217;s MySQL libraries&#8230;</p>
<pre><code class="javascript">apt-get install mysql-client mysql-common mysql-server php5-mysql</code></pre>
<p>Finally, Install the other packages you need as well</p>
<pre><code class="javascript">apt-get install php5-sqlite php5-gd ...</code></pre>
<h2>Testing the System</h2>
<p>Go to your document root(<code>/var/www</code>) and create a php files called &#8216;info.php&#8217; and put this code inside that&#8230;</p>
<pre><code class="php">&lt;?php
php<!-- PHP bug -->info();

</code></pre>
<h3>Start the Servers</h3>
<p>First, turn on the MySQL database server&#8230;</p>
<pre><code class="javascript">/etc/init.d/mysql start</code></pre>
<p>Then, start the Apache Web Server&#8230;</p>
<pre><code class="javascript">/etc/init.d/apache2 start</code></pre>
<p>Now fire up a browser and go to <a href="http://localhost/">localhost</a> &#8211; you should see a file listing page with a &#8216;info.php&#8217; in the list. Click on that link &#8211; if you see a PHP information page, your web server is setup correctly.</p>
<p>To make sure MySQL-PHP connection is working, <a href="http://www.bin-co.com/database/clients/phpmyadmin/installing_phpmyadmin.php">install phpMyAdmin</a> &#8211; or write a database connection script &#8211; whatever is easier for you.</p>
<h2>Related Links</h2>
<ul>
<li><a href="http://www.thegeekstuff.com/2008/09/how-to-install-or-upgrade-lamp-apache-mysql-and-php-stack-on-linux-using-yum/">How To Install Or Upgrade LAMP: Linux, Apache, MySQL and PHP Stack Using Yum</a></li>
<li><a href="http://www.debianadmin.com/apache2-installation-and-configuration-with-php-support-in-debian-linux.html">Apache2 installation and configuration with php support</a></li>
<li><a href="http://www.debianadmin.com/install-and-configure-apache2-with-php5-and-ssl-support-in-debian-etch.html">Install and Configure Apache2 with PHP5 and SSL Support in Debian Etch</a></li>
<li><a href="http://www.adobe.com/devnet/dreamweaver/articles/lamp.html">Setting Up Your PHP Server Environment Using Linux, Apache, MySQL, and PHP</a></li>
<li><a href="http://www.mysql-apache-php.com/">Quick Linux Server w/ Apache+PHP+MySQL</a></li>
<li><a href="http://www.debianhelp.co.uk/lamp.htm">LAMP (Linux Apache Mysql PHP) Configuration and Installing in Debian</a></li>
<li><a href="http://lamphowto.com/">HOWTO: Installing MySQL and Apache with PHP support on Linux</a></li>
<li><a href="http://www.kewanshunn.com/articles/how_to_install_apache2,_php5,_mysql5_on_redhat/3.html">How to install Apache2, PHP5, MySQL5 on RedHat</a></li>
</ul>
<p><strong>Shameless Plug</strong>: If you are a Linux user, you may want to check out my <a href="http://lindesk.com/">Linux Blog &#8211; LinDesk</a> &#8211; its about Linux on the Desktop &#8211; Articles, Application Reviews and Tutorials about many aspects of Linux included configuration and scripting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2008/09/installing-lampapache-web-serverphpmysql-in-debian/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Hello Script for bash</title>
		<link>http://www.bin-co.com/blog/2008/05/hello-script-for-bash/</link>
		<comments>http://www.bin-co.com/blog/2008/05/hello-script-for-bash/#comments</comments>
		<pubDate>Mon, 12 May 2008 18:02:25 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[hello]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=107</guid>
		<description><![CDATA[Hello Script series for Bash. &#8216;Hello Script&#8217; is a file that contains the most commonly used elements of a programming language so that it can be used as a cheat sheet when working with that language. bash bash is the most commonly used shell in Linux. That makes the bash scripting language the most popular [...]]]></description>
			<content:encoded><![CDATA[<p class="intro"><a href="http://www.bin-co.com/blog/2008/03/learning-a-new-programming-language-the-hello-world-method/">Hello Script series</a> for Bash. <strong>&#8216;Hello Script&#8217; is a file that contains the most commonly used elements of a programming language so that it can be used as a cheat sheet</strong> when working with that language.</p>
<h2>bash</h2>
<p><a href="http://www.gnu.org/software/bash/">bash</a> is the most commonly used shell in Linux. That makes the bash scripting language the most popular shell scripting language. OK, maybe after batch. But then again, bash is much more powerful than batch(DOS scripting language). If want to learn bash, I will recommend this tutorial &#8211; <a href="http://tldp.org/LDP/abs/html/">Advanced Bash Scripting</a></p>
<p>Officially, <a href="http://lindesk.com/2008/05/shell-script-language-use-perl-not-bash/">I hate bash</a>. I use perl or other similar high level language to create shell script. I use bash only for the <a href="http://binnyva.blogspot.com/2007/03/using-twitter-part-1-command-line.html">simplest scripts</a>. But even I admit that bash has its uses. So, here is the hello script for bash&#8230;</p>
<h2>Hello Script</h2>
<pre><code class="bash">
#!/usr/sh

# Printing(IO)
echo "Hello World"

# Variables, concatenation
name='Binny'
year=2008
echo "Hello, " $name " - welcome to " $year

#If,else conditions
if [ $year -gt 2008 ]; then
	echo "Welcome to the future - yes, we have flying cars!"

elif [ $year -lt 2008 ]; then
	echo "The past - please don't change anything. Don't step on any butterflies. And for the sake of all that's good and holy, stay away from your parents!"

else
	echo "Anything wrong with your time machine? You have not gone anywhere, kiddo."
fi

# If you are using anything after this, consider using a high level language.
# For loop
for i in 1 2 3
do
	echo $i ") Hi there!"
done

#Numerical Array, foreach
rules[0]="Do no harm"
rules[1]="Obey"
rules[2]="Continue Living"

for ((i=0; i &lt; 3; i++))
do
	echo "Rule" `expr $i + 1` ":" ${rules[$i]}
done

#A While Demo
keys=(hello foo lorem)

i=0
while [ $i -lt 3 ]
do
	echo ${keys[$i]}
	i=`expr $i + 1`
done

# Function, argument, return, call
hello () {
	myname=$1  #First argument.
	echo "Hello" $myname
}
hello "Binny"

# File IO
# File reading
contents=`cat Hello.sh` #For some reason, I'm losing all the \n's in the file.
echo "Hello has `echo $contents|wc -m` chars" # Or wc -m Hello.sh

# Writing to a file
echo "Hello World from shell script" &gt; /tmp/hello.txt

# Command Executing
ls

# Regular Expressions
string="Hello World"
evil=`echo $string | grep '^Hell'`
if [ "$evil" != "" ]; then
	echo "Yup - its evil"
fi
echo "Hello World" | sed -e 's/l//g' #Will return Heo Word

# http://tldp.org/LDP/abs/html/
</code></pre>
<p>And, by the way, this will work only in Linux &#8211; or if you installed cygwin in your Windows system. Use <code>sh &lt;File_Name&gt;</code> to execute the above code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2008/05/hello-script-for-bash/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Case Sensitivity in URLs</title>
		<link>http://www.bin-co.com/blog/2007/10/case-sensitivity-in-urls/</link>
		<comments>http://www.bin-co.com/blog/2007/10/case-sensitivity-in-urls/#comments</comments>
		<pubDate>Wed, 17 Oct 2007 18:16:29 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Case]]></category>
		<category><![CDATA[Sensitive]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/2007/10/case-sensitivity-in-urls/</guid>
		<description><![CDATA[I am an open source guy - so naturally I prefer the flagship <abbr title="Open Source Software">OSS</abbr> software Apache to the proprietary Microsoft IIS. But there is one area where IIS does a better job than Apache - the case sensitivity of URLs.]]></description>
			<content:encoded><![CDATA[<p class="intro">I am an open source guy &#8211; so naturally I prefer the flagship <abbr title="Open Source Software">OSS</abbr> software Apache to the proprietary Microsoft IIS. But there is one area where IIS does a better job than Apache &#8211; the case sensitivity of URLs.</p>
<h2>Are URLs Case Sensitive?</h2>
<p>They should not be &#8211; but they sometimes are. Domain names are not case sensitive &#8211; for example <a href="http://www.apache.org/">http://www.apache.org/</a> and <a href="http://WWW.Apache.Org/">http://WWW.Apache.Org/</a> goes to the same location. But in the <abbr title="Linux/Apache/MySQL/PHP">LAMP</abbr> platform, the path is case sensitive&#8230;</p>
<ul>
<li><a href="http://www.apache.org/foundation/getinvolved.html">http://www.apache.org/foundation/getinvolved.html</a> is not</li>
<li><a href="http://www.apache.org/Foundation/GetInvolved.HTML">http://www.apache.org/Foundation/GetInvolved.HTML</a></li>
</ul>
<p>But in the case of Microsoft IIS server, this is not true &#8211; try&#8230;</p>
<ul>
<li><a href="http://www.microsoft.com/WindowsServer2003/IIS/Default.mspx">http://www.microsoft.com/WindowsServer2003/IIS/Default.mspx</a> is the same as</li>
<li><a href="http://www.microsoft.com/windowsserver2003/iis/default.mspx">http://www.microsoft.com/windowsserver2003/iis/default.mspx</a></li>
</ul>
<h2>Reason: Linux Filesystem is Case Sensitive</h2>
<p>The root cause of this is that the filesystem in the Linux OS is case sensitive &#8211; while FAT32/NTFS filesystems in Windows are not.</p>
<h2>Dynamic URLs</h2>
<p>Now Dynamic/friendly/clean URLs are appearing in many CMS tools. A good example for this is the &#8216;permalink structure&#8217; in WordPress. These dynamic URLs could be case sensitive or not &#8211; it depends on the software. In WordPress they are case insensitive. <a href="http://del.icio.us/">Del.icio.us</a> is also case insensitive. TinyURL is another service that uses case insensitive URLs. But it is possible for the tool to make the URLs case sensitive.</p>
<h2>From the SEO perspective</h2>
<p>If the search bot visits two urls say, example.com/MyWebPage/Index and example.com/mywebpage/index , will the bot index both page contents? If they are same, will one get the duplicate content penalty? Or will google just index the URL with lower case and ignore the other &#8211; remember, in Linux/Apache, both pages may have different content.</p>
<h2>Conclusion</h2>
<p>The <a href="http://www.ietf.org/rfc/rfc1738.txt">RFC for URL</a> says they must be case insensitive.</p>
<blockquote><p>For resiliency, programs interpreting URLs should treat upper case letters as equivalent to lower case in scheme names (e.g., allow &#8220;HTTP&#8221; as well as &#8220;http&#8221;).</p></blockquote>
<p>Apache must not use the filesystem as an excuse &#8211; I really hope they provide case insensitive URLs</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2007/10/case-sensitivity-in-urls/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>LinDesk &#8211; Linux on the Desktop</title>
		<link>http://www.bin-co.com/blog/2007/09/lindesk-linux-on-the-desktop/</link>
		<comments>http://www.bin-co.com/blog/2007/09/lindesk-linux-on-the-desktop/#comments</comments>
		<pubDate>Sat, 01 Sep 2007 17:19:09 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[lindesk]]></category>
		<category><![CDATA[me]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/2007/09/lindesk-linux-on-the-desktop/</guid>
		<description><![CDATA[I have a new blog &#8211; LinDesk. LinDesk concentrates on the use of Linux on the Desktop. I am trying to keep it distro agnostic &#8211; but there is a slight leaning towards Fedora &#8211; as it is the distro I am using. Also, you might find a disproportionate amount of articles about KDE. Actually [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://lindesk.com/' title='LinDesk'><img src='http://www.bin-co.com/blog/wp-content/uploads/2007/09/lindesk.png' alt='LinDesk' class="intro" align="right" /></a></p>
<p class="intro">I have a new blog &#8211; <a href="http://lindesk.com/">LinDesk</a>. LinDesk concentrates on the use of Linux on the Desktop. I am trying to keep it distro agnostic &#8211; but there is a slight leaning towards Fedora &#8211; as it is the distro I am using. Also, you might find a disproportionate amount of articles about KDE.</p>
<p>Actually this blog has been around for some time. The <a href="http://lindesk.com/2007/04/fishfriendly-interactive-shell/">first article</a> appeared on April 8. But I did not announce it so that there can be a build up of articles before it goes public.</p>
<p>Take a look at <a href="http://lindesk.com/">LinDesk</a> &#8211; and if you are a fan of the Linux operating system, <a href="http://feeds.feedburner.com/Lindesk">subscribe</a>.</p>
<h2>Some Popular Posts</h2>
<ul>
<li><a href="http://lindesk.com/2007/04/konqueror-a-killer-app-for-linux/">Konqueror &#8211; A Killer App for Linux</a></li>
<li><a href="http://lindesk.com/2007/05/konqueror-the-browser/">Konqueror, The Browser</a></li>
<li><a href="http://lindesk.com/2007/05/using-konqueror-as-an-ftp-client/">Using Konqueror as an FTP Client</a></li>
<li><a href="http://lindesk.com/2007/04/internet-connection-sharing-using-iptables/">Internet Connection Sharing using iptables</a></li>
<li><a href="http://lindesk.com/2007/05/how-to-mount-isomdf-images-in-linux/">How to Mount ISO/MDF Images in Linux</a></li>
<li><a href="http://lindesk.com/2007/05/top-5-video-players-in-linux/">Top 5 Video Players in Linux</a></li>
<li><a href="http://lindesk.com/2007/05/wesnoth-the-battle-for-productivity/">Wesnoth &#8211; The Battle for Productivity</a></li>
</ul>
<p>So what do you guys think of the new blog? Is it a good move? Or am I moving towards an early burnout?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2007/09/lindesk-linux-on-the-desktop/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

