<?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>NamHuy &#187; Huy Tran</title>
	<atom:link href="http://namhuy.org/blog/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://namhuy.org/blog</link>
	<description>Includes news, help, tutorials, programming, tips and how-to guides for Linux, UNIX, and BSD</description>
	<lastBuildDate>Fri, 20 Jan 2012 19:37:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Do HTTP authentication over HTTPS with URL rewriting</title>
		<link>http://namhuy.org/blog/2012/01/20/do-http-authentication-over-https-with-url-rewriting/</link>
		<comments>http://namhuy.org/blog/2012/01/20/do-http-authentication-over-https-with-url-rewriting/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 19:37:47 +0000</pubDate>
		<dc:creator>Huy Tran</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Tips - Tricks]]></category>

		<guid isPermaLink="false">http://namhuy.org/blog/?p=347</guid>
		<description><![CDATA[I am trying to protect the ~/public_html/dev directory using http auth basic, but to make that secure I want to run it over ssl. The middle section of the below .htaccess file switches to https if the request URI begins &#8230; <a href="http://namhuy.org/blog/2012/01/20/do-http-authentication-over-https-with-url-rewriting/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am trying to protect the ~/public_html/dev directory using http auth basic, but to make that secure I want to run it over ssl.</p>
<p>The middle section of the below .htaccess file switches to https if the request URI begins with /dev and works.</p>
<p>The last section of the file works as well but does not work properly with the https redirect.</p>
<p>I basically want to be able to type http://www.namhuy.org/dev/some_sub_dir/ and be redirected to https://www.namhuy.org/dev/some_sub_dir/ and prompted for the http auth username and password.</p>
<p>What currently happens is if I go to http://www.namhuy.org/dev/some_sub_dir/ I get prompted for a username and password over port 80, and then immediately get prompted again over port 443. So my credentials are being sent twice, once in the clear, and once encrypted. Making the whole https url rewrite a little pointless.</p>
<p>The reason for doing this is so that I won&#8217;t be able to accidentally submit my user/pass over http; https will always be used to access the /dev directory.</p>
<p>Create a file /etc/httpd/conf.d/test.conf with:</p>
<p>&lt;Directory &#8220;/var/www/html/dev&#8221;&gt;<br />
#<br />
# force HTTPS<br />
#<br />
RewriteEngine On<br />
RewriteCond %{HTTPS} off<br />
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}<br />
&lt;/Directory&gt;</p>
<p>&#8230;and then adding the following inside /etc/httpd/conf.d/ssl.conf just above the &lt;/VirtualHost&gt; tag:</p>
<p>&lt;Directory &#8220;/var/www/html/dev&#8221;&gt;<br />
#<br />
# require authentication<br />
#<br />
AuthType Basic<br />
AuthName &#8220;Please Log In&#8221;<br />
AuthUserFile /var/www/auth/passwords<br />
Require valid-user<br />
&lt;/Directory&gt;</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fnamhuy.org%2Fblog%2F2012%2F01%2F20%2Fdo-http-authentication-over-https-with-url-rewriting%2F&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=80px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://namhuy.org/blog/2012/01/20/do-http-authentication-over-https-with-url-rewriting/"></g:plusone>
			</div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://namhuy.org/blog/2012/01/20/do-http-authentication-over-https-with-url-rewriting/"  data-text="Do HTTP authentication over HTTPS with URL rewriting" data-count="horizontal">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://namhuy.org/blog/2012/01/20/do-http-authentication-over-https-with-url-rewriting/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://namhuy.org/blog/2012/01/20/do-http-authentication-over-https-with-url-rewriting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Add the EPEL Repository in RHEL/CentOS 5/6</title>
		<link>http://namhuy.org/blog/2011/11/25/how-to-add-the-epel-repository-in-rhelcentos-56/</link>
		<comments>http://namhuy.org/blog/2011/11/25/how-to-add-the-epel-repository-in-rhelcentos-56/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 07:35:23 +0000</pubDate>
		<dc:creator>Huy Tran</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tips - Tricks]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[epel]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[rhel]]></category>

		<guid isPermaLink="false">http://namhuy.org/blog/?p=333</guid>
		<description><![CDATA[EPEL (Extra Packages for Enterprise Linux) is a third party RPM repository for Red Hat Enterprise Linux and CentOS. This article describes how to add the EPEL repository in Red Hat Enterprise Linux and CentOS 5 or 6. Install EPEL1. &#8230; <a href="http://namhuy.org/blog/2011/11/25/how-to-add-the-epel-repository-in-rhelcentos-56/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>EPEL (Extra Packages for Enterprise Linux) is a third party RPM repository for Red Hat Enterprise Linux and CentOS. This article describes how to add the EPEL repository in Red Hat Enterprise Linux and CentOS 5 or 6.<br />
Install EPEL1. Install the EPEL package using the command below.</p>
<p><strong>rpm -Uvh http://bit.ly/q7kHBq</strong></p>
<p>NoteThe full link for the RHEL 6 EPEL package and the links for the lower versions of RHEL are provided below. The rpm command prior to RHEL 6 cannot handle http redirects so no bit.ly links have been provided.</p>
<p>http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm</p>
<p>http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm</p>
<p>http://download.fedora.redhat.com/pub/epel/4/i386/epel-release-4-10.noarch.rpm</p>
<p>yum repolist2. Verify the installation using the command below. You should see epel in the output.</p>
<p><strong>yum repolist</strong></p>
<p>install yum priorities3. Install the Yum priorities package using the command below.</p>
<p><strong>yum install yum-priorities</strong></p>
<p>edit epel.repo4. Edit the file /etc/yum.repos.d/epel.repo and add the line below under the [epel] section.</p>
<p><strong>priority=10</strong></p>
<p>yum check update5. Test your configuration using the command below. You should see a priority protections message in the output.</p>
<p><strong>yum check-update</strong></p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fnamhuy.org%2Fblog%2F2011%2F11%2F25%2Fhow-to-add-the-epel-repository-in-rhelcentos-56%2F&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=80px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://namhuy.org/blog/2011/11/25/how-to-add-the-epel-repository-in-rhelcentos-56/"></g:plusone>
			</div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://namhuy.org/blog/2011/11/25/how-to-add-the-epel-repository-in-rhelcentos-56/"  data-text="How to Add the EPEL Repository in RHEL/CentOS 5/6" data-count="horizontal">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://namhuy.org/blog/2011/11/25/how-to-add-the-epel-repository-in-rhelcentos-56/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://namhuy.org/blog/2011/11/25/how-to-add-the-epel-repository-in-rhelcentos-56/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux defacements and Linux hacking</title>
		<link>http://namhuy.org/blog/2011/11/15/linux-defacements-and-linux-hacking/</link>
		<comments>http://namhuy.org/blog/2011/11/15/linux-defacements-and-linux-hacking/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 17:36:26 +0000</pubDate>
		<dc:creator>Huy Tran</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[freeware]]></category>
		<category><![CDATA[hackers]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Hacking Linux]]></category>
		<category><![CDATA[internet security]]></category>
		<category><![CDATA[Linux hacking]]></category>
		<category><![CDATA[Red Hat]]></category>

		<guid isPermaLink="false">http://namhuy.org/blog/?p=329</guid>
		<description><![CDATA[Zone-h.org has an excellent site to see defacements and what is going on across the internet.   Reviewing the archives and live defacements, Linux is defaced (hacked) more times than Windows.   What exactly does this mean?  Is Linux unsafe? &#8230; <a href="http://namhuy.org/blog/2011/11/15/linux-defacements-and-linux-hacking/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://zone-h.org/archive/published=0" target="_blank">Zone-h.org </a>has an excellent site to see defacements and what is going on across the internet.   Reviewing the archives and live defacements, Linux is defaced (hacked) more times than Windows.   What exactly does this mean?  Is Linux unsafe?  Not at all.  It truly falls on the administrator who configured Linux.   There is a false sense of security when you install Linux based on all of the sites and forums that support Linux’s ability to be safe and reliable.   Truly it can be the safest if the following holds true -</p>
<ul>
<li>Proper configuration</li>
<li>Updates</li>
<li>Reading materials</li>
<li>Frequent penetration tests</li>
<li>Monitoring and logging</li>
<li>Experience with advanced configurations</li>
</ul>
<p><a href="http://zone-h.org/archive/published=0" target="_blank">Zone-h archives</a></p>
<p>All operating systems have vulnerabilities.  And yes Apple, Microsoft and Linux is only as safe as the end user.</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fnamhuy.org%2Fblog%2F2011%2F11%2F15%2Flinux-defacements-and-linux-hacking%2F&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=80px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://namhuy.org/blog/2011/11/15/linux-defacements-and-linux-hacking/"></g:plusone>
			</div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://namhuy.org/blog/2011/11/15/linux-defacements-and-linux-hacking/"  data-text="Linux defacements and Linux hacking" data-count="horizontal">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://namhuy.org/blog/2011/11/15/linux-defacements-and-linux-hacking/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://namhuy.org/blog/2011/11/15/linux-defacements-and-linux-hacking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Curl Extension for PHP in Ubuntu</title>
		<link>http://namhuy.org/blog/2011/09/25/install-curl-extension-for-php-in-ubuntu/</link>
		<comments>http://namhuy.org/blog/2011/09/25/install-curl-extension-for-php-in-ubuntu/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 04:03:57 +0000</pubDate>
		<dc:creator>Huy Tran</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tips - Tricks]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[curl extension]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://namhuy.org/blog/?p=314</guid>
		<description><![CDATA[Many times we come across web applications which are written in PHP and require curl extension. PHP curl functions can used through use of libcurl. The libcurl was create by Daniel Sternberg. With the help of libcurl you can connect &#8230; <a href="http://namhuy.org/blog/2011/09/25/install-curl-extension-for-php-in-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Many times we come across web applications which are written in PHP and require curl extension. PHP curl functions can used through use of libcurl. The libcurl was create by Daniel Sternberg. With the help of libcurl you can connect and communicate with webserver using different protocols. To install curl library on your Ubuntu computer, you need to have LAMP (Linux apache mysql php) set up ready. Once you have Lamp setup ready just type in following command in terminal to install curl library,</p>
<p>sudo apt-get install curl libcurl3 libcurl3-dev php5-curl</p>
<p>After installing libcurl you should restart the web server with following command,</p>
<p>sudo /etc/init.d/apache2 restart</p>
<p>If you don&#8217;t have LAMP functionality already installed, then please click on the following link to find out how install LAMP on Ubuntu Linux,</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fnamhuy.org%2Fblog%2F2011%2F09%2F25%2Finstall-curl-extension-for-php-in-ubuntu%2F&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=80px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://namhuy.org/blog/2011/09/25/install-curl-extension-for-php-in-ubuntu/"></g:plusone>
			</div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://namhuy.org/blog/2011/09/25/install-curl-extension-for-php-in-ubuntu/"  data-text="Install Curl Extension for PHP in Ubuntu" data-count="horizontal">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://namhuy.org/blog/2011/09/25/install-curl-extension-for-php-in-ubuntu/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://namhuy.org/blog/2011/09/25/install-curl-extension-for-php-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set Ubuntu Server Time through Terminal</title>
		<link>http://namhuy.org/blog/2011/08/30/set-ubuntu-server-time-through-terminal/</link>
		<comments>http://namhuy.org/blog/2011/08/30/set-ubuntu-server-time-through-terminal/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 04:38:14 +0000</pubDate>
		<dc:creator>Huy Tran</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tips - Tricks]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[time zone]]></category>

		<guid isPermaLink="false">http://namhuy.org/blog/?p=304</guid>
		<description><![CDATA[Get the current server time by just typing “date” in the terminal. Install Time Zone 1 $sudo aptitude install tzdata 2 $dpkg-reconfigure tzdata 3 $sudo vim /etc/ntp.conf Add NTP server 1 driftfile /var/lib/ntp/ntp.drift 2 server 0.pool.ntp.org 3 server 1.pool.ntp.org 4 &#8230; <a href="http://namhuy.org/blog/2011/08/30/set-ubuntu-server-time-through-terminal/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Get the current server time by just typing “date” in the terminal.</p>
<p>Install Time Zone<br />
1 $sudo aptitude install tzdata<br />
2 $dpkg-reconfigure tzdata<br />
3 $sudo vim /etc/ntp.conf</p>
<p>Add NTP server<br />
1 driftfile /var/lib/ntp/ntp.drift<br />
2 server 0.pool.ntp.org<br />
3 server 1.pool.ntp.org<br />
4 server 2.pool.ntp.org<br />
5 server pool.ntp.org</p>
<p>Manually update the time by “$sudo ntpdate pool.ntp.org”</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fnamhuy.org%2Fblog%2F2011%2F08%2F30%2Fset-ubuntu-server-time-through-terminal%2F&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=80px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://namhuy.org/blog/2011/08/30/set-ubuntu-server-time-through-terminal/"></g:plusone>
			</div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://namhuy.org/blog/2011/08/30/set-ubuntu-server-time-through-terminal/"  data-text="Set Ubuntu Server Time through Terminal" data-count="horizontal">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://namhuy.org/blog/2011/08/30/set-ubuntu-server-time-through-terminal/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://namhuy.org/blog/2011/08/30/set-ubuntu-server-time-through-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>changing port tomcat</title>
		<link>http://namhuy.org/blog/2011/07/25/changing-port-tomcat/</link>
		<comments>http://namhuy.org/blog/2011/07/25/changing-port-tomcat/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 09:14:58 +0000</pubDate>
		<dc:creator>Huy Tran</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tips - Tricks]]></category>
		<category><![CDATA[catalina]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://namhuy.org/blog/?p=269</guid>
		<description><![CDATA[If you get this message after start tomcat SEVERE: Error initializing endpoint java.net.BindException: Address already in use:8080 Means you will to change tomcat&#8217;s port, here is how to do, go to $CATALINA_HOME/conf/server.xml change &#60;connector port:8080 to &#60;connector port:8083 If you &#8230; <a href="http://namhuy.org/blog/2011/07/25/changing-port-tomcat/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you get this message after start tomcat</p>
<pre>SEVERE: Error initializing endpoint
java.net.BindException: Address already in use:8080</pre>
<p>Means you will to change tomcat&#8217;s port, here is how to do, go to<br />
<strong>$CATALINA_HOME/conf/server.xml</strong></p>
<p>change</p>
<pre>&lt;connector port:8080</pre>
<p>to</p>
<pre>&lt;connector port:8083</pre>
<p>If you running in multiple catalina services, you should create new shell script and include different $CATALINE_HOME and $CATALINA_BASE into it</p>
<p>First, check on your $CATALINA_HOME/conf/server.xml</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fnamhuy.org%2Fblog%2F2011%2F07%2F25%2Fchanging-port-tomcat%2F&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=80px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://namhuy.org/blog/2011/07/25/changing-port-tomcat/"></g:plusone>
			</div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://namhuy.org/blog/2011/07/25/changing-port-tomcat/"  data-text="changing port tomcat" data-count="horizontal">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://namhuy.org/blog/2011/07/25/changing-port-tomcat/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://namhuy.org/blog/2011/07/25/changing-port-tomcat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install all programs on a newly installed ubuntu system</title>
		<link>http://namhuy.org/blog/2011/07/22/install-all-programs-on-a-newly-installed-ubuntu-system/</link>
		<comments>http://namhuy.org/blog/2011/07/22/install-all-programs-on-a-newly-installed-ubuntu-system/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 20:51:17 +0000</pubDate>
		<dc:creator>Huy Tran</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tips - Tricks]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[dpkg]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[programs]]></category>
		<category><![CDATA[system]]></category>

		<guid isPermaLink="false">http://namhuy.org/blog/?p=259</guid>
		<description><![CDATA[If you&#8217;re running Ubuntu there is a neat way of installing all of your programs on a newly installed Ubuntu system. Run the following command on the &#8216;old&#8217; Ubuntu installation. &#8220;dpkg &#8211;get-selections &#62; installed-software&#8221; You&#8217;ll end up with a file &#8230; <a href="http://namhuy.org/blog/2011/07/22/install-all-programs-on-a-newly-installed-ubuntu-system/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re running Ubuntu there is a neat way of installing all of your programs on a newly installed Ubuntu system.<br />
Run the following command on the &#8216;old&#8217; Ubuntu installation.<br />
&#8220;dpkg &#8211;get-selections &gt; installed-software&#8221;</p>
<p>You&#8217;ll end up with a file called installed-software. Copy the file to a usb key and copy it to a location on your backtrack machine.<br />
Run: &#8220;dpkg &#8211;set-selections &lt; installed-software&#8221; in the directory where you copied the file installed-software.<br />
Finally the &#8220;sudo apt-get dselect-upgrade&#8221; commands completes all of this. Be aware that is might take while until the installtion finishes.</p>
<p>If the above doesn&#8217;t work, you probably do not have dselect installed.<br />
In that case, run &#8220;apt-get install deselect&#8221;<br />
The above instructions also work on BackTrack 5</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fnamhuy.org%2Fblog%2F2011%2F07%2F22%2Finstall-all-programs-on-a-newly-installed-ubuntu-system%2F&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=80px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://namhuy.org/blog/2011/07/22/install-all-programs-on-a-newly-installed-ubuntu-system/"></g:plusone>
			</div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://namhuy.org/blog/2011/07/22/install-all-programs-on-a-newly-installed-ubuntu-system/"  data-text="Install all programs on a newly installed ubuntu system" data-count="horizontal">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://namhuy.org/blog/2011/07/22/install-all-programs-on-a-newly-installed-ubuntu-system/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://namhuy.org/blog/2011/07/22/install-all-programs-on-a-newly-installed-ubuntu-system/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hard and Soft Linking in Linux</title>
		<link>http://namhuy.org/blog/2011/07/21/hard-and-soft-linking-in-linux/</link>
		<comments>http://namhuy.org/blog/2011/07/21/hard-and-soft-linking-in-linux/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 08:37:08 +0000</pubDate>
		<dc:creator>Huy Tran</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[hard]]></category>
		<category><![CDATA[linking]]></category>
		<category><![CDATA[soft]]></category>

		<guid isPermaLink="false">http://namhuy.org/blog/?p=253</guid>
		<description><![CDATA[Sometimes it’s nice to have files accessible from more than one location on your computer, but to only actually have one copy of the file (it can save on drive space for really big files!). An example of where I &#8230; <a href="http://namhuy.org/blog/2011/07/21/hard-and-soft-linking-in-linux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes it’s nice to have files accessible from more than one location on your computer, but to only actually have one copy of the file (it can save on drive space for really big files!). An example of where I have needed this most, actually, has been with the use of Dropbox on my laptop. Many times I’ve been working out of a folder somewhere on my computer and I’ve needed to make the files accessible to other computers in the research lab. I’ve had to physically copy and paste these directories to my Dropbox folder (or usb drive, before I discovered Dropbox) and then once all the edits had been made elsewhere, had to copy and paste them back to where they belong. If, however, I could place a link to the files in my Dropbox folder, both copy and paste steps could be avoided (as well as the simultaneous confusion of which files were updated, and in what order etc.).<span id="more-253"></span></p>
<p>In linux systems this “linking” process is called “symlinking” (softlinking) or “hardlinking.” The difference between the two is a little subtle and can be understood in that unix files have two parts the “file header” (which includes the name) and the “data” part. The header part contains the file name, permissions, etc, and also contains an inode number. This inode number is like the data part’s address on the hard drive…and points/associates the file name to the data it contains. One way to think about it is through this schematic:</p>
<p><img class="alignnone" title="Inode data file" src="http://img703.imageshack.us/img703/3834/inodedatafile.png" alt="" width="300" height="37" /></p>
<p>&nbsp;</p>
<p>You can imagine that linking to the file can be accomplished through one of two methods. One method is to simply have two filenames associated with the same inode. These two filenames (file header information) can reside in different physical locations on the hard disk and thus in two different locations in your folder tree of your computer. This process is called “hardlinking” and looks like this:</p>
<p><img class="alignnone" title="Hard linking" src="http://img202.imageshack.us/img202/2650/hardlinking1.png" alt="" width="300" height="96" /></p>
<p>Hardlinking is great. If you delete filename1, filename2 still has the data stored in itself even though the file was originally created with filename1. Dropbox supports this linking feature. The only drawback to this kind of linking is that the link literally looks like and feels like the file in any file system–you can’t really tell the difference. So you better remember what was supposed to be the link! The filename doesn’t show up as a link because it has the same properties as a normal file… file header information (stored in the filename1, including the inode number), which links to the data.</p>
<p>Through command line, the way you create one of these hardlinks is through the following command:</p>
<p><strong><code>ln file-to-be-linked.txt linking-file-name.txt</code></strong></p>
<p>Now, the other way of linking files is a literal link: its a special unique file that has a file header portion with an inode link, but instead of that inode pointing straight to the file data inode, it points to the inode of its own file within which contains a “link” to the file you’re linking too. It’s much like a shortcut in Windows…and this is called soft-linking, or forming a symbolic link or “symlink.” It works in the following manner:</p>
<p><img class="alignnone" title="soft link" src="http://img15.imageshack.us/img15/3049/softlink.png" alt="" width="300" height="35" /></p>
<p>Obviously that “to.txt” file is the file header information that contains the inode number of where the data actually resides…so soft links are literally a special file that points to another file and the operating system treats it as such…its obvious that its a link and if you delete the symlink it just no longer points to the file anymore. And if you delete the original file and the symlink still links to it, the data is lost…it is not kept.</p>
<p>To access this kind of linking in the command line, you run the following command:</p>
<p><code>ln -s file-to-be-linked.txt name-of-link-to-file</code></p>
<p>Notice how I dropped the file extension off of the name of the link…you can do that because it is its own type of file that just points to the real thing. Dropbox also supports this kind of file linking. And it comes in handy particularly if you want the file to show up as a symlink.</p>
<p>Now you might be asking yourself why bother with the soft linking if hard linking works so well? The answer might be baffling: all directories in unix/linux systems are soft links that contain a name and point to a data file that contains all the file header information location of all the files associated with that directory. I mean, what are folders anyways? They aren’t “files” in that they don’t have data intrinsic to themselves. But they are “containers” that tell you what is associated with them. Brilliant? Yes. Immediately intuitive? No.</p>
<p>So a “directory” or “folder” has its own file header information which points to an inode number that contains all the addresses of all the files associated with itself. When you go to one of these addresses of the contained files you get pointed to the inode that contains all the data associated with that file. That’s how folders work–and if you want to use a symlink to point to a directory, you have to add a special flag to the linking command:</p>
<p><code> ln -sd directory-to-be-symlinked name-of-link</code></p>
<p>Of course, you can also hardlink a directory, then the code would just be:</p>
<p><code> ln -d directory-to-be-hardlinked name-of-link</code></p>
<p>I think I mostly use symlinking so I remember its a link and not the actual file, but I’m very appreciative that Dropbox supports this option. Makes changing files in different directories on my computer remotely very easy to do!</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fnamhuy.org%2Fblog%2F2011%2F07%2F21%2Fhard-and-soft-linking-in-linux%2F&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=80px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://namhuy.org/blog/2011/07/21/hard-and-soft-linking-in-linux/"></g:plusone>
			</div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://namhuy.org/blog/2011/07/21/hard-and-soft-linking-in-linux/"  data-text="Hard and Soft Linking in Linux" data-count="horizontal">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://namhuy.org/blog/2011/07/21/hard-and-soft-linking-in-linux/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://namhuy.org/blog/2011/07/21/hard-and-soft-linking-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install tomcat 7 from source in ubuntu 11.04 manually ?</title>
		<link>http://namhuy.org/blog/2011/07/16/how-to-install-tomcat-7-from-source-in-ubuntu-11-04-manually/</link>
		<comments>http://namhuy.org/blog/2011/07/16/how-to-install-tomcat-7-from-source-in-ubuntu-11-04-manually/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 23:12:02 +0000</pubDate>
		<dc:creator>Huy Tran</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tips - Tricks]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[timcat]]></category>

		<guid isPermaLink="false">http://namhuy.org/blog/?p=230</guid>
		<description><![CDATA[In this post, i will show you how to install tomcat 7 in ubuntu 11.04. 1. First download apache tomcat 7 linux version zipped file, then extract it. 2. now u place the tomcat wherever you like using following command &#8230; <a href="http://namhuy.org/blog/2011/07/16/how-to-install-tomcat-7-from-source-in-ubuntu-11-04-manually/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In this post, i will show you how to install tomcat 7 in ubuntu 11.04.</p>
<p>1. First download apache tomcat 7 linux version zipped file, then extract it.</p>
<p>2. now u place the tomcat wherever you like using following command</p>
<p><strong>sudo mv apachetomcat /usr/local/tomcat</strong><br />
<span id="more-230"></span><br />
3. make *.sh file executable inside /usr/local/tomcat/bin folder</p>
<p><strong>sudo chmod +x *.sh</strong></p>
<p>make sure you are inside the /usr/local/tomcat/bin folder..</p>
<p>4. you can install open jdk and jre or sun jdk and jre.</p>
<p>define JAVA_HOME path in .bashrc file or /etc/environment file</p>
<p>export JAVA_HOME=/usr/lib/jvm/sun-java-jdk…in my case..check yours</p>
<p>5. now write the script to run the tomcat at startup..</p>
<p>by creating a file tomcat in /etc/init.d directory</p>
<p><strong>sudo nano /etc/init.d/tomcat</strong></p>
<p>after that</p>
<p>in tomcat script file..</p>
<p>write script to start stop and restart</p>
<p>case “$1″ in</p>
<p>start)</p>
<p><strong>sh /etc/local/tomcat/bin/startup.sh</strong></p>
<p>;;</p>
<p>stop)</p>
<p><strong>sh /etc/local/tomcat/bin/shutdown.sh</strong></p>
<p>;;</p>
<p>restart)</p>
<p><strong>sh /etc/local/tomcat/bin/shutdown.sh</strong></p>
<p><strong>sh /etc/local/tomcat/bin/startup.sh</strong></p>
<p>;;</p>
<p><strong>esac</strong></p>
<p><strong>exit 0</strong></p>
<p>6. to run this tomcat script at startup, you can run this script in rc.local script which runs at startup or rc0 which is run at rebooting or rc6 which runs at shutdown..</p>
<p>for automatic handling by ubuntu,you can run following command</p>
<p><strong>sudo update-rc.d tomcat defaults</strong></p>
<p>it may show some warning message like LSB ..but you can ignore it because it is just a comment to write in any script in standard pattern.</p>
<p>reboot you computer or just login logout, you are ready to run your apache tomcat 7..</p>
<p><strong>issue:: http://localhost:8080</strong></p>
<p>for manager and host manager application of tomcat 7, you need to write following code..</p>
<p><strong>sudo nano /usr/local/tomcat/conf/tomcat-users.xml</strong></p>
<p>That’s all done..</p>
<p>For check..some commands can be useful..</p>
<p><strong>echo $JAVA_HOME</strong></p>
<p><strong>sudo update-alternatives –config java</strong></p>
<p><strong>sudo update-alternatives –config javac</strong></p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fnamhuy.org%2Fblog%2F2011%2F07%2F16%2Fhow-to-install-tomcat-7-from-source-in-ubuntu-11-04-manually%2F&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=80px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://namhuy.org/blog/2011/07/16/how-to-install-tomcat-7-from-source-in-ubuntu-11-04-manually/"></g:plusone>
			</div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://namhuy.org/blog/2011/07/16/how-to-install-tomcat-7-from-source-in-ubuntu-11-04-manually/"  data-text="How to install tomcat 7 from source in ubuntu 11.04 manually ?" data-count="horizontal">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://namhuy.org/blog/2011/07/16/how-to-install-tomcat-7-from-source-in-ubuntu-11-04-manually/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://namhuy.org/blog/2011/07/16/how-to-install-tomcat-7-from-source-in-ubuntu-11-04-manually/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clearing Ubuntu Cache Memory</title>
		<link>http://namhuy.org/blog/2011/07/16/clearing-ubuntu-cache-memory/</link>
		<comments>http://namhuy.org/blog/2011/07/16/clearing-ubuntu-cache-memory/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 23:09:17 +0000</pubDate>
		<dc:creator>Huy Tran</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tips - Tricks]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[clear]]></category>
		<category><![CDATA[memory]]></category>

		<guid isPermaLink="false">http://namhuy.org/blog/?p=228</guid>
		<description><![CDATA[Did a search for help on clearing up Ubuntu’s Cache System as my system keeps using up my memory for cache system. Though using up my memory for cache doesn’t actually hinder my system’s operation, I find it quite irritating &#8230; <a href="http://namhuy.org/blog/2011/07/16/clearing-ubuntu-cache-memory/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Did a search for help on clearing up Ubuntu’s Cache System as my system keeps using up my memory for cache system. Though using up my memory for cache doesn’t actually hinder my system’s operation, I find it quite irritating to see it being used up even though I have 8GB of RAM. This command should work for most Debian based Linux Operating System, but I haven’t try them as I don’t own any now. Here is the link to the document.<br />
<span id="more-228"></span><br />
Before using the below commands, do a sync to flush any cache data to the disk so data that’s required isn’t lost.</p>
<p>To free pagecache:<br />
echo 1 &gt; /proc/sys/vm/drop_caches</p>
<p>To free dentries and inodes:<br />
echo 2 &gt; /proc/sys/vm/drop_caches</p>
<p>To free pagecache, dentries and inodes:<br />
echo 3 &gt; /proc/sys/vm/drop_caches</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fnamhuy.org%2Fblog%2F2011%2F07%2F16%2Fclearing-ubuntu-cache-memory%2F&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=80px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://namhuy.org/blog/2011/07/16/clearing-ubuntu-cache-memory/"></g:plusone>
			</div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://namhuy.org/blog/2011/07/16/clearing-ubuntu-cache-memory/"  data-text="Clearing Ubuntu Cache Memory" data-count="horizontal">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://namhuy.org/blog/2011/07/16/clearing-ubuntu-cache-memory/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://namhuy.org/blog/2011/07/16/clearing-ubuntu-cache-memory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.445 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-04 17:23:18 -->
<!-- Compression = gzip -->
