<?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>KarkomaOnline &#187; Apache</title>
	<atom:link href="http://www.karkomaonline.com/index.php/category/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.karkomaonline.com</link>
	<description>a Blog for SysAdmins and Unix stuff in general</description>
	<lastBuildDate>Thu, 25 Nov 2010 07:49:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Installing MySQL, Apache and PHP in Solaris 10</title>
		<link>http://www.karkomaonline.com/index.php/2006/12/installing-mysql-apache-and-php-in-solaris-10/</link>
		<comments>http://www.karkomaonline.com/index.php/2006/12/installing-mysql-apache-and-php-in-solaris-10/#comments</comments>
		<pubDate>Mon, 11 Dec 2006 00:43:40 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.karkoma.info/index.php/2006/12/11/installing-mysql-apache-and-php-in-solaris-10/</guid>
		<description><![CDATA[This is a quick guide to install PHP4, MySQL4 and Apache2 in Solaris 10. In order to facilitate the management and installation of packages we will use the pkg-get tool. pkg-get is a tool to automate download and installation of binary packages, for example from Blastwave an Open Source software repository for Solaris. Our first [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick guide to install PHP4, MySQL4 and Apache2 in Solaris 10. In order to facilitate the management and installation of packages we will use the <em>pkg-get</em> tool. pkg-get is a tool to automate download and installation of binary packages, for example from <a href="http://www.blastwave.org/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.blastwave.org/?referer=');">Blastwave</a> an Open Source software repository for Solaris.</p>
<p>Our first task will be the installation of pkg-get. At <a href="http://www.blastwave.org/howto.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.blastwave.org/howto.html?referer=');">Blastwave</a> you&#8217;ll find a complete guide on how to undertake this task. Briefly:</p>
<blockquote><p>cd /tmp<br />
/usr/sfw/bin/wget http://www.blastwave.org/pkg_get.pkg<br />
pkgadd -d pkg_get.pkg all<br />
/usr/sfw/bin/wget http://www.blastwave.org/wget-i386.bin<br />
chmod 755 wget-i386.bin</p>
<p>PATH=/tmp:/opt/csw/bin:/usr/sbin:/usr/bin:</p>
<p> /usr/dt/bin:/usr/openwin/bin:/usr/ccs/bin<br />
export PATH</p>
<p>vi /opt/csw/etc/pkg-get.conf</p></blockquote>
<p>Pick a <a href="http://www.blastwave.org/mirrors.php" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.blastwave.org/mirrors.php?referer=');">mirror</a> next to you. Then:</p>
<blockquote><p>pkg-get -i wget</p>
<p>PATH=/opt/csw/bin:/usr/sbin:/usr/bin:/usr/dt/bin:</p>
<p> /usr/openwin/bin:/usr/ccs/bin<br />
export PATH</p></blockquote>
<p>And now you may install other packages. But let&#8217;s focus in our target.</p>
<p>As Solaris 10 comes with MySQL and Apache installed by default, first we are going to uninstall them. Take a look at your system:</p>
<blockquote><p>pkginfo | grep -i apache</p>
<p>system      SUNWaclg                         Apache Common Logging<br />
system      SUNWapch2d                       Apache Web Server V2 Documentation<br />
system      SUNWapch2r                       Apache Web Server V2 (root)<br />
system      SUNWapch2u                       Apache Web Server V2 (usr)<br />
system      SUNWapchd                        Apache Web Server Documentation<br />
system      SUNWapchr                        Apache Web Server (root)<br />
system      SUNWapchu                        Apache Web Server (usr)</p>
<p>pkginfo | grep -i mysql</p>
<p>system      SUNWmysqlr                       mysql &#8211; MySQL Database Management System (root component)<br />
system      SUNWmysqlt                       mysql &#8211; MySQL Database Management System (test component)<br />
system      SUNWmysqlu                       mysql &#8211; MySQL Database Management System (usr component)</p></blockquote>
<p>Next task would be to uninstall these packages. Proceed as follows:</p>
<blockquote><p>pkgrm SUNWaclg SUNWapch2d SUNWapch2r SUNWapch2u SUNWapchd SUNWapchr SUNWapchu<br />
pkgrm SUNWmysqlr SUNWmysqlt SUNWmysqlu</p></blockquote>
<p>Finally, install Apache, MySQL and PHP from pkg-get:</p>
<blockquote><p>pkg-get -i apache2 mysql4 php4 mod_php</p></blockquote>
<p>That&#8217;s all. Now configure the software as usual. Note that packages installed with pkg-get reside in /opt/csw, so I recommed adding something like this to your /etc/profile:</p>
<blockquote><p>PATH=/opt/csw/bin:/opt/csw/mysql4/bin:$PATH<br />
export PATH</p></blockquote>
<p>More info:</p>
<p><a href="http://www.blastwave.org/howto.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.blastwave.org/howto.html?referer=');">pkg-get installation howto</a><br />
<a href="http://www.blastwave.org/userguide/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.blastwave.org/userguide/?referer=');"> pkg-get users guide</a><br />
<a href="http://docs.sun.com/app/docs/doc/806-7612/6jgfmsvrq?a=view" target="_blank" onclick="pageTracker._trackPageview('/outgoing/docs.sun.com/app/docs/doc/806-7612/6jgfmsvrq?a=view&amp;referer=');"> Customizing Your Working Environment</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2006/12/installing-mysql-apache-and-php-in-solaris-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Redirect HTTP to HTTPS</title>
		<link>http://www.karkomaonline.com/index.php/2005/08/redirect-http-to-https/</link>
		<comments>http://www.karkomaonline.com/index.php/2005/08/redirect-http-to-https/#comments</comments>
		<pubDate>Sat, 06 Aug 2005 21:19:51 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.karkoma.info/index.php/2005/08/06/redirect-http-to-https/</guid>
		<description><![CDATA[This little trick will show you how to configure Apache to automatically redirect HTTP requests to HTTPS, i.e. http://www.karkomaonline.com to https://www.karkomaonline.com. Add this directives to you configuration file: RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]]]></description>
			<content:encoded><![CDATA[<p>This little trick will show you how to configure Apache to automatically redirect HTTP requests to HTTPS, i.e. http://www.karkomaonline.com to https://www.karkomaonline.com.</p>
<p>Add this directives to you configuration file:</p>
<blockquote><p>RewriteEngine On<br />
RewriteCond %{SERVER_PORT} !^443$<br />
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2005/08/redirect-http-to-https/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>mod_rewrite serve pages depending on time</title>
		<link>http://www.karkomaonline.com/index.php/2005/04/mod_rewrite-serve-pages-depending-on-time/</link>
		<comments>http://www.karkomaonline.com/index.php/2005/04/mod_rewrite-serve-pages-depending-on-time/#comments</comments>
		<pubDate>Fri, 01 Apr 2005 15:21:31 +0000</pubDate>
		<dc:creator>sigix</dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.karkoma.info/index.php/2005/04/01/mod_rewrite-serve-pages-depending-on-time/</guid>
		<description><![CDATA[Apache&#8217;s mod_rewrite can be used to serve pages depending on the time. RewriteEngine on RewriteCond %{TIME_HOUR}%{TIME_MIN} &#62;2300 RewriteCond %{TIME_HOUR}%{TIME_MIN} &#60;1900 RewriteRule ^index.php$ day.html RewriteRule ^index.php$ night.html When request for index.php is made then to corresponding time day.html or night.html page is served.]]></description>
			<content:encoded><![CDATA[<p>Apache&#8217;s <em>mod_rewrite</em> can be used to serve pages depending on the time.</p>
<blockquote><p>RewriteEngine on<br />
RewriteCond %{TIME_HOUR}%{TIME_MIN} &gt;2300<br />
RewriteCond %{TIME_HOUR}%{TIME_MIN} &lt;1900<br />
RewriteRule ^index.php$ day.html<br />
RewriteRule ^index.php$ night.html</p></blockquote>
<p>When request for <em>index.php</em> is made then to corresponding time <em>day.html</em> or <em>night.html</em> page is served.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2005/04/mod_rewrite-serve-pages-depending-on-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Memory allocation DOS</title>
		<link>http://www.karkomaonline.com/index.php/2004/07/memory-allocation-dos/</link>
		<comments>http://www.karkomaonline.com/index.php/2004/07/memory-allocation-dos/#comments</comments>
		<pubDate>Tue, 13 Jul 2004 05:14:00 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.karkoma.info/index.php/2004/07/12/memory-allocation-dos/</guid>
		<description><![CDATA[A bug in Apache 2.0.49 may allow a remote attacker to perform a Denial of Service attack by exhausting memory. It seems that 1.3.x releases are safe. For more information: Georgi Guninski security advisory #70, 2004 Gentoo GLSA 200407-03 / Apache Apache 2.0 Security Vulnerabilities]]></description>
			<content:encoded><![CDATA[<p>A bug in Apache 2.0.49 may allow a remote attacker to perform a Denial of Service attack by exhausting memory. It seems that 1.3.x releases are safe.</p>
<p>For more information:</p>
<ul>
<li><a href="http://www.guninski.com/httpd1.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.guninski.com/httpd1.html?referer=');">Georgi Guninski security advisory #70, 2004</a></li>
<li><a href="http://www.gentoo.org/security/en/glsa/glsa-200407-03.xml" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.gentoo.org/security/en/glsa/glsa-200407-03.xml?referer=');">Gentoo GLSA 200407-03 / Apache</a></li>
<li><a href="http://www.apacheweek.com/features/security-20" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.apacheweek.com/features/security-20?referer=');">Apache 2.0 Security Vulnerabilities</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2004/07/memory-allocation-dos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gracefully restarting Apache</title>
		<link>http://www.karkomaonline.com/index.php/2004/06/gracefully-restarting-apache/</link>
		<comments>http://www.karkomaonline.com/index.php/2004/06/gracefully-restarting-apache/#comments</comments>
		<pubDate>Mon, 14 Jun 2004 18:53:18 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.karkoma.info/index.php/2004/06/14/gracefully-restarting-apache/</guid>
		<description><![CDATA[When you restart your Apache by issuing&#8230; apachectl restart or /etc/init.d/apache restart the httpd daemon is stopped and started again closing currently open connections. There is a way to restart Apache&#8217;s http daemon keeping current connections opened. Simply type: apachectl graceful This is useful if you changed the httpd.conf configuration file and want Apache to [...]]]></description>
			<content:encoded><![CDATA[<p>When you restart your Apache by issuing&#8230;</p>
<blockquote><p>apachectl restart</p></blockquote>
<p>or</p>
<blockquote><p>/etc/init.d/apache restart</p></blockquote>
<p>the httpd daemon is stopped and started again closing currently open connections.</p>
<p>There is a way to restart Apache&#8217;s http daemon keeping current connections opened. Simply type:</p>
<blockquote><p>apachectl graceful</p></blockquote>
<p>This is useful if you changed the <em>httpd.conf</em> configuration file and want Apache to re-read it keeping connections.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2004/06/gracefully-restarting-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache as an open proxy?</title>
		<link>http://www.karkomaonline.com/index.php/2004/04/apache-as-an-open-proxy/</link>
		<comments>http://www.karkomaonline.com/index.php/2004/04/apache-as-an-open-proxy/#comments</comments>
		<pubDate>Sun, 25 Apr 2004 19:41:09 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.karkoma.info/index.php/2004/04/25/apache-as-an-open-proxy/</guid>
		<description><![CDATA[If you have seen entries in your access.log file like this one&#8230; a.b.c.d &#8211; - [24/Apr/2004:23:00:00 +0200] &#8220;GET http://www.google.com/&#8221; 200 46124 This means that a.b.c.d is trying to access www.google.com using your Apache as a proxy. As you can see the response status 200 indicates success and the data returned is 46124 bytes long. If [...]]]></description>
			<content:encoded><![CDATA[<p>If you have seen entries in your <em>access.log</em> file like this one&#8230;</p>
<blockquote><p>a.b.c.d &#8211; - [24/Apr/2004:23:00:00 +0200] &#8220;GET http://www.google.com/&#8221; 200 46124</p></blockquote>
<p>This means that <em>a.b.c.d</em> is trying to access <em>www.google.com</em> using your Apache as a proxy. As you can see the response status 200 indicates success and the data returned is 46124 bytes long.</p>
<p>If you don&#8217;t want your server to be used as a forward proxy make sure that <em>ProxyRequests</em> directive is set to <em>Off</em>, even better do not load <em>mod_proxy</em> module.</p>
<p>Despite the fact the entry shown in the previous example says that the request succeded, this is not necessarily true. Try the following to test your server:</p>
<blockquote><p>telnet www.yoursite.com 80<br />
GET http://www.google.com/</p></blockquote>
<p>Watch the access.log file. If you see the code status 200, compare the bytes returned by Apache (the last field in the log entry) with your homepage size (your index.html). If they match, Apache is serving your homepage instead of forwarding the request to google. If they don&#8217;t, probably your Apache is an open forwarding proxy.</p>
<p><strong>References:</strong></p>
<ul>
<li><a href="http://httpd.apache.org/docs/misc/FAQ.html#proxyscan" target="_blank" onclick="pageTracker._trackPageview('/outgoing/httpd.apache.org/docs/misc/FAQ.html_proxyscan?referer=');">Apache FAQ</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2004/04/apache-as-an-open-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitoring Apache activity</title>
		<link>http://www.karkomaonline.com/index.php/2004/03/monitoring-apache-activity/</link>
		<comments>http://www.karkomaonline.com/index.php/2004/03/monitoring-apache-activity/#comments</comments>
		<pubDate>Thu, 25 Mar 2004 05:30:16 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.karkoma.info/index.php/2004/03/24/monitoring-apache-activity/</guid>
		<description><![CDATA[The Apache mod_status module provides useful information to find out the activity and performance of the HTTP daemon. To watch the activity of your Apache webserver edit httpd.conf or apache2.conf or whatever is named in your environment and add the following: &#8230;.. LoadModule status_module modules/mod_status.so &#8230;.. ExtendedStatus On &#8230;.. &#60;Location /server-status&#62; SetHandler server-status Order deny,allow [...]]]></description>
			<content:encoded><![CDATA[<p>The Apache <em>mod_status</em> module provides useful information to find out the activity and performance of the HTTP daemon.</p>
<p>To watch the activity of your Apache webserver edit <em>httpd.conf</em> or <em>apache2.conf</em> or whatever is named in your environment and add the following:</p>
<p><span id="more-78"></span></p>
<blockquote><p>&#8230;..<br />
LoadModule status_module                 modules/mod_status.so<br />
&#8230;..</p>
<p>ExtendedStatus On<br />
&#8230;..</p>
<p>&lt;Location /server-status&gt;<br />
SetHandler server-status<br />
Order deny,allow<br />
Deny from all<br />
Allow from 192.168.10.<br />
&lt;/Location&gt;</p></blockquote>
<p>Now point your browser to&#8230;</p>
<blockquote><p>http://your_server/server-status</p></blockquote>
<p>You can force the page to refresh automatically every, say, 60 seconds by requesting the following:</p>
<blockquote><p>http://your_server/server-status?refresh=60</p></blockquote>
<p>And even make the output suitable for your scripts to be parsed:</p>
<blockquote><p>lynx -dump &#8220;http://192.168.10.2/server-status?auto&#8221;</p></blockquote>
<p><strong>References:</strong></p>
<ul>
<li>Apache&#8217;s <a href="http://httpd.apache.org/docs-2.0/mod/mod_status.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/httpd.apache.org/docs-2.0/mod/mod_status.html?referer=');">mod_status</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2004/03/monitoring-apache-activity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Identifying the process that served a request</title>
		<link>http://www.karkomaonline.com/index.php/2004/02/identifying-the-process-that-served-a-request/</link>
		<comments>http://www.karkomaonline.com/index.php/2004/02/identifying-the-process-that-served-a-request/#comments</comments>
		<pubDate>Sun, 01 Feb 2004 18:36:53 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.karkoma.info/index.php/2004/02/01/identifying-the-process-that-served-a-request/</guid>
		<description><![CDATA[In some situations it is very useful to know what request was processed by a given PID (process id) in your Apache box to identify undesirable behaviour such as too memory usage, CPU load, etc. Apache can log the process ID of the child that serviced a request. It&#8217;s very easy. Simply edit your httpd.conf [...]]]></description>
			<content:encoded><![CDATA[<p>In some situations it is very useful to know what request was processed by a given PID (process id) in your Apache box to identify undesirable behaviour such as too memory usage, CPU load, etc.</p>
<p>Apache can log the process ID of the child that serviced a request. It&#8217;s very easy. Simply edit your httpd.conf configuration file and add or modify the following:</p>
<blockquote><p>LogFormat &#8220;%h %l %u %t %P &#8220;%r&#8221; %&gt;s %b &#8220;%{Referer}i&#8221; &#8220;%{User-Agent}i&#8221;" combined</p></blockquote>
<p>Then tell Apache to reload the configuration file:</p>
<blockquote><p>/etc/init.d/apache reload</p></blockquote>
<p>Note the <strong><em>%P</em></strong> directive in the format string, which is replaced in the log file by the value of the process ID that processes the request.<br />
<strong>References:</strong></p>
<ul>
<li>Custom <a href="http://httpd.apache.org/docs-2.0/mod/mod_log_config.html#formats" target="_blank" onclick="pageTracker._trackPageview('/outgoing/httpd.apache.org/docs-2.0/mod/mod_log_config.html_formats?referer=');">log formats</a></li>
<li><a href="http://httpd.apache.org/docs-2.0/mod/mod_log_config.html#logformat" target="_blank" onclick="pageTracker._trackPageview('/outgoing/httpd.apache.org/docs-2.0/mod/mod_log_config.html_logformat?referer=');">LogFormat directive</a></li>
<li><a href="http://httpd.apache.org/docs-2.0/mod/mod_log_config.html#customlog" target="_blank" onclick="pageTracker._trackPageview('/outgoing/httpd.apache.org/docs-2.0/mod/mod_log_config.html_customlog?referer=');">CustomLog directive</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2004/02/identifying-the-process-that-served-a-request/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache: Customizing error responses</title>
		<link>http://www.karkomaonline.com/index.php/2003/11/apache-customizing-error-responses/</link>
		<comments>http://www.karkomaonline.com/index.php/2003/11/apache-customizing-error-responses/#comments</comments>
		<pubDate>Wed, 19 Nov 2003 08:16:23 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.karkoma.info/index.php/2003/11/19/apache-customizing-error-responses/</guid>
		<description><![CDATA[Apache provides the possibility to customize the HTTP error codes returned to your clients. If you hate the default error messages that Apache displays or you simply want to fit those messages to your own needs, read on&#8230; The easiest way to start is by simply adding the following lines to your httpd.conf configuration file: [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://httpd.apache.org/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/httpd.apache.org/?referer=');">Apache</a> provides the possibility to customize the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.w3.org/Protocols/rfc2616/rfc2616-sec10.html?referer=');">HTTP error codes</a> returned to your clients. If you hate the default error messages that Apache displays or you simply want to fit those messages to your own needs, read on&#8230;</p>
<p>The easiest way to start is by simply adding the following lines to your <em>httpd.conf</em> configuration file:</p>
<p><span id="more-53"></span></p>
<blockquote><p>Alias /error &#8220;/path/to/documentroot/custom_err&#8221;</p>
<p>&lt;Directory &#8220;/path/to/documentroot/custom_err&#8221;&gt;<br />
AllowOverride None<br />
Options IncludesNoExec<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Directory&gt;</p>
<p>ErrorDocument 403 /error/http_err_403.html<br />
ErrorDocument 404 /error/http_err_404.html</p></blockquote>
<p>Now go to your document root directory (see DocumentRoot directive in your httpd.conf) and make a directory called custom_err:</p>
<blockquote><p>cd /path/to/documentroot<br />
mkdir custom_err<br />
cd custom_err</p></blockquote>
<p>Now create the HTML files that would display custom error messages. Here goes a sample:</p>
<blockquote><p>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;HTTP ERROR 404&lt;/title&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=ISO-8859-1&#8243;&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;center&gt;<br />
&lt;h3&gt;Ummm&#8230; Where are you trying to go?&lt;/h3&gt;<br />
&lt;h4&gt;Try &lt;a href=&#8221;http://www.karkomaonline.com&#8221;&gt;here&lt;/a&gt;&lt;/h4&gt;<br />
&lt;/center&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>Finally restart the Apache daemon and point your browser to a nonexistent page&#8230; Et voila!</p>
<p>You can do more sophisticated things such as creating scripts to handle errors, redirections to other sites, etc&#8230; but this is your homework for today (see references below).</p>
<p>References:</p>
<ul>
<li>Apache <a href="http://httpd.apache.org/docs-2.0/mod/core.html#errordocument" target="_blank" onclick="pageTracker._trackPageview('/outgoing/httpd.apache.org/docs-2.0/mod/core.html_errordocument?referer=');">ErrorDocument</a> directive</li>
<li><a href="http://httpd.apache.org/docs-2.0/custom-error.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/httpd.apache.org/docs-2.0/custom-error.html?referer=');"> Custom errors</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2003/11/apache-customizing-error-responses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache ServerTokens</title>
		<link>http://www.karkomaonline.com/index.php/2003/11/apache-servertokens/</link>
		<comments>http://www.karkomaonline.com/index.php/2003/11/apache-servertokens/#comments</comments>
		<pubDate>Mon, 17 Nov 2003 08:27:30 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.karkoma.info/index.php/2003/11/17/apache-servertokens/</guid>
		<description><![CDATA[The Apache&#8217;s ServerTokens directive controls whether Server response header field which is sent back to clients, includes a description of the generic OS-type of the server as well as information about compiled-in modules. As many worms/viruses check the Server header before attempting an exploit in order to choose the best attack available, it could be [...]]]></description>
			<content:encoded><![CDATA[<p>The Apache&#8217;s <em>ServerTokens</em> directive controls whether <em>Server response header</em> field which is sent back to clients, includes a description of the generic OS-type of the server as well as information about compiled-in modules.</p>
<p>As many worms/viruses check the <em>Server header</em> before attempting an exploit in order to choose the best attack available, it could be a good idea to provide the minimal information possible (the default is to provide full information). Edit your httpd.conf and add the following:</p>
<blockquote><p>ServerTokens Prod</p></blockquote>
<p>This will only send the string Apache in the <em>Server header</em>.</p>
<p><strong>Note</strong> that this <strong>would not stop</strong> skilled bad guys, but would slow down those kiddies playing around.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2003/11/apache-servertokens/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

