<?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>Jeffs Blog &#187; Servers</title>
	<atom:link href="http://blog.kreitsoft.com/category/servers/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.kreitsoft.com</link>
	<description>Blog about life and the internet</description>
	<lastBuildDate>Wed, 22 Dec 2010 17:49:55 +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>Directory Indexing</title>
		<link>http://blog.kreitsoft.com/2008/03/directory-indexing/</link>
		<comments>http://blog.kreitsoft.com/2008/03/directory-indexing/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 03:27:21 +0000</pubDate>
		<dc:creator>kreitje</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[directory indexing]]></category>

		<guid isPermaLink="false">http://blog.kreitsoft.com/2008/03/17/directory-indexing/</guid>
		<description><![CDATA[So I was doing some PHP work for a company and another programmer they used mentioned turning off directory indexing. This was a good observation as there are files we don&#8217;t want to be seen. I have a ton of them on the web server at my house. However, for a server that hosts one [...]]]></description>
			<content:encoded><![CDATA[<p>So I was doing some PHP work for a company and another programmer they used mentioned turning off directory indexing. This was a good observation as there are files we don&#8217;t want to be seen. I have a ton of them on the web server at my house. However, for a server that hosts one companies files (several websites) what is the best way to accomplish this? I had my thoughts and then, I read through the httpd.conf file and found my solution.</p>
<p><strong>My Thoughts:</strong><br />
- .htaccess file. Put in &#8220;Options -Indexes&#8221;   : Good idea however would require quite a bit of working hitting all the sites / sub domains they run.</p>
<p>- Put an index.html file in every folder. Loop through as bash script : While plausable, it would be a pain as there is a bunch of extra files added. Plus everytime you add a new website you have run the script on that folder, along with any other time you add new folders to the website you would have to make sure to put the files in there. In the end, not something I wanted to do.</p>
<p>- cPanel/WHM option : Great idea. However if they implemented this option I sure as hell couldn&#8217;t find it. The most I could find regarding indexes was the priority of say &#8220;index.php&#8221; and &#8220;index.html&#8221;  but not to turn off indexing.</p>
<p><strong>The Solution:</strong><br />
I did some playing around in the httpd.conf file on my home webserver and found the solution. To turn off indexing by default across an entire server find the like. It might not match exact however it must be &lt;Directory /&gt;</p>
<div style="border: 1px dotted #000000; background-color: #ffffff">
<pre> &lt;Directory /&gt;
  Options All
  AllowOverride All
 &lt;/Directory&gt;</pre>
</div>
<p>If you see Options All replace it with  Options -Indexes . If you don&#8217;t see a line with Options add it. So it should look like</p>
<div style="border: 1px dotted #000000; background-color: #ffffff">
<pre> &lt;Directory /&gt;
  Options -Indexes
  AllowOverride All
 &lt;/Directory&gt;</pre>
</div>
<p>cPanel servers are a little bit different. The files are split up a bit more than other servers. The file you are looking for is located at &#8220;/usr/local/apache/conf/access.conf&#8221;</p>
<p>This was a public service announcement brought to you by me <img src='http://blog.kreitsoft.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kreitsoft.com/2008/03/directory-indexing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

