<?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>AskApache &#187; Search Results  &#187;  server</title>
	<atom:link href="http://www.askapache.com/search/server/feed/rss2/" rel="self" type="application/rss+xml" />
	<link>http://www.askapache.com</link>
	<description>Advanced Web Development</description>
	<lastBuildDate>Sun, 29 Jan 2012 12:04:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Programming Fonts for the Web</title>
		<link>http://www.askapache.com/css/programming-fonts-code.html</link>
		<comments>http://www.askapache.com/css/programming-fonts-code.html#comments</comments>
		<pubDate>Sat, 29 Oct 2011 09:37:43 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=4809</guid>
		<description><![CDATA[<p>The idea is to use CSS to have the browser display programming and code similar to the high-quality look of a developers machine, like this older screenshot of my VIM.</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/css/programming-fonts-code.html"></a><a href="http://www.askapache.com/css/programming-fonts-code.html"><cite>AskApache.com</cite></a></p><p>The idea is to have the browser display programming and code similar to the high-quality found on a developers machine, like this older screenshot of my vim. <br /><a href="http://www.askapache.com/linux/bash-power-prompt.html/bash-prompt-screenshot/" rel="attachment wp-att-4177"><img src="http://uploads.askapache.com/2010/03/bash-prompt-screenshot.png" alt="Custom Power Prompt" title="Custom Power Prompt" width="795" height="596" /></a></p>
<p>The most important step is to figure out the font-family and the basic font-attributes.  You want to show the best font for those visitors (like me) who have all these extra console fonts, but fallback to a font that anyone in the world can view.</p>

<h2>Monospace is the fallback</h2>
<blockquote cite="http://www.w3.org/TR/CSS2/fonts.html">
<h4><a href="http://www.w3.org/TR/CSS2/fonts.html">15.3.1.5 <dfn>monospace</dfn></a></h4>
<p><p>The sole criterion of a monospace font is that all glyphs have the same fixed width. (This can make some scripts, such as Arabic, look most peculiar.) The effect is similar to a manual typewriter, and is often used to set samples of computer code.</p>
</blockquote>



<h2>CSS Rules for Code</h2>
<p>Here are a few css rules I use.  That is my ultimate font-family heirarchy of console-type fonts, though not many people have them installed.  The fallback is usually Andale Mono, Monaco, or DejaVu Sans Mono, Lucida Console, Bitstream, then Courier.</p>
<pre>kbd, samp, tt, pre, code, var,
.code, .pre {
   font-family: Terminus,Consolas,Profont,"Andale Mono",Monaco,Inconsolata,Inconsolata-g,
      Unifont,Lime,"ClearlyU PUA",Clean,"DejaVu Sans Mono","Lucida Console",
      "Bitstream Vera Sans Mono",Freemono,"Liberation Mono",Dina,Anka,Droid Sans Mono,
      Anonymous Pro,Proggy fonts,Envy Code R,Gamow,Courier,"Courier New",Terminal,monospace;
}</pre>

<p>This is just some basic pre attributes, useful as a reset or to force the issue.  You may just want to do <code>.pre {...}</code> to apply to elements with <code>class="pre"</code> instead of applying to all pre elements sitewide.</p>
<pre>pre { letter-spacing:normal; word-spacing:normal; text-transform:none; max-width:100%; overflow:auto; white-space:pre-wrap; }
pre.normal { white-space:normal }</pre>


<h2>Live Font Examples</h2>
<p>What you see is what you get, so experiment with different browsers.</p>
<ul>
<li><a id="font-Courier" name="font-Courier">Courier</a><br />
<pre style='font-family:Courier,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Courier-New" name="font-Courier-New">Courier New</a><br />
<pre style='font-family:Courier New,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Terminal" name="font-Terminal">Terminal</a><br />
<pre style='font-family:Terminal,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Agency-FB-Bold" name="Agency-FB-Bold">Agency FB Bold</a><br />
<pre style='font-family:Agency FB Bold,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Consolas" name="font-Consolas">Consolas</a><br />
<pre style='font-family:Consolas,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Terminus" name="font-Terminus">Terminus</a><br />
<pre style='font-family:Terminus,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Profont" name="font-Profont">Profont</a><br />
<pre style='font-family:Profont,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Andale-Mono" name="font-Andale-Mono">Andale Mono</a><br />
<pre style='font-family:Andale Mono,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Monaco" name="font-Monaco">Monaco</a><br />
<pre style='font-family:Monaco,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Inconsolata" name="font-Inconsolata">Inconsolata</a><br />
<pre style='font-family:Inconsolata,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Inconsolata-g" name="font-Inconsolata-g">Inconsolata-g</a><br />
<pre style='font-family:Inconsolata-g,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Unifont" name="font-Unifont">Unifont</a><br />
<pre style='font-family:Unifont,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Lime" name="font-Lime">Lime</a><br />
<pre style='font-family:Lime,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-ClearlyU-PUA" name="font-ClearlyU-PUA">ClearlyU PUA</a><br />
<pre style='font-family:ClearlyU PUA,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Clean" name="font-Clean">Clean</a><br />
<pre style='font-family:Clean,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-DejaVu-Sans-Mono" name="font-DejaVu-Sans-Mono">DejaVu Sans Mono</a><br />
<pre style='font-family:DejaVu Sans Mono,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Lucida-Console" name="font-Lucida-Console">Lucida Console</a><br />
<pre style='font-family:Lucida Console,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Bitstream-Vera-Sans-Mono" name="font-Bitstream-Vera-Sans-Mono">Bitstream Vera Sans Mono</a><br />
<pre style='font-family:Bitstream Vera Sans Mono,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Freemono" name="font-Freemono">Freemono</a><br />

<pre style='font-family:Freemono,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Liberation-Mono" name="font-Liberation-Mono">Liberation Mono</a><br />
<pre style='font-family:Liberation Mono,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Dina" name="font-Dina">Dina</a><br />
<pre style='font-family:Dina,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Anka" name="font-Anka">Anka</a><br />
<pre style='font-family:Anka,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Droid-Sans-Mono" name="font-Droid-Sans-Mono">Droid Sans Mono</a><br />
<pre style='font-family:Droid Sans Mono,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Anonymous-Pro" name="font-Anonymous-Pro">Anonymous Pro</a><br />
<pre style='font-family:Anonymous Pro,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Proggy-fonts" name="font-Proggy-fonts">Proggy fonts</a><br />
<pre style='font-family:Proggy fonts,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Envy-Code-R" name="font-Envy-Code-R">Envy-Code-R</a><br />
<pre style='font-family:Envy Code R,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
<li><a id="font-Gamow" name="font-Gamow">Gamow</a><br />
<pre style='font-family:Gamow,Open Symbol,Webdings,Wingdings,SWMacro,Haettenschweiler,Wide Latin,Marlett,Parchment,fantasy'>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 |
|     Type      |      Code     |          A B C D E F G H      |</pre></li>
</ul>



<h2>More Info and Software</h2>
<ul>
<li><a href="http://www.w3.org/Style/Examples/007/fonts#font-family">CSS Font Families Example at W3</a></li>
<li><a href="http://www.lowing.org/fonts/">Monospace/Fixed Width Programmer's Fonts</a></li>
<li><a href="http://www.nirsoft.net/utils/windows_fonts_viewer.html">WinFontsView v1.10 - View samples of Windows fonts installed on your system </a></li>
</ul>



<p><a class="hs hs13" href="http://www.askapache.com/servers/mod_rewrite.c.html"></a></p><p><a href="http://www.askapache.com/css/programming-fonts-code.html"></a><a href="http://www.askapache.com/css/programming-fonts-code.html">Programming Fonts for the Web</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/css/programming-fonts-code.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Raw HTTP Header Debugger</title>
		<link>http://www.askapache.com/online-tools/http-headers-tool</link>
		<comments>http://www.askapache.com/online-tools/http-headers-tool#comments</comments>
		<pubDate>Wed, 26 Oct 2011 15:14:08 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
		
		<guid isPermaLink="false">http://www.askapache.com/online-tools/http-headers-tool/</guid>
		<description><![CDATA[<p><a href="http://www.askapache.com/online-tools/http-headers-tool"></a><a href="http://www.askapache.com/online-tools/http-headers-tool"><cite>AskApache.com</cite></a></p><hr class="C" />
<h2>HTTP Headers</h2>
<table>
    <thead>
        <tr>
            <td><strong>HTTP Header Name</strong></td>
            <td><strong>Header Description</strong></td>
            <td><strong>Example HTTP Header</strong></td>
        </tr>
    </thead>
    <tr>
        <td>Accept</td>
        <td>Content-Types that are acceptable</td>
        <td><code>Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</code></td>
    </tr>
    <tr>
        <td>Accept-Charset</td>
        <td>Character sets that are acceptable</td>
        <td><code>Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7</code></td>
    </tr>
    <tr>
        <td>Accept-Encoding</td>
        <td>Acceptable encodings</td>
        <td><code>Accept-Encoding: gzip,deflate</code></td>
    </tr>
    <tr>
        <td>Accept-Language</td>
        <td>Acceptable languages for response</td>
        <td><code>Accept-Language: en-us,en</code></td>
    </tr>
    <tr>
        <td>Accept-Ranges</td>
        <td>What partial content range types this server supports</td>
        <td><code>Accept-Ranges: bytes</code></td>
    </tr>
    <tr>
        <td>Age</td>
        <td>The age the object has been in a proxy cache </td></tr>&#8230; <a href="http://www.askapache.com/online-tools/http-headers-tool" class="read_more">Read the rest</a></table>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/online-tools/http-headers-tool"></a><a href="http://www.askapache.com/online-tools/http-headers-tool"><cite>AskApache.com</cite></a></p><hr class="C" />
<h2>HTTP Headers</h2>
<table>
    <thead>
        <tr>
            <td><strong>HTTP Header Name</strong></td>
            <td><strong>Header Description</strong></td>
            <td><strong>Example HTTP Header</strong></td>
        </tr>
    </thead>
    <tr>
        <td>Accept</td>
        <td>Content-Types that are acceptable</td>
        <td><code>Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</code></td>
    </tr>
    <tr>
        <td>Accept-Charset</td>
        <td>Character sets that are acceptable</td>
        <td><code>Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7</code></td>
    </tr>
    <tr>
        <td>Accept-Encoding</td>
        <td>Acceptable encodings</td>
        <td><code>Accept-Encoding: gzip,deflate</code></td>
    </tr>
    <tr>
        <td>Accept-Language</td>
        <td>Acceptable languages for response</td>
        <td><code>Accept-Language: en-us,en</code></td>
    </tr>
    <tr>
        <td>Accept-Ranges</td>
        <td>What partial content range types this server supports</td>
        <td><code>Accept-Ranges: bytes</code></td>
    </tr>
    <tr>
        <td>Age</td>
        <td>The age the object has been in a proxy cache in seconds</td>
        <td><code>Age: 7200</code></td>
    </tr>
    <tr>
        <td>Allow</td>
        <td>Valid actions for a specified resource. To be used for a 405 Method not allowed</td>
        <td><code>Allow: GET,HEAD,POST,OPTIONS,TRACE</code></td>
    </tr>
    <tr>
        <td>Authorization</td>
        <td>Authentication credentials for HTTP authentication</td>
        <td><code>Authorization: Basic UXNrYXBhggRfoopc5NteWFzcw==</code></td>
    </tr>
    <tr>
        <td>Cache-Control</td>
        <td>Controls how proxies may cache this object</td>
        <td><code>Cache-Control: max-age=7200, public</code></td>
    </tr>
    <tr>
        <td>Connection</td>
        <td>What type of connection the user-agent would prefer</td>
        <td><code>Connection: Keep-Alive</code></td>
    </tr>
    <tr>
        <td>Content-Encoding</td>
        <td>The type of encoding used on the data</td>
        <td><code>Content-Encoding: gzip</code></td>
    </tr>
    <tr>
        <td>Content-Language</td>
        <td>The language the content is in</td>
        <td><code>Content-Language: en-us</code></td>
    </tr>
    <tr>
        <td>Content-Length</td>
        <td>The length of the content in bytes</td>
        <td><code>Content-Length: 5356</code></td>
    </tr>
    <tr>
        <td>Content-Location</td>
        <td>An alternate location for the returned data</td>
        <td><code>Content-Location: /index.html</code></td>
    </tr>
    <tr>
        <td>Content-MD5</td>
        <td>An MD5 sum of the content of the response</td>
        <td><code>Content-MD5: 1167b9c13ad2b6d3694493fc47976c8</code></td>
    </tr>
    <tr>
        <td>Content-Range</td>
        <td>Where in a full body message this partial message belongs</td>
        <td><code>Content-Range: bytes 110-2034/2035</code></td>
    </tr>
    <tr>
        <td>Content-Type</td>
        <td>The mime type of this content</td>
        <td><code>Content-Type: text/html; charset=UTF-8</code></td>
    </tr>
    <tr>
        <td>Date</td>
        <td>The date and time that the message was sent</td>
        <td><code>Date: Sat, 05 Jan 2008 09:27:35 GMT</code></td>
    </tr>
    <tr>
        <td>Host</td>
        <td>The domain name of the server (for virtual hosting)</td>
        <td><code>Host: www.askapache.com</code></td>
    </tr>
    <tr>
        <td>If-Modified-Since</td>
        <td>Allows a 304 Not Modified to be returned</td>
        <td><code>If-Modified-Since: Sat, 05 Jan 2007 09:26:12 GMT</code></td>
    </tr>
    <tr>
        <td>Last-Modified</td>
        <td>The last modified date for the requested object</td>
        <td><code>Last-Modified: Sat, 05 Jan 2008 09:26:12 GMT</code></td>
    </tr>
    <tr>
        <td>Location</td>
        <td>Used in redirection</td>
        <td><code>Location: http://www.askapache.com/</code></td>
    </tr>
    <tr>
        <td>Server</td>
        <td>A name for the server</td>
        <td><code>Server: Apache/2.0.61 (Unix) PHP/4.4.7 mod_ssl/2.0.61 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2</code></td>
    </tr>
    <tr>
        <td>User-Agent</td>
        <td>The user agent string of the user agent</td>
        <td><code>User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7</code></td>
    </tr>
</table>
<hr class="C" />


<address>part of <a rev='Section' href='http://www.w3.org/Protocols/rfc2616/rfc2616.html'>Hypertext Transfer Protocol -- HTTP/1.1</a><br />RFC 2616 Fielding, et al.</address>
<h2><a id='sec9'>9</a> Method Definitions</h2>
<p>The set of common methods for HTTP/1.1 is defined below. Although this set can be expanded, additional methods cannot be assumed to share the same semantics for separately extended clients and servers.</p>
<p>The Host request-header field (section <a rel='xref' href='http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23'>14.23</a>) MUST accompany all HTTP/1.1 requests.</p>
<h3><a id='sec9.1'>9.1</a> Safe and Idempotent Methods</h3>
<h3><a id='sec9.1.1'>9.1.1</a> Safe Methods</h3>
<p>Implementors should be aware that the software represents the user in their interactions over the Internet, and should be careful to allow the user to be aware of any actions they might take which may have an unexpected significance to themselves or others.</p>
<p>In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval. These methods ought to be considered "safe". This allows user agents to represent other methods, such as POST, PUT and DELETE, in a special way, so that the user is made aware of the fact that a possibly unsafe action is being requested.</p>
<p>Naturally, it is not possible to ensure that the server does not generate side-effects as a result of performing a GET request; in fact, some dynamic resources consider that a feature. The important distinction here is that the user did not request the side-effects, so therefore cannot be held accountable for them.</p>
<h3><a id='sec9.1.2'>9.1.2</a> Idempotent Methods</h3>
<p>Methods can also have the property of "idempotence" in that (aside from error or expiration issues) the side-effects of N > 0 identical requests is the same as for a single request. The methods GET, HEAD, PUT and DELETE share this property. Also, the methods OPTIONS and TRACE SHOULD NOT have side effects, and so are inherently idempotent.</p>
<p>However, it is possible that a sequence of several requests is non- idempotent, even if all of the methods executed in that sequence are idempotent. (A sequence is idempotent if a single execution of the entire sequence always yields a result that is not changed by a reexecution of all, or part, of that sequence.) For example, a sequence is non-idempotent if its result depends on a value that is later modified in the same sequence.</p>
<p>A sequence that never has side effects is idempotent, by definition (provided that no concurrent operations are being executed on the same set of resources).</p>
<h3><a id='sec9.2'>9.2</a> OPTIONS</h3>
<p>The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.</p>
<p>Responses to this method are not cacheable.</p>
<p>If the OPTIONS request includes an entity-body (as indicated by the presence of Content-Length or Transfer-Encoding), then the media type MUST be indicated by a Content-Type field. Although this specification does not define any use for such a body, future extensions to HTTP might use the OPTIONS body to make more detailed queries on the server. A server that does not support such an extension MAY discard the request body.</p>
<p>If the Request-URI is an asterisk ("*"), the OPTIONS request is intended to apply to the server in general rather than to a specific resource. Since a server's communication options typically depend on the resource, the "*" request is only useful as a "ping" or "no-op" type of method; it does nothing beyond allowing the client to test the capabilities of the server. For example, this can be used to test a proxy for HTTP/1.1 compliance (or lack thereof).</p>
<p>If the Request-URI is not an asterisk, the OPTIONS request applies only to the options that are available when communicating with that resource.</p>
<p>A 200 response SHOULD include any header fields that indicate optional features implemented by the server and applicable to that resource (e.g., Allow), possibly including extensions not defined by this specification. The response body, if any, SHOULD also include information about the communication options. The format for such a</p>
<p>body is not defined by this specification, but might be defined by future extensions to HTTP. Content negotiation MAY be used to select the appropriate response format. If no response body is included, the response MUST include a Content-Length field with a field-value of "0".</p>
<p>The Max-Forwards request-header field MAY be used to target a specific proxy in the request chain. When a proxy receives an OPTIONS request on an absoluteURI for which request forwarding is permitted, the proxy MUST check for a Max-Forwards field. If the Max-Forwards field-value is zero ("0"), the proxy MUST NOT forward the message; instead, the proxy SHOULD respond with its own communication options. If the Max-Forwards field-value is an integer greater than zero, the proxy MUST decrement the field-value when it forwards the request. If no Max-Forwards field is present in the request, then the forwarded request MUST NOT include a Max-Forwards field.</p>
<h3><a id='sec9.3'>9.3</a> GET</h3>
<p>The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in the response and not the source text of the process, unless that text happens to be the output of the process.</p>
<p>The semantics of the GET method change to a "conditional GET" if the request message includes an If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. A conditional GET method requests that the entity be transferred only under the circumstances described by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network usage by allowing cached entities to be refreshed without requiring multiple requests or transferring data already held by the client.</p>
<p>The semantics of the GET method change to a "partial GET" if the request message includes a Range header field. A partial GET requests that only part of the entity be transferred, as described in section <a rel='xref' href='http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35'>14.35</a>. The partial GET method is intended to reduce unnecessary network usage by allowing partially-retrieved entities to be completed without transferring data already held by the client.</p>
<p>The response to a GET request is cacheable if and only if it meets the requirements for HTTP caching described in section 13.</p>
<p>See section <a rel='xref' href='http://www.w3.org/Protocols/rfc2616/rfc2616-sec15.html#sec15.1.3'>15.1.3</a> for security considerations when used for forms.</p>
<h3><a id='sec9.4'>9.4</a> HEAD</h3>
<p>The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request. This method can be used for obtaining metainformation about the entity implied by the request without transferring the entity-body itself. This method is often used for testing hypertext links for validity, accessibility, and recent modification.</p>
<p>The response to a HEAD request MAY be cacheable in the sense that the information contained in the response MAY be used to update a previously cached entity from that resource. If the new field values indicate that the cached entity differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag or Last-Modified), then the cache MUST treat the cache entry as stale.</p>
<h3><a id='sec9.5'>9.5</a> POST</h3>
<p>The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform method to cover the following functions:</p>
<pre>      - Annotation of existing resources; </pre>
<pre>      - Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; </pre>
<pre>      - Providing a block of data, such as the result of submitting a form, to a data-handling process; </pre>
<pre>      - Extending a database through an append operation. </pre>
<p>The actual function performed by the POST method is determined by the server and is usually dependent on the Request-URI. The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory containing it, a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a database.</p>
<p>The action performed by the POST method might not result in a resource that can be identified by a URI. In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on whether or not the response includes an entity that describes the result.</p>
<p>If a resource has been created on the origin server, the response SHOULD be 201 (Created) and contain an entity which describes the status of the request and refers to the new resource, and a Location header (see section <a rel='xref' href='http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30'>14.30</a>).</p>
<p>Responses to this method are not cacheable, unless the response includes appropriate Cache-Control or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent to retrieve a cacheable resource.</p>
<p>POST requests MUST obey the message transmission requirements set out in section 8.2.</p>
<p>See section <a rel='xref' href='http://www.w3.org/Protocols/rfc2616/rfc2616-sec15.html#sec15.1.3'>15.1.3</a> for security considerations.</p>
<h3><a id='sec9.6'>9.6</a> PUT</h3>
<p>The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new resource by the requesting user agent, the origin server can create the resource with that URI. If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate successful completion of the request. If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be given that reflects the nature of the problem. The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not understand or implement and MUST return a 501 (Not Implemented) response in such cases.</p>
<p>If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those entries SHOULD be treated as stale. Responses to this method are not cacheable.</p>
<p>The fundamental difference between the POST and PUT requests is reflected in the different meaning of the Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations. In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what URI is intended and the server MUST NOT attempt to apply the request to some other resource. If the server desires that the request be applied to a different URI,</p>
<p>it MUST send a 301 (Moved Permanently) response; the user agent MAY then make its own decision regarding whether or not to redirect the request.</p>
<p>A single resource MAY be identified by many different URIs. For example, an article might have a URI for identifying "the current version" which is separate from the URI identifying each particular version. In this case, a PUT request on a general URI might result in several other URIs being defined by the origin server.</p>
<p>HTTP/1.1 does not define how a PUT method affects the state of an origin server.</p>
<p>PUT requests MUST obey the message transmission requirements set out in section 8.2.</p>
<p>Unless otherwise specified for a particular entity-header, the entity-headers in the PUT request SHOULD be applied to the resource created or modified by the PUT.</p>
<h3><a id='sec9.7'>9.7</a> DELETE</h3>
<p>The DELETE method requests that the origin server delete the resource identified by the Request-URI. This method MAY be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the operation has been carried out, even if the status code returned from the origin server indicates that the action has been completed successfully. However, the server SHOULD NOT indicate success unless, at the time the response is given, it intends to delete the resource or move it to an inaccessible location.</p>
<p>A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not include an entity.</p>
<p>If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those entries SHOULD be treated as stale. Responses to this method are not cacheable.</p>
<h3><a id='sec9.8'>9.8</a> TRACE</h3>
<p>The TRACE method is used to invoke a remote, application-layer loop- back of the request message. The final recipient of the request SHOULD reflect the message received back to the client as the entity-body of a 200 (OK) response. The final recipient is either the</p>
<p>origin server or the first proxy or gateway to receive a Max-Forwards value of zero (0) in the request (see section 14.31). A TRACE request MUST NOT include an entity.</p>
<p>TRACE allows the client to see what is being received at the other end of the request chain and use that data for testing or diagnostic information. The value of the Via header field (section <a rel='xref' href='http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.45'>14.45</a>) is of particular interest, since it acts as a trace of the request chain. Use of the Max-Forwards header field allows the client to limit the length of the request chain, which is useful for testing a chain of proxies forwarding messages in an infinite loop.</p>
<p>If the request is valid, the response SHOULD contain the entire request message in the entity-body, with a Content-Type of "message/http". Responses to this method MUST NOT be cached.</p>
<h3><a id='sec9.9'>9.9</a> CONNECT</h3>
<p>This specification reserves the method name CONNECT for use with a proxy that can dynamically switch to being a tunnel (e.g. SSL tunneling <a rel='bibref' href='http://www.w3.org/Protocols/rfc2616/rfc2616-sec17.html#bib44'>[44]</a>).</p>


<h2><a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html">List of HTTP Response Status Codes</a></h2>
<h3>1xx Info / Informational</h3>
<h4><code>HTTP_INFO</code> - Request received, continuing process.</h4>
<p>Indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line.</p>
<ul>
    <li><strong>100 Continue</strong> - <code>HTTP_CONTINUE</code></li>
    <li><strong>101 Switching Protocols</strong> - <code>HTTP_SWITCHING_PROTOCOLS</code></li>
    <li><strong>102 Processing</strong> - <code>HTTP_PROCESSING</code></li>
</ul>
<h3>2xx Success / OK</h3>
<h4><code>HTTP_SUCCESS</code> - The action was successfully received, understood, and accepted.</h4>
<p>Indicates that the client's request was successfully received, understood, and accepted.</p>
<ul>
    <li><strong>200 OK</strong> - <code>HTTP_OK</code></li>
    <li><strong>201 Created</strong> - <code>HTTP_CREATED</code></li>
    <li><strong>202 Accepted</strong> - <code>HTTP_ACCEPTED</code></li>
    <li><strong>203 Non-Authoritative Information</strong> - <code>HTTP_NON_AUTHORITATIVE</code></li>
    <li><strong>204 No Content</strong> - <code>HTTP_NO_CONTENT</code></li>
    <li><strong>205 Reset Content</strong> - <code>HTTP_RESET_CONTENT</code></li>
    <li><strong>206 Partial Content</strong> - <code>HTTP_PARTIAL_CONTENT</code></li>
    <li><strong>207 Multi-Status</strong> - <code>HTTP_MULTI_STATUS</code></li>
</ul>
<h3>3xx Redirect</h3>
<h4><code>HTTP_REDIRECT</code> - The client must take additional action to complete the request.</h4>
<p>Indicates that further action needs to be taken by the user-agent in order to fulfill the request. The action required may be carried out by the user agent without interaction with the user if and only if the method used in the second request is GET or HEAD. A user agent should not automatically <em>redirect a request more than 5 times</em>, since such redirections usually indicate an <strong>infinite loop</strong>.</p>
<ul>
    <li><strong>300 Multiple Choices</strong> - <code>HTTP_MULTIPLE_CHOICES</code></li>
    <li><strong>301 Moved Permanently</strong> - <code>HTTP_MOVED_PERMANENTLY</code></li>
    <li><strong>302 Found</strong> - <code>HTTP_MOVED_TEMPORARILY</code></li>
    <li><strong>303 See Other</strong> - <code>HTTP_SEE_OTHER</code></li>
    <li><strong>304 Not Modified</strong> - <code>HTTP_NOT_MODIFIED</code></li>
    <li><strong>305 Use Proxy</strong> - <code>HTTP_USE_PROXY</code></li>
    <li><strong>306 unused</strong> - <code>UNUSED</code></li>
    <li><strong>307 Temporary Redirect</strong> - <code>HTTP_TEMPORARY_REDIRECT</code></li>
</ul>
<h3>4xx Client Error</h3>
<h4><code>HTTP_CLIENT_ERROR</code> - The request contains bad syntax or cannot be fulfilled.</h4>
<p>Indicates case where client seems to have erred. Except when responding to a HEAD request, the server should include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition.</p>
<ul>
    <li><strong>400 Bad Request</strong> - <code>HTTP_BAD_REQUEST</code></li>
    <li><strong>401 Authorization Required</strong> - <code>HTTP_UNAUTHORIZED</code></li>
    <li><strong>402 Payment Required</strong> - <code>HTTP_PAYMENT_REQUIRED</code></li>
    <li><strong>403 Forbidden</strong> - <code>HTTP_FORBIDDEN</code></li>
    <li><strong>404 Not Found</strong> - <code>HTTP_NOT_FOUND</code></li>
    <li><strong>405 Method Not Allowed</strong> - <code>HTTP_METHOD_NOT_ALLOWED</code></li>
    <li><strong>406 Not Acceptable</strong> - <code>HTTP_NOT_ACCEPTABLE</code></li>
    <li><strong>407 Proxy Authentication Required</strong> - <code>HTTP_PROXY_AUTHENTICATION_REQUIRED</code></li>
    <li><strong>408 Request Time-out</strong> - <code>HTTP_REQUEST_TIME_OUT</code></li>
    <li><strong>409 Conflict</strong> - <code>HTTP_CONFLICT</code></li>
    <li><strong>410 Gone</strong> - <code>HTTP_GONE</code></li>
    <li><strong>411 Length Required</strong> - <code>HTTP_LENGTH_REQUIRED</code></li>
    <li><strong>412 Precondition Failed</strong> - <code>HTTP_PRECONDITION_FAILED</code></li>
    <li><strong>413 Request Entity Too Large</strong> - <code>HTTP_REQUEST_ENTITY_TOO_LARGE</code></li>
    <li><strong>414 Request-URI Too Large</strong> - <code>HTTP_REQUEST_URI_TOO_LARGE</code></li>
    <li><strong>415 Unsupported Media Type</strong> - <code>HTTP_UNSUPPORTED_MEDIA_TYPE</code></li>
    <li><strong>416 Requested Range Not Satisfiable</strong> - <code>HTTP_RANGE_NOT_SATISFIABLE</code></li>
    <li><strong>417 Expectation Failed</strong> - <code>HTTP_EXPECTATION_FAILED</code></li>
    <li><strong>418 unused</strong> - <code>UNUSED</code></li>
    <li><strong>419 unused</strong> - <code>UNUSED</code></li>
    <li><strong>420 unused</strong> - <code>UNUSED</code></li>
    <li><strong>421 unused</strong> - <code>UNUSED</code></li>
    <li><strong>422 Unprocessable Entity</strong> - <code>HTTP_UNPROCESSABLE_ENTITY</code></li>
    <li><strong>423 Locked</strong> - <code>HTTP_LOCKED</code></li>
    <li><strong>424 Failed Dependency</strong> - <code>HTTP_FAILED_DEPENDENCY</code></li>
    <li><strong>425 No code</strong> - <code>HTTP_NO_CODE</code></li>
    <li><strong>426 Upgrade Required</strong> - <code>HTTP_UPGRADE_REQUIRED</code></li>
</ul>
<h3>5xx Server Error</h3>
<h4><code>HTTP_SERVER_ERROR</code> - The server failed to fulfill an apparently valid request.</h4>
<p>Indicate cases in which the server is aware that it has erred or is incapable of performing the request. Except when responding to a HEAD request, the server should include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition. User agents should display any included entity to the user. These response codes are applicable to any request method.</p>
<ul>
    <li><strong>500 Internal Server Error</strong> - <code>HTTP_INTERNAL_SERVER_ERROR</code></li>
    <li><strong>501 Method Not Implemented</strong> - <code>HTTP_NOT_IMPLEMENTED</code></li>
    <li><strong>502 Bad Gateway</strong> - <code>HTTP_BAD_GATEWAY</code></li>
    <li><strong>503 Service Temporarily Unavailable</strong> - <code>HTTP_SERVICE_UNAVAILABLE</code></li>
    <li><strong>504 Gateway Time-out</strong> - <code>HTTP_GATEWAY_TIME_OUT</code></li>
    <li><strong>505 HTTP Version Not Supported</strong> - <code>HTTP_VERSION_NOT_SUPPORTED</code></li>
    <li><strong>506 Variant Also Negotiates</strong> - <code>HTTP_VARIANT_ALSO_VARIES</code></li>
    <li><strong>507 Insufficient Storage</strong> - <code>HTTP_INSUFFICIENT_STORAGE</code></li>
    <li><strong>508 unused</strong> - <code>UNUSED</code></li>
    <li><strong>509 unused</strong> - <code>UNUSED</code></li>
    <li><strong>510 Not Extended</strong> - <code>HTTP_NOT_EXTENDED</code></li>
</ul>
<h2>Helpful HTTP Links</h2>
<ol>
    <li><a href="http://rfc.askapache.com/rfc2616.html#section-10">HTTP specification, Section 10</a></li>
    <li><a href="http://rfc.askapache.com/rfc2817.html#section-4">TLS Upgrade within HTTP specification, Section 4</a></li>
    <li><a href="http://rfc.askapache.com/rfc2817.html#section-7.1">HTTP Status Code Registry</a></li>
    <li><a href="http://rfc.askapache.com/rfc4918.html#section-11">WebDAV specification, Section 11</a></li>
    <li><a href="http://www.iana.org/assignments/http-status-codes">IANA registry</a></li>
    <li><a href="http://livedocs.adobe.com/fms/2/docs/00000338.html">Adobe Flash status code definitions (ie 408)</a></li>
    <li><a href="http://support.microsoft.com/?id=318380">Microsoft Internet Information Server Status Codes and Sub-Codes</a></li>
    <li>httplint</li>
    <li><a href="http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html">HTTP Headers, brief intro.</a></li>
    <li><a href="http://www.w3.org/TR/cuap">Common User-Agent Issues</a></li>
</ol>
<hr class="C" />
<dl>
    <dt>DRP</dt>
    <dd><a href="http://www.w3.org/TR/NOTE-drp-19970825">"The HTTP Distribution and Replication Protocol"</a></dd>
    <dt>DupSup</dt>
    <dd><a href="http://www3.ietf.org/proceedings/98dec/I-D/draft-mogul-http-dupsup-00.txt">"Duplicate Suppression in HTTP"</a></dd>
    <dt>EARL Schema</dt>
    <dd><a href="http://www.w3.org/WAI/ER/EARL10/WD-EARL10-Schema-20060101">"Evaluation and Report Language (EARL) 1.0 Schema"</a></dd>
    <dt>EDD</dt>
    <dd><a href="http://wp.netscape.com/assist/net_sites/pushpull.html">"An exploration of dynamic documents"</a></dd>
    <dt>EdgeArch</dt>
    <dd><a href="http://www.w3.org/TR/2001/NOTE-edge-arch-20010804">"Edge Architecture Specification"</a></dd>
    <dt>HttpClient</dt>
    <dd><a href="http://jakarta.apache.org/commons/httpclient/">Jakarta Commons HttpClient</a></dd>
    <dt>HTML4</dt>
    <dd><a href="http://www.w3.org/TR/1999/REC-html401-19991224/">"HTML 4.01 Specification"</a></dd>
    <dt>JEPI</dt>
    <dd><a href="http://www.w3.org/TR/NOTE-jepi-970519">"White Paper: Joint Electronic Payment Initiative"</a></dd>
    <dt>ObjectHeaders</dt>
    <dd><a href="http://www.w3.org/Protocols/HTTP/Object_Headers.html">"Object Header lines in HTTP"</a></dd>
    <dt>OPS-OverHTTP</dt>
    <dd><a href="http://www.w3.org/TR/NOTE-OPS-OverHTTP">"Implementation of OPS Over HTTP"</a></dd>
    <dt>OPTIONS messages</dt>
    <dd>"Specification of HTTP/1.1 OPTIONS messages"</dd>
    <dt>P3P</dt>
    <dd><a href="http://www.w3.org/TR/2002/REC-P3P-20020416/">"The Platform for Privacy Preferences 1.0 (P3P1.0) Specification"</a></dd>
    <dt>PEP</dt>
    <dd><a href="http://www.w3.org/TR/WD-http-pep-970526">"PEP - an Extension Mechanism for HTTP"</a></dd>
    <dt>PICSLabels</dt>
    <dd><a href="http://www.w3.org/TR/REC-PICS-labels-961031">"PICS Label Distribution Label Syntax and Communication Protocols, Version 1.1"</a></dd>
    <dt>Proxy Notification</dt>
    <dd><a href="http://www.w3.org/TR/WD-proxy-960221">"Notification for Proxy Caches"</a></dd>
    <dt>RDF</dt>
    <dd><a href="http://www.w3.org/TR/rdf-concepts/">"Resource Description Framework (RDF): Concepts and Abstract Syntax"</a></dd>
    <dt>RDF-PRIMER</dt>
    <dd><a href="http://www.w3.org/TR/rdf-primer/"> <acronym title="Resource Description Framework">RDF</acronym> Primer</a></dd>
    <dt>RFC2068</dt>
    <dd><a href="http://rfc.askapache.com/rfc2068/">"Hypertext Transfer Protocol -- HTTP/1.1"</a></dd>
    <dt>RFC2109</dt>
    <dd><a href="http://rfc.askapache.com/rfc2109/">"HTTP State Management Mechanism"</a></dd>
    <dt>RFC2183</dt>
    <dd><a href="http://rfc.askapache.com/rfc2183/">"Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field"</a></dd>
    <dt>RFC2227</dt>
    <dd><a href="http://rfc.askapache.com/rfc2227/">"Simple Hit-Metering and Usage-Limiting for HTTP"</a></dd>
    <dt>RFC2295</dt>
    <dd><a href="http://rfc.askapache.com/rfc2295/">"Transparent Content Negotiation in HTTP"</a></dd>
    <dt>RFC2310</dt>
    <dd><a href="http://rfc.askapache.com/rfc2310/">"The Safe Response Header Field"</a></dd>
    <dt>RFC2324</dt>
    <dd><a href="http://rfc.askapache.com/rfc2324/">"Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0)"</a></dd>
    <dt>RFC2397</dt>
    <dd><a href="http://rfc.askapache.com/rfc2397/">"The 'data' URL scheme"</a></dd>
    <dt>RFC2518</dt>
    <dd><a href="http://rfc.askapache.com/rfc2518/">"HTTP Extensions for Distributed Authoring -- WEBDAV"</a></dd>
    <dt>RFC2616</dt>
    <dd><a href="http://rfc.askapache.com/rfc2616/">"Hypertext Transfer Protocol -- HTTP/1.1"</a></dd>
    <dt>RFC2617</dt>
    <dd><a href="http://rfc.askapache.com/rfc2617/">"HTTP Authentication: Basic and Digest Access Authentication"</a></dd>
    <dt>RFC2660</dt>
    <dd><a href="http://rfc.askapache.com/rfc2660/">"The Secure HyperText Transfer Protocol"</a></dd>
    <dt>RFC2774</dt>
    <dd><a href="http://rfc.askapache.com/rfc2774/">"An HTTP Extension Framework"</a></dd>
    <dt>RFC2965</dt>
    <dd><a href="http://rfc.askapache.com/rfc2965/">"HTTP State Management Mechanism"</a></dd>
    <dt>RFC3229</dt>
    <dd><a href="http://rfc.askapache.com/rfc3229/">"Delta encoding in HTTP"</a></dd>
    <dt>RFC3230</dt>
    <dd><a href="http://rfc.askapache.com/rfc3230/">"Instance Digests in HTTP"</a></dd>
    <dt>RFC3253</dt>
    <dd><a href="http://rfc.askapache.com/rfc3253/">"Versioning Extensions to WebDAV (Web Distributed Authoring and Versioning)"</a></dd>
    <dt>RFC3648</dt>
    <dd><a href="http://rfc.askapache.com/rfc3648/">"Web Distributed Authoring and Versioning (WebDAV) Ordered Collections Protocol"</a></dd>
    <dt>RFC3986</dt>
    <dd><a href="http://rfc.askapache.com/rfc3648/">"Uniform Resource Identifier (URI): Generic Syntax"</a></dd>
    <dt>RFC4229</dt>
    <dd><a href="http://rfc.askapache.com/rfc4229/">"HTTP Header Field Registrations"</a></dd>
    <dt>SOAP1.1</dt>
    <dd><a href="http://www.w3.org/TR/2000/NOTE-SOAP-20000508">"Simple Object Access Protocol (SOAP) 1.1"</a></dd>
    <dt>UA Attributes</dt>
    <dd>"User-Agent Display Attributes Headers"</dd>
    <dt>WIRE</dt>
    <dd><a href="http://www3.ietf.org/proceedings/98dec/I-D/draft-girod-w3-id-res-ext-00.txt">"WIRE - W3 Identifier Resolution Extensions"</a></dd>
</dl><p><a href="http://www.askapache.com/online-tools/http-headers-tool"></a><a href="http://www.askapache.com/online-tools/http-headers-tool">Raw HTTP Header Debugger</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/online-tools/http-headers-tool/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>3 Ways to Serve PDF Files using Htaccess Cookies, Headers, Rewrites</title>
		<link>http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html</link>
		<comments>http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html#comments</comments>
		<pubDate>Sun, 21 Aug 2011 03:07:53 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Htaccess]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=2328</guid>
		<description><![CDATA[<p><a class="IFL" href="http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html"><img height="60" width="45" src='http://uploads.askapache.com/2007/11/60x45_acrobat_trefoil.gif' alt='Adobe PDF' /></a>FYI, using the <a href="http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html">Mod_Rewrite Variables Cheatsheet</a> makes this example, and all advanced .htaccess code easier to understand.  This demo lets you set a cookie with 1 of 3 values, then you just request the pdf file with a normal link click and get 1 of 3 different responses. This is accomplished with a nice bit of <a href="http://www.askapache.com/htaccess/htaccess.html">.htaccess</a> code.<br class="C" /></p>
<div class="cnote">
<p><strong>Set PDF Viewing Mode</strong> - <kbd id="pdfr">Make a selection, then click the view pdf button.</kbd></p>
<p><span id="pdfi" class="FL btnn">Inline</span> <span id="pdfa" class="FL btnn">Download</span> <span id="pdfs" class="FL btnn">Save As</span> <a class="FL btnn" style="margin-left:10px; border-top:1px solid #96F8AF; background:-moz-linear-gradient(center top , #3E9D43, #6ED766) repeat scroll 0 0 transparent;margin-left:20px;" rel="nofollow" href="http://www.askapache.com/storage/pdf/AskApache-Test.pdf">View PDF using selected mode &#187;</a><br class="C" /></p>
</div>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html"></a><a href="http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html"><cite>AskApache.com</cite></a></p><p><a class="IFL" id="id10" href="http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html"></a>FYI, using the <a href="http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html">Mod_Rewrite Variables Cheatsheet</a> makes this example, and all advanced .htaccess code easier to understand.  This demo lets you set a cookie with 1 of 3 values, then you just request the pdf file with a normal link click and get 1 of 3 different responses. This is accomplished with a nice bit of <a href="http://www.askapache.com/htaccess/htaccess.html">.htaccess</a> code.<br /><br />As I explain the htaccess code that achieves this, keep in mind this is merely one simple application for this code.  It's much more advanced than your basic htaccess trick, notice how this htaccess acts like a php script, very unusual..  I really wanted to share this trick after I created it for one of my clients because this is the tip of the iceberg.  Another use would be to display an alternate style sheet depending on a users theme preference.  The coolest thing is that it uses multiple advanced .htaccess ideas.  This code uses mod_headers to set the Content-Disposition header for forcing a download and uses mod_rewrite to: Send different Content-Type headers, Check the value of a cookie, Set environment variables for use later by mod_headers header directive<br class="C" /></p>

<div class="cnote">
<p><strong>Set PDF Viewing Mode</strong> - <kbd id="pdfr">Make a selection, then click the view pdf button.</kbd></p>
<p><span id="pdfi" class="FL btnn">Inline</span> <span id="pdfa" class="FL btnn">Download</span> <span id="pdfs" class="FL btnn">Save As</span> <a class="FL btnn" style="margin-left:10px; border-top:1px solid #96F8AF; background:-moz-linear-gradient(center top , #3E9D43, #6ED766) repeat scroll 0 0 transparent;margin-left:20px;" rel="nofollow" href="http://www.askapache.com/storage/pdf/AskApache-Test.pdf">View PDF using selected mode &raquo;</a><br class="C" /></p>
</div>


<h2>What's Going On</h2>
<p>There are 3 different ways for a server to send a pdf file in response to a request for one.  This causes 3 different ways to open/view the pdf file in the clients browser.</p>
<ol>
<li>The browser display's a <strong>"Save File As"</strong> dialog, allowing you to save the file or open.</li>
<li>The browser opens the pdf file <strong>"Inline"</strong>, opening the pdf file in the browser like a web page.</li>
<li>The browser "<strong>Downloads</strong>" the pdf file automatically as an "<strong>Attachment</strong>" and then causes an external pdf reader program like adobe reader to open the file.</li>
</ol>
<p>Some people prefer to have the option of saving the file to view later, some prefer opening it with an external program, and some just like the pdf file to load right in the browser...  The point is that by using .htaccess, we can let them choose any of the 3 methods and save their preference for all further pdf files requested from our site by that user.</p>





<h2>How It Works</h2>
<p>When you click on one of the 3 demo buttons above, "Inline", "Save As", or "Download", a cookie named <code>askapache_pdf</code> is saved in your browser using the javascript below, with the value being set to which button you clicked.  Then when you request the pdf file the .htaccess code below uses mod_rewrite to read the value of the askapache_pdf cookie, and depending on which was your preference it will send alternate HTTP Headers that control how your browser handles the file.</p>


<h3>Unique HTTP Headers Returned</h3>
<p>When it comes down to it, the following information is the 3 modes.  Notice each one is different, because these headers are the only thing controlling how your browser handles the file.</p>
<h4>Save As Mode (askapache_pdf=s)</h4>
<pre>Content-Disposition: attachment
Content-Type: application/pdf</pre>
<h4>Inline Mode (askapache_pdf=i)</h4>
<pre>Content-Type: application/pdf</pre>
<h4>Download Mode (askapache_pdf=a)</h4>
<pre>Content-Type: application/octet-stream</pre>


<h3>Htaccess Demo File</h3>
<p>For the demo I created the folder /storage/pdf/ and this is the .htaccess file at /storage/pdf/.htaccess</p>
<p>The default Content-Type for .pdf files.  This will make .pdf files default Content-Type header have  the value 'application/pdf' - but the default can be overridden by using RewriteRule with the <code>[T=&#039;different/type&#039;]</code></p>
<pre>AddType application/pdf .pdf</pre>

<p>Turn on the rewrite engine if its already on you dont need this </p>
<pre>RewriteEngine On</pre>

<p>Skip RewriteRules if not .pdf request, like autoindexing. The next [2] RewriteRule directives are specific for .pdf files so if the filename requested does not end in .pdf then the <code>[S=2]</code> instructs the next 2 RewriteRule  directives to be completely skipped.</p>
<pre>RewriteRule !.*\.pdf$ - [S=2]</pre>


<p>The first RewriteCond checks to see if the askapache_pdf cookie is NOT set.  The second RewriteCond checks to see if the askapche_pdf cookie has the value of s, which is the value corresponding to someone clicking the "Save As" button.</p>
<p>The <code>[NC,OR]</code> flag means that if the cookie askapache_pdf does not exist, OR (next cond) if the askapache_pdf cookie does exist and is set to 's' then process the RewriteRule.  If neither cond is true the rewriterule is skipped.</p>
<p>If one of the RewriteCond is true, then the RewriteRule is processed.   The RewriteRule applies to any/all requests (.*) but doesn't rewrite anything (-) This RewriteRule sets an Apache environment variable ASKAPACHE_PDFS to have the value of 1 if either rewritecond is true.  The variable can be checked by any directives following the rewriterule in the whole htaccess file.  The ASKAPACHE_PDFS ends in S because if this variable exists then it means the users preference is 'Save As'</p>
<p>Notice that if the user requested the pdf file without selecting a preference i.e. no cookie exists, then the ASKAPACHE_PDFS variable is still set. This just lets us pick the default preference for them, in this example the default is 'Save As'</p>
<pre>RewriteCond %{HTTP_COOKIE} !^.*askapache_pdf.*$ [NC,OR]
RewriteCond %{HTTP_COOKIE} ^.*askapache_pdf=s.*$ [NC]
RewriteRule .* - [E=ASKAPACHE_PDFS:1]</pre>

<p>The RewriteCond checks the askapache_pdf cookie for the value 'a' which 'a' represents 'Download'</p>
<p>If the cookies value is 'a' then the RewriteRule overrides the default Content-Type from 'application/pdf' set with AddType earlier, to 'application/octet-stream', which is a special content-type that tells the browser that the file cannot be loaded by the browser 'Inline', but must be saved which will be opened by an external viewer depending on browser configuration and plugins.</p>
<pre>RewriteCond %{HTTP_COOKIE} ^.*askapache_pdf=a.*$
RewriteRule .* - [T=application/octet-stream]</pre>

<p>This is superfly.  If the cookie/users-preference was 'Save As' (s) then the RewriteRule above the last one set the environment variable ASKAPACHE_PDFS to have the value 1.  The Header directive here is ONLY processed in that variable ASKAPACHE_PDFS exists.  That is what the end 'env=ASKAPACHE_PDFS' does, it is the condition that must be met or the Header directive is skipped.  If the ASKAPACHE_PDFS environment variable set by RewriteRule does exist then the header directive adds the header '<code>Content-Disposition: attachment</code>' to  the normal Response Headers.  The 'Content-Disposition: attachment' header instructs your browser to present you with the 'Save As' dialog box allowing you to choose whether you want to save or open.</p>
<pre>Header set Content-Disposition "attachment" env=ASKAPACHE_PDFS</pre>






<h2>Javascript used by Demo</h2>
<p>The best place for javascript is quirksmode, here is a definitive article on setting, reading, parsing, etc.. <a title="I am a javascript cookie monster" href="http://www.quirksmode.org/js/cookies.html">COOKIES</a>.</p>
<p>Note, I now prefer using jQuery over my AAJS javascript library.  Also, the whole using cookies aspect is just to highlight some advanced htaccess, you can accomplish this much easier without javascript or cookies.</p>
<pre>if(!gi(&#039;pdfr&#039;))return;
var pdfr=gi(&#039;pdfr&#039;);
var cval=getCookie(&#039;askapache_pdf&#039;);
&nbsp;
if(cval==&#039;i&#039;){pdfr.innerHTML=&#039;Currently set to "Inline".&#039;;}
else if(cval==&#039;a&#039;){pdfr.innerHTML=&#039;Currently set to "Download" mode.&#039;;}
else if(cval==&#039;s&#039;){pdfr.innerHTML=&#039;Currently set to "Save As" mode.&#039;;}
&nbsp;
addMyEvent(gi(&#039;pdfi&#039;),"mousedown",function(){
  setCookie("askapache_pdf", "i", "", "/", "www.askapache.com"); gi(&#039;pdfr&#039;).innerHTML = &#039;Changed mode to "Inline".&#039;; return false; });
addMyEvent(gi(&#039;pdfa&#039;),"mousedown",function(){
  setCookie("askapache_pdf", "a", "", "/", "www.askapache.com"); gi(&#039;pdfr&#039;).innerHTML = &#039;Changed mode to "Download".&#039;; return false; });
addMyEvent(gi(&#039;pdfs&#039;),"mousedown",function(){
  setCookie("askapache_pdf", "s", "", "/", "www.askapache.com"); gi(&#039;pdfr&#039;).innerHTML = &#039;Changed mode to "Save As".&#039;; return false; });</pre>

<h2>Alternative Method - No Cookies + PHP</h2>
<p>This is what I came up with first for my client, and then while programming the php I noticed.. Hey!  I think I can do the same thing using .htaccess, which would save me on cpu/memory/potential security/etc.. but this works great too.  Though you will need to hack the code to get it working probably..</p>
<p>Note that the .htaccess rewrite code I used here used FILENAME-i.pdf or FILENAME-s.pdf to pass the preference to the pdf-dl.php script, it also worked for FILENAME.pdf?i=i</p>

<h3>pdf-dl.php</h3>
<pre>&lt;?php
if (
  !isset($_GET[&#039;file&#039;])
  || ($f=$_GET[&#039;file&#039;])===false
  || ($fp=@fopen($f,"rb"))===false
  || ($fi=pathinfo($f))===false
  || ($fi[&#039;fsize&#039;]=filesize($f))===false
  || strtolower($fi["extension"])!=&#039;pdf&#039;
) die(&#039;Failed&#039;);
&nbsp;
ob_start();
header(&#039;Accept-Ranges: bytes&#039;);
header("Content-Length: {$fi[&#039;fsize&#039;]}");
header(&#039;Content-Type: application/pdf&#039;);
if(!isset($_GET[&#039;i&#039;])) header("Content-Disposition: attachment; filename=\"{$fi[&#039;basename&#039;]}\"");
&nbsp;
$sent = 0;
while ( !feof($fp) &amp;&amp; $sent &lt; $fi[&#039;fsize&#039;] &amp;&amp; ($buf = fread($fp, 8192)) != &#039;&#039; ){
  echo $buf;
  $sent += strlen($buf);
  flush();  ob_flush();
}
fclose($fp);
exit;
?&gt;</pre>


<h3>Alternate Method .htaccess</h3>
<p>Deny direct request to pdf-dl.php file</p>
<pre>RewriteCond %{THE_REQUEST} ^.*pdf-dl\.php.*$ [NC]
RewriteRule .* - [F]</pre>
<p>Handle PDF files named anything-i.pdf as inline</p>
<pre>RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ([^/]*)-i\.pdf$  /cgi-bin/pdf-dl.php?i=i&amp;file=%{DOCUMENT_ROOT}/storage/pdf/$1.pdf [L,NC,QSA,S=1]</pre>
<p>Handle PDF files without -i.pdf as attachments</p>
<pre>RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ([^/]*)\.pdf$  /cgi-bin/pdf-dl.php?file=%{DOCUMENT_ROOT}/storage/pdf/$1.pdf [L,NC,QSA]</pre>




<h2>More Info</h2>
<p>The following is more information about the Content-Dispositon header and related subjects for fast readers.</p>

<h3>Interesting Reading</h3>
<p>Here is the thread of the original draft proposal for the Content-Disposition header.</p>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03620.html">Content-Disposition Header</a>, <em>Rens Troost - 22 Jun 1993</em>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03629.html">Re: Content-Disposition Header</a>, <em>Nathaniel Borenstein</em>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03630.html">Re: Content-Disposition Header</a>, <em>Gabe Beged-Dov</em>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03631.html">Re: Content-Disposition Header</a>, <em>Rens Troost</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03635.html">Re: Content-Disposition Header</a>, <em>Gabe Beged-Dov</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03641.html">Content-Disposition Header and multipart/alternative</a>, <em>Rens Troost</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03645.html">Re: Content-Disposition Header and multipart/alternative</a>, <em>Nathaniel Borenstein</em></li>
</ul>
</li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03632.html">Re: Content-Disposition Header</a>, <em>Keith Moore</em>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03633.html">Re: Content-Disposition Header</a>, <em>Nathaniel Borenstein</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03634.html">Re: Content-Disposition Header</a>, <em>Ed Levinson (Contractor)</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03636.html">Re: Content-Disposition Header</a>, <em>Keith Moore</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03640.html">Re: Content-Disposition Header</a>, <em>Rens Troost</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03650.html">Re: Content-Disposition Header</a>, <em>Harald Tveit Alvestrand</em></li>
</ul>
</li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03621.html">Re: Content-Disposition Header</a>, <em>Steve Dorner</em>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03622.html">Re: Content-Disposition Header</a>, <em>Rens Troost</em>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03624.html">Re: Content-Disposition Header</a>, <em>Keith Moore</em></li>
</ul>
</li>
</ul>
</li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03652.html">Re: Content-Disposition Header</a>, <em>Carlyn M. Lowery</em></li>
</ul>
</li>
</ul>
</li>
</ul>



<h3>Intense Reading</h3>
<ul>
<li><a href="http://www2.roguewave.com/support/docs/leif/sourcepro/html/protocolsug/10-1.html">Using the MIME Headers Effectively</a></li>
<li><a href="http://www.iana.org/assignments/mail-cont-disp">Mail Content Disposition Values and Parameters</a></li>
<li><cite><a href="http://rfc.askapache.com/rfc1766/rfc1766.txt">Tags for the Identification of Languages</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1436/rfc1436.txt">The Internet Gopher Protocol (a distributed document search and retrieval protocol)</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1630/rfc1630.txt">Universal Resource Identifiers in WWW</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1738/rfc1738.txt">Uniform Resource Locators (URL)</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1866/rfc1866.txt">Hypertext Markup Language - 2.0</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1945/rfc1945.txt">Hypertext Transfer Protocol -- HTTP/1.0</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2045/rfc2045.txt">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1123/rfc1123.txt">Requirements for Internet Hosts -- Communication Layers</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc822/rfc822.txt">Standard for The Format of ARPA Internet Text Messages</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1808/rfc1808.txt">Relative Uniform Resource Locators</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1036/rfc1036.txt">Standard for Interchange of USENET Messages</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc977/rfc977.txt">Network News Transfer Protocol</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2047/rfc2047.txt">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1867/rfc1867.txt">Form-based File Upload in HTML</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc821/rfc821.txt">Simple Mail Transfer Protocol</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1590/rfc1590.txt">Media Type Registration Procedure</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc959/rfc959.txt">File Transfer Protocol</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1700/rfc1700.txt">Assigned Numbers</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1737/rfc1737.txt">Functional Requirements for Uniform Resource Names</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1864/rfc1864.txt">The Content-MD5 Header Field</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1900/rfc1900.txt">Renumbering Needs Work</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1952/rfc1952.txt">GZIP file format specification version 4.3</a></cite></li>
<li><cite>Improving HTTP Latency</cite></li>
<li><cite><a href="http://www.isi.edu/touch/pubs/http-perf96/">Analysis of HTTP Performance</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1305/rfc1305.txt">Network Time Protocol (Version 3) Specification, Implementation and Analysis</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1951/rfc1951.txt">DEFLATE Compressed Data Format Specification version 1.3</a></cite></li>
<li><cite><a href="http://sunsite.unc.edu/mdma-release/http-prob.html">Analysis of HTTP Performance Problems,</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1950/rfc1950.txt">ZLIB Compressed Data Format Specification version 3.3</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2069/rfc2069.txt">An Extension to HTTP: Digest Access Authentication</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2068/rfc2068.txt">Hypertext Transfer Protocol -- HTTP/1.1</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2119/rfc2119.txt">Key words for use in RFCs to Indicate Requirement Levels</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1806/rfc1806.txt">Communicating Presentation Information in Internet Messages: The Content-Disposition Header</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2145/rfc2145.txt">Use and Interpretation of HTTP Version Numbers</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2076/rfc2076.txt">Common Internet Message Headers</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2279/rfc2279.txt">UTF-8, a transformation format of Unicode and ISO-10646</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2046/rfc2046.txt">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2277/rfc2277.txt">IETF Policy on Character Sets and Languages</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2396/rfc2396.txt">Uniform Resource Identifiers (URI): Generic Syntax and Semantics</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2617/rfc2617.txt">HTTP Authentication: Basic and Digest Access Authentication</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2110/rfc2110.txt">MIME E-mail Encapsulation of Aggregate Documents, such as HTML (MHTML)</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2026/rfc2026.txt">The Internet Standards Process -- Revision 3</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2324/rfc2324.txt">Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0)</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2049/rfc2049.txt">Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2183/rfc2183.txt">Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field</a></cite></li>
</ul><p><a href="http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html"></a><a href="http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html">3 Ways to Serve PDF Files using Htaccess Cookies, Headers, Rewrites</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>HOWTO: Uninstall CPANEL over SSH</title>
		<link>http://www.askapache.com/hacking/uninstall-cpanel.html</link>
		<comments>http://www.askapache.com/hacking/uninstall-cpanel.html#comments</comments>
		<pubDate>Mon, 04 Jul 2011 18:55:40 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=4404</guid>
		<description><![CDATA[<p>The following is just a quick reference of some of the commands I used to successfully uninstall cpanel.  This is for advanced users of the shell.  If you aren't that advanced and you run a single one of these commands without fully understanding it, you will probably kill your server, probably lose everything on it permanently, probably not have a website or email for weeks..  So backup all your data FIRST.  Also, if you aren't 100% sure you won't run into problems, you should contact your hosts technical support - but be prepared for some MAJOR negativity..  cpanel makes things very easy for hosts, you are just a drop in their bucket.</p>

<blockquote cite="http://www.askapache.com/server-administration/uninstall-cpanel.html#comment-168222">
<p><strong>Wow!</strong></p>
<p>You sure gotta bigger set that *I* do. . . . - for real! I've been known to do some abysmally stupid things in my day - and actually had them work the way I wanted them to! - but this takes the <strong>titanium, gadolinium, rhodium alloy cake</strong>!</p>
<p>Me, I'd try something like that and find out later that the fire-trucks showed up right after I hit the "Enter" key. It's a REALLY interesting post, and a real eye-opener - especially for someone who is relatively new to the whole web-hosting-service paradigm.  I know, no guts, no glory - but THIS is WAY over the top!  I'm reading this and thinking <em>"Why not just put a couple of sticks of dynamite under the thing?"</em></p>
<p>Seriously now, this was an excellent read - and for someone who is just now looking into the whole web-hosting paradigm, it's a real eye-opener.  Though I think I'll just tiptoe past this <strong>REAL QUIETLY</strong> for now. . . .  (laughing!)</p>
<p><a href="http://www.qatechtips.com/">Jim</a></p>
</blockquote>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/hacking/uninstall-cpanel.html"></a><a href="http://www.askapache.com/hacking/uninstall-cpanel.html"><cite>AskApache.com</cite></a></p><p><strong>WARNING!</strong> This is for advanced users of the shell, this is NOT a howto or tutorial.  The thing is, I googled <strong>how to uninstall cpanel</strong> and for once in my life I came up empty.. And certainly the cpanel official sites themselves don't provide any instructions other than to say "Dont uninstall it, reinstall your entire operating system without it."..   they sure don't seem confident that they know exactly what their code is doing.  Cpanel is great for most people, perfect for many situations, so don't get me wrong.. this is just for fun.</p>

<h2>Why Uninstall?</h2>
<p>Why?  Because I have always built my servers, php installations, perl installs, ruby, iptables, everything from source.  I read the INSTALL/README docs, I read the man pages, and I read the info pages as well.  I google for configuration advice, I google for tips, and I don't need a web-based perl script messing my stuff up!</p>
<p>The main problems I had with cpanel, which really is a great bit of software for millions of website developers, is that it was incredibly sneaky!  I used it for about 6 months and spent that entire time trying to figure out what the heck it was doing.  A couple issues that I really disliked, it takes over your bind install, it takes over your apache install, it takes over your php install.  And although it does let you configure some things (very few) for custom configurations and the like, I just don't need any of that.  By removing the darn thing I am saving GIGS of space on my server, tons of bandwidth, and most importantly to me I am saving CPU and processing time along with RAM and IO speed.</p>
<h3>Anything Else</h3>
<p>Please.. I could go on for DAYS!  Another reason I have wanted to be rid of cpanel is that I like my servers to be as lean and mean as possible.  This means I like as few files and processes as possible.  There are many benefits to this, like it's much easier for my integrity checking software and rootkit/antivirus software to run and drastically reduces the false positives.  And there is that glaring security issue of constantly having cpanel run it's own software to create the WHM/Cpanel web interface, which is accessible online.  I haven't researched cpanel security at all, it's possible that it never has security problems that are published, but for me, why take the chance?</p>


<h2>Warning - Caution!</h2>
<p>The following is just a quick reference of some of the commands I used to uninstall cpanel.  This is for advanced users of the shell.  If you aren't that advanced and you run a single one of these commands without fully understanding it, you will probably kill your server, probably lose everything on it permanently, probably not have a website or email for weeks..  So backup all your data FIRST.  Also, if you aren't 100% sure you won't run into problems, you should contact your hosts technical support - but be prepared for some MAJOR negativity..  cpanel makes things very easy for hosts, and the last thing tech support wants is to fix a server broken by someone who doesn't know what they are doing.</p>

<h2>Last Warning!</h2>
<p>Unless you understand what theses commands do and the purpose they serve, do not try any of this.  These are not the exact commands I used verbatim, they are also not in order.  I only put them up here because I was so amazed that google didn't have any uninstall cpanel intructions.  Hopefully it's not a conspiracy that will get my site taken down.. ;)</p>
<p>That said and out of the way, it really only took me about 10 minutes to uninstall cpanel completely.  But keep in mind I have been closely monitoring and debugging cpanel for 6 months, so I knew what I was doing.  And finally, I do apologize for not having better instructions.. but hey, if you don't get this then you have no business trying to figure out how to uninstall cpanel!  It's great software and shouldn't be removed unless you are fully capable of managing email/dns/www/ftp and any/all other servers and services on your machine by hand.</p>

<h2>Do This First</h2>
<p>I have a few drafts I'm working on at the moment with specifics, but for now you will have to figure it out with google.  Basically you want to make sure you don't totally knock your machine offline without being able to reconnect.  What I do is compile a static version of openssh and a few other security-type shell tools, and configure this binary sshd to run by using inittab, which is the file run by init (pid 1) and makes sure if it dies it is restarted.  Here is my /etc/inittab to run the static sshd binary:</p>
<pre>hh:12345:respawn:/failover/os/sbin/aassh -D -q -u0 -f /failover/os/etc/aassh</pre>

<p>Another trick is to keep a detached screen logged in to root.  That way if you mess up your sudoers or securetty or pam or whatever, you can just reattach and fix it.</p>
<p>Finally, you may want to setup your syslog to start earlier than usual, and set up more than normal verbosity.  ( I take it to the max ).  Then you should setup a 2nd server or machine somewhere to act as a syslog server.  Lastly, configure your web server syslog to copy all messages to the remote syslog you set up.  I use a reverse ssh tunnel to encrypt the syslog packets, but when I do something serious like reboot after uninstalling cpanel, I prepare for it by adding additional networking routes on my machine to make sure I will get some logs even if sshd cant start or even if my network addresses aren't brought up correctly.</p>
<p>If that sounds easy to you, please continue.   If you are saying: Wha??? Continue in read-only mode.</p>

<p class="cnote">Also, you can't just uninstall cpanel, I have replaced a lot of cpanel already, like building my own bind, apache, php, syslog and making sure they work and aren't being tampered with by cpanel.  Basically cpanel runs everything on your server in most cases, so you should prepare by creating your own static software to replace cpanel, and make sure it works.</p>


<h2>Find files Accessing /var/cpanel</h2>
<p>More than likely these will need to be killed.</p>
<pre>lsof +w -Rg -nP +c15 -x f +D /var/cpanel
lsof +w -Rg -nP +c15 -x f +D /usr/local/cpanel</pre>

<h2>Killing cpanel</h2>
<p>Just an example, your machine may have a lot more than these, I have been slowly taking control of my machine back from cpanel for 6 months, so it was easier for me.</p>
<pre>for P in tailwatchd queueprocd cpanellogd exim; do pkill -9 $P; done</pre>

<h2>Commands and Shortcuts</h2>
<pre>alias NF=&#039;nice find $PWD -mount -depth ! -type d&#039;
alias NFF=&#039;nice find $PWD -mount -depth ! -type d | xargs -IF87 file F87&#039;
alias NA=&#039;nice find $PWD -mount -depth&#039;
alias NAF=&#039;nice find $PWD -mount -depth | xargs -IF87 file F87&#039;</pre>


<h2>Watch out for crontab</h2>
<p>An example of the sneakiness (from my POV, from most it's called builtin robustness) that cpanel does is automagically adding crontab entries that make it behave similarly to a self-propagating virus.  If you don't disable the cronjobs and kill the right processes within a short period of time, be prepared for a magic resurrection.</p>

<p>Here's my awesome crontab information function, you will need to check every file, it lists the default crons on my box, and every users crontab, but it can't account for other cron software like at and other crons.</p>
<pre>function askapache_crontab()
{
  local GG i;
  for i in `getent passwd|cut -d ":" -f1`;
  do
    GG=$(sudo crontab -u $i -l 2&gt;$N6 | tr -s &#039;\n\000&#039; | sed &#039;/^#/d&#039;);
    [[ ${#GG} -gt 3 ]] &amp;&amp; sleep 1 &amp;&amp; echo -e "$i \n\n${GG}"
  done;
   sleep 4;
   ls -aLls1ch --color=always /etc/cron.{hourly,daily,weekly,monthly,d} | sed &#039;/^total/d; /\ drwxr-xr-x/d&#039;;
}</pre>



<pre>grep -ir /var/spool cpan</pre>
<pre>#6 3 * * * /scripts/upcp
#0 1 * * * /scripts/cpbackup
#0 2 * * * /scripts/mailman_chown_archives
#35 * * * * /usr/bin/test -x /usr/local/cpanel/bin/tail-check &amp;&amp; /usr/local/cpanel/bin/tail-check
#11,26,41,56 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue &gt; /dev/null 2&gt;&amp;1
#30 */4 * * * /usr/bin/test -x /scripts/update_db_cache &amp;&amp; /scripts/update_db_cache
#45 */8 * * * /usr/bin/test -x /usr/local/cpanel/bin/optimizefs &amp;&amp; /usr/local/cpanel/bin/optimizefs
#*/5 * * * * /usr/local/cpanel/bin/dcpumon &gt;/dev/null 2&gt;&amp;1
#25 1 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify</pre>



<h2>Delete Crontabs</h2>
<pre>sudo crontab -u mailman -r</pre>


<h2>Find INIT scripts with cpanel</h2>
<p>This is the main startup script: <code>/usr/local/cpanel/etc/init/startup</code></p>
<p>I had no idea ruby-on-rails was being controlled by cpanel.. sneaky bugger.  You can tell by all of these advanced unix commands just how difficult it would be to uninstall cpanel, its totally like the Alien!</p>
<pre>(1:3744)# find . ! -type d -print0|xargs -0 -I&#039;F87&#039; grep -Hi "cpan\|tailwat\|chkser" F87
./fastmail:# Author:       cPanel, Inc. &lt;nick@cpanel.net&gt;
./httpd:        HTTPD=/usr/local/cpanel/bin/chroothttpd
./cpanel:# cpanel8       Start Cpanel Services
./cpanel:# Author:       cPanel, Inc. &lt;nick@cpanel.net&gt;
./cpanel:# description: This is the cpanel webserver and chat.
./cpanel:# processname: cpaneld
./cpanel:# pidfile: /var/run/cpanel.pid
./cpanel:[ -f /usr/local/cpanel/etc/init/startup ] || exit 0
./cpanel:       if [ -f "/var/cpanel/smtpgidonlytweak" ]; then
./cpanel:       echo -n "Starting cPanel services: "
./cpanel:       daemon /usr/local/cpanel/etc/init/startcpsrvd
./cpanel:       echo -n "Starting cPanel brute force detector services: "
./cpanel:       daemon /usr/local/cpanel/etc/init/startcphulkd
./cpanel:    echo -n "Starting cPanel dav services: "
./cpanel:       daemon /usr/local/cpanel/etc/init/startcpdavd
./cpanel:               daemon /usr/local/cpanel/etc/init/startcppop
./cpanel:       echo -n "Starting cPanel Chat services: "
./cpanel:               daemon /usr/local/cpanel/entropychat/entropychat
./cpanel:               daemon /usr/local/cpanel/bin/startmelange
./cpanel:                       /usr/local/cpanel/bin/startinterchange
./cpanel:       echo -n "Starting cPanel ssl services: "
./cpanel:       daemon /usr/local/cpanel/startstunnel
./cpanel:    echo -n "Starting cPanel Queue services: "
./cpanel:       daemon /usr/local/cpanel/etc/init/startqueueprocd
./cpanel:    echo -n "Starting tailwatchd: "
./cpanel:    daemon /usr/local/cpanel/libexec/tailwatchd --start
./cpanel:       echo -n "Starting cPanel Log services: "
./cpanel:       daemon /usr/local/cpanel/cpanellogd
./cpanel:    action "Starting mailman services: " /usr/local/cpanel/etc/init/startmailman
./cpanel:    action "Stopping tailwatchd: " /usr/local/cpanel/libexec/tailwatchd --stop
./cpanel:    action "Stopping cPanel services: " /usr/local/cpanel/etc/init/stopcpsrvd
./cpanel:       action "Stopping cPanel dav services: " /usr/local/cpanel/etc/init/stopcpdavd
./cpanel:       action "Stopping cPanel queue services: " /usr/local/cpanel/etc/init/stopqueueprocd
./cpanel:       action "Stopping cPanel brute force detector services: " /usr/local/cpanel/etc/init/stopcphulkd
./cpanel:               action "Stopping pop3 services: " /usr/local/cpanel/etc/init/stopcppop
./cpanel:       echo -n "Stopping cPanel log services: "
./cpanel:       killproc cpanellogd
./cpanel:       echo -n "Stopping cPanel Chat services: "
./cpanel:       action "Stopping cPanel ssl services: " /usr/local/cpanel/etc/init/stopstunnel
./cpanel:       action "Stopping mailman services: " /usr/local/cpanel/etc/init/stopmailman
./cpanel:       if [ -e "/usr/local/cpanel/3rdparty/mailman/bin/mailmanctl" ]; then
./exim:if [ -e "/etc/chkserv.d" ]; then
./exim:        for file in `ls /etc/chkserv.d`
./exim:            if [ ! -e "/usr/local/cpanel/libexec/tailwatchd" ]; then
./exim:    if [ -x "/usr/local/cpanel/etc/init/startspamd" ]; then
./exim:        /usr/local/cpanel/etc/init/startspamd
./exim:        if [ ! -e "/usr/local/cpanel/libexec/tailwatchd" ]; then
./ror:  /usr/local/cpanel/bin/rormgr --startboot
./ror:  /usr/local/cpanel/bin/rormgr --stopall
./ror:  /usr/local/cpanel/bin/rormgr --stopall
./ror:  /usr/local/cpanel/bin/rormgr --startboot
./ror:  /usr/local/cpanel/bin/rormgr --statusall
./securetmp:# Author:       cPanel, Inc. &lt;copyright@cpanel.net&gt;</pre>

<h3>Turn off cpanel services</h3>
<p>You should remove the below delete command and start by just disabling the inits by turning them off.  Then reboot. Then delete.  If your machine won't reboot, I told you so, Cpanel told you so, and likely your host told you so.</p>
<pre>for S in cpanel ror securetmp fastmail exim; do R=$(command chkconfig --level 123456 $S off ||echo); R=$(command chkconfig --del $S ||echo); done</pre>


<h4>HTTPD</h4>
<p>If you are running chrooted httpd then you'll need to make sure you don't delete your entire webserver on accident.  Here's a relevant part from the /etc/init.d/httpd script.</p>
<pre># the path to your httpd binary, including options if necessary
if [ -e "/etc/chroothttpd" ]; then
        HTTPD=/usr/local/cpanel/bin/chroothttpd
else
        HTTPD=/usr/local/apache/bin/httpd
fi</pre>




<h2>Finding files owned by cpanel</h2>
<p>Some super cool bash commands in this post.. let's start with one to find all the files and folders on your machine owned by cpanel.  Check your /etc/passwd file for your machines specific usernames and groups.  This command saves all the filenames to ~/cpanel-files-backup.txt, which is used by tar next to create a backup of all of them.</p>
<pre>{ find / -mount -depth -maxdepth 150 \( -group cpanel -o   -group cpanel-phpmyadmin -o -group cpanel-phppgadmin   -o -group cpanelphpmyadmin   -o -group cpanelphppgadmin   -o -group cpanelhorde   -o -group cpanelroundcube \) -print; find / -mount -depth -maxdepth 150 \( -user cpanel -o   -user cpanel-phpmyadmin -o -user cpanel-phppgadmin   -o -user cpanelphpmyadmin   -o -user cpanelphppgadmin   -o -user cpanelhorde   -o -user cpanelroundcube \) -print; } &gt; ~/cpanel-files-backup.txt</pre>

<p>Here's another way to search directories.</p>
<pre> grep --color=always -Hir cpanel /var</pre>

<h2>Create the Backup</h2>
<p>Note that you must have the latest version of tar for this exact command, also you should backup /var/cpanel and /usr/local/cpanel and /etc and heck the whole machine why dontcha!</p>
<pre>tar -T ~/cpanel-files-backup.txt -cvz --checkpoint=1000 --checkpoint-action="ttyout=\rHit %s checkpoint #%u" -f /cpanel-files-backup.tgz --totals</pre>


<h2>Remove Files</h2>
<p>Once you do this your upstream without a paddle, you better make sure you know what you're doing with this.  This removes all those files.</p>
<pre>cat ~/cpanel-files-backup.txt | xargs -I&#039;F87&#039; rm -vfr F87</pre>

<p>Additionally you will want to remove /usr/local/cpanel and /var/cpanel - What I always do when running as root is alias my rm command to instead simply move the files to a .trash folder.  That way if something goes bork you have a better chance at fixing it.</p>


<h2>Find Group-Owned Files</h2>
<pre>find / -mount -depth -maxdepth 150 \
\(  -group cpanel -o \
  -group cpanel-phpmyadmin \
  -o -group cpanel-phppgadmin \
  -o -group cpanelphpmyadmin \
  -o -group cpanelphppgadmin \
  -o -group mailman \
  -o -group cpanelhorde \
  -o -group cpanelroundcube \
\) -fprintf /root/cpanel-group-files.log &#039;%#8k %#5m %11M %#10u:%-10g %-5U:%-5G %p %f %Y %F\n&#039;</pre>

<h2>Find User-Owned Files</h2>
<pre>find / -mount -depth -maxdepth 150 \(
  -user cpanel \
  -o -user cpanel-phpmyadmin \
  -o -user cpanel-phppgadmin \
  -o -user cpanelphpmyadmin \
  -o -user cpanelphppgadmin \
  -o -user mailman \
  -o -user cpanelhorde \
  -o -user cpanelroundcube
\) -fprintf /root/cpanel-users-files.log &#039;%#8k %#5m %11M %#10u:%-10g %-5U:%-5G %p %f %Y %F\n&#039;</pre>



<pre>       4  0755  drwxr-xr-x     cpanel:cpanel     32002:32004 /var/cpanel/userhomes/cpanel cpanel d reiserfs
       4  0700  drwx------ cpanel-phpmyadmin:cpanel-phpmyadmin 32005:32007 /var/cpanel/userhomes/cpanel-phpmyadmin/tmp tmp d reiserfs
       4  0644  -rw-r--r-- cpanel-phpmyadmin:cpanel-phpmyadmin 32005:32007 /var/cpanel/userhomes/cpanel-phpmyadmin/.cpanel/caches/featurelists/default.cache default.cache f reiserfs
       4  0700  drwx------ cpanel-phpmyadmin:cpanel-phpmyadmin 32005:32007 /var/cpanel/userhomes/cpanel-phpmyadmin/.cpanel/caches/featurelists featurelists d reiserfs
       4  0700  drwx------ cpanel-phpmyadmin:cpanel-phpmyadmin 32005:32007 /var/cpanel/userhomes/cpanel-phpmyadmin/.cpanel/caches caches d reiserfs
       4  0700  drwx------ cpanel-phpmyadmin:cpanel-phpmyadmin 32005:32007 /var/cpanel/userhomes/cpanel-phpmyadmin/.cpanel .cpanel d reiserfs
       4  0750  drwxr-x--- cpanel-phpmyadmin:cpanel-phpmyadmin 32005:32007 /var/cpanel/userhomes/cpanel-phpmyadmin/mail mail d reiserfs
       4  0711  drwx--x--x cpanel-phpmyadmin:cpanel-phpmyadmin 32005:32007 /var/cpanel/userhomes/cpanel-phpmyadmin cpanel-phpmyadmin d reiserfs
       4  0700  drwx------ cpanelphppgadmin:cpanelphppgadmin 32009:32011 /var/cpanel/userhomes/cpanelphppgadmin/sessions sessions d reiserfs
       4  0644  -rw-r--r-- cpanelphppgadmin:cpanelphppgadmin 32009:32011 /var/cpanel/userhomes/cpanelphppgadmin/.cpanel/caches/featurelists/default.cache default.cache f reiserfs
       4  0700  drwx------ cpanelphppgadmin:cpanelphppgadmin 32009:32011 /var/cpanel/userhomes/cpanelphppgadmin/.cpanel/caches/featurelists featurelists d reiserfs
       4  0700  drwx------ cpanelphppgadmin:cpanelphppgadmin 32009:32011 /var/cpanel/userhomes/cpanelphppgadmin/.cpanel/caches caches d reiserfs
       4  0700  drwx------ cpanelphppgadmin:cpanelphppgadmin 32009:32011 /var/cpanel/userhomes/cpanelphppgadmin/.cpanel .cpanel d reiserfs
       4  0750  drwxr-x--- cpanelphppgadmin:cpanelphppgadmin 32009:32011 /var/cpanel/userhomes/cpanelphppgadmin/mail mail d reiserfs
       4  0711  drwx--x--x cpanelphppgadmin:cpanelphppgadmin 32009:32011 /var/cpanel/userhomes/cpanelphppgadmin cpanelphppgadmin d reiserfs
       4  0750  drwxr-x--- cpanelroundcube:cpanelroundcube 514  :514   /var/cpanel/userhomes/cpanelroundcube/mail mail d reiserfs
       4  0700  drwx------ cpanelroundcube:cpanelroundcube 514  :514   /var/cpanel/userhomes/cpanelroundcube/sessions sessions d reiserfs
       4  0711  drwx--x--x cpanelroundcube:cpanelroundcube 514  :514   /var/cpanel/userhomes/cpanelroundcube cpanelroundcube d reiserfs
       4  0644  -rw-r--r--     cpanel:cpanel     32002:32004 /var/cpanel/.cpanel/caches/featurelists/default.cache default.cache f reiserfs
       4  0700  drwx------     cpanel:cpanel     32002:32004 /var/cpanel/.cpanel/caches/featurelists featurelists d reiserfs
       4  0700  drwx------     cpanel:cpanel     32002:32004 /var/cpanel/.cpanel/caches caches d reiserfs
       4  0700  drwx------     cpanel:cpanel     32002:32004 /var/cpanel/.cpanel .cpanel d reiserfs
       4  0700  drwx------ cpanelroundcube:cpanelroundcube 514  :514   /var/cpanel/roundcube/tmp tmp d reiserfs
       4  0700  drwx------ cpanelroundcube:cpanelroundcube 514  :514   /var/cpanel/roundcube/log log d reiserfs</pre>


<h3>Find Permissions</h3>
<pre>cat ~/cpanel-group-files.log ~/cpanel-users-files.log |tr -s &#039;\000 \t&#039;|cut -d&#039; &#039; -f3|sort -u</pre>






<h3>Find files tailwatchd</h3>
<pre>(1:3732)# $NICE find ${1:-`pwd`} -mount -name &#039;*tailwatch*&#039;
/usr/local/cpanel/libexec/tailwatchd
/usr/local/cpanel/libexec/tailwatch
/usr/local/cpanel/libexec/tailwatch/tailwatchd
/usr/local/cpanel/etc/init/scripts/freebsd/tailwatchd.sh
/usr/local/cpanel/etc/init/scripts/trustix/tailwatchd
/usr/local/cpanel/etc/init/scripts/centos/tailwatchd
/usr/local/cpanel/etc/init/scripts/suse/tailwatchd
/usr/local/cpanel/etc/init/scripts/caos/tailwatchd
/usr/local/cpanel/etc/init/scripts/whitebox/tailwatchd
/usr/local/cpanel/etc/init/scripts/mandrake/tailwatchd
/usr/local/cpanel/etc/init/scripts/debian/tailwatchd
/usr/local/cpanel/etc/init/scripts/redhat/tailwatchd
/usr/local/cpanel/etc/init/scripts/fedora/tailwatchd
/usr/local/cpanel/etc/init/stoptailwatchd
/usr/local/cpanel/etc/init/starttailwatchd
/usr/local/cpanel/bin/tailwatchd
/usr/local/cpanel/logs/tailwatchd_log
/var/log/cpanel/tailwatchd_log
/var/cpanel/log_rotation/cp_tailwatchd_log.cpanellogd
/var/cpanel/tailwatch.positions
/var/run/tailwatchd.pid
/etc/chkserv.d/tailwatchd
/scripts/restartsrv_tailwatchd</pre>


<h2>Delete cpanel Users/Groups</h2>
<pre>for U in cpanel-phpmyadmin cpanel-phppgadmin cpanelphpmyadmin cpanelphppgadmin cpanelhorde cpanelroundcube machbuild; do userdel -fr $U; groupdel $U; done</pre>

<h2>Check for broken symlinks</h2>
<pre>find / -mount -depth -type l -print0 |xargs -0 -P0 -I&#039;F87&#039; file -s &#039;F87&#039; | sed -n &#039;/: broken symbolic link to/p&#039;</pre>
<p>Especially check /etc</p>
<pre>$ find /etc -mount -depth -type l -print0 |xargs -0 -P0 -I&#039;F87&#039; file -s &#039;F87&#039; | sed -n &#039;/: broken symbolic link to/p&#039;
/etc/ftpd-rsa.pem                   broken symbolic link to `/var/cpanel/ssl/ftp/ftpd-rsa.pem&#039;
/etc/rc.d/rc1.d/K10chkservd         broken symbolic link to `../init.d/chkservd&#039;
/etc/rc.d/rc1.d/K30antirelayd       broken symbolic link to `../init.d/antirelayd&#039;
/etc/rc.d/rc1.d/K80dcc              broken symbolic link to `../init.d/dcc&#039;
/etc/rc.d/rc3.d/K80dcc              broken symbolic link to `../init.d/dcc&#039;
/etc/rc.d/rc3.d/S80chkservd         broken symbolic link to `../init.d/chkservd&#039;
/etc/rc.d/rc3.d/S80antirelayd       broken symbolic link to `../init.d/antirelayd&#039;
/etc/rc.d/rc6.d/K10chkservd         broken symbolic link to `../init.d/chkservd&#039;
/etc/rc.d/rc6.d/K30antirelayd       broken symbolic link to `../init.d/antirelayd&#039;
/etc/rc.d/rc6.d/K80dcc              broken symbolic link to `../init.d/dcc&#039;
/etc/rc.d/rc5.d/K80dcc              broken symbolic link to `../init.d/dcc&#039;
/etc/rc.d/rc5.d/S80chkservd         broken symbolic link to `../init.d/chkservd&#039;
/etc/rc.d/rc5.d/S80antirelayd       broken symbolic link to `../init.d/antirelayd&#039;
/etc/rc.d/rc2.d/K80dcc              broken symbolic link to `../init.d/dcc&#039;
/etc/rc.d/rc2.d/S80chkservd         broken symbolic link to `../init.d/chkservd&#039;
/etc/rc.d/rc2.d/S80antirelayd       broken symbolic link to `../init.d/antirelayd&#039;
/etc/rc.d/rc4.d/K80dcc              broken symbolic link to `../init.d/dcc&#039;
/etc/rc.d/rc4.d/S80chkservd         broken symbolic link to `../init.d/chkservd&#039;
/etc/rc.d/rc4.d/S80antirelayd       broken symbolic link to `../init.d/antirelayd&#039;
/etc/rc.d/rc0.d/K10chkservd         broken symbolic link to `../init.d/chkservd&#039;
/etc/rc.d/rc0.d/K30antirelayd       broken symbolic link to `../init.d/antirelayd&#039;
/etc/rc.d/rc0.d/K80dcc              broken symbolic link to `../init.d/dcc&#039;
/etc/authlib/authProg               broken symbolic link to `/usr/local/cpanel/bin/courier-auth&#039;</pre>

<p>And delete if you are sure</p>
<pre>find /etc -mount -depth -type l -print0 |xargs -0 -P0 -I&#039;F87&#039; file -s &#039;F87&#039; | sed -n &#039;/: broken symbolic link to/p&#039; |cut -d&#039; &#039; -f1|xargs -I&#039;F87&#039; rm -rvf &#039;F87&#039;</pre>


<h2>Reinstall CSF</h2>
<p>The only thing I actually used that came with cpanel is the CSF/LFD Firewall package, which is a fantastic piece of software.  I had to reinstall this, and to get it working without cpanel add the following line to the csf.conf</p>
<pre>GENERIC = "1"</pre>

<h2>Thats It</h2>
<p>Now once you've cleaned up everything, you should try everything conceivable to get an error before rebooting.  Like you should start and stop every service in /etc/init.d/, you should use telinit to check various runlevels (which keeps your sshd connection still live).  Go all out, should take at least a full hour.</p>
<p>Another thing I like to do is rebuild alot of my source-built software again in case anything got messed up.  I upgrade perl from cpanels 5.8.8 to 5.10, which is pretty thorough, and you know, reinstall anything else I think I might need.  One of the benefits of compiling your own software is all I have to do is cd to the source directory and type <code>make -B &amp;&amp; ( { make test || make check || make checks || make tests; } || echo  ) &amp;&amp; sudo make install</code> and that's it.  The tests/checks are optional of course.</p>


<p>If anyone actually ever reads this and does it, please share your advice here.. everybody knows we need it!  Good Luck</p><p><a href="http://www.askapache.com/hacking/uninstall-cpanel.html"></a><a href="http://www.askapache.com/hacking/uninstall-cpanel.html">HOWTO: Uninstall CPANEL over SSH</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/hacking/uninstall-cpanel.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Enhanced printenv Script for Server Debugging</title>
		<link>http://www.askapache.com/hosting/enhanced-printenv.html</link>
		<comments>http://www.askapache.com/hosting/enhanced-printenv.html#comments</comments>
		<pubDate>Thu, 14 Apr 2011 19:05:17 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=4920</guid>
		<description><![CDATA[<p>A souped-up version of the Apache printenv script for hard-core server environment debuggery.</p>
<pre>
#!/bin/sh
echo -e "Content-type: text/plain\n\n"
...
  __T "CURRENT PROCESS CMDLINE"
  {
   for p in `echo /proc/[0-9]*/cmdline`;
   do
    pid=${p:6:$((${#p}-13))}
    [[ $pid == $PPID &#124;&#124; $pid == $$ ]] &#38;&#38; continue;
    __M "[ /proc/$pid ]";
    sed 's/\x00/ /g;G' $p 2>/dev/null
   done
  }
 fi</pre>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/hosting/enhanced-printenv.html"></a><a href="http://www.askapache.com/hosting/enhanced-printenv.html"><cite>AskApache.com</cite></a></p><p>Every Apache server comes pre-shipped with an old cgi script named <tt>printenv</tt>.  It's useful and used for printing out the environment variables from your servers point of view.  Basically you save this file where you can then call it from your browser, like <code>site.com/printenv.cgi</code> -- then it will be executing as the user running the web server, <tt>nobody</tt>, <tt>apache</tt>, etc..   So this tells you all sorts of interesting things about your server, especially if you want/need to know about the users, groups, and file permissions.</p>

<h2>Enabling CGI</h2>
<p>You need to do 1 of 2 things to use this:</p>
<ol><li>Make it executable and in your server directory</li>
<li>Use a trick to cause your server to execute it regardless</li></ol>

<h2>Htaccess CGI</h2>
<p>If you have htaccess then you most likely can get this to work by giving it an execute bit with chmod or from your ftp client, and then use htaccess like this:</p>
<pre>Options +ExecCGI Indexes +FollowSymLinks
AddHandler cgi-script .cgi .pl .sh
&nbsp;
Order Deny,Allow
Deny from All
Allow from 127.0.0.1 ADDYOURIPHERE env=REDIRECT_STATUS
Satisfy All</pre>
<p>Search around on this site for php.cgi tricks if you can't seem to get it.  Basically you can try stuff like making it an errordocument, using other directives like forcetype, AddType, and even try stuff like mod_security's upload binary setting.</p>

<p class="cnote">You do not want anyone other than you ever looking at the output of this.  It's so full of details about your machine that it would be a huge security problem.</p>

<h2>The AskApache Printenv</h2>
<pre>#!/bin/sh
echo -e "Content-type: text/plain\n\n"
&nbsp;
# FUNCTIONS
################################################################################################################
function __A ()
{ local __a __i __z;for __a;do __z=\${!${__a}*};for __i in `eval echo "${__z}"`;do echo -e "$__i: ${!__i}";done;done; }
&nbsp;
function __S ()
{ local L IFS=&#039;;&#039;;while read -r L;do builtin printf "${#L}@%s\n" "$L";done|sort -n|sed -u &#039;s/^[^@]*//&#039;; }
&nbsp;
function __P ()
{ local l=`builtin printf %${2:-$__WIDTH}s` &amp;&amp; echo -e "${l// /${1:-=}}"; }
&nbsp;
function __T ()
{ echo -e "\n\n+`__P -`+\n| $*\n+`__P &#039;=&#039;`+"; }
&nbsp;
function __M ()
{ echo -e " &gt;&gt;&gt; $M" $*; }
&nbsp;
function __H ()
{ command builtin type $1 &amp;&gt;/dev/null &amp;&amp; local a="yes" || return 1; }
&nbsp;
function LE ()
{
 [[ ! -r /proc/${1:-$$}/limits ]] &amp;&amp; return;
 sed -e &#039;1z;s/ *$//;:a;$!N;s/\nM.. [a-z]* [a-z]* [a-z]* \{1,\}\([^ ]*\) *\([^ ]*\) *[a-z]* */\1:\2 /;ta;s/u\w\+d/u/g;s/ *$//;s/ / | /g;s/\([^:]\+\):\1/\1:=/g&#039; /proc/${1:-$$}/limits;
}
function LH ()
{
 [[ ! -r /proc/${1:-$$}/limits ]] &amp;&amp; return;
 sed -e &#039;1z;s/ *$//;:a;$!N;s/\nM.. \([a-z]\+ [a-z]* [a-z]*\) \{1,\}\([^ ]*\) *\([^ ]*\) *\([a-z]*\) */:\1/;ta;s/ *:/:/g;s/size/sz/g;s/file/f/g;s/ p\w\+y/ pri/g;s/memory/mem/g;s/p\w\+s/procs/g;s/^://;s/:/ | /g&#039; /proc/${1:-$$}/limits
}
&nbsp;
# CUSTOM SETTINGS
################################################################################################################
__WIDTH=170
LC_COLLATE=C LC_CTYPE=C LC_ALL=C
&nbsp;
# RUNTIME SETUP
#################################################################################################################
shopt -s dotglob nocaseglob extglob
&nbsp;
# -C If set, disallow existing regular files to be overwritte
# -f Disable file name generation (globbing
# -e Exit immediately if a command exits with a non-zero status
# -B enable brace expansion
# +H disable History
set -C +f +H -B
&nbsp;
# make sure we dont create any files
umask 0177
&nbsp;
# redirect everything to output (no logs or stderr is used)
exec 2&gt;/dev/null
&nbsp;
# MAIN EXECUTION
#################################################################################################################
{
 __T "EXPANDING PATH"
 {
  __M "ORIG PATH:$PATH"
  PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/libexec:/usr/local/apache/bin
  for t in ${PATH//:/ };
  do
   [[ -d "$t" ]] &amp;&amp; sed -n -e "/:${t//\//\\/}:/Q1" &lt;&lt;&lt; ":${p:=}:" &amp;&amp; p=$p:$t || continue;
  done
  PATH=${p/:/}:.
  __M "NEW PATH:$PATH"
 }
&nbsp;
 __T "USER INFO"
 {
  __M "UMASK: `(umask 2&gt;/dev/null)` ( `(umask -S 2&gt;/dev/null)` )"
  __H uname &amp;&amp; __M "UNAME: `eval echo $(uname -a 2&gt;/dev/null)`"
  __H whoami &amp;&amp; __M "WHOAMI: `(whoami 2&gt;/dev/null)`"
  __H id &amp;&amp; __M "ID: `(id 2&gt;/dev/null)`"
  __H logname &amp;&amp; __M "LOGNAME: `(logname 2&gt;/dev/null)`"
  __H groups &amp;&amp; __M "GROUPS: `(groups 2&gt;/dev/null)`"
  echo -e "\n\n"
 }
&nbsp;
 if __H who;
 then
  __T "LOGGED ON USERS"
  {
   (who -a 2&gt;/dev/null)
  }
 fi;
&nbsp;
 if [[ -r /etc/passwd ]];
 then
  __T "/etc/passwd"
  {
   (cat /etc/passwd)
  }
 fi;
&nbsp;
 if __H ulimit;
 then
  __T "USER LIMITS"
  {
   ulimit -a
  }
 fi
&nbsp;
 if [[ -d /dev ]] &amp;&amp; __H ls;
 then
  __T "/dev Directory"
  {
   ( ls -vlaph /dev 2&gt;/dev/null )
  }
 fi;
&nbsp;
 if [[ -d /proc ]];
 then
  __T "CURRENT PROCESS LIMITS"
  {
   for p in `echo /proc/[0-9]*/limits`
   do
    pid=${p:6:$((${#p}-13))}
    [[ $pid == $PPID || $pid == $$ ]] &amp;&amp; continue;
    echo -e "\n/proc/$pid:"
    sed &#039;1s/\x00/ /g;n;s/\x00/\n/g;/.\{2,\}/!d&#039; /proc/$pid/cmdline $p 2&gt;/dev/null
   done
  }
&nbsp;
  __T "CURRENT PROCESS CMDLINE"
  {
   for p in `echo /proc/[0-9]*/cmdline`;
   do
    pid=${p:6:$((${#p}-13))}
    [[ $pid == $PPID || $pid == $$ ]] &amp;&amp; continue;
    __M "[ /proc/$pid ]";
    sed &#039;s/\x00/ /g;G&#039; $p 2&gt;/dev/null
   done
  }
 fi
&nbsp;
 __T "IP INFORMATION"
 {
  __H ip &amp;&amp; __M "IP:" &amp;&amp; (ip -o -f inet addr 2&gt;/dev/null) | sed &#039;s/^.*inet \([0-9.]*\).*$/\1/g&#039;;
  __H nmap &amp;&amp; __M "NMAP:" &amp;&amp; (nmap --iflist 2&gt;/dev/null) | sed 1,4d | sed -n &#039;/ethernet/s/^.*) \([0-9.]*\).*$/\1/gp&#039;;
  __H ifconfig &amp;&amp; __M "IFCONFIG:" &amp;&amp; (ifconfig -a 2&gt;/dev/null) | sed -n &#039;/inet a/s/^.*addr:\([0-9.]*\).*$/\1/gp&#039;;
  [[ -f "$HOME/.cpanel/datastore/_sbin_ifconfig_-a" ]] &amp;&amp; __M "CPANEL CACHE:" &amp;&amp; sed -e &#039;/inet/!d; s/.*addr:\([0-9\.]*\).*/\1/g&#039; "$HOME/.cpanel/datastore/_sbin_ifconfig_-a" | sort -u
 }
&nbsp;
 __T "ROUTE / INTERFACE INFO"
 {
  __H route &amp;&amp; __M "ROUTE" &amp;&amp; (route -nv 2&gt;/dev/null)
  __H ip &amp;&amp; ( ip rule &amp;&amp; ip route &amp;&amp; ip address ) 2&gt;/dev/null
  __H ifconfig &amp;&amp; (ifconfig -a 2&gt;/dev/null)
 }
&nbsp;
 __T "CGI/1.0 test script report:"
 {
  __A SERVER REQUEST GET SERVER PATH REMOTE AUTH CONTENT HTTP TZ GATEWAY QUERY MO
  echo -e "\n\n"
 }
&nbsp;
 __T "HIDDEN VARIABLES"
 {
  __A {a..z} {A..Z} _{0..9} _{A..Z} _{a..z} | cat -Tsv 2&gt;/dev/null
  echo -e "\n\n"
 }
&nbsp;
 __T "DECLARE INFO"
 {
  for i in "r" "i" "a" "x" "t" "-";
  do
   builtin eval declare -$i &amp;&amp; echo;
  done | sed &#039;s/^declare //&#039; | cat -Tsv 2&gt;/dev/null
  echo -e "\n\n"
 }
&nbsp;
 __T "SHELL OPTIONS"
 {
  __A SHELLOPTS BASHOPTS
  echo -e "\$-: $-"
  __P &#039;-&#039; &amp;&amp; builtin shopt -s -p
  __P &#039;-&#039; &amp;&amp; builtin shopt -u -p
  echo -e "\n\n"
 }
&nbsp;
 __T "ENV AND EXPORT"
 {
  __H env &amp;&amp; command env | cat -Tsv 2&gt;/dev/null &amp;&amp; __P &#039;-&#039;
  builtin export | cat -Tsv 2&gt;/dev/null
  echo -e "\n\n"
 }
&nbsp;
 if __H perl;
 then
  __T "PERL VARIABLES"
  {
   perl -e&#039;foreach $v (sort(keys(%ENV))) {$vv = $ENV{$v};$vv =~ s|\n|\\n|g;$vv =~ s|"|\\"|g;print "${v}=\"${vv}\"\n"}&#039; | cat -Tsv 2&gt;/dev/null
   echo -e "\n\n"
  }
 fi
&nbsp;
} | fold - -w$(($__WIDTH+3))
exit $?</pre><p><a href="http://www.askapache.com/hosting/enhanced-printenv.html"></a><a href="http://www.askapache.com/hosting/enhanced-printenv.html">Enhanced printenv Script for Server Debugging</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/hosting/enhanced-printenv.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

