<?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>Admins Goodies &#187; apache2</title>
	<atom:link href="http://adminsgoodies.com/tag/apache2/feed/" rel="self" type="application/rss+xml" />
	<link>http://adminsgoodies.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Wed, 19 Jun 2013 16:33:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Redirect https .com to https .co.uk without a valid SSL cert on .com without DNS change</title>
		<link>http://adminsgoodies.com/redirect-https-com-to-https-co-uk-without-a-valid-ssl-cert-on-com-without-dns-change/</link>
		<comments>http://adminsgoodies.com/redirect-https-com-to-https-co-uk-without-a-valid-ssl-cert-on-com-without-dns-change/#comments</comments>
		<pubDate>Sat, 15 Jun 2013 16:33:32 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[mod-rewrite]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[vhosts]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/redirect-https-com-to-https-co-uk-without-a-valid-ssl-cert-on-com-without-dns-change/</guid>
		<description><![CDATA[I have an SSL cert valid for the www. and . subdomains on a domain. That&#8217;s up and working great. All traffic on http redirects to https, and all bare domain traffic redirects to the www. version. In short, everything ends up on https://www. So far so good. However, I also have a .com. That currently has an apache level redirect (can&#8217;t change DNS currently) At the moment going to the https://www.***.com address shows that [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>I have an SSL cert valid for the <code>www.</code> and <code>.</code> subdomains on a domain. That&#8217;s up and working great. All traffic on <code>http</code> redirects to <code>https</code>, and all bare domain traffic redirects to the <code>www.</code> version. In short, everything ends up on <code>https://www.</code> So far so good.</p>
<p>However, I also have a .<code>com</code>. That currently has an apache level redirect (can&#8217;t change DNS currently)</p>
<p>At the moment going to the <code>https://www.***.com</code> address shows that the certificate isn&#8217;t valid, which is of course correct – it&#8217;s only for <code>www</code> and <code>.</code> on <code>.co.uk</code>.</p>
<p><strong>Question</strong></p>
<p>How do I get the <code>https://www.***.com</code> to redirect to <code>https://www.***.co.uk</code> without a valid SSL cert for the .com, and without changing the DNS?</p>
<hr />
<p><strong>Technical details</strong></p>
<p>All domains point to same server. A vhost is set up for the ssl version and non ssl version, both with aliases for www and no www for the .co.uk and .com.</p>
<p>A rewrite rule like:</p>
<pre class="prettyprint"><code>RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</code></pre>
<p>pushes everything to https.</p>
<div class="author">Asked by <a href="http://serverfault.com/users/15918/rich-bradshaw" target="_blank">Rich Bradshaw</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>You can&#8217;t send redirects without a vlid certificate. The redirect is done in either the HTTP protocol by returning a 301 or 302 response, or in html content with a meta header. For this data to be sent, the SSL connection needs to be set up first, with a valid certificate. So don&#8217;t be ridiculously cheap and get an almost-free startssl certificate for the .com.</p>
<p>And if you don&#8217;t want to point that domain to a separate IP, you need to set up <a href="http://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI">SNI support</a> in apache to deal with multiple certs on one IP.</p>
<div class="author">Answered by <a href="http://serverfault.com/users/144990/dennis-kaarsemaker" target="_blank">Dennis Kaarsemaker</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/516019/redirect-https-com-to-https-co-uk-without-a-valid-ssl-cert-on-com-without-dns" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/redirect-https-com-to-https-co-uk-without-a-valid-ssl-cert-on-com-without-dns-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install Apache Benchmark on CentOS?</title>
		<link>http://adminsgoodies.com/how-to-install-apache-benchmark-on-centos/</link>
		<comments>http://adminsgoodies.com/how-to-install-apache-benchmark-on-centos/#comments</comments>
		<pubDate>Sun, 09 Jun 2013 16:33:25 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[ab]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/how-to-install-apache-benchmark-on-centos/</guid>
		<description><![CDATA[I try to install Apache Benchmark using Is there a way to install Apache Bench (ab) without installing apache solutions on my centos but when i run yumdownloader httpd, i get error: root@local [~/httpd]# yumdownloader httpd Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: yum.phx.singlehop.com * elrepo: repos.lax-noc.com * extras: centos.tcpdiag.net * updates: mirror.stanford.edu No Match for argument httpd Nothing to download What is it? and how can i fixed it? Edit [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>I try to install Apache Benchmark using <a href="http://serverfault.com/questions/240496/is-there-a-way-to-install-apache-bench-ab-without-installing-apache">Is there a way to install Apache Bench (ab) without installing apache</a> solutions on my centos but when i run <code>yumdownloader httpd</code>, i get error:</p>
<pre class="prettyprint"><code>root@local [~/httpd]# yumdownloader httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: yum.phx.singlehop.com
 * elrepo: repos.lax-noc.com
 * extras: centos.tcpdiag.net
 * updates: mirror.stanford.edu
No Match for argument httpd
Nothing to download
</code></pre>
<p>What is it? and how can i fixed it?</p>
<p>Edit 1:<br />
i try to use Michael Hampton way but i get this errors:</p>
<pre class="prettyprint"><code>root@local [~]# yum provides /usr/bin/ab
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: yum.phx.singlehop.com
 * elrepo: repos.lax-noc.com
 * extras: centos.tcpdiag.net
 * updates: mirror.stanford.edu
No Matches foundroot@local [~]# yum install httpd-tools
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: yum.phx.singlehop.com
 * elrepo: repos.lax-noc.com
 * extras: centos.tcpdiag.net
 * updates: mirror.stanford.edu
Setting up Install Process
No package httpd-tools available.
Error: Nothing to do
</code></pre>
<div class="author">Asked by <a href="http://serverfault.com/users/168844/mehdi-yeganeh" target="_blank">Mehdi Yeganeh</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>You can discover which package contains the program you want using <code>yum provides</code>:</p>
<pre class="prettyprint"><code>yum provides /usr/bin/ab
</code></pre>
<p>Then you will see that <code>ab</code> is in the <code>httpd-tools</code> package.</p>
<p>And now you can install it:</p>
<pre class="prettyprint"><code>yum install httpd-tools
</code></pre>
<div class="author">Answered by <a href="http://serverfault.com/users/126632/michael-hampton" target="_blank">Michael Hampton</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/514401/how-to-install-apache-benchmark-on-centos" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/how-to-install-apache-benchmark-on-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limit Apache log on Mac OS X 10.6</title>
		<link>http://adminsgoodies.com/limit-apache-log-on-mac-os-x-10-6/</link>
		<comments>http://adminsgoodies.com/limit-apache-log-on-mac-os-x-10-6/#comments</comments>
		<pubDate>Thu, 14 Feb 2013 17:33:50 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[log-files]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/limit-apache-log-on-mac-os-x-10-6/</guid>
		<description><![CDATA[Yesterday I found that my Apache log file in my development machine was almost 50 GB in size. Is there a way to limit the site of the Apache log file? Asked by Onema This is typically done using logrotate. Example logrotate configuration for Apache: /var/log/httpd/*log { daily rotate 30 compress missingok notifempty sharedscripts postrotate /bin/kill -HUP `cat /var/run/httpd.pid 2&#62;/dev/null` 2&#62; /dev/null &#124;&#124; true endscript } Answered by Warner Check more discussion of this question.]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>Yesterday I found that my Apache log file in my development machine was almost 50 GB in size.</p>
<p>Is there a way to limit the site of the Apache log file?</p>
<div class="author">Asked by <a href="http://serverfault.com/users/56195/onema" target="_blank">Onema</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>This is typically done using <a href="http://linuxcommand.org/man_pages/logrotate8.html">logrotate</a>.  Example logrotate configuration for Apache:</p>
<pre class="prettyprint"><code>/var/log/httpd/*log {
    daily
    rotate 30
    compress
    missingok
    notifempty
    sharedscripts
    postrotate
      /bin/kill -HUP `cat /var/run/httpd.pid 2&gt;/dev/null` 2&gt; /dev/null || true
    endscript
}
</code></pre>
<div class="author">Answered by <a href="http://serverfault.com/users/35817/warner" target="_blank">Warner</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/187814/limit-apache-log-on-mac-os-x-10-6" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/limit-apache-log-on-mac-os-x-10-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Found special user in apache weblog called @^Y@.@{phqsp~{2&#8242;/2&#124;pq{jvk@-1(&#8216;@lvo)&amp;1&#8211;1.(/1)&#8217;@./*</title>
		<link>http://adminsgoodies.com/found-special-user-in-apache-weblog-called-y-phqsp22pqjvk-1lvo1-1-1/</link>
		<comments>http://adminsgoodies.com/found-special-user-in-apache-weblog-called-y-phqsp22pqjvk-1lvo1-1-1/#comments</comments>
		<pubDate>Fri, 25 Jan 2013 17:34:14 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[http-basic-authentication]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/found-special-user-in-apache-weblog-called-y-phqsp22pqjvk-1lvo1-1-1/</guid>
		<description><![CDATA[When checking the logfiles of some of my customers I found this as username for authenticated users. We have a .htusers file used for basic web auth, all other users in the serverlog I found in the .htusers, but not the @^Y@.@{phqsp~{2'/2&#124;pq{jvk@-1('@lvo)&#38;1--1.(/1)'@./* user. Server version is 2.2.22 on 64b Opensuse 12 First question: was this user able to receive the content protected by the .htusers file? Next one: anyone having more information about this break-in [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>When checking the logfiles of some of my customers I found this as username for authenticated users. We have a <code>.htusers</code> file used for basic web auth, all other users in the serverlog I found in the <code>.htusers</code>, but not the <code>@^Y@.@{phqsp~{2'/2|pq{jvk@-1('@lvo)&amp;1--1.(/1)'@./*</code> user. </p>
<p>Server version is 2.2.22 on 64b Opensuse 12</p>
<p><strong>First question:</strong> was this user able to receive the content protected by the <code>.htusers</code> file?</p>
<p><strong>Next one:</strong> anyone having more information about this break-in attempt? I found nothing on Google except lots of access-logs from all over the world.</p>
<p>Edit:<br />
Just to add the logentries:</p>
<p><code>x.y.z.x - @^Y@.@{phqsp~{2'/2|pq{jvk@-1('@lvo)&amp;1--1.(/1)'@./* [06/Jan/2013:16:53:16 +0000] "GET xxxxxxxxxxxxxxx HTTP/1.1" 200 676 "xxxxxxxxxxxxxxx" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML,                like Gecko) Chrome/23.0.1271.97 Safari/537.11"</code></p>
<p><code>x.y.z.x - @^Y@.@{phqsp~{2'/2|pq{jvk@-1('@lvo)&amp;1--1.(/1)'@./* [06/Jan/2013:16:53:16 +0000] "GET xxxxxxxxxxxxxxx HTTP/1.1" 200 523 "xxxxxxxxxxxxxxx" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML,                like Gecko) Chrome/23.0.1271.97 Safari/537.11"</code></p>
<p><code>x.y.z.x - @^Y@&amp;@{phqsp~{2'/2|pq{jvk@-1('@lvo)&amp;1--1.(/1)'@./* [06/Jan/2013:16:57:47 +0000] "GET xxxxxxxxxxxxxxx HTTP/1.1" 200 11 "xxxxxxxxxxxxxxx" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"</code></p>
<div class="author">Asked by <a href="http://serverfault.com/users/155444/peter-stimpel" target="_blank">Peter Stimpel</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>I think there&#8217;s some bad news if the xxxxxx&#8217;ed-out ressources are located in the protected area. The http status code 200 in your logs tells that your server has happily sent out the ressource to the client x.y.z.x. If basic-auth had failed in any way, a 401 (forbidden) would have been returned instead.</p>
<p>The number next to the <em>200</em> tells you how many bytes have been sent in the answer. Check if the ressources behind the xxxxxx&#8217;es are actually 676, 523 and 11 bytes in size for another hint if the data was successfully accessed.</p>
<p><strong>Update / Solution:</strong></p>
<p>As it turned out in the comments, the mentioned accesses were to ressources in unprotected areas, thus resulting in http status code 200 (OK). The confusing fact that a unknown user name is shown in the logs is due to the possibilty to set the &#8220;Authorization&#8221; header in a http request regardless of whether authorization was requested by the server at all or whether the username is known on the server. So apparently this is the work of some webcrawler or bot having set the auth header by default. Maybe innocent, maybe not, but obviously not as harmful as it seems at a first glance to the logfile.</p>
<div class="author">Answered by <a href="http://serverfault.com/users/144503/karma-fusebox" target="_blank">Karma Fusebox</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/471169/found-special-user-in-apache-weblog-called-y-phqsp2-2pqjvk-1lvo1" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/found-special-user-in-apache-weblog-called-y-phqsp22pqjvk-1lvo1-1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NFS soft mount timeout too slow</title>
		<link>http://adminsgoodies.com/nfs-soft-mount-timeout-too-slow/</link>
		<comments>http://adminsgoodies.com/nfs-soft-mount-timeout-too-slow/#comments</comments>
		<pubDate>Tue, 22 Jan 2013 17:33:27 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[nfs-client]]></category>
		<category><![CDATA[nfs-perfomance]]></category>
		<category><![CDATA[nfs-server]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/nfs-soft-mount-timeout-too-slow/</guid>
		<description><![CDATA[We have a VERY busy cluster of servers. Our 16 app servers serve our application off of a local SSD on each machine, but they also process images which are then served off of our cdn. Because of this, we have a couple central image servers that we nfs mount from our app servers. We recently had an issue with the image servers in which we were required to shut them down. No big deal, [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>We have a VERY busy cluster of servers. Our 16 app servers serve our application off of a local SSD on each machine, but they also process images which are then served off of our cdn. Because of this, we have a couple central image servers that we nfs mount from our app servers.<br />
We recently had an issue with the image servers in which we were required to shut them down. No big deal, our CDN will still serve the majority of our images so no one should notice the downtime. Not quite..</p>
<p>Instead of continuing normal operations, the app servers instead shot up in load and crashed, or became unresponsive. After a day of digging, we narrowed the problem down to our nfs mount. Even though there were no reads or writes going to the nfs mount, the simple fact that it was down was causing apache to freeze up completely.<br />
No big deal, we did some research and found that we were mounting our nfs volume as a hard mount, and we needed to switch to a soft mount, use <code>intr</code>, and set both a timeo value as well as a retr value. We set the number of retries to 0, and set the <code>timeo=1</code> (it&#8217;s in tenths of a second, so I believe 1 is as low as we can go). With these settings in place we shut down the image servers to replicate the earlier crash and waited to see what happened.</p>
<p>The result was better, but only in that the entire system didn&#8217;t crash,but service because so slow that it may as well have been down. It seems that even at 1 tenth of a second, this is far too long for the nfs mount to timeout, so we end up with a huge backlog of connections at the load balancer, and maybe 1/10th capacity.</p>
<p>To verify my result, I unmounted the nfs mount from 4 of the 16 app servers, and request levels to those 4 servers were completely normal.</p>
<p>So, is there a way to set a lower timeout for the nfs mount, or to dismount the drive upon error, and have it auto remount after the down server comes back online? Or, is there another solution I am overlooking that doesn&#8217;t add a bunch of complexity to our system?</p>
<div class="author">Asked by <a href="http://serverfault.com/users/155445/brian-lovett" target="_blank">Brian Lovett</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>The first thing I would do is set the <code>retrans</code> option to 1 (or 0, but I don&#8217;t know if that will work as expected). This should lower the time it takes to actually timeout</p>
<div class="author">Answered by <a href="http://serverfault.com/users/99283/kormoc" target="_blank">kormoc</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/471176/nfs-soft-mount-timeout-too-slow" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/nfs-soft-mount-timeout-too-slow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CherryPy 3 with Apache 2 using ModWSGI: stack traces?</title>
		<link>http://adminsgoodies.com/cherrypy-3-with-apache-2-using-modwsgi-stack-traces/</link>
		<comments>http://adminsgoodies.com/cherrypy-3-with-apache-2-using-modwsgi-stack-traces/#comments</comments>
		<pubDate>Sat, 19 Jan 2013 17:34:07 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[cherrypy]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[mod-wsgi]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/cherrypy-3-with-apache-2-using-modwsgi-stack-traces/</guid>
		<description><![CDATA[I am trying to show stack traces or at least some sort of errors rendered to the HTML response while using a WSGI script. A ModuleNotFound exception is raised when I tried to import a module the script can&#8217;t seem to find (which is fine for now), but all that is reported in the HTTP response is a rather vague Internal Server Error status 500 error which looks like Apache&#8217;s work. How can I get [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>I am trying to show stack traces or at least some sort of errors rendered to the HTML response while using a WSGI script. A <code>ModuleNotFound</code> exception is raised when I tried to import a module the script can&#8217;t seem to find (which is fine for now), but all that is reported in the HTTP response is a rather vague Internal Server Error status 500 error which looks like Apache&#8217;s work.</p>
<p><strong>How can I get a stack trace to show up?</strong></p>
<p>Other information: I&#8217;m using Windows Server for this with Apache 2.2 (standalone, non-WAMP) as a service and CherryPy 3.2.2. I am using another machine on the same local network to edit the script through network sharing; I am unfamiliar with remote WSGI debugging, but if someone knows how to debug this without having to rely on apache&#8217;s error logs, I&#8217;d love some suggestions. I&#8217;ve tried lots of configuration options for CherryPy to no avail, so I&#8217;d love to hear if anyone is familiar with exactly this.</p>
<p>Please let me know if you have any ideas; thanks!</p>
<div class="author">Asked by <a href="http://serverfault.com/users/151357/apelsin" target="_blank">Apelsin</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>It was as simple as cleverly wrapping everything in a big try/except and including modules inside of the main reply function (yucky) and replying with a string formatted version of an exception.</p>
<p>Needless to say I ultimately ended up making a Django project for this (probably for the best).</p>
<p>Django gets the job done and then some.</p>
<div class="author">Answered by <a href="http://serverfault.com/users/151357/apelsin" target="_blank">Apelsin</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/461765/cherrypy-3-with-apache-2-using-modwsgi-stack-traces" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/cherrypy-3-with-apache-2-using-modwsgi-stack-traces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How can I forbid DNS queries from an unwanted domain on my server?</title>
		<link>http://adminsgoodies.com/how-can-i-forbid-dns-queries-from-an-unwanted-domain-on-my-server/</link>
		<comments>http://adminsgoodies.com/how-can-i-forbid-dns-queries-from-an-unwanted-domain-on-my-server/#comments</comments>
		<pubDate>Fri, 18 Jan 2013 17:34:18 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/how-can-i-forbid-dns-queries-from-an-unwanted-domain-on-my-server/</guid>
		<description><![CDATA[Not sure my question&#8217;s title is explicit, so I&#8217;ll try and explain it the best I can. I have a dedicated web hosting server running Linux (Gentoo). There are a couple websites hosted on it, and therefore a couple domain names from multiple providers have their DNS zone settings set to point to my server. There is one particular website that used to be hosted on this server, but was then removed. However, it looks [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>Not sure my question&#8217;s title is explicit, so I&#8217;ll try and explain it the best I can.</p>
<p>I have a dedicated web hosting server running Linux (Gentoo). There are a couple websites hosted on it, and therefore a couple domain names from multiple providers have their DNS zone settings set to point to my server.</p>
<p>There is one particular website that used to be hosted on this server, but was then removed. However, it looks like its domain name is still pointing to my server. If I <code>cat /var/log/messages</code> :</p>
<pre class="prettyprint"><code>Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/A/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/A/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/A/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/A/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/A/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/A/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/A/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/A/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/A/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/A/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/A/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/A/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/MX/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/MX/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/MX/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/MX/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/MX/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/MX/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/MX/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/MX/IN' denied
Jan 16 03:13:36 stock named[25829]: client XX.XX.XX.XX#XXXXX: query (cache) 'the-goddamn-domain.com/MX/IN' denied
</code></pre>
<p>As you can see, I have dozens of these <strong>a second</strong>.</p>
<p>Can I do anything to forbid these requests (except contacting the owner and asking him to change his DNS zone settings) ? The server already denies them, but I guess it still tries and wastes a couple of microseconds for each of them, which all added up is no good to me. I thought of banning the IPs but they always seem to change (guess the requests come from multiple DNS servers around the world).</p>
<div class="author">Asked by <a href="http://serverfault.com/users/154996/neemzy" target="_blank">neemzy</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>You are asking &#8220;Can I do anything to forbid these requests?&#8221; but it seems that you are already doing it. Isn&#8217;t that exactly what <code>'the-goddamn-domain.com/A/IN' denied</code> means?</p>
<p>If you are thinking of adding something else to do the filtering in front of the DNS server to save microseconds, then it doesn&#8217;t make much sense to do it. The new filter will still waste cycles filtering the request before it lets it through to the real DNS server. What you have right now is the optimal solution.</p>
<p>If are worried about the disk space wasted on logging, then there might be a way to silence the error message from the logs. If nothing else, you can simply filter out the message in your syslog configuration.</p>
<p>Or you can simply add the zone back with only an SOA record in.</p>
<div class="author">Answered by <a href="http://serverfault.com/users/114782/chutz" target="_blank">chutz</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/470060/how-can-i-forbid-dns-queries-from-an-unwanted-domain-on-my-server" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/how-can-i-forbid-dns-queries-from-an-unwanted-domain-on-my-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apache mod rewrite too many redirects</title>
		<link>http://adminsgoodies.com/apache-mod-rewrite-too-many-redirects/</link>
		<comments>http://adminsgoodies.com/apache-mod-rewrite-too-many-redirects/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 17:34:06 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[mod-rewrite]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/apache-mod-rewrite-too-many-redirects/</guid>
		<description><![CDATA[I am trying to redirect all requests for my default language (nl) to /nl&#8230;.. (without showing the redirect to the user). So example.com should redirect to example.com/nl without visibly altering the url in the browser. Here is what I tried: RewriteEngine On RewriteCond %{REQUEST_URI} !^/en.* RewriteCond %{REQUEST_URI} !^/nl.* RewriteRule ^(.*)$ nl$1 [R,L] The redirect is visible to the user (/nl/index.php) and in addition it results in a &#8216;too many redirect&#8217;. If I try [P,L] I [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>I am trying to redirect all requests for my default language (nl) to /nl&#8230;.. (without showing the redirect to the user). So example.com should redirect to example.com/nl without visibly altering the url in the browser. Here is what I tried:</p>
<pre class="prettyprint"><code>    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/en.*
    RewriteCond %{REQUEST_URI} !^/nl.*
    RewriteRule ^(.*)$  nl$1 [R,L]
</code></pre>
<p>The redirect is visible to the user (/nl/index.php) and in addition it results in a &#8216;too many redirect&#8217;.</p>
<p>If I try [P,L] I get: no permission to access &#8216;\&#8217; on this server.</p>
<p>What is the correct way to achieve what I want?</p>
<div class="author">Asked by <a href="http://serverfault.com/users/122437/zensys" target="_blank">zensys</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>There&#8217;s shouldn&#8217;t be an <code>[R]</code> after the RewriteRule as this tells Apache to send a 302 redirect rather than internally rewriting the URL.</p>
<p>The second part of the RewriteRule should start with a slash unless this is in a Directory context (such as in a <code>.htaccess</code> file or a <code>&lt;Directory &gt;</code> block).  Without the slash, you are rewriting the URL to something like <code>http://example.comnl/index.php</code> rather than <code>http://example.com/nl/index.php</code>.</p>
<pre class="prettyprint"><code>RewriteEngine On
RewriteCond %{REQUEST_URI} !^/en.*
RewriteCond %{REQUEST_URI} !^/nl.*
RewriteRule ^(.*)$  /nl$1 [L]
</code></pre>
<div class="author">Answered by <a href="http://serverfault.com/users/26130/ladadadada" target="_blank">Ladadadada</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/469946/apache-mod-rewrite-too-many-redirects" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/apache-mod-rewrite-too-many-redirects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How should I configure my ELB health check when using NameVirtualHosts and redirecting to www?</title>
		<link>http://adminsgoodies.com/how-should-i-configure-my-elb-health-check-when-using-namevirtualhosts-and-redirecting-to-www/</link>
		<comments>http://adminsgoodies.com/how-should-i-configure-my-elb-health-check-when-using-namevirtualhosts-and-redirecting-to-www/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 17:33:19 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[amazon-web-services]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[healthcheck]]></category>
		<category><![CDATA[load-balancing]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/how-should-i-configure-my-elb-health-check-when-using-namevirtualhosts-and-redirecting-to-www/</guid>
		<description><![CDATA[My ELB keeps taking my instances out of service, because the HTTP health check is failing. We have a DNS wildcard, and redirect everything to www: vhost.conf: ServerName www.example.com ServerAlias *.example.com RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC] RewriteRule ^ http://www.example.com/$1 [R=301,L] This works fine for actual browsers, but the HTTP health check to / fails, presumably because it&#8217;s getting a 302. Is the best option to use a TCP health check, or is there a [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>My ELB keeps taking my instances out of service, because the HTTP health check is failing.</p>
<p>We have a DNS wildcard, and redirect everything to www:</p>
<p>vhost.conf:</p>
<pre class="prettyprint"><code>ServerName www.example.com
ServerAlias *.example.com
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^ http://www.example.com/$1 [R=301,L]
</code></pre>
<p>This works fine for actual browsers, but the HTTP health check to / fails, presumably because it&#8217;s getting a 302.</p>
<p>Is the best option to use a TCP health check, or is there a way to get HTTP to work?</p>
<div class="author">Asked by <a href="http://serverfault.com/users/2100/chris" target="_blank">chris</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>This question has been <a href="https://forums.aws.amazon.com/message.jspa?messageID=386149" rel="nofollow">asked on the AWS forums</a> and the answer was to set up a default vhost that handles traffic on the bare IP address and doesn&#8217;t do any redirects.  This will mean that normal users who hit your IP address will not be redirected either.</p>
<p>You could alternatively specify the path part of the URL that you want the ELB to request and ignore that path by adding another RewriteCond:</p>
<pre class="prettyprint"><code>RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/health-check$
RewriteRule ^ http://www.example.com/$1 [R=301,L]
</code></pre>
<p>Normal users who hit that URL will not be redirected.</p>
<p>You could also use the same technique to detect the User-Agent of the ELB.</p>
<pre class="prettyprint"><code>RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^ELB-HealthChecker
RewriteRule ^ http://www.example.com/$1 [R=301,L]
</code></pre>
<p>Normal users who spoof their User-Agent will not be redirected.</p>
<p>Or the internal IP address of the ELB.</p>
<pre class="prettyprint"><code>RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteCond %{REMOTE_ADDR} !^10\.
RewriteRule ^ http://www.example.com/$1 [R=301,L]
</code></pre>
<p>For this option to work, you will require either <code>mod_rpaf</code> (for Apache 2.2) or <code>mod_remoteip</code> (for Apache 2.4) to modify the <code>REMOTE_ADDR</code> variable to contain the correct part of the contents of the <code>X-Forwarded-For</code> header.  As long as you set that up correctly, it shouldn&#8217;t be possible for a normal user to avoid the redirect response.</p>
<div class="author">Answered by <a href="http://serverfault.com/users/26130/ladadadada" target="_blank">Ladadadada</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/470015/how-should-i-configure-my-elb-health-check-when-using-namevirtualhosts-and-redir" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/how-should-i-configure-my-elb-health-check-when-using-namevirtualhosts-and-redirecting-to-www/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mitigate DDoS Proxy attack</title>
		<link>http://adminsgoodies.com/mitigate-ddos-proxy-attack/</link>
		<comments>http://adminsgoodies.com/mitigate-ddos-proxy-attack/#comments</comments>
		<pubDate>Wed, 16 Jan 2013 17:33:48 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[General Questions]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[ddos]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://adminsgoodies.com/mitigate-ddos-proxy-attack/</guid>
		<description><![CDATA[In last days my apache is being attacked by many connections from proxies. I&#8217;ve identified the source but could not block the attack effectively. The attacker seems to be using pyloris or a variation of this to attack my apache on port 80. I installed nginx and varnish but not enough to support the extra load. I also added a rule in iptables to drop packets that contain the string &#8220;X-Forwarded-For&#8221; but does not block [...]]]></description>
				<content:encoded><![CDATA[<h3 class="pq"><img src="http://adminsgoodies.com/imgs/question.png" alt="Question" /></h3>
<p>In last days my apache is being attacked by many connections from proxies. I&#8217;ve identified the source but could not block the attack effectively.</p>
<p>The attacker seems to be using pyloris or a variation of this to attack my apache on port 80.</p>
<p>I installed nginx and varnish but not enough to support the extra load.</p>
<p>I also added a rule in iptables to drop packets that contain the string &#8220;X-Forwarded-For&#8221; but does not block all the proxies.</p>
<p>Does anyone have a suggestion?</p>
<div class="author">Asked by <a href="http://serverfault.com/users/154665/digorp" target="_blank">Digorp</a></div>
<h3 class="pa"><img src="http://adminsgoodies.com/imgs/answer.png" alt="Answer" /></h3>
<p>Usually pyloris attacks are utilised using TOR network. As first step I would suggest you to block ip addresses of TOR network and check if it helps at all. </p>
<p><a href="https://www.dan.me.uk/torlist/" rel="nofollow">Here is a list of TOR network&#8217;s ip addresses</a> </p>
<p>Let us know if it helps</p>
<p>&#8212;- Edited &#8212;&#8211;</p>
<p>Please try this one, it should work:</p>
<blockquote>
<p>iptables -I INPUT 1 -p tcp &#8211;dport 80 -m string &#8211;string &#8220;X-Forwarded-For&#8221; &#8211;algo kmp -j DROP</p>
</blockquote>
<p>I have seen pyloris packets contain a keep alive flag. It was something like &#8220;Keep-Alive: 300&#8243; so having</p>
<blockquote>
<p>iptables -I INPUT 1 -p tcp &#8211;dport 80 -m string &#8211;string &#8220;Keep-Alive&#8221; &#8211;algo kmp -j DROP</p>
</blockquote>
<p>would help even more.</p>
<div class="author">Answered by <a href="http://serverfault.com/users/122393/hex" target="_blank">Hex</a></div>
<p class="ref-link">Check <a href="http://serverfault.com/questions/469581/mitigate-ddos-proxy-attack" target="_blank">more discussion</a> of this question.</p>
]]></content:encoded>
			<wfw:commentRss>http://adminsgoodies.com/mitigate-ddos-proxy-attack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
