<?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>Kudithipudi.Org &#187; Web</title>
	<atom:link href="http://kudithipudi.org/category/technology/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://kudithipudi.org</link>
	<description>Too much time on hand!!!</description>
	<lastBuildDate>Tue, 22 May 2012 13:11:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>2012 May Project</title>
		<link>http://kudithipudi.org/2012/05/01/2012-may-project/</link>
		<comments>http://kudithipudi.org/2012/05/01/2012-may-project/#comments</comments>
		<pubDate>Tue, 01 May 2012 20:40:20 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kudithipudi.org/?p=1417</guid>
		<description><![CDATA[Continuing on my project/month theme.. here is what I want to accomplish in May 2012 Understand Google App Engine and Windows Azure Platforms Write a simple application and deploy it both the platforms The application that I am envisioning will display the &#8220;user agent&#8221; string of the client trying to access the application. I know [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing on my project/month theme.. here is what I want to accomplish in May 2012</p>
<ul>
<li>Understand <a href="https://developers.google.com/appengine/">Google App Engine</a> and <a href="http://www.windowsazure.com/en-us/">Windows Azure</a> Platforms</li>
<li>Write a simple application and deploy it both the platforms</li>
<li>The application that I am envisioning will display the &#8220;<a href="http://en.wikipedia.org/wiki/User_agent">user agent</a>&#8221; string of the client trying to access the application. I know there are tons of sites that already do this.. but I think this is an useful tool to have in your bag of tricks <img src='http://kudithipudi.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . It is simple enough that I think I can program it in a month.</li>
</ul>
<p>Why am I doing this? I understand the <a href="http://en.wikipedia.org/wiki/Infrastructure_as_a_service#Service_Models">IaaS</a> area pretty well, but am not well versed in the <a href="http://en.wikipedia.org/wiki/Platform_as_a_service">PaaS</a> arena. Hoping this adventure will teach me some new things. And yes, I do plan on documenting my journey <img src='http://kudithipudi.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Wish me luck <img src='http://kudithipudi.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://kudithipudi.org/2012/05/01/2012-may-project/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>HOW TO : Configure Jboss to not show backend server name when proxying https (ssl) traffic</title>
		<link>http://kudithipudi.org/2012/04/30/how-to-configure-jboss-to-not-show-backend-server-name-when-proxying-https-ssl-traffic/</link>
		<comments>http://kudithipudi.org/2012/04/30/how-to-configure-jboss-to-not-show-backend-server-name-when-proxying-https-ssl-traffic/#comments</comments>
		<pubDate>Tue, 01 May 2012 00:32:34 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[jboss]]></category>

		<guid isPermaLink="false">http://kudithipudi.org/?p=1415</guid>
		<description><![CDATA[Phew.. that was a long title .  Was running into an issue with the setup shown in the picture below When we try to access the web site using https, the html content being served back was showing the app server name as the reference, rather than the web site. So in this example, let&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Phew.. that was a long title <img src='http://kudithipudi.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .  Was running into an issue with the setup shown in the picture below <img class="aligncenter" title="Web App Proxy Setup" src="http://farm8.staticflickr.com/7261/6985879760_2748debcfe_o_d.png" alt="" width="480" height="133" /></p>
<p>When we try to access the web site using https, the html content being served back was showing the app server name as the reference, rather than the web site.</p>
<p>So in this example, let&#8217;s say the web address was kudithipudi.org and the app server was app-server-kudithipudi, the HTML content was showing https://app-server-kudithipudi:8080 as the source.</p>
<p>Here&#8217;s how, we fixed it.</p>
<p>Edit the server.xml file found in $JBOSS_HOME/server/$JBOSS_PROFILE/deploy/jboss-web.deployer and update the HTTPS connector to use the web address (kudithipudi.org) as the proxyName.</p>
<p><strong>BEFORE</strong></p>
<pre class="brush: plain; title: ; notranslate">&lt;Connector port=&quot;8443&quot; protocol=&quot;HTTP/1.1&quot; SSLEnabled=&quot;true&quot;
maxThreads=&quot;250&quot; scheme=&quot;https&quot; secure=&quot;true&quot;
clientAuth=&quot;false&quot; sslProtocol=&quot;TLS&quot;
keystoreFile=&quot;/opt/jboss/jboss-as/server/kudithipudi/conf/ssl/kudithipudi.keystore&quot;
keystorePass=&quot;xxxxxx&quot; /&gt;
</pre>
<p><strong>AFTER</strong></p>
<pre class="brush: plain; title: ; notranslate">&lt;Connector port=&quot;8443&quot; protocol=&quot;HTTP/1.1&quot; SSLEnabled=&quot;true&quot;
maxThreads=&quot;250&quot; scheme=&quot;https&quot; secure=&quot;true&quot;
clientAuth=&quot;false&quot; sslProtocol=&quot;TLS&quot;
proxyName=&quot;kudithipudi.org&quot; proxyPort=&quot;443&quot;
keystoreFile=&quot;/opt/jboss/jboss-as/server/kudithipudi/conf/ssl/kudithipudi.keystore&quot;
keystorePass=&quot;xxxxxx&quot; /&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://kudithipudi.org/2012/04/30/how-to-configure-jboss-to-not-show-backend-server-name-when-proxying-https-ssl-traffic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Uptime : Progress Report 7 : Putting the finishing touches</title>
		<link>http://kudithipudi.org/2012/04/18/project-uptime-progress-report-7-putting-the-finishing-touches/</link>
		<comments>http://kudithipudi.org/2012/04/18/project-uptime-progress-report-7-putting-the-finishing-touches/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 06:24:47 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kudithipudi.org/?p=1383</guid>
		<description><![CDATA[We finally come to one of the last posts of Project Uptime. Now that all the components have been setup, I finally copied the wordpress directory from my old server to the new one. The only changes, I had to make after copying the files were Configure Apache to have the wordpress folder as the [...]]]></description>
			<content:encoded><![CDATA[<p>We finally come to one of the last posts of <a href="http://kudithipudi.org/2012/03/05/project-uptime/">Project Uptime</a>. Now that all the components have been setup, I finally copied the wordpress directory from my old server to the new one. The only changes, I had to make after copying the files were</p>
<ol>
<li>Configure Apache to have the wordpress folder as the default directory. I did this by changing the DocumentRoot option in the vhost</li>
<li>Changed the permissions on the wordpress directories (so that wordpress can make rewrite rule changes on the fly)</li>
</ol>
<pre class="brush: plain; title: ; notranslate">sudo chmod -v 664 $WORDPRESS_DIRECTORY/.htaccess

sudo chmod 755 $WORDPRESS_DIRECTORY/wp-content </pre>
]]></content:encoded>
			<wfw:commentRss>http://kudithipudi.org/2012/04/18/project-uptime-progress-report-7-putting-the-finishing-touches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW TO : Configure Jboss to use hugepages in RHEL/CentOS</title>
		<link>http://kudithipudi.org/2012/04/17/how-to-configure-jboss-to-use-hugepages-in-rhelcentos/</link>
		<comments>http://kudithipudi.org/2012/04/17/how-to-configure-jboss-to-use-hugepages-in-rhelcentos/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 22:23:42 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kudithipudi.org/?p=1374</guid>
		<description><![CDATA[Most of us worry about paging to disk (swap), but if you are running a transaction intensive application the paging that happens in RAM also starts to impact the application performance. This happens due to the size of the &#8220;block&#8221; that is used to store data in memory. Hugepages allows you to store the data [...]]]></description>
			<content:encoded><![CDATA[<p>Most of us worry about paging to disk (swap), but if you are running a transaction intensive application the paging that happens in RAM also starts to impact the application performance. This happens due to the size of the &#8220;block&#8221; that is used to store data in memory. Hugepages allows you to store the data in bigger blocks, hence reducing the need to page while interacting with the data.</p>
<p>Here is how you can enable hugepages and configure jboss (actually any Java app) to use hugepages on a RHEL/CentoOS system.</p>
<p><strong>OS CONFIGURATION</strong></p>
<ol>
<li>Check if your system is capable of supporting hugepages by running
<pre class="brush: plain; title: ; notranslate">grep HUGETLB /boot/config-`uname -r`</pre>
<p>If you see the response as below, you should be good
<pre class="brush: plain; title: ; notranslate">CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
</pre>
</li>
</ol>
<ul>
<li>Next check if huge pages are already being used by running
<pre class="brush: plain; title: ; notranslate">cat /proc/sys/vm/nr_hugepages </pre>
</li>
</ul>
<ol>
<li>If the response is anything other than 0, that means hugepages have already been configured.</li>
</ol>
<ul>
<li>Find the block size for hugepages by running
<pre class="brush: plain; title: ; notranslate">cat /proc/meminfo | grep -i hugepagesize </pre>
</li>
<li>Calculate the amount of memory you want to dedicate to hugepages. (note: memory allocated to hugepages cannot be used by other processes in the system, unless they are configured to use it)</li>
</ul>
<ol>
<li>For example, I want to dedicate 3GB of RAM for hugepages. So the number of hugepages would be
<pre class="brush: plain; title: ; notranslate">(3*1024*1024)/2048</pre>
</li>
</ol>
<ul>
<li>Configure the number of hugepages on the system by editing the /etc/sysctl.conf and adding the option
<pre class="brush: plain; title: ; notranslate">vm.nr_hugepages = 1536</pre>
<p>(note: I put in 1536 since that was the value I got from the above example)</li>
<li>Restart the server and check if hugepages has been enabled by running
<pre class="brush: plain; title: ; notranslate">cat /proc/meminfo | grep -i huge </pre>
</li>
</ul>
<ol>
<li>You should see something like this
<pre class="brush: plain; title: ; notranslate">AnonHugePages:    839680 kB
HugePages_Total:    1500
HugePages_Free:     1500
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
</pre>
</li>
</ol>
<p><strong>JBOSS CONFIGURATION</strong></p>
<ol>
<li>At this point your system is configured with hugepages and any application that is configured to use them can leverage them.  In this example, we want to configure Jboss to utilize these hugepages</li>
<li>Add the groupid of the user that Jboss is running under to the /etc/sysctl.conf file. In my case, the jboss user group had a GID of 505, so I added this line to /etc/sysctl.conf
<pre class="brush: plain; title: ; notranslate">vm.hugetlb_shm_group = 505 </pre>
</li>
<li>Next allocate the memory to the user by editing /etc/security/limits.conf and allocating the memory. Again, in my case, I added the following to /etc/security/limits.conf
<pre class="brush: plain; title: ; notranslate"># Allocate memory for Jboss user to take advantage of hugepages
jboss   soft    memlock 1500
jboss   hard    memlock 1500
</pre>
</li>
<li>Finally add the following to the Jboss startup parameters. I edited the $JBOSS_HOME/bin/run.sh file. (note: the startup file can be different based on your config) with the option
<pre class="brush: plain; title: ; notranslate"> -XX:+UseLargePages</pre>
</li>
<li>Restart Jboss and you are good to go</li>
</ol>
<p>note : A lot articles that I read online say that hugepages are effective when you are allocating large amounts of RAM to the application. The use case of just using 3GB above was just that.. a use case.</p>
<p>While I cannot personally vouch for it, a lot of users have noted that they saw &gt;2 fold increase in performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://kudithipudi.org/2012/04/17/how-to-configure-jboss-to-use-hugepages-in-rhelcentos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Uptime : Progress Report 6 : Tweaking Varnish</title>
		<link>http://kudithipudi.org/2012/04/14/project-uptime-progress-report-6-tweaking-varnish/</link>
		<comments>http://kudithipudi.org/2012/04/14/project-uptime-progress-report-6-tweaking-varnish/#comments</comments>
		<pubDate>Sat, 14 Apr 2012 05:54:00 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kudithipudi.org/?p=1371</guid>
		<description><![CDATA[The server has held up pretty well, since the installation of varnish. Based on this wiki post, I added the following to /etc/varnish/default.vcl I think the comments are pretty self explanatory.]]></description>
			<content:encoded><![CDATA[<p>The server has held up pretty well, since <a href="http://kudithipudi.org/2012/04/02/project-uptime-progress-report-5-getting-ready-for-reddit-and-hacker-news/">the installation</a> of varnish. Based on <a href="https://www.varnish-cache.org/trac/wiki/VarnishAndWordpress">this</a> wiki post, I added the following to /etc/varnish/default.vcl</p>
<pre class="brush: plain; title: ; notranslate">
&lt;pre&gt;
# Drop any cookies sent to WordPress.
sub vcl_recv {
        if (!(req.url ~ &quot;wp-(login|admin)&quot;)) {
                unset req.http.cookie;
        }
}

# Drop any cookies WordPress tries to send back to the client.
sub vcl_fetch {
        if (!(req.url ~ &quot;wp-(login|admin)&quot;)) {
                unset beresp.http.set-cookie;
        }
}
</pre>
<p>I think the comments are pretty self explanatory.</p>
]]></content:encoded>
			<wfw:commentRss>http://kudithipudi.org/2012/04/14/project-uptime-progress-report-6-tweaking-varnish/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Apache mod_rewrite for enhancing your application security</title>
		<link>http://kudithipudi.org/2012/04/11/using-apache-mod_rewrite-for-enhancing-your-application-security/</link>
		<comments>http://kudithipudi.org/2012/04/11/using-apache-mod_rewrite-for-enhancing-your-application-security/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 13:50:16 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kudithipudi.org/?p=1356</guid>
		<description><![CDATA[For my own notes.. very nice post on perishablepress.com regarding using the different capabilities of mod_rewrite to secure your website (application) http://perishablepress.com/eight-ways-to-blacklist-with-apaches-mod_rewrite/]]></description>
			<content:encoded><![CDATA[<p>For my own notes.. very nice post on <a href="http://perishablepress.com/">perishablepress.com</a> regarding using the different capabilities of mod_rewrite to secure your website (application)</p>
<p><a href="http://perishablepress.com/eight-ways-to-blacklist-with-apaches-mod_rewrite/">http://perishablepress.com/eight-ways-to-blacklist-with-apaches-mod_rewrite/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kudithipudi.org/2012/04/11/using-apache-mod_rewrite-for-enhancing-your-application-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW TO : Redirect web traffic based on URL patterns in Apache</title>
		<link>http://kudithipudi.org/2012/04/09/how-to-redirect-web-traffic-based-on-url-patterns-in-apache/</link>
		<comments>http://kudithipudi.org/2012/04/09/how-to-redirect-web-traffic-based-on-url-patterns-in-apache/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 23:27:51 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kudithipudi.org/?p=1343</guid>
		<description><![CDATA[Apache configuration to redirect traffic to a particular URL based on the pattern in the URL (AKA URI). In this particular example, I want to redirect any traffic that does not have the URL starting with /application or /content to redirect to https://domain_name/application Enable the rewrite module in Apache Add the following conditions in the [...]]]></description>
			<content:encoded><![CDATA[<p>Apache configuration to redirect traffic to a particular URL based on the pattern in the URL (AKA URI). In this particular example, I want to redirect any traffic that does not have the URL starting with /application or /content to redirect to https://domain_name/application</p>
<ul>
<li>Enable the <a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html">rewrite module</a> in Apache</li>
<li>Add the following conditions in the conf file
<pre class="brush: plain; title: ; notranslate">RewriteCond %{REQUEST_URI} !^/(application|content) [NC]
RewriteRule ^/(.*) https://%{HTTP_HOST}/application [R,L]
</pre>
</li>
</ul>
<p>Explanation of the rule</p>
<ul>
<li>! implies match if the string is not found</li>
<li>^ implies start of string</li>
<li>| implies OR</li>
<li>[NC] implies not case sensitive (no case)</li>
<li>The rule will be triggered if the conditions match</li>
<li>[R,L] means external (client side) redirection and last rule to process</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kudithipudi.org/2012/04/09/how-to-redirect-web-traffic-based-on-url-patterns-in-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW TO : Configure Jboss to send log messages to syslog</title>
		<link>http://kudithipudi.org/2012/04/04/how-to-configure-jboss-to-send-log-messages-to-syslog/</link>
		<comments>http://kudithipudi.org/2012/04/04/how-to-configure-jboss-to-send-log-messages-to-syslog/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 15:27:13 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kudithipudi.org/?p=1326</guid>
		<description><![CDATA[Jboss uses the log4j framework for providing logging services. log4j is a very flexible framework and can do a lot of things. One of the features provided by log4j is to send log messages to multiple destinations. Here is a quick how to on configuring Jboss to send log messages using the syslog protocol to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jboss.org">Jboss</a> uses the <a href="http://logging.apache.org/log4j/index.html">log4j</a> framework for providing logging services. log4j is a very flexible framework and can do a lot of things. One of the features provided by log4j is to send log messages to multiple destinations. Here is a quick how to on configuring Jboss to send log messages using the syslog protocol to a syslog server. This is pretty useful, when you are trying to consolidate logs from multiple sources into a central location.</p>
<p>First, some background about how log4j is configured in Jboss</p>
<p>The log4j configuration in Jboss is managed by the file jboss-log4j.xml located at $JBOSS_HOME/server/$JBOSS_PROFILE/conf.</p>
<p>There are three parts to this configuration file</p>
<ol>
<li>Appenders</li>
<ul>
<li>An appender is a way to define a particular logging method. By default, Jboss provides a bunch of appenders in this config file, but only the FILE and CONSOLE appenders are enabled. The FILE appender writes the log messages to a log file and rotates them based on the criteria in the appender. The CONSOLE appender just sends messages to the console. This will come into picture, when you are not running Jboss as a service. In addition, there are appenders for syslog, snmp, email that are commented out.</li>
</ul>
<li>Categories</li>
<ul>
<li>A category is where you define the class you want to log  messages for and which appender it should use. If you don&#8217;t specify an appender or the threshold for the logging level, logging for this class will be done at the default log levels and by the appender specified by the default (root) category.</li>
</ul>
<li>Default (root) Category</li>
<ul>
<li>As mentioned above, this is the catch all for classes that are not specified specifically in the categories section.</li>
</ul>
</ol>
<p>So pictorially, it would look like this <img class="aligncenter" title="Jboss : log4j Layout" src="http://farm6.staticflickr.com/5280/6899088292_a24242b145_d.jpg" alt="" width="500" height="454" /></p>
<p>Getting back to the reason for this post, here is how you would enable the syslog appender and then configure a category to use this appender. For this example, we will use a class names org.kudithipudi</p>
<ol>
<li>Enable the syslog appender by un-commenting the following section in the jboss-log4j.xml file
<pre class="brush: plain; title: ; notranslate">   &lt;!-- Syslog events --&gt;
&lt;appender name=&quot;SYSLOG&quot;&gt;
&lt;errorHandler/&gt;
&lt;param name=&quot;Threshold&quot; value=&quot;ERROR&quot;/&gt;
&lt;param name=&quot;Facility&quot; value=&quot;LOCAL7&quot;/&gt;
&lt;param name=&quot;FacilityPrinting&quot; value=&quot;true&quot;/&gt;
&lt;param name=&quot;SyslogHost&quot; value=&quot;localhost&quot;/&gt;
&lt;layout&gt;
&lt;param name=&quot;ConversionPattern&quot; value=&quot;[%d{ABSOLUTE},%c{1}] %m%n&quot;/&gt;
&lt;/layout&gt;
&lt;/appender&gt;
</pre>
</li>
<li>Add a new category to use this appender
<pre class="brush: plain; title: ; notranslate">   &lt;category name=&quot;org.kudithipudi&quot;&gt;
&lt;priority value=&quot;INFO&quot; /&gt;
&lt;appender-ref ref=&quot;SYSLOG&quot;/&gt;
&lt;/category&gt; </pre>
</li>
<li>Restart Jboss and you should see messages from Jboss being sent to the syslog server</li>
</ol>
<p>Couple of notes..</p>
<ul>
<li>Even though we are specifying the threshold of INFO in the category, because we specified a threshold of ERROR in the appender, only message of ERROR type will be sent to the syslog server. This is actually pretty useful when you want to specify two appenders to a category and log them at different levels. You can set another appender to INFO level and add it to this category. And in essence, the appender will log everything of INFO and higher, while the syslog appender will only process ERROR messages.</li>
<li>The destination for the syslog messages is the SysLogHost parameter. In this example, I just used localhost.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kudithipudi.org/2012/04/04/how-to-configure-jboss-to-send-log-messages-to-syslog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Uptime : Progress Report 5 : Getting ready for Reddit and Hacker News</title>
		<link>http://kudithipudi.org/2012/04/02/project-uptime-progress-report-5-getting-ready-for-reddit-and-hacker-news/</link>
		<comments>http://kudithipudi.org/2012/04/02/project-uptime-progress-report-5-getting-ready-for-reddit-and-hacker-news/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 02:03:30 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kudithipudi.org/?p=1318</guid>
		<description><![CDATA[A very timely post on Hacker News by Ewan Leith about configuring a low end server to take ~11million hits/per month gave me some more ideas on optimizing the performance of this website. Ewan used a combination of nginx and varnish to get the server to respond to such traffic. From my earlier post, you [...]]]></description>
			<content:encoded><![CDATA[<p>A very <a href="http://news.ycombinator.com/item?id=3775715">timely post</a> on <a href="http://news.ycombinator.com">Hacker News</a> by <a href="http://www.ewanleith.com">Ewan Leith</a> about configuring a low end server to take ~11million hits/per month gave me some more ideas on optimizing the performance of this website. Ewan used a combination of <a href="htt://nginx.org">nginx</a> and <a href="https://www.varnish-cache.org/">varnish</a> to get the server to respond to such traffic.</p>
<p>From my <a href="http://kudithipudi.org/2012/03/05/project-uptime/">earlier post</a>, you might recall, that I planned on checking out nginx as the web server, but then ended up using <a href="http://kudithipudi.org/2012/03/28/project-uptime-progress-report-3/">Apache</a>. My earlier stack looked like this <img class="aligncenter" title="Stack - Old" src="http://farm8.staticflickr.com/7059/6894483670_4f80897e59_n_d.jpg" alt="" width="320" height="228" />Based on the recommendations from Ewan&#8217;s article, I decided to add Varnish to the picture. So here is how the stack looks currently<img class="aligncenter" title="Stack - New" src="http://farm8.staticflickr.com/7188/6894483686_dbd524fedb_n_d.jpg" alt="" width="320" height="228" /></p>
<p>And boy, did the performance improve or what. Here are some before and after performance charts based on a test run from <a href="http://blitz.io">blitz.io</a>. The test lasted for 60 seconds and was for 250 simultaneous connections.</p>
<p><strong>BEFORE</strong></p>
<ul>
<li>Screenshot of Response times and hit rates. Note that the server essentially stopped responding 25 minutes into the test. <img class="aligncenter" title="Pre Varnish" src="http://farm8.staticflickr.com/7085/7039058711_ec1ee1d2de_z_d.jpg" alt="" width="640" height="550" /></li>
<li>Screenshot of the analysis summary. 84% error rate!! <img class="aligncenter" title="Pre Varnish - 2" src="http://farm8.staticflickr.com/7241/7039058741_24785181aa_z_d.jpg" alt="" width="640" height="220" /></li>
</ul>
<p><strong>AFTER</strong></p>
<ul>
<li>Screenshot of response times and hit rates<img class="aligncenter" title="Post Varnish - 1" src="http://farm8.staticflickr.com/7126/7039058817_7a2bacb17a_z_d.jpg" alt="" width="640" height="552" /></li>
<li>Screenshot of summary of Analysis. 99.98% success rate!!<img class="aligncenter" title="Post Varnish - 2" src="http://farm8.staticflickr.com/7125/7039058847_26f9765f78_z_d.jpg" alt="" width="640" height="200" /></li>
</ul>
<p>&nbsp;</p>
<p>What a difference!!.. The server in fact stopped responding after the first test and had to be hard rebooted.  So how did I achieve it? By mostly copying the ideas from Ewan <img src='http://kudithipudi.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . The final configuration for serving the web pages looks like this on the server end</p>
<p>Varnish (listens on TCP 80) &#8211;&gt; Apache (listens on TCP 8080)</p>
<p><strong>NOTE :</strong> All the configuration guides (as with the previous entries of the posts in this series) are specific to Ubuntu.</p>
<ol>
<li>Configure Apache to listen on port 8080</li>
<ol>
<li>Stop Apache
<pre class="brush: plain; title: ; notranslate"> sudo service apache2 stop </pre>
</li>
<li>Edit the following files to change the default port from 80 to 8080</li>
<ol>
<li>/etc/apache2/ports.conf</li>
<ol>
<li>Change
<pre class="brush: plain; title: ; notranslate">NameVirtualHost *:80
Listen 80
</pre>
</li>
<li>to
<pre class="brush: plain; title: ; notranslate">NameVirtualHost *:8080
Listen 8080
</pre>
</li>
</ol>
<li>/etc/apache2/sites-available/default.conf (NOTE: This is the default sample site that comes with the package. You can create a new one for your site.  If you do so, you need to edit your site specific conf file)</li>
<ol>
<li>Change
<pre class="brush: plain; title: ; notranslate"> &lt;VirtualHost *:80&gt; </pre>
</li>
<li>To
<pre class="brush: plain; title: ; notranslate">&lt;VirtualHost *:8080&gt; </pre>
</li>
</ol>
</ol>
<li>Restart apache and ensure that it is listening on port 8080 by using this <a href="http://kudithipudi.org/2011/01/26/how-to-find-out-which-network-port-a-program-is-using-in-linux/">trick</a>.</li>
</ol>
<li>Install Varnish and configure it to listen on port 80</li>
<ol>
<li>Add the Varnish repository to the system and install the package
<pre class="brush: plain; title: ; notranslate">sudo curl http://repo.varnish-cache.org/debian/GPG-key.txt | apt-key add -
sudo echo &quot;deb http://repo.varnish-cache.org/ubuntu/ lucid varnish-3.0&quot; &gt;&gt; /etc/apt/sources.list
sudo apt-get update
sudo apt-get install varnish
</pre>
</li>
<li>Configure Varnish to listen on port 80 and use 64Mb of RAM for caching. (<strong>NOTE:</strong> Varnish uses port 8080 to get to the backend, in this case Apache, by default. So there is no need to configure it specifically).</li>
<ol>
<li>Edit the file /etc/default/varnish</li>
<ol>
<li>Change
<pre class="brush: plain; title: ; notranslate">DAEMON_OPTS=&quot;-a :6081 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,256m&quot;
</pre>
</li>
<li>To
<pre class="brush: plain; title: ; notranslate"> DAEMON_OPTS=&quot;-a :80 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,64m&quot;
</pre>
</li>
</ol>
</ol>
<li>Restart Varnish
<pre class="brush: plain; title: ; notranslate">sudo service varnish restart</pre>
<p>and you are ready to rock and roll.</li>
</ol>
</ol>
<p>There are some issues with this setup in terms of logging. Unlike your typical web server logs, where every request is logged, I noticed that not all the requests were being logged. I guess, that is because varnish is serving the content from cache. I have to figure out how to get that working. But that is for another post <img src='http://kudithipudi.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://kudithipudi.org/2012/04/02/project-uptime-progress-report-5-getting-ready-for-reddit-and-hacker-news/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HOW TO : Perform OCR on PDF files for free</title>
		<link>http://kudithipudi.org/2012/03/31/how-to-perform-ocr-on-pdf-files-for-free/</link>
		<comments>http://kudithipudi.org/2012/03/31/how-to-perform-ocr-on-pdf-files-for-free/#comments</comments>
		<pubDate>Sat, 31 Mar 2012 13:12:25 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kudithipudi.org/?p=1310</guid>
		<description><![CDATA[I had to convert a scanned PDF file into an editable document recently. You can do this using OCR and there is a ton of software out there, that does this. There are even web based services that do this. But each of them had limitations (either had to buy the software or limit in [...]]]></description>
			<content:encoded><![CDATA[<p>I had to convert a scanned PDF file into an editable document recently. You can do this using <a href="http://en.wikipedia.org/wiki/Optical_character_recognition">OCR</a> and there is a <a href="http://en.wikipedia.org/wiki/List_of_optical_character_recognition_software">ton</a> of software out there, that does this. There are even <a href="http://www.free-ocr.com/">web based services</a> that do this. But each of them had limitations (either had to buy the software or limit in the number of pages that can be scanned). I didn&#8217;t want to buy the license, since this is not something I would be doing regularly and the document I had to convert was 61 pages, so none of the online services allowed me to do it. I remembered reading that Google Docs, added this (OCR) capability a while ago and since I have a Google Apps account, I decided to give it a try.</p>
<p>Google also has a limit of 2 pages per OCR conversion. So after some brainstorming, I came up with this quick hack to use <a href="http://docs.google.com">Google Docs</a> for converting large PDF files into editable content.</p>
<ol>
<li>Split the PDF file into two page documents using <a href="http://www.pdfsam.org/">PDFsam</a> (Open Source PDF Split and Merge Tool).</li>
<li>Log into your Google Docs interface at <a href="http://docs.google.com">http://docs.google.com</a> . All you need is a Google Account to use this feature</li>
<li>Create a folder (collection) to organize your files. This is not required, but it will make searching for the files a lot easier <img class="aligncenter" title="Google Docs : Creation New Collection" src="http://farm8.staticflickr.com/7080/7038644631_3201ef721f_d.jpg" alt="" width="249" height="344" /></li>
<li>Check the settings to convert PDF files to editable <img class="aligncenter" title="Google Docs : Convert PDF to text" src="http://farm8.staticflickr.com/7255/6892548786_b7a3f38335_z_d.jpg" alt="" width="640" height="211" /></li>
<li>Upload the PDF files you created in step 1. <img class="aligncenter" title="Google Docs : Upload Files" src="http://farm8.staticflickr.com/7191/7038644647_0a5176e6a9_o_d.png" alt="" width="157" height="165" /></li>
<li>As you upload the files, Google creates an editable document with the text from the PDF files. You can then create a new document and copy/paste the content from all the smaller files.</li>
</ol>
<p>I think someone with more programming chops than me can improve this by using the <a href="https://developers.google.com/google-apps/documents-list/">Google API</a> to do the copy/paste from the smaller docs into the final document <img src='http://kudithipudi.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://kudithipudi.org/2012/03/31/how-to-perform-ocr-on-pdf-files-for-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

