<?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>Kevin Deldycke &#187; Apache</title> <atom:link href="http://kevin.deldycke.com/tag/apache/feed/" rel="self" type="application/rss+xml" /><link>http://kevin.deldycke.com</link> <description>Free software engineer &#38; wannabe videomaker</description> <lastBuildDate>Fri, 03 Feb 2012 19:08:27 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>WebPing Open-sourced !</title><link>http://kevin.deldycke.com/2011/08/webping-open-sourced/</link> <comments>http://kevin.deldycke.com/2011/08/webping-open-sourced/#comments</comments> <pubDate>Tue, 16 Aug 2011 10:10:06 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[email]]></category> <category><![CDATA[flot]]></category> <category><![CDATA[GitHub]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[HTTP]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[munin]]></category> <category><![CDATA[nagios]]></category> <category><![CDATA[plone]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[sqlite]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[webping]]></category> <category><![CDATA[yaml]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=3715</guid> <description><![CDATA[I&#8217;ve just released WebPing under a GPL license. It&#8217;s available right now on a GitHub repository. WebPing is a script I started to work on in 2009 while working at EDF. Back then, I needed a monitoring tool to keep &#8230; <a href="http://kevin.deldycke.com/2011/08/webping-open-sourced/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I&#8217;ve just released WebPing under a GPL license. It&#8217;s available right now on a <a href="http://github.com/kdeldycke/webping">GitHub repository</a>.</p><p>WebPing is a script I started to work on in 2009 while working at <a href="http://www.edf.com/">EDF</a>. Back then, I needed a monitoring tool to keep an eye on the 80+ <a href="http://plone.org/">Plone</a> instances that my team managed. For several corporate reasons, I wasn&#8217;t allowed to use a proper monitoring tool like <a href="http://munin-monitoring.org/">Munin</a> or <a href="http://www.nagios.org/">Nagios</a>. So I created a small script to fill this need. That&#8217;s how WebPing came to be.</p><p>WebPing is just a stupid Python script that is designed to be ticked regularly by a cron job. It try to fetch a list of URLs and store response times in an SQLite database. Then it create a static HTML report you&#8217;re free to serve with any HTTP server (an <a href="http://github.com/kdeldycke/webping/blob/master/apache.conf">example Apache configuration</a> is provided). The configuration of WebPing and the list of URLs it monitor is stored in a YAML file.</p><p>The produced HTML report use the <a href="http://code.google.com/p/flot">Flot jQuery plugin</a> to render graphs. Here is how the dashboard looks like:<br /> <a href="http://kevin.deldycke.com/wp-content/uploads/2011/08/webping-dashboard.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/08/webping-dashboard-271x300.png" alt="" title="webping-dashboard" width="271" height="300" class="aligncenter size-medium wp-image-3777" /></a></p><p>Finally, WebPing is able to send reports and alerts by emails. Here is how a mail alert looks like:<br /> <a href="http://kevin.deldycke.com/wp-content/uploads/2011/08/webping-email-alert.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2011/08/webping-email-alert-300x293.png" alt="" title="webping-email-alert" width="300" height="293" class="aligncenter size-medium wp-image-3743" /></a></p><p>Since I created WebPing, I found several other projects more or less developed around the same idea. See <a href="http://github.com/ericholscher/django-kong">Kong</a>, which is based on Django and <a href="http://twill.idyll.org/">Twill</a>, a web-oriented <a href="http://en.wikipedia.org/wiki/Domain-specific_language">DSL</a>. Another project I spotted after the facts was <a href="http://code.google.com/p/multi-mechanize">multi-mechanize</a>. Like Kong, it&#8217;s written in Python. But I never played with one or the other.</p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2011/08/webping-open-sourced/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Configuring Fail2Ban on Debian Squeeze</title><link>http://kevin.deldycke.com/2011/06/configuring-fail2ban-debian-squeeze/</link> <comments>http://kevin.deldycke.com/2011/06/configuring-fail2ban-debian-squeeze/#comments</comments> <pubDate>Tue, 21 Jun 2011 10:25:16 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[Exim]]></category> <category><![CDATA[fail2ban]]></category> <category><![CDATA[security]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[SSH]]></category> <category><![CDATA[Web]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=3236</guid> <description><![CDATA[This always start with a package installation: Then I simply create a local configuration file where I&#8217;ll put all my custom config: Here is the content of that file: While adjusting Fail2Ban, I was surprised by how sensitive this software &#8230; <a href="http://kevin.deldycke.com/2011/06/configuring-fail2ban-debian-squeeze/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>This always start with a package installation:</p><pre class="brush: bash; title: ; notranslate">
$ aptitude install fail2ban
</pre><p>Then I simply create a local configuration file where I&#8217;ll put all my custom config:</p><pre class="brush: bash; title: ; notranslate">
$ touch /etc/fail2ban/jail.local
</pre><p>Here is the content of that file:</p><pre class="brush: plain; title: ; notranslate">
[DEFAULT]
# Do not filter connexion from my apartment and from the server itself
ignoreip  = 127.0.0.1 88.123.123.123 91.123.123.123
# Ban for a week
bantime   = 604800
maxretry  = 3
destemail = kevin@deldycke.com
banaction = iptables-allports
action    = %(action_mwl)s

[ssh]
enabled  = true
port     = 22
maxretry = 2

[ssh-ddos]
enabled = true
port     = 22

[apache]
# Apache basic auth
enabled   = true
maxretry  = 3
# Ban for 1 hour
bantime   = 3600

[apache-noscript]
enabled = true

[apache-overflows]
enabled = true

[apache-badbots]
enabled  = true
filter   = apache-badbots
port     = http,https
action   = iptables-allports
logpath  = /var/log/apache*/*access.log
maxretry = 1

[apache-nohome]
enabled  = true
filter   = apache-nohome
port     = http,https
action   = iptables-allports
logpath  = /var/log/apache*/*access.log
maxretry = 1

[exim]
enabled  = true
filter   = exim
port     = smtp,ssmtp
action   = iptables-allports
logpath  = /var/log/exim*/rejectlog
maxretry = 1

[exim-relay]
enabled  = true
filter   = exim-relay
port     = smtp,ssmtp
action   = iptables-allports
logpath  = /var/log/exim*/rejectlog
maxretry = 1
</pre><p>While adjusting Fail2Ban, I was surprised by how sensitive this software is. It can just refuse to start without any notice in the log or on the command line. Even if its <code>log_level</code> variable is set to <code>4</code> (= <code>DEBUG</code>) in <code>/etc/fail2ban/fail2ban.conf</code>.</p><p>In such a case, a sure way to find the culprit is to use a brute force debugging method: first set all the <code>enabled</code> variable of your <code>jail.local</code>&#8216;s sections to <code>false</code>. Then activate one section after another until Fail2Ban refuse to restart.</p><p>For me, the problem was that I forgot to add my custom <code>exim-relay</code> filter to Fail2Ban. So I fixed my issue by creating an empty file at <code>/etc/fail2ban/filter.d/exim-relay.conf</code> in which I pasted the following content:</p><pre class="brush: plain; title: ; notranslate">
# Based on default exim.conf filter by Cyril Jaquier
# Real life exemaple:
# 2009-07-02 08:16:42 H=118-167-129-21.dynamic.hinet.net (91.121.198.84) [118.167.129.21] F=&lt;titieueue@hotmail.com&gt; rejected RCPT &lt;s2288@mail2000.com.tw&gt;: relay not permitted

[Definition]

# Option:  failregex
# Notes.:  regex to match use of my exim mail server as a relay it does not
#          allow.
# Values:  TEXT
#
failregex = \[&lt;HOST&gt;\] .*(?:relay not permitted)

# Option:  ignoreregex
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
# Values:  TEXT
#
ignoreregex =
</pre><p>Speaking of custom filters, here is one to filter DFind scans (file located at <code>/etc/fail2ban/filter.d/apache-w00tw00t.conf</code>):</p><pre class="brush: plain; title: ; notranslate">
# Based on http://howflow.com/tricks/block_w00tw00t_scan_hosts_with_fail2ban
# Real life exemaple:
# [Sat Jun 27 16:43:08 2009] [error] [client 94.23.57.77] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:)

[Definition]

# Option:  failregex
# Notes.:  regex to match the w00tw00t scan messages in the logfile.
# Values:  TEXT
failregex = ^.*\[client &lt;HOST&gt;\].*w00tw00t\.at\.ISC\.SANS\.DFind.*

# Option:  ignoreregex
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
# Values:  TEXT
ignoreregex =
</pre><p>And here is the corresponding section from my <code>jail.local</code> file:</p><pre class="brush: plain; title: ; notranslate">
[apache-w00tw00t]
enabled  = true
filter   = apache-w00tw00t
action   = iptables-allports
logpath  = /var/log/apache*/*error.log
maxretry = 1
</pre>]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2011/06/configuring-fail2ban-debian-squeeze/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Apache commands</title><link>http://kevin.deldycke.com/2011/01/apache-commands/</link> <comments>http://kevin.deldycke.com/2011/01/apache-commands/#comments</comments> <pubDate>Tue, 11 Jan 2011 10:53:50 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[CLI]]></category> <category><![CDATA[Git]]></category> <category><![CDATA[HTTP]]></category> <category><![CDATA[nedstat]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Subversion]]></category> <category><![CDATA[Web]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=2674</guid> <description><![CDATA[Hide Subversion and Git directories content (source): Disable rendering of PHP files coming from imported third party Javascript submodules (context): Redirect any request to current year sub-directory (I used this for a yearly-updated static web page): Here is my template &#8230; <a href="http://kevin.deldycke.com/2011/01/apache-commands/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<ul><li>Hide Subversion and Git directories content (<a href="http://news.ycombinator.com/item?id=839016">source</a>):<pre class="brush: plain; title: ; notranslate">
RedirectMatch 404 /\.(svn|git)(/|$)
</pre></li><li>Disable rendering of PHP files coming from imported third party Javascript submodules (<a href="http://github.com/kdeldycke/cool-cavemen/blob/master/.htaccess">context</a>):<pre class="brush: plain; title: ; notranslate">
RedirectMatch 404 js-(.*)\.php$
</pre></li><li>Redirect any request to current year sub-directory (I used this for a yearly-updated static web page):<pre class="brush: plain; title: ; notranslate">
RewriteEngine on
RewriteRule !^/2010/ /2010/ [R=301,L]
</pre></li><li>Here is my template for domain-based virtual host routing:<pre class="brush: plain; title: ; notranslate">
# Setup the main website access
&lt;VirtualHost *:80&gt;
  ServerName example.com
  DocumentRoot /var/www/example
  # Add extra capabilities to let CMS like WordPress manage redirections
  &lt;Directory /var/www/example&gt;
    Options +FollowSymLinks +SymLinksIfOwnerMatch
  &lt;/Directory&gt;
&lt;/VirtualHost&gt;
# Redirect all other access to the website from different domains to the canonical URL
&lt;VirtualHost *:80&gt;
  ServerName www.example.com
  ServerAlias *.example.com
  ServerAlias example.net *.example.net
  ServerAlias example.org *.example.org
  RedirectMatch permanent (.*) http://example.com$1
&lt;/VirtualHost&gt;
</pre></li><li>Insert dynamic headers in HTTP responses depending on the browser:<pre class="brush: plain; title: ; notranslate">
BrowserMatchNoCase &quot;.*MSIE\s[1-6].*&quot; IS_DISGUSTING_BROWSER
Header add X-advice-of-the-day &quot;Save a kitten: use Firefox !&quot; env=IS_DISGUSTING_BROWSER
</pre></li><li>Prevent WebDAV connexions (thanks Guillaume!):<pre class="brush: plain; title: ; notranslate">
&lt;Location /&gt;
  &lt;Limit PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK PATCH&gt;
    # Leaves GET (and HEAD), POST, PUT, DELETE, CONNECT, OPTIONS and TRACE alone
    Order allow,deny
    Deny from all
  &lt;/Limit&gt;
&lt;/Location&gt;
SetEnvIf Request_Method &quot;OPTIONS&quot; CLIENT_PROBE
Header set Allow &quot;GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE&quot; env=CLIENT_PROBE
</pre></li><li>At work, we had to engineer a convoluted software architecture for our intranet to fit the network security policy of our customer. This had a bad side effect of letting the <a href="http://www.nedstat.com">web statistic collector</a> delete all cookies but its own, thus breaking intranet&#8217;s authentication. So we (thanks Matthieu!) came up with this unmaintainable hack on Apache side to hide our intranet&#8217;s cookies to NedStat&#8217;s Javascript embedded code:<pre class="brush: plain; title: ; notranslate">
&lt;LocationMatch &quot;/(.*)&quot;&gt;
  LoadModule headers_module modules/mod_headers.so
  RequestHeader edit Cookie &quot;(app_cookie_001=[^;]*(; )*)&quot; &quot;&quot;
  RequestHeader edit Cookie &quot;(app_cookie_002=[^;]*(; )*)&quot; &quot;&quot;
  RequestHeader edit Cookie &quot;(app_cookie_003=[^;]*(; )*)&quot; &quot;&quot;
&lt;/LocationMatch&gt;
</pre></li><li>Kill all apache processes and restart the service:<pre class="brush: bash; title: ; notranslate">
/etc/init.d/apache2 stop ; pkill -9 -u www-data ; /etc/init.d/apache2 restart
</pre></li><li>Restart Apache service if no process found:<pre class="brush: bash; title: ; notranslate">
[ `ps axu | grep -v &quot;grep&quot; | grep --count &quot;www-data&quot;` -le 0 ] &amp;&amp; /etc/init.d/apache2 restart
</pre></li></ul> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2011/01/apache-commands/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Blocking e107 dDOS attack with fail2ban</title><link>http://kevin.deldycke.com/2010/08/blocking-e107-ddos-attack-fail2ban/</link> <comments>http://kevin.deldycke.com/2010/08/blocking-e107-ddos-attack-fail2ban/#comments</comments> <pubDate>Tue, 03 Aug 2010 19:09:54 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[Cool Cavemen]]></category> <category><![CDATA[e107]]></category> <category><![CDATA[fail2ban]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[security]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Web]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=1613</guid> <description><![CDATA[Last month, a new security vulnerability was discovered in e107. If a fix was released quickly, some instances on the web were left unpatched. These sites are easy target for hackers script-kiddies, and a generalized dDOS attack was carry out &#8230; <a href="http://kevin.deldycke.com/2010/08/blocking-e107-ddos-attack-fail2ban/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Last month, a new security vulnerability was discovered in e107. If <a href="http://e107.org/comment.php?comment.news.867">a fix was released quickly</a>, some instances on the web were left unpatched. These sites are easy target for <strike>hackers</strike> script-kiddies, and <a href="http://e107.org/comment.php?comment.news.868">a generalized dDOS attack was carry out</a> on every e107 websites out there.</p><p>I&#8217;m no exception and the old and decrepit part of Cool Cavemen&#8217;s website <a href="http://coolcavemen.com/e107_plugins/forum/forum_viewforum.php?3">still running on e107</a> was attacked. This was enough to crash my tiny server. Unfortunately this <a href="http://twitter.com/kdeldycke/status/17728248113">happened while I was on holidays</a>. Without any time to address this issue properly, I decided to shutdown my web server. This explain why this blog and all Cool Cavemen&#8217;s websites were dead during half of july.</p><p><a href="http://kevin.deldycke.com/wp-content/uploads/2010/08/munin-fail2ban-jails-weekly-stats.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2010/08/munin-fail2ban-jails-weekly-stats-150x150.png" alt="" title="munin-fail2ban-jails-weekly-stats" width="150" height="150" class="alignleft size-thumbnail wp-image-1707" /></a> Now <a href="http://twitter.com/kdeldycke/status/19250530728">everything is back to normal</a> (I hope), thanks to <code><a href="http://www.fail2ban.org">fail2ban</a></code>. I created a set of rules (<a href="http://eromang.zataz.com/2010/07/13/byroenet-casper-bot-search-e107-rce-scanner/">based on this article</a>) to dynamically catch <a href="http://en.wikipedia.org/wiki/Denial-of-service_attack">dDOS</a> attempts and ban all IP addresses involved. Here is how I configured <code>fail2ban</code>&#8230;</p><div style="clear: both;"></div><p>First, create a new empty file at <code>/etc/fail2ban/filter.d/apache-e107ddos.conf</code> and put the following directives there:</p><pre class="brush: plain; title: ; notranslate">
# Fail2Ban configuration file
# Notes.:  Regexp to catch all attemps to exploit an e107 vulnerability.
# Author: Kevin Deldycke

[Definition]
failregex = &lt;HOST&gt;\s-\s-\s.*\s&quot;(GET|POST).*\/(help_us|contact|config|avd_start|\*)\.php
            &lt;HOST&gt;\s-\s-\s.*(Casper|b3b4s|dex|Dex|kmccrew|plaNETWORK|sasqia|sledink|indocom) Bot Search
            &lt;HOST&gt;\s-\s-\s.*MaMa CaSpEr
            &lt;HOST&gt;\s-\s-\s.*rk q kangen
            &lt;HOST&gt;\s-\s-\s.*Mozilla\/4\.76 \[ru\] \(X11; U; SunOS 5\.7 sun4u\)
            &lt;HOST&gt;\s-\s-\s.*perl post
ignoreregex =
</pre><p>Then update you fail2ban config file (<code>/etc/fail2ban/jail.local</code> in my case) with the appropriate section:</p><pre class="brush: plain; title: ; notranslate">
[apache-e107ddos]
enabled  = true
filter   = apache-e107ddos
port     = http,https
action   = iptables-allports
logpath  = /var/log/apache*/*access.log
maxretry = 1
</pre><p>Then restart your fail2ban service:</p><pre class="brush: bash; title: ; notranslate">
$ /etc/init.d/fail2ban restart
</pre><p>And you&#8217;ll start to get those nice logs:</p><pre class="brush: bash; title: ; notranslate">
$ tail -F /var/log/fail2ban.log
2010-06-23 16:05:37,417 fail2ban.actions: WARNING [apache-e107ddos] Ban 193.33.21.199
2010-06-23 16:05:58,113 fail2ban.actions: WARNING [apache-e107ddos] Ban 89.108.116.226
2010-06-23 16:05:58,521 fail2ban.actions: WARNING [apache-e107ddos] Ban 69.41.162.10
2010-06-23 16:05:58,541 fail2ban.actions: WARNING [apache-e107ddos] Ban 209.62.28.178
2010-06-23 16:06:03,573 fail2ban.actions: WARNING [apache-e107ddos] Ban 69.73.147.90
2010-06-23 16:06:42,975 fail2ban.actions: WARNING [apache-e107ddos] 69.41.162.10 already banned
2010-06-23 16:06:44,227 fail2ban.actions: WARNING [apache-e107ddos] 69.41.162.10 already banned
2010-06-23 16:06:54,238 fail2ban.actions: WARNING [apache-e107ddos] 69.73.147.90 already banned
2010-06-23 16:07:50,305 fail2ban.actions: WARNING [apache-e107ddos] Ban 80.55.107.74
</pre>]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2010/08/blocking-e107-ddos-attack-fail2ban/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Feeds updated !</title><link>http://kevin.deldycke.com/2010/05/feeds-updated/</link> <comments>http://kevin.deldycke.com/2010/05/feeds-updated/#comments</comments> <pubDate>Tue, 18 May 2010 10:45:29 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Aggregator]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[Atom]]></category> <category><![CDATA[feed]]></category> <category><![CDATA[FeedBurner]]></category> <category><![CDATA[Google]]></category> <category><![CDATA[RSS]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=1459</guid> <description><![CDATA[Last night I&#8217;ve changed the way my feeds are handled on this blog. I&#8217;ve taken care of all redirections with a mix of WordPress plugins, Apache&#8217;s 301 redirects and Feedburner&#8217;s &#8220;My Brand&#8221; service. So everything should be transparent from your &#8230; <a href="http://kevin.deldycke.com/2010/05/feeds-updated/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><a href="http://kevin.deldycke.com/wp-content/uploads/2010/05/Newspaper-Feed.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2010/05/Newspaper-Feed-150x150.png" alt="" title="Newspaper-Feed" width="150" height="150" class="alignright size-thumbnail wp-image-1463" /></a> Last night I&#8217;ve changed the way my feeds are handled on this blog. I&#8217;ve taken care of all redirections with a mix of <a href="http://www.google.com/support/feedburner/bin/answer.py?answer=78483">WordPress plugins</a>, <a href="http://kevin.deldycke.com/2007/05/feedburner-and-e107-integration/">Apache&#8217;s 301 redirects</a> and <a href="http://www.google.com/support/feedburner/bin/answer.py?answer=79590">Feedburner&#8217;s &#8220;My Brand&#8221; service</a>. So everything should be transparent from your (and your feed reader) point of you.</p><p>But since this <a href="http://kevin.deldycke.com/2009/09/moving-wordpress-blog-to-another-domain/">blog moved</a> from one location to another in the last past years, I doubt everyone use the right URLs. This update is a good opportunity to check that you are using the &#8220;official&#8221; feed URLs:</p><ul><li>For blog posts: <a href="http://kevin.deldycke.com/feed">http://kevin.deldycke.com/feed</a></li><li>For blog comments: <a href="http://kevin.deldycke.com/comments/feed">http://kevin.deldycke.com/comments/feed</a></li></ul><p>In the future, I plan to support these URLs only. So please update your feed aggregation settings ! <img src='http://kevin.deldycke.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2010/05/feeds-updated/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Moving a WordPress blog to another domain</title><link>http://kevin.deldycke.com/2009/09/moving-wordpress-blog-to-another-domain/</link> <comments>http://kevin.deldycke.com/2009/09/moving-wordpress-blog-to-another-domain/#comments</comments> <pubDate>Mon, 21 Sep 2009 18:59:10 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[Blog]]></category> <category><![CDATA[CLI]]></category> <category><![CDATA[find]]></category> <category><![CDATA[grep]]></category> <category><![CDATA[Hosting]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[sed]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=844</guid> <description><![CDATA[I provide hosting for free to some of my friends. One of them, QPX, had a side project called Lich&#8217;ti. But the latter is no longer active, so he decided to not renew the lich-ti.fr domain. If Lich&#8217;ti&#8217;s domain name &#8230; <a href="http://kevin.deldycke.com/2009/09/moving-wordpress-blog-to-another-domain/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><a href="http://kevin.deldycke.com/wp-content/uploads/2009/09/qpx-site-domain-migration.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2009/09/qpx-site-domain-migration-150x150.png" alt="qpx-site-domain-migration" title="qpx-site-domain-migration" width="150" height="150" class="alignleft size-thumbnail wp-image-859" /></a> I provide hosting for free to some of my friends. One of them, <a href="http://qpx.coolcavemen.com">QPX</a>, had a side project called <a href="http://www.myspace.com/espace_lichti">Lich&#8217;ti</a>. But the latter is no longer active, so he decided to not renew the <code>lich-ti.fr</code> domain.</p><p>If Lich&#8217;ti&#8217;s domain name is dead, QPX&#8217;s personal blog is not. His website is powered by WordPress and was available at <code>http://qpx.lich-ti.fr</code>. My job is now to move it to <code>http://qpx.coolcavemen.com</code>. In this post, I&#8217;ll tell you how I&#8217;ve done it.</p><p>Before going further, backup everything, and be ready to revert back to your original situation at any moment ! What works for me will not necessary works for you&#8230;</p><p>To play nice with your visitors, you can <a href="http://www.milienzo.com/2007/05/16/how-to-display-a-maintenance-page-whilst-upgrading-wordpress/">setup a temporary maintenance page</a> while we&#8217;re performing the migration.</p><p>Let&#8217;s start the migration by replacing, in the files served by Apache, all occurrences of the old domain name by the new one:</p><pre class="brush: bash; title: ; notranslate">
find /var/www/qpx-blog -mount -print -type f -exec sed -i 's/qpx.lich-ti.fr/qpx.coolcavemen.com/g' &quot;{}&quot; \;
</pre><p>If you have doubts about the efficiency of the command above, you can check the presence of the string we&#8217;re looking to replace via this command:</p><pre class="brush: bash; title: ; notranslate">
grep -RIi &quot;qpx.lich-ti.fr&quot; ./*
</pre><p>Then, we dump the database containing all WordPress content and config to a local file (the command will prompt for password):</p><pre class="brush: bash; title: ; notranslate">
mysqldump -p --host=localhost --port=3306 --user=root --opt --databases &quot;qpx_blog&quot; &gt; qpx_dump.sql
</pre><p>And we replace all strings of the old domain by the new one:</p><pre class="brush: bash; title: ; notranslate">
sed 's/qpx.lich-ti.fr/qpx.coolcavemen.com/g' qpx_dump.sql &gt; new_qpx.sql
</pre><p>Finally, we re-inject the modified database content after clearing the original:</p><pre class="brush: bash; title: ; notranslate">
mysql -p --host=localhost --port=3306 --user=root --execute='DROP DATABASE `qpx_blog`;'
mysql -p --host=localhost --port=3306 --user=root &lt; new_qpx.sql
</pre><p>Now you can disable the maintenance page and test the blog to check nothing&#8217;s broken.</p><p>Again, to play nice with your visitors (and search engines), you can redirect old URLs to the new domain, with apache directives similar to this one:</p><pre class="brush: bash; title: ; notranslate">
&lt;VirtualHost *:80&gt;
  ServerName qpx.lich-ti.fr
  RedirectMatch permanent (.*) http://qpx.coolcavemen.com$1
&lt;/VirtualHost&gt;
</pre>]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2009/09/moving-wordpress-blog-to-another-domain/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>eAccelerator for PHP5 on Debian Lenny</title><link>http://kevin.deldycke.com/2009/08/how-to-install-eaccelerator-php5-debian-lenny/</link> <comments>http://kevin.deldycke.com/2009/08/how-to-install-eaccelerator-php5-debian-lenny/#comments</comments> <pubDate>Mon, 24 Aug 2009 22:06:16 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[aptitude]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[eAccelerator]]></category> <category><![CDATA[lenny]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Repository]]></category> <category><![CDATA[Server]]></category><guid isPermaLink="false">http://kevin.deldycke.com/?p=800</guid> <description><![CDATA[eAccelerator is an open-source PHP accelerator, optimizer, and dynamic content cache (to quote the official website of the project). It can effectively speed-up PHP processing on a server by caching bytecode. As Wikipedia tells you, several tools of this kind &#8230; <a href="http://kevin.deldycke.com/2009/08/how-to-install-eaccelerator-php5-debian-lenny/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><a href="http://eaccelerator.net">eAccelerator</a> is an <em>open-source PHP accelerator, optimizer, and dynamic content cache</em> (to quote the official website of the project). It can effectively speed-up PHP processing on a server by caching bytecode.</p><p>As Wikipedia tells you, <a href="http://wikipedia.org/wiki/List_of_PHP_accelerators">several tools of this kind exists</a>. Why choosing eAccelerator in particular ? I really have no clue&#8230; I&#8217;ve never used any of these tools, so I had to start somewhere. That&#8217;s as simple as that !</p><p>Now, I have a Debian server as a target system. Unfortunately, eAccelerator is not bundled in Lenny. Browsing the web, I found some personal repositories of people kindly sharing their deb packages, like <a href="http://andrew.mcmillan.net.nz/node/70">Andrew McMillan</a> and <a href="http://www.schnuckelig.eu/blog/debian-lenny-eaccelerator-packages-amd64-20090527">schnuckelig.eu</a>. The former provides a version of eAccelerator for the <code>i386</code>, the latter for the <code>amd64</code> architecture. In this how-to, I&#8217;ve combined the 2 repositories to give both 32 bits and 64 bits users a chance to use eAccelerator on Lenny.</p><p>Let&#8217;s start the installation ! First, add the following lines to your <code>/etc/apt/sources.list</code> file:</p><pre class="brush: plain; title: ; notranslate">
deb http://debian.mcmillan.net.nz/debian lenny awm
deb-src http://debian.mcmillan.net.nz/debian lenny awm
deb http://debian.schnuckelig.eu/ lenny main contrib non-free
</pre><p>To kill annoying warning messages, register the cryptographic fingerprint of each repository:</p><pre class="brush: bash; title: ; notranslate">
$ gpg --keyserver keyring.debian.org --recv-keys 0x8f068012;
$ gpg --export --armor 0x8f068012 | apt-key add -
$ wget -O - http://debian.schnuckelig.eu/repository-key.gpg | apt-key add -
</pre><p>Then, update your package database:</p><pre class="brush: bash; title: ; notranslate">
$ aptitude update
</pre><p>And finally, you can install eAccelerator for PHP5 without any pain:</p><pre class="brush: bash; title: ; notranslate">
$ apt-get install php5-eaccelerator
</pre><p>Happy <a href="http://eaccelerator.net/wiki/Settings">fine-tunning</a> !</p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2009/08/how-to-install-eaccelerator-php5-debian-lenny/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>WordPress 2.2 Security Hole: Identity Theft</title><link>http://kevin.deldycke.com/2007/06/wordpress-22-security-hole-identity-theft/</link> <comments>http://kevin.deldycke.com/2007/06/wordpress-22-security-hole-identity-theft/#comments</comments> <pubDate>Thu, 07 Jun 2007 15:22:51 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[Blog]]></category> <category><![CDATA[hack]]></category> <category><![CDATA[log]]></category> <category><![CDATA[security]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://kevin.deldycke.com/2007/06/wordpress-22-security-hole-identity-theft/</guid> <description><![CDATA[I&#8217;m running 4 WordPress blogs, for me and my friends. All of them are updated to latest version of WordPress as soon as a new one is available. One of them, Maomium, was hacked last night. Someone created a user &#8230; <a href="http://kevin.deldycke.com/2007/06/wordpress-22-security-hole-identity-theft/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I&#8217;m running 4 WordPress blogs, for me and my friends. All of them are updated to latest version of WordPress as soon as a new one is available.</p><p>One of them, <a href="http://maomium.com">Maomium</a>, was hacked last night. Someone created a user account on it then stole my admin identity to post content. As soon as I discovered the hack, I&#8217;ve put the blog down and changed all passwords which may have been exposed to the hacker (database, etc&#8230;).</p><p>Before the hack happened, my apache log show me that a person was looking for blogs powered by WordPress 2.2 and open to registration:</p><pre class="brush: bash; title: ; notranslate">
123.76-136-217.adsl-dyn.isp.belgacom.be www.maomium.com - [07/Jun/2007:00:51:55 +0200] &quot;GET /category/wordpress/ HTTP/1.1&quot; 200 2960 &quot;http://www.google.be/search?hl=fr&amp;q=%22powered+by+wordpress+2.2%22+Register&amp;btnG=Rechercher&amp;meta=&quot; &quot;Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4&quot;
</pre><p>This person was my hacker. As you can see he&#8217;s a belgian guy and his broadband provider is <a href="http://selfcare.belgacom.net/index.html?l=private:internet:security:notify&#038;a=hacking_skynet">Belgacom, to which I sent an abuse request</a>. He register himself as <a href="http://waryas.skynetblogs.be">Waryas</a> with his <code>myv4you@hotmail.com</code> email. I know that, thanks to the email WordPress send me each time someone register. Then <a href="http://www.google.fr/search?q=myv4you%40hotmail.com">google told me</a> that <a href="http://www.coolforum.net/forum/detail.php?forumid=1&#038;id=17468&#038;p=1#29054">this hack was not his first</a>.</p><p>If you want to disect his behaviour, you can <a href='http://kevin.deldycke.com/wp-content/uploads/2007/06/wordpress-22-register-new-user-hack.txt' title='wordpress-22-register-new-user-hack.txt'>download my apache log</a>.</p><p>This event show us that the WordPress vulnerablility regarding guest account registration is still there. So the <a href="http://www.4null4.de/174/wp-users-disable-guest-account-registration-immediately/">advice given by CountZero</a> <strong>must</strong> be applied !</p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2007/06/wordpress-22-security-hole-identity-theft/feed/</wfw:commentRss> <slash:comments>20</slash:comments> </item> <item><title>FeedBurner and e107 integration</title><link>http://kevin.deldycke.com/2007/05/feedburner-and-e107-integration/</link> <comments>http://kevin.deldycke.com/2007/05/feedburner-and-e107-integration/#comments</comments> <pubDate>Sun, 27 May 2007 18:45:12 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[Atom]]></category> <category><![CDATA[Blog]]></category> <category><![CDATA[CMS]]></category> <category><![CDATA[e107]]></category> <category><![CDATA[feed]]></category> <category><![CDATA[FeedBurner]]></category> <category><![CDATA[htaccess]]></category> <category><![CDATA[RDF]]></category> <category><![CDATA[RSS]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://kevin.deldycke.com/2007/05/feedburner-and-e107-integration/</guid> <description><![CDATA[In the context of my plan to move an e107-based website to WordPress, I need to take care of my RSS subscribers. To let people (and search engines) get my content via old URLs, I will use Apache redirections to &#8230; <a href="http://kevin.deldycke.com/2007/05/feedburner-and-e107-integration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><img src="http://kevin.deldycke.com/wp-content/uploads/2007/05/e107-and-feedburner.png" alt="" title="FeedBurner and e107 integration" width="440" height="80" class="aligncenter size-full wp-image-176" /></p><p>In the context of my <a href="http://kevin.deldycke.com/2006/08/e107-to-wordpress-migration-here-is-why/">plan to move an e107-based website to WordPress</a>, I need to take care of my RSS subscribers. To let people (and search engines) get my content via old URLs, I will use <a href="http://en.wikipedia.org/wiki/URL_redirection">Apache redirections</a> to do this transparently and permanently. My final goal is to have a WordPress website with all RSS feeds (blog posts and comments) managed by <a href="http://www.feedburner.com">FeedBurner</a>, to gather statistics about my audience.</p><p>Actually there is plenty of feeds format available in e107 (RSS 1.0, RSS 2.0, Atom and RDF) and one feed can be accessed through multiple URLs. We will reduce this incredible mess by using RSS 2.0 feeds only and redirect all others to it.</p><p>First, check that the e107 RSS feed plugin is activated. Then <a href="https://www.feedburner.com/fb/a/register">create an account on FeedBurner</a> and setup there two feeds, one for your website&#8217;s news and another one for comments. Based on default e107 parameters, your news feed URL is like <code>http://www.my-domain.com/e107_plugins/rss_menu/rss.php?1.2</code> and comments feed like <code>http://www.my-domain.com/e107_plugins/rss_menu/rss.php?5.2</code>.</p><p>Then, create (or edit) the <code>http://www.my-domain.com/.htaccess</code> file, and add following code:</p><pre class="brush: bash; title: ; notranslate">
RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC]
RewriteCond %{QUERY_STRING} ^(5|Comments)
RewriteRule e107_plugins/rss_menu/rss\.php http://feeds.feedburner.com/myfeed-comments? [R=301,L]

RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC]
RewriteCond %{QUERY_STRING} ^(1|News|.*)
RewriteRule e107_plugins/rss_menu/rss\.php http://feeds.feedburner.com/myfeed? [R=301,L]
</pre><p>This code is inspired by the one written by <a href="http://www.mikeatlas.com">Mike Atlas</a>, who had a similar issue and wanted to <a href="http://www.mikeatlas.com/blog/2007/03/09/transparently-outsourcing-your-rss-feeds-to-feedburner/">outsource his e107 forum RSS feeds to FeedBurner</a>.</p><p>The first rewrite rule will redirect all URLs that start with <code>http://www.my-domain.com/e107_plugins/rss_menu/rss.php?5</code> or <code>http://www.my-domain.com/e107_plugins/rss_menu/rss.php?Comments</code> to <code>http://feeds.feedburner.com/myfeed-comments</code>.</p><p>The second rewrite rule will redirect all other URLs that start with <code>http://www.my-domain.com/e107_plugins/rss_menu/rss.php</code> (including <code>http://www.my-domain.com/e107_plugins/rss_menu/rss.php?1</code> and <code>http://www.my-domain.com/e107_plugins/rss_menu/rss.php?News</code>) to <code>http://feeds.feedburner.com/myfeed</code>.</p><p>That&#8217;s all ! Thanks to this server-side redirection, nobody will notice that the feeds have moved and no subscriber will be bothered to update their <a href="http://en.wikipedia.org/wiki/Aggregator">aggregator</a>.</p><p>In my case, the only remaining task to do is to move my e107 website to WordPress then install <a href="http://blogs.feedburner.com/feedburner/archives/2007/05/feedburner_adopts_twoyearold_r_1.php">FeedSmith plugin</a>. But that&#8217;s another story&#8230; <img src='http://kevin.deldycke.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2007/05/feedburner-and-e107-integration/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Repository Moved thanks to Apache and 301 Redirections</title><link>http://kevin.deldycke.com/2007/02/repository-moved-thanks-to-apache-and-301-redirections/</link> <comments>http://kevin.deldycke.com/2007/02/repository-moved-thanks-to-apache-and-301-redirections/#comments</comments> <pubDate>Wed, 28 Feb 2007 20:49:57 +0000</pubDate> <dc:creator>Kev</dc:creator> <category><![CDATA[English]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[Blog]]></category> <category><![CDATA[Hosting]]></category> <category><![CDATA[htaccess]]></category> <category><![CDATA[ISP]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Mandriva]]></category> <category><![CDATA[Repository]]></category> <category><![CDATA[RPM]]></category> <category><![CDATA[urpmi]]></category> <category><![CDATA[Web]]></category><guid isPermaLink="false">http://kevin.deldycke.com/2007/02/repository-moved-thanks-to-apache-and-301-redirections/</guid> <description><![CDATA[Since the creation of my personal Mandriva repository (10 months ago) the number of my RPMs did not cease to increase. Currently all RPMs and SRPMs from 2006.0 and 2007.0 take 383MiB of space. So I decided to move the &#8230; <a href="http://kevin.deldycke.com/2007/02/repository-moved-thanks-to-apache-and-301-redirections/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Since the creation of my personal Mandriva repository (<a href="http://kevin.deldycke.com/2006/04/new-repository-for-mandriva-2006/">10 months ago</a>) the number of my RPMs did not cease to increase. Currently all RPMs and SRPMs from 2006.0 and 2007.0 take 383MiB of space.</p><p>So I decided to move the <code>http://kev.coolcavemen.com/static/repository</code> folder to <code>http://kevin.deldycke.free.fr/repository</code>, which is a 10GiB (yes, ten <a href="http://en.wikipedia.org/wiki/Gibibyte">gibibyte</a>, this is not a typo) free web space offered by <a href="http://free.fr">Free</a>, my ISP.</p><p>To do this smoothly, I&#8217;ve just set up a generic <code>301</code> redirection thanks to Apache. This is the only line I added to my root <code>.htaccess</code> file to enable this:</p><pre class="brush: plain; title: ; notranslate">
Redirect permanent /static/repository http://kevin.deldycke.free.fr/repository
</pre><p>This move will normally be completely silent for you. So please, let me now if something bad happend while you play with my repository.</p> ]]></content:encoded> <wfw:commentRss>http://kevin.deldycke.com/2007/02/repository-moved-thanks-to-apache-and-301-redirections/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/40 queries in 0.029 seconds using apc
Object Caching 1157/1244 objects using apc

Served from: kevin.deldycke.com @ 2012-02-08 10:20:35 -->
