<?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>Making Life Simple &#187; linux</title>
	<atom:link href="http://www.lalitmehta.com/home/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lalitmehta.com/home</link>
	<description></description>
	<lastBuildDate>Tue, 09 Feb 2010 21:36:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Integrate Apache 2 with Tomcat 6</title>
		<link>http://www.lalitmehta.com/home/2010/01/18/integrate-apache-2-with-tomcat-6/</link>
		<comments>http://www.lalitmehta.com/home/2010/01/18/integrate-apache-2-with-tomcat-6/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 20:08:18 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[general web]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=131</guid>
		<description><![CDATA[I have been trying to configure apache/tomcat is such a way that apache comes on the front-end so that I can have all the features of apache like URL rewriting, virtual hosts, PHP etc. and forward only certain requests to tomcat whose only job should be running servlets. I have CentOS installed on my server [...]]]></description>
			<content:encoded><![CDATA[<p>I have been trying to configure apache/tomcat is such a way that apache comes on the front-end so that I can have all the features of apache like URL rewriting, virtual hosts, PHP etc. and forward only certain requests to tomcat whose only job should be running servlets.</p>
<p>I have CentOS installed on my server with Apache 2 installed through yum and the goal was to install the binaries for Tomcat 6 and make them talk to each other.  After some googling, the best tutorial I found to configure tomcat through mod_jk was found <a href="http://www3.ntu.edu.sg/home/ehchua/programming/howto/Apache_Tomcat_HowTo.html" target="_blank">here</a>.  I have attached the PDF of the instructions <a title="Integrate Apache2 with Tomcat 6" href="http://www.lalitmehta.com/home/wp-content/uploads/2010/01/Apache2-Tomcat6.pdf" target="_blank">here</a>.<br />
After following the steps, I was easily able to create a worker and configure apache to forward the request to /examples to tomcat.<br />
The next issue was how to configure virtual hosts so that I can host multiple websites, some handled by apache and others through tomcat. Following is the snippet of httpd.conf setting that needs to be updated to enable virtual hosting.</p>
<p><code><br />
NameVirtualHost *:80<br />
#<br />
# NOTE: NameVirtualHost cannot be used without a port specifier<br />
# (e.g. :80) if mod_ssl is being used, due to the nature of the<br />
# SSL protocol.<br />
#<br />
#<br />
# VirtualHost example:<br />
# Almost any Apache directive may go into a VirtualHost container.<br />
# The first VirtualHost section is used for requests without a known<br />
# server name.<br />
#<br />
#&lt;VirtualHost *:80&gt;<br />
#    ServerAdmin webmaster@dummy-host.example.com<br />
#    DocumentRoot /www/docs/dummy-host.example.com<br />
#    ServerName dummy-host.example.com<br />
#    ErrorLog logs/dummy-host.example.com-error_log<br />
#    CustomLog logs/dummy-host.example.com-access_log common<br />
#&lt;/VirtualHost&gt;<br />
&lt;VirtualHost *:80&gt;</code><code><br />
ServerAdmin webmaster@lalitmehta.com<br />
ServerName www.lalitmehta.com<br />
ErrorLog logs/lalitmehta.com-error_log<br />
CustomLog logs/lalitmehta-access_log common<br />
&lt;/VirtualHost&gt;<br />
&lt;VirtualHost *:80&gt;<br />
ServerAdmin info@saiyam.com<br />
ServerName rsspile.com<br />
#   No need of DocumentRoot<br />
ErrorLog logs/rsspile.com-error_log<br />
CustomLog logs/rsspile.com-access_log common<br />
JkMount /rss ajp13<br />
JkMount /rss/* ajp13<br />
&lt;/VirtualHost&gt;<br />
</code><br />
<br />
I do have two questions though:<br />
1. since mod_jk.so is available for download for Linux, what advantage you get by compiling Apache and mod_jk from source? Most of the websites mention the need to compile the source. Let me know <img src='http://www.lalitmehta.com/home/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
2. How do I enable SSL on my server with the above configuration?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2010/01/18/integrate-apache-2-with-tomcat-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Increase maximum limit of open files per user</title>
		<link>http://www.lalitmehta.com/home/2010/01/15/increase-maximum-limit-of-open-files-per-user/</link>
		<comments>http://www.lalitmehta.com/home/2010/01/15/increase-maximum-limit-of-open-files-per-user/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 16:34:48 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=128</guid>
		<description><![CDATA[If you want to increase the limit of open files for the current session, simply run ulimit -n 2048 If you want to increase it by default, edit /etc/security/limits.conf and add *    hard     nofile     2048 *    soft     nofile     2048 or if you want to increase it only for a certain user, set it as [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to increase the limit of open files for the current session, simply run</p>
<p><code>ulimit -n 2048</code></p>
<p>If you want to increase it by default, edit /etc/security/limits.conf and add</p>
<p><code>*    hard     nofile     2048<br />
*    soft     nofile     2048</code></p>
<p>or if you want to increase it only for a certain user, set it as</p>
<p><code>userlogin    hard     nofile     2048<br />
userlogin    soft     nofile     2048</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2010/01/15/increase-maximum-limit-of-open-files-per-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Force SSL on apache</title>
		<link>http://www.lalitmehta.com/home/2009/07/10/force-ssl-on-apache/</link>
		<comments>http://www.lalitmehta.com/home/2009/07/10/force-ssl-on-apache/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 15:17:53 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=89</guid>
		<description><![CDATA[mod rewrite should be enabled on apache. Add the following to your apache config file. ######################################### #### XXX: BEGIN EDIT FOR MOD_REWRITE #### #### This is intended to force HTTPS #### #### for all inbound HTTP requests #### #### # This module (mod_rewrite) simply tells Apache2 that all connections to # port 80 need to [...]]]></description>
			<content:encoded><![CDATA[<p>mod rewrite should be enabled on apache. Add the following to your apache config file.<br />
<code><br />
#########################################<br />
#### XXX: BEGIN EDIT FOR MOD_REWRITE ####<br />
#### This is intended to force HTTPS ####<br />
#### for all inbound HTTP requests ####</p>
<p>####<br />
# This module (mod_rewrite) simply tells Apache2 that all connections to<br />
# port 80 need to go to port 443 – SSL – No exceptions<br />
####</p>
<p><IfModule !mod_rewrite.c><br />
LoadModule rewrite_module modules/mod_rewrite.so<br />
</IfModule><br />
<IfModule mod_rewrite.c><br />
RewriteEngine on</p>
<p>####<br />
# The line below sets the rewrite condition for mod_rewrite.so.<br />
# That is, if the server port does not equal 443, then this condition is true<br />
####</p>
<p>ReWriteCond %{SERVER_PORT} !^443$</p>
<p>####<br />
# The line below is the rule, it states that if above condition is true,<br />
# and the request can be any url, then redirect everything to https:// plus<br />
# the original url that was requested.<br />
####</p>
<p>RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]<br />
</IfModule></p>
<p>#### XXX: END EDIT FOR MOD_REWRITE ####<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2009/07/10/force-ssl-on-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Disable Hardware Beep Sound For Terminal</title>
		<link>http://www.lalitmehta.com/home/2009/07/08/linux-disable-turn-off-hardware-beep-sound-for-terminal/</link>
		<comments>http://www.lalitmehta.com/home/2009/07/08/linux-disable-turn-off-hardware-beep-sound-for-terminal/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 13:03:44 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=82</guid>
		<description><![CDATA[If you are using xterm, open ~/.xsession file $ cd $ vi .xession Append the following line: xset b off Save and close the file. If you are using bash shell, open ~/.inputrc file $ cd $ vi .inputrc Append following line: set bell-style none Save and close the file. If you want to turn [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li> If you are using xterm, open ~/.xsession file<br />
<code>$ cd<br />
$ vi .xession<br />
</code>Append the following line:<br />
<code>xset b off<br />
</code>Save and close the file.</li>
<li> If you are using bash shell, open ~/.inputrc file<br />
<code>$ cd<br />
$ vi .inputrc<br />
</code>Append following line:<br />
<code>set bell-style none<br />
</code>Save and close the file.</li>
<li> If you want to turn off beep for VIM text editor, open vim config file ~/.vimrc<br />
<code>$ cd<br />
$ vi .vimrc<br />
</code>Append following line<br />
<code>set vb<br />
</code>Save and close the file.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2009/07/08/linux-disable-turn-off-hardware-beep-sound-for-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove .svn folders</title>
		<link>http://www.lalitmehta.com/home/2009/07/08/remove-svn-folders/</link>
		<comments>http://www.lalitmehta.com/home/2009/07/08/remove-svn-folders/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 07:04:41 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=78</guid>
		<description><![CDATA[In order to clean up the SVN checkout, you can do #deletes all .svn files/folders find . -name ".svn" -exec rm -rf {} \; OR #deletes all .svn folders find . -name ".svn" -type d -exec rm -rf {} \;]]></description>
			<content:encoded><![CDATA[<p>In order to clean up the SVN checkout, you can do</p>
<p><code>#deletes all .svn files/folders<br />
find . -name ".svn" -exec rm -rf {} \;<br />
</code></p>
<p>OR</p>
<p><code>#deletes all .svn folders<br />
find . -name ".svn" -type d -exec rm -rf {} \;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2009/07/08/remove-svn-folders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TOP 25 Most Dangerous Programming Errors</title>
		<link>http://www.lalitmehta.com/home/2009/01/13/top-25-most-dangerous-programming-errors/</link>
		<comments>http://www.lalitmehta.com/home/2009/01/13/top-25-most-dangerous-programming-errors/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 01:59:07 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[Windoze]]></category>
		<category><![CDATA[general web]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=68</guid>
		<description><![CDATA[CWE-20:Improper Input Validation CWE-116:Improper Encoding or Escaping of Output CWE-89:Failure to Preserve SQL Query Structure CWE-79:Failure to Preserve Web Page Structure CWE-78:Failure to Preserve OS Command Structure CWE-319:Cleartext Transmission of Sensitive Information CWE-352:Cross-Site Request Forgery CWE-362:Race Condition CWE-209:Error Message Information Leak CWE-119:Failure to Constrain Operations within the Bounds of a Memory Buffer CWE-642:External Control of [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>CWE-20:Improper Input Validation</li>
<li>CWE-116:Improper Encoding or Escaping of Output</li>
<li>CWE-89:Failure to Preserve SQL Query Structure</li>
<li>CWE-79:Failure to Preserve Web Page Structure</li>
<li>CWE-78:Failure to Preserve OS Command Structure</li>
<li>CWE-319:Cleartext Transmission of Sensitive Information</li>
<li>CWE-352:Cross-Site Request Forgery</li>
<li>CWE-362:Race Condition</li>
<li>CWE-209:Error Message Information Leak</li>
<li>CWE-119:Failure to Constrain Operations within the Bounds of a Memory Buffer</li>
<li>CWE-642:External Control of Critical State Data</li>
<li>CWE-73:External Control of File Name or Path</li>
<li>CWE-426:Untrusted Search Path</li>
<li>CWE-94:Failure to Control Generation of Code</li>
<li>CWE-494:Download of Code Without Integrity Check</li>
<li>CWE-404:Improper Resource Shutdown or Release</li>
<li>CWE-665:Improper Initialization</li>
<li>CWE-682:Incorrect Calculation</li>
<li>CWE-285:Improper Access Control</li>
<li>CWE-327:Use of a Broken or Risky Cryptographic Algorithm</li>
<li>CWE-259:Hard-Coded Password</li>
<li>CWE-732:Insecure Permission Assignment for Critical Resource</li>
<li>CWE-330:Use of Insufficiently Random Values</li>
<li>CWE-250:Execution with Unnecessary Privileges</li>
<li>CWE-602:Client-Side Enforcement of Server-Side Security</li>
</ol>
<p><a title="Top 25 most dangerous programming errors" href="http://www.sans.org/top25errors/" target="_blank">Full story</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2009/01/13/top-25-most-dangerous-programming-errors/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>oracle XE &#8220;cannot access http://127.0.0.1:8080/apex&#8221;</title>
		<link>http://www.lalitmehta.com/home/2008/12/26/oracle-xe-cannot-access-http1270018080apex/</link>
		<comments>http://www.lalitmehta.com/home/2008/12/26/oracle-xe-cannot-access-http1270018080apex/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 17:41:30 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/?p=65</guid>
		<description><![CDATA[I had installed oracle XE on CentOS and was not able to connect to web admin for past two days. Finally after a long two days of search, found this. Thanks!]]></description>
			<content:encoded><![CDATA[<p>I had installed oracle XE on CentOS and was not able to connect to web admin for past two days. Finally after a long two days of search, found <a href="http://www.zyxware.com/articles/2008/12/24/oracle-xe-solution-to-cannot-access-http-127-0-0-1-8080apex-errors" target="_blank">this</a>.</p>
<p>Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2008/12/26/oracle-xe-cannot-access-http1270018080apex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delete all iptables rules</title>
		<link>http://www.lalitmehta.com/home/2008/02/05/delete-all-iptables-rules/</link>
		<comments>http://www.lalitmehta.com/home/2008/02/05/delete-all-iptables-rules/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 06:21:16 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/2008/02/05/delete-all-iptables-rules/</guid>
		<description><![CDATA[Enter the following to delete iptables completely # iptables -F # iptables -t nat -F # iptables -t mangle -F # iptables -X]]></description>
			<content:encoded><![CDATA[<p>Enter the following to delete iptables completely</p>
<p># iptables -F<br />
# iptables -t nat -F<br />
# iptables -t mangle -F<br />
# iptables -X</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2008/02/05/delete-all-iptables-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tomcat does not run on port 80 as non-root</title>
		<link>http://www.lalitmehta.com/home/2008/01/30/tomcat-does-not-run-on-port-80-as-non-root/</link>
		<comments>http://www.lalitmehta.com/home/2008/01/30/tomcat-does-not-run-on-port-80-as-non-root/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 04:02:05 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/2008/01/30/tomcat-does-not-run-on-port-80-as-non-root/</guid>
		<description><![CDATA[It is not recommended to make tomcat listen in 80 port, since Tomcat would need to run as a privileged user. It is suggested either you redirect the port traffic using iptables . # /sbin/iptables -A FORWARD -p tcp --destination-port 80 -j ACCEPT # /sbin/iptables -t nat -A PREROUTING -j REDIRECT -p tcp --destination-port 80 [...]]]></description>
			<content:encoded><![CDATA[<p>It is not recommended to make tomcat listen in 80 port, since Tomcat would need to run as a privileged user.</p>
<p>It is suggested either you redirect the port traffic using iptables .</p>
<pre>
# /sbin/iptables -A FORWARD -p tcp --destination-port 80 -j ACCEPT
# /sbin/iptables -t nat -A PREROUTING -j REDIRECT -p tcp
--destination-port 80 -to-port 8080
# /sbin/iptables-save</pre>
<p>Please remember that in this case clients connecting from server itself have to connect to 8080 port itself.</p>
<p>OR</p>
<p>Another option is to use Apache as a front end to all requests and use modules to redirect to tomcat.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2008/01/30/tomcat-does-not-run-on-port-80-as-non-root/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>java.net.SocketException: Too many open files</title>
		<link>http://www.lalitmehta.com/home/2008/01/18/javanetsocketexception-too-many-open-files/</link>
		<comments>http://www.lalitmehta.com/home/2008/01/18/javanetsocketexception-too-many-open-files/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 22:27:29 +0000</pubDate>
		<dc:creator>lalit</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.lalitmehta.com/home/2008/01/18/javanetsocketexception-too-many-open-files/</guid>
		<description><![CDATA[For System Wide settings To see the settings for maximum open files for the OS level, use following command. cat /proc/sys/fs/file-max This should be a value from 36000 to 50000 or more. To increase the system wide maximum open files, as root edit the /etc/sysctl.conf and add the following to the end of the file. [...]]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: underline;">For System Wide settings</span><br />
To see the settings for maximum open files for the OS level, use following command.<br />
<em>cat /proc/sys/fs/file-max</em><br />
This should be a value from 36000 to 50000 or more. To increase the system wide maximum open files, as root edit the /etc/sysctl.conf and add the following to the end of the file.</p>
<p>Note: The following example will increase the maximum number of files to 49,500 on your currently running system and will persist after rebooting.</p>
<p>fs.file-max = 49500</p>
<p>Then issue the following command to activate this change to your live system.<br />
sysctl -p</p>
<p><span style="text-decoration: underline;">For user level setting</span></p>
<p>Also, you should update /etc/security/limits.conf for the user.</p>
<p>myuser hard nofile 2048<br />
myuser soft nofile 2048</p>
<p>Type this to see what it&#8217;s set at:</p>
<p>ulimit -a</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lalitmehta.com/home/2008/01/18/javanetsocketexception-too-many-open-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
