<?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>mFabrik - mobile sites, apps, HTML5 and CMS software development &#187; prerouting</title>
	<atom:link href="http://blog.mfabrik.com/tag/prerouting/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mfabrik.com</link>
	<description>Freedom delivered.</description>
	<lastBuildDate>Wed, 03 Aug 2011 09:47:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>MySQL bind_address workaround</title>
		<link>http://blog.mfabrik.com/2008/09/25/mysql-bind_address-workaround/</link>
		<comments>http://blog.mfabrik.com/2008/09/25/mysql-bind_address-workaround/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 10:34:44 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[3306]]></category>
		<category><![CDATA[bind_address]]></category>
		<category><![CDATA[dnat]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[localhost]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqld]]></category>
		<category><![CDATA[port forward]]></category>
		<category><![CDATA[prerouting]]></category>
		<category><![CDATA[xinetd]]></category>

		<guid isPermaLink="false">http://blog.redinnovation.com/?p=121</guid>
		<description><![CDATA[MySQL has an ugly design fault preventing it to listen more than one interface in its bind_address my.conf directive. Thus, you usually cannot connect to the same MySQL instance using localhost and external IP sources. Here is a workaround based on xinetd daemon. These are sample commands for Ubuntu/Debian. Go to root sudo -i Install [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL has an ugly design fault preventing it to listen more than one interface in its bind_address my.conf directive. Thus, you usually cannot connect to the same MySQL instance using localhost and external IP sources.</p>
<p>Here is a workaround based on xinetd daemon. These are sample commands for Ubuntu/Debian.</p>
<p>Go to root</p>
<pre>sudo -i</pre>
<p>Install xinetd</p>
<pre>apt-get install xinetd</pre>
<p>Add a new xinetd mapping</p>
<pre>pico /etc/xinetd.d/mysql

service mysql
{
    only_from	   = localhost mansikki.redinnovation.com 80.75.108.108 server213-171-218-5.livedns.org.uk 213.171.218.5
    flags          = REUSE
    socket_type    = stream
    wait           = no
    user           = root
    redirect       = 127.0.0.1 3306
    log_on_failure += USERID
    interface 	   = 84.34.147.68
}</pre>
<p>Restart xinetd</p>
<pre>/etc/init.d/xinetd restart</pre>
<p>To debug xinetd:</p>
<pre>/etc/init.d/xinetd stop</pre>
<pre>xinetd -d</pre>
<p>xinetd only_from directive also gives an access control by allowed source IP addresses. This protects your MySQL against bots and brute force attacks.</p>
<p>Note that iptables DNAT translation doesn&#8217;t work (easily). Localhost packets don&#8217;t travel PREROUTING and POSTROUTING chains.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2008/09/25/mysql-bind_address-workaround/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

