<?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>SecureSlash.com &#187; Apache</title>
	<atom:link href="http://secureslash.com/category/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://secureslash.com</link>
	<description>Because security matters</description>
	<lastBuildDate>Mon, 20 Feb 2012 12:05:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Apache Benchmark Results &#8211; PHP vs PERL</title>
		<link>http://secureslash.com/apache/php-vs-perl-an-apache-benchmark-results-2/</link>
		<comments>http://secureslash.com/apache/php-vs-perl-an-apache-benchmark-results-2/#comments</comments>
		<pubDate>Thu, 08 May 2008 18:58:57 +0000</pubDate>
		<dc:creator>paimpozhil</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP Scripting]]></category>
		<category><![CDATA[Web Administration]]></category>
		<category><![CDATA[apache benchmark test]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php vs perl]]></category>

		<guid isPermaLink="false">http://secureslash.com/?p=88</guid>
		<description><![CDATA[Tweet I have used Apache Benchmarking tool and ran it for 1000 requests with concurrenncy 2 You can learn about this tool on http://httpd.apache.org/docs/2.0/programs/ab.html Testing PHP This is the result of Processing the Whole secureslash.com/index.php . We have sent 1000 request to it to see how it performs. PHP Results: * Requests per second:Â Â Â  85.96 [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fapache%2Fphp-vs-perl-an-apache-benchmark-results-2%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; 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://secureslash.com/apache/php-vs-perl-an-apache-benchmark-results-2/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/apache/php-vs-perl-an-apache-benchmark-results-2/"  data-text="Apache Benchmark Results &#8211; PHP vs PERL" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/apache/php-vs-perl-an-apache-benchmark-results-2/" data-counter="right"></script></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://secureslash.com/apache/php-vs-perl-an-apache-benchmark-results-2/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>I have used Apache Benchmarking tool and ran it for 1000 requests with<br />
concurrenncy 2</p>
<p>You can learn about this tool  on <a title="Apache Benchmark Tool" href="http://httpd.apache.org/docs/2.0/programs/ab.html" target="_blank">http://httpd.apache.org/docs/2.0/programs/ab.html</a><br />
<script type="text/javascript"><!--
google_ad_client = "pub-1553934370392546";
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = "300x250_as";
google_ad_type = "text";
//2007-08-15: SecureSlash - SideBox
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "2f63b3";
google_color_text = "000000";
google_color_url = "CCCCCC";

//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
<strong>Testing PHP</strong></p>
<p>This is the result of Processing the Whole secureslash.com/index.php . We have sent 1000 request to<br />
it to see  how it performs.</p>
<p><strong>PHP Results:</strong><br />
<script type="text/javascript"><!--
google_ad_client = "pub-1553934370392546";
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = "300x250_as";
google_ad_type = "text";
//2007-08-15: SecureSlash - SideBox
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "2f63b3";
google_color_text = "000000";
google_color_url = "CCCCCC";

//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
<blockquote><p>*<br />
Requests per second:Â Â Â  85.96 [#/sec] (mean)<br />
Time per  request:Â Â Â Â Â Â  58.168 [ms] (mean)<br />
Time per request:Â Â Â Â Â Â  11.634 [ms] (mean,  across all concurrent requests)<br />
*</p>
<p>This is ApacheBench, Version  2.0.40-dev &lt;$Revision: 1.146 $&gt; apache-2.0<br />
Copyright 1996 Adam Twiss,  Zeus Technology Ltd, <a href="http://www.zeustech.net/">http://www.zeustech.net/</a><br />
Copyright  1997-2005 The Apache Software Foundation, <a href="http://www.apache.org/">http://www.apache.org/</a></p>
<p>Benchmarking secureslash .com (be patient)<br />
Completed 100 requests<br />
Completed 200  requests<br />
Completed 300 requests<br />
Completed 400 requests<br />
Completed 500  requests<br />
Completed 600 requests<br />
Completed 700 requests<br />
Completed 800  requests<br />
Completed 900 requests<br />
Finished 1000 requests</p>
<p>Server  Software:Â Â Â Â Â Â Â  Apache/2.2.6<br />
Server Hostname:Â Â Â Â Â Â Â  secureslash.com<br />
Server  Port:Â Â Â Â Â Â Â Â Â Â Â  80</p>
<p>Document Path:Â Â Â Â Â Â Â Â Â  /<br />
Document Length:Â Â Â Â Â Â Â   23188 bytes</p>
<p>Concurrency Level:Â Â Â Â Â  5<br />
Time taken for tests:Â Â   11.633571 seconds<br />
Complete requests:Â Â Â Â Â  1000<br />
Failed requests:Â Â Â Â Â Â Â   0<br />
Write errors:Â Â Â Â Â Â Â Â Â Â  0<br />
Total transferred:Â Â Â Â Â  24052000 bytes<br />
HTML  transferred:Â Â Â Â Â Â  23188000 bytes<br />
Requests per second:Â Â Â  85.96 [#/sec]  (mean)<br />
Time per request:Â Â Â Â Â Â  58.168 [ms] (mean)<br />
Time per request:Â Â Â Â Â Â   11.634 [ms] (mean, across all concurrent requests)<br />
Transfer rate:Â Â Â Â Â Â Â Â Â   2018.98 [Kbytes/sec] received</p>
<p>Connection Times (ms)<br />
minÂ   mean[+/-sd] medianÂ Â  max<br />
Connect:Â Â Â Â Â Â Â  0Â Â Â  2Â Â  4.0Â Â Â Â Â  1Â Â Â Â Â   27<br />
Processing:Â Â Â  26Â Â  55 114.2Â Â Â Â  37Â Â Â  1357<br />
Waiting:Â Â Â Â Â Â  21Â Â  44  114.2Â Â Â Â  28Â Â Â  1349<br />
Total:Â Â Â Â Â Â Â Â  26Â Â  57 114.5Â Â Â Â  39Â Â Â   1364</p>
<p>Percentage of the requests served within a certain time  (ms)<br />
50%Â Â Â Â  39<br />
66%Â Â Â Â  45<br />
75%Â Â Â Â  51<br />
80%Â Â Â Â  54<br />
90%Â Â Â Â   65<br />
95%Â Â Â Â  77<br />
98%Â Â Â  195<br />
99%Â Â Â  804<br />
100%Â Â  1364 (longest  request)</p></blockquote>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>Testing Perl</strong></p>
<p>This Is a result of JUST HELLOWORLD Program in cgi bin &#8212; &gt; secureslash.com/cgi-bin/index.cgi see  the<br />
times below it is SLOWER than php .</p>
<p><strong>PERL Results</strong></p>
<blockquote><p>*<br />
Requests per second:Â Â Â   86.01 [#/sec] (mean)<br />
Time per request:Â Â Â Â Â Â  58.131 [ms] (mean)<br />
Time per  request:Â Â Â Â Â Â  11.626 [ms] (mean, across all concurrent  requests)*</p>
<p>This is ApacheBench, Version 2.0.40-dev &lt;$Revision:  1.146 $&gt; apache-2.0<br />
Copyright 1996 Adam Twiss, Zeus Technology Ltd, <a href="http://www.zeustech.net/">http://www.zeustech.net/</a><br />
Copyright  1997-2005 The Apache Software Foundation, <a href="http://www.apache.org/">http://www.apache.org/</a></p>
<p>Benchmarking secureslash.com (be patient)<br />
Completed 100 requests<br />
Completed 200  requests<br />
Completed 300 requests<br />
Completed 400 requests<br />
Completed 500  requests<br />
Completed 600 requests<br />
Completed 700 requests<br />
Completed 800  requests<br />
Completed 900 requests<br />
Finished 1000 requests</p>
<p>Server  Software:Â Â Â Â Â Â Â  Apache/2.2.8<br />
Server Hostname:Â Â Â Â Â Â Â  secureslash.com.com<br />
Server  Port:Â Â Â Â Â Â Â Â Â Â Â  80</p>
<p>Document Path:Â Â Â Â Â Â Â Â Â  /cgi-bin/index.cgi<br />
Document  Length:Â Â Â Â Â Â Â  12 bytes</p>
<p>Concurrency Level:Â Â Â Â Â  5<br />
Time taken for  tests:Â Â  11.626206 seconds<br />
Complete requests:Â Â Â Â Â  1000<br />
Failed  requests:Â Â Â Â Â Â Â  0<br />
Write errors:Â Â Â Â Â Â Â Â Â Â  0<br />
Total transferred:Â Â Â Â Â   258320 bytes<br />
HTML transferred:Â Â Â Â Â Â  12000 bytes<br />
Requests per second:Â Â Â   86.01 [#/sec] (mean)<br />
Time per request:Â Â Â Â Â Â  58.131 [ms] (mean)<br />
Time per  request:Â Â Â Â Â Â  11.626 [ms] (mean, across all concurrent requests)<br />
Transfer  rate:Â Â Â Â Â Â Â Â Â  21.68 [Kbytes/sec] received</p>
<p>Connection Times  (ms)<br />
minÂ  mean[+/-sd] medianÂ Â  max<br />
Connect:Â Â Â Â Â Â Â  0Â Â Â  0Â Â   0.0Â Â Â Â Â  0Â Â Â Â Â Â  0<br />
Processing:Â Â Â Â  5Â Â  56 206.2Â Â Â Â Â  7Â Â Â   2441<br />
Waiting:Â Â Â Â Â Â Â  5Â Â  56 205.9Â Â Â Â Â  7Â Â Â  2441<br />
Total:Â Â Â Â Â Â Â Â Â  5Â Â  56  206.2Â Â Â Â Â  7Â Â Â  2441</p>
<p>Percentage of the requests served within a certain  time (ms)<br />
50%Â Â Â Â Â  7<br />
66%Â Â Â Â  11<br />
75%Â Â Â Â  13<br />
80%Â Â Â Â   15<br />
90%Â Â Â Â  25<br />
95%Â Â Â  508<br />
98%Â Â Â  821<br />
99%Â Â  1027<br />
100%Â Â  2441  (longest request)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p></blockquote>
<p>Moral is <span style="color: #ff0000;"><strong>PHP is faster than CGI-Perl.</strong></span></p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/apache/php-vs-perl-an-apache-benchmark-results-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Port is blocked by some program</title>
		<link>http://secureslash.com/apache/port-is-blocked-by-some-program/</link>
		<comments>http://secureslash.com/apache/port-is-blocked-by-some-program/#comments</comments>
		<pubDate>Tue, 25 Dec 2007 05:30:20 +0000</pubDate>
		<dc:creator>paimpozhil</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server Administration]]></category>

		<guid isPermaLink="false">http://secureslash.com/apache/port-is-blocked-by-some-program/</guid>
		<description><![CDATA[Tweet Port access related problems will occur, During the fresh installation or reinstallation of programs such as Apache/MySQL. When you are starting a service in linux/unix and it says Address already in use or similar error.. It is common in Apache and solution is, Case 1: You dont know which service is blocking that port [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fapache%2Fport-is-blocked-by-some-program%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; 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://secureslash.com/apache/port-is-blocked-by-some-program/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/apache/port-is-blocked-by-some-program/"  data-text="Port is blocked by some program" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/apache/port-is-blocked-by-some-program/" data-counter="right"></script></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://secureslash.com/apache/port-is-blocked-by-some-program/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Port access related problems will occur, During the fresh installation or reinstallation of programs such as Apache/MySQL. When you are starting a service in linux/unix and it says  Address already in use or similar error..</p>
<p>It is common in Apache and solution is,<br />
 <!--adsense--><br />
<strong>Case 1:</strong> You dont know which service is blocking that port<br />
in this case.</p>
<p><code>fuser -k [portnumber]/[protocol]</code></p>
<p><strong>Examples:</strong></p>
<p><code>fuser -k 80/tcp</code><br />
<code>fuser -k 443/tcp</code><br />
<code>fuser -k 576/udp<br />
</code><br />
<a href="http://nixdoc.net/man-pages/Linux/fuser.1.html">fuser man page</a></p>
<p><strong>Case 2:</strong> You know the name of program.</p>
<p><code>killall -9 programname</code></p>
<p><strong>Examples</strong></p>
<p><code>killall -9 httpd</code></p>
<p><code>killall -9 exim</code></p>
<p>once done.. restart the service now and remember this to handle port<br />
blocks with  &#8220;Ease in breadth&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/apache/port-is-blocked-by-some-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to completely redirect a subdomain to a domain</title>
		<link>http://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/</link>
		<comments>http://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 14:31:20 +0000</pubDate>
		<dc:creator>KarthiKeyan</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[Web Administration]]></category>
		<category><![CDATA[Website Security]]></category>

		<guid isPermaLink="false">http://secureslash.com/website-security/how-to-completely-redirect-a-subdomain-to-a-domain/</guid>
		<description><![CDATA[Tweet Write a simple .htaccess file to redirect your subdomain to a domain. This .htaccess will redirect all dead subdomains to a domain name. Ex: It will redirect http://dead.domainname.com to http://IamMRabc.com. ############################# ############################# ####Subdomain to Domain redirection### ####From SecureSlash.com########## RewriteEngine On RewriteCond %{HTTP_HOST} dead\.domainname\.com ############Place your subdomain info### RewriteRule ^(.*) http://IamMrAbc.com$1 ############Place the destination domain [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fapache%2Fhow-to-completely-redirect-a-subdomain-to-a-domain%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; 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://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/"  data-text="How to completely redirect a subdomain to a domain" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/" data-counter="right"></script></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://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Write a simple .htaccess file to redirect your subdomain to a domain. This .htaccess will redirect all dead subdomains to a domain name. Ex: It will redirect http://dead.domainname.com to http://IamMRabc.com.</p>
<p><!--adsense--></p>
<p>#############################<br />
#############################<br />
####Subdomain to Domain redirection###<br />
####From SecureSlash.com##########<br />
RewriteEngine On<br />
RewriteCond %{HTTP_HOST} dead\.domainname\.com<br />
############Place your subdomain info###<br />
RewriteRule ^(.*) http://IamMrAbc.com$1<br />
############Place the destination domain<br />
############################<br />
############################</p>
<p>Save above code as .htaccess and place it under your subdomain folder,<br />
Ex: /subdomains/dead/.htaccess<br />
/public_html/dead/.htaccess</p>
<p>It depends upon server&#8217;s directory structure. </p>
<p><!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/apache/how-to-completely-redirect-a-subdomain-to-a-domain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>chrooting Apache</title>
		<link>http://secureslash.com/system-security/chrooting-apache/</link>
		<comments>http://secureslash.com/system-security/chrooting-apache/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 13:19:56 +0000</pubDate>
		<dc:creator>KarthiKeyan</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[System Security]]></category>

		<guid isPermaLink="false">http://secureslash.com/apache/chrooting-apache/</guid>
		<description><![CDATA[Tweet Installing Apache binary There are no special steps needed to build the Apache binary in order to install it in a chroot jail. The following steps apply equally to a precompiled binary (such as an RPM) or one you have compiled yourself. Starting with a working binary helps with debugging later, if necessary. Just [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fsecureslash.com%2Fsystem-security%2Fchrooting-apache%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; 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://secureslash.com/system-security/chrooting-apache/"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://secureslash.com/system-security/chrooting-apache/"  data-text="chrooting Apache" data-count="horizontal">Tweet</a>
			</div><div style="float:left; width:105px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="http://secureslash.com/system-security/chrooting-apache/" data-counter="right"></script></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://secureslash.com/system-security/chrooting-apache/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p><strong>Installing Apache binary</strong><br />
There are no special steps needed to build the Apache binary in order to install it in a chroot jail. The following steps apply equally to a precompiled binary (such as an RPM) or one you have compiled yourself. Starting with a working binary helps with debugging later, if necessary. Just make sure that you are using the latest patched version of the server, install Apache normally, and ensure that it is working as expected.<br />
<!--adsense--><br />
Finally, make sure you configure Apache to run with its own user and group IDs. Create a user and group with the commands:</p>
<p><span class="code"># groupadd apache<br />
# useradd -c &#8220;Apache Server&#8221; -d /dev/null -g apache -s  /bin/false apache </span><br />
These commands create the regular user apache and the apache group. Apache runs as nobody by default. User nobody may be used by many processes, and if it is compromised an intruder will gain access to all processes on your system running under that UID.<br />
<strong>Creating the chroot tree</strong><br />
Our chroot jail is a mini-version of the Linux filesystem. I prefer to use a seperate partition mounted as /chroot, with Apache under a directory named httpd on my chroot partition.</p>
<p align="justify">&nbsp;</p>
<pre class="code"># mkdir /chroot/httpd</pre>
<pre class="code"># mkdir /chroot/httpd/dev</pre>
<pre class="code"># mkdir /chroot/httpd/lib</pre>
<pre class="code"># mkdir /chroot/httpd/etc</pre>
<pre class="code"># mkdir -p /chroot/httpd/usr/sbin</pre>
<pre class="code"># mkdir /chroot/httpd/usr/lib</pre>
<pre class="code"># mkdir /chroot/httpd/usr/libexec</pre>
<pre class="code"># mkdir -p /chroot/httpd/var/run</pre>
<pre class="code"># mkdir -p /chroot/httpd/var/log/apache</pre>
<pre class="code"># mkdir -p /chroot/httpd/home/httpd</pre>
<p align="justify">Now set the permissions on your directory structure:</p>
<p align="justify">&nbsp;</p>
<pre class="code"># chown -R root /chroot/httpd</pre>
<pre class="code"># chmod -R 0755 /chroot/httpd</pre>
<pre class="code"># chmod 750 /chroot/httpd/var/log/apache/</pre>
<p align="justify">Your exact structure may vary slightly depending upon what features of Apache you are using and where the nescessary libraries live on your main file system.<br />
Once you have created the nescessary directories you need to create the null device.</p>
<p align="justify">&nbsp;</p>
<pre class="code"># mknod  /chroot/httpd/dev/null c 1 3</pre>
<pre class="code"># chown root.sys /chroot/httpd/dev/null</pre>
<pre class="code"># chmod 666 /chroot/httpd/dev/null</pre>
<p align="justify">You need the null device and /chroot/httpd/var/log/httpd/ because, when run in chroot jail, Apache sees the /chroot/httpd directory as the equivalent of /. This means that it cannot access /dev/null or /var/log on the normal filesystem.<br />
<strong>Copying the nescessary files</strong><br />
Now shut down Apache, run killall httpd, and you&#8217;re ready to start copying across the necessary files. Note that some directory names may be different in your case depending upon how you originally installed Apache. First, copy your configuration files:<br />
<span class="code"># cp -r /etc/apache /chroot/httpd/etc/ </span><br />
Next, copy your Apache DocumentRoot and CGI scripts:<br />
<span class="code"># cp -r /home/httpd/html  /chroot/httpd/home/httpd/<br />
# cp -r /home/httpd/cgi-bin /chroot/httpd/home/httpd/ </span><br />
Now copy your httpd binary (and, if you use them, the Apache scripts) from /usr/sbin:<br />
<span class="code"># cp /usr/sbin/httpd /chroot/usr/sbin/<br />
# cp /usr/sbin/apache* /chroot/usr/sbin/ </span><br />
If you use mod_ssl you need to copy the /etc/ssl  directory and its contents too:<br />
<span class="code"># cp -a /etc/ssl /chroot/httpd/etc/ </span><br />
You should also copy any modules from your original install:<br />
<span class="code">cp -r /usr/libexec/apache  /chroot/httpd/usr/libexec/ </span><br />
Once you have copied Apache itself (and ssl if needed) you need to copy all of the shared libraries Apache relies on to run. To find out which libraries you need, execute # ldd /chroot/httpd/usr/sbin/httpd. This should give output something like:</p>
<p align="justify">&nbsp;</p>
<pre class="code">/lib/libsafe.so.2 =&gt; /lib/libsafe.so.2 (0x40017000)</pre>
<pre class="code">libm.so.6 =&gt; /lib/libm.so.6 (0x40037000)</pre>
<pre class="code">libcrypt.so.1 =&gt; /lib/libcrypt.so.1 (0x40059000)</pre>
<pre class="code">libdb.so.2 =&gt; /lib/libdb.so.2 (0x40086000)</pre>
<pre class="code">libexpat.so.0 =&gt; /usr/lib/libexpat.so.0 (0x40096000)</pre>
<pre class="code">libdl.so.2 =&gt; /lib/libdl.so.2 (0x400b6000)</pre>
<pre class="code">libc.so.6 =&gt; /lib/libc.so.6 (0x400b9000)</pre>
<pre class="code">/lib/ld-linux.so.2 =&gt; /lib/ld-linux.so.2 (0x40000000)</pre>
<p align="justify">The exact output will depend upon how your httpd binary was built in the first place. Copy the required files to their respective directories in your chroot:</p>
<p align="justify">&nbsp;</p>
<pre class="code"># cp /lib/libsafe* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libm* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libcrypt* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libdb* /chroot/httpd/lib/</pre>
<pre class="code"># cp /usr/lib/libexpat* /chroot/httpd/usr/lib/</pre>
<pre class="code"># cp /lib/libdl* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libc* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/ld-* /chroot/httpd/lib/</pre>
<p align="justify">You need certain libraries for some standard networking functionality:</p>
<p align="justify">&nbsp;</p>
<pre class="code"># cp /lib/libnss_compat* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libnss_dns* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libnss_files* /chroot/httpd/lib/</pre>
<pre class="code"># cp /lib/libnsl* /chroot/httpd/lib/</pre>
<p align="justify"><strong>The /chroot/httpd/etc configuration files</strong><br />
For Apache to function properly you also need several configuration files from /etc. First, edit the /etc/passwd and /etc/group files. These should contain only entries for the Apache user and group you created earlier. For example:</p>
<p align="justify">&nbsp;</p>
<pre class="code">/etc/passwd:</pre>
<pre class="code">apache:x:12347:12348:Apache Server:/dev/null:/bin/false</pre>
<pre class="code">/etc/group:</pre>
<pre class="code">apache:x:12347:</pre>
<p align="justify">You also need several network configuration files:</p>
<p align="justify">&nbsp;</p>
<pre class="code"># cp /etc/hosts /chroot/httpd/etc/</pre>
<pre class="code"># cp /etc/host.conf /chroot/httpd/etc/</pre>
<pre class="code"># cp /etc/resolv.conf /chroot/httpd/etc/</pre>
<pre class="code"># cp /etc/nsswitch.conf /chroot/httpd/etc/</pre>
<p align="justify">For extra security you can set the immutable bit on these configuration files. When the immutable bit is set, root has to specifically unset it before a file can be modified, making it much harder for an intruder to tamper with the files:</p>
<p align="justify">&nbsp;</p>
<pre class="code"># chattr +i /chroot/httpd/etc/hosts</pre>
<pre class="code"># chattr +i /chroot/httpd/etc/host.conf</pre>
<pre class="code"># chattr +i /chroot/httpd/etc/resolv.conf</pre>
<pre class="code"># chattr +i /chroot/httpd/etc/nsswitch.conf</pre>
<pre class="code"># chattr +i /chroot/httpd/etc/passwd</pre>
<pre class="code"># chattr +i /chroot/httpd/etc/group</pre>
<p align="justify">In order that the log files be written with the correct time, you need to check /etc/localtime. localtime is a symlink to a file in /usr/share/zoneinfo. To find out which file, run ls -l /etc/localtime and copy the appropriate file to /chroot/httpd/etc/localtime.<br />
By default, syslogd monitors log files only in /var/log. The chrooted httpd daemon will write its logs to /chroot/httpd/var/log, however, so you need to tell syslogd to monitor this directory too. To change this you need to edit the appropriate startup script, /etc/rc.d/rc.syslog or /etc/rc.d/init.d/syslog, depending upon your distro.<br />
For /etc/rc.d/rc.syslog change daemon syslogd -m 0 to daemon syslogd -m 0 -a /chroot/httpd/dev/log.<br />
For /etc/rc.d/rc.syslog  change:</p>
<p align="justify">&nbsp;</p>
<pre class="code">    echo -n " /usr/sbin/syslogd"</pre>
<pre class="code">    /usr/sbin/syslogd</pre>
<p align="justify">to:</p>
<p align="justify">&nbsp;</p>
<pre class="code">    echo -n " /usr/sbin/syslogd"</pre>
<pre class="code">    /usr/sbin/syslogd -m 0 -a /chroot/httpd/dev/log</pre>
<p align="justify">It is a good idea to create the nescessary log files and set the appendable  bit on them too.</p>
<p align="justify">&nbsp;</p>
<pre class="code"># touch /chroot/httpd/var/log/apache/access_log</pre>
<pre class="code"># touch /chroot/httpd/var/log/apache/error_log</pre>
<pre class="code"># chmod 600 /chroot/httpd/var/log/apache/*</pre>
<pre class="code"># chattr +a /chroot/httpd/var/log/apache/*</pre>
<p>Finally, you need to change the httpd startup script to run the chrooted httpd. Depending on your distro, open up /etc/rc.d/rc.httpd or /etc/rc.d/init.d/httpd and change the command that starts the httpd daemon to read /usr/sbin/chroot /chroot/httpd/ /usr/sbin/httpd.<br />
<strong>Testing the server</strong><br />
If you have not already done so you should shut down the httpd daemon now. Next, restart the syslog daemon:<span class="code"> /etc/rc.d/rc.syslog  restart</span> (or <span class="code">/etc/rc.d/init.d/syslog  restart</span> accordingly). Now start the chrooted version of Apache  with<span class="code"> /etc/rc.d/rc.httpd start</span> (or<span class="code"> /etc/rc.d/init.d/httpd start</span>).<br />
If there are no errors, check the daemon is running with the command ps -aux | grep httpd. You should see several entries indicating a running httpd process. Taking the process number from the output of ps and running ls<span class="code"> -l /proc/PROC_NUMBER/root/ </span>should show the structure of your <span class="code">/chroot/httpd</span> rather than your server&#8217;s /  filesystem.<br />
If something has gone wrong, you should try running your chrooted httpd with strace. The command # strace chroot /chroot/httpd /usr/sbin/httpd 2&gt; httpd.strace redirects the output of strace to a file named httpd.strace which should give you an idea where the problem lies.<br />
Once everything is running you can remove your original Apache install.<br />
<strong>Summary</strong><br />
<!--adsense--><br />
Although chroot can be used to help create a more secure environment, it is not perfect. You still need to keep your Web server patched up to date and monitor your logs. Your chroot environment should help to contain a potential breakin and protect your system&#8217;s main filesystem from unseen vulnerabilities in your Web server.</p>
]]></content:encoded>
			<wfw:commentRss>http://secureslash.com/system-security/chrooting-apache/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

