<?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>Digitalnerds News &#187; Featured</title>
	<atom:link href="http://www.digitalnerds.net/category/featured/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.digitalnerds.net</link>
	<description>tail -f /var/blog</description>
	<lastBuildDate>Fri, 16 Apr 2010 23:14:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Apache2/workerMPM/FastCGI/PHP5</title>
		<link>http://www.digitalnerds.net/featured/apache2-worker-mpm-with-fastcgi-php5/</link>
		<comments>http://www.digitalnerds.net/featured/apache2-worker-mpm-with-fastcgi-php5/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 22:53:05 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[fcgid]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[worker-mpm]]></category>

		<guid isPermaLink="false">http://www.digitalnerds.net/?p=71</guid>
		<description><![CDATA[Usually when you are trying to do something on linux and have no ideea you usually google it. I was doing it myself recently when i had to put up a new ... ]]></description>
			<content:encoded><![CDATA[<p><center><script type="text/javascript"><!--
google_ad_client = "pub-7007755366569181";
/* 468x60, created 8/7/08 */
google_ad_slot = "6387267832";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center></p>
<p>Usually when you are trying to do something on linux and have no ideea you usually google it. I was doing it myself recently when i had to put up a new web server with apache 2 and i just decided to change from the standard mod php to fastcgi spawned php and from regular prefork MPM to the worker one.<br />
Well trust me i&#8217;ve been crawling all the net for several days and i found so many advices and tips and mini howtos, that in the end all the info got so mixed in my head i was unable to figure it out.<br />
So i started out step-by-step and reading all the readme files and docs of apache and php alike as well as fcgi specs.<br />
I&#8217;m publishing this just for the reason of being usefull to other persons like me, rather than just have &#8220;YET ANOTHER&#8221; howto alongside miriads of others.</p>
<p>But let&#8217;s just start</p>
<p>You may or may not know that PHP is considered not to be thread-safe therefore not suitable to be run in multi-threaded envs like apache with worker-mpm. Well i&#8217;ve decided to test on my own and see if those statements are true and if i manage to get to see the &#8220;PHP has encountered an access violation at memory_address&#8221; error. I wouldnt like to dissapoint people at neosmart.net[http://neosmart.net/blog/2008/dont-believe-the-lies-php-isnt-thread-safe-yet/] and i wouldnt want by comments to earn a collective cockpunch but my experience with fcgi&#8217;d PHP5 under apache+worker=mpm is the best possible one.</p>
<p>I&#8217;m not covering all the apache2 initiald eploy, and even if you didnt installed any of htem yet the command i&#8217;ll issue will check dependencies and ask you to install all the other pre-requisites. Pay attention to the fact that when you are trying to install the apache2-mpm-worker package your Debian will want to uninstall the libapache2-mod-php5 one. That&#8217;s because the PHP5 module is not compatible with the multithreaded version of apache. It only owrk with standard prefork MPM.</p>
<p>So we are goign to use worker but there&#8217;s no more php5 module. Worry not as we will run it as cgi within fastcgi thus freeing apache itself that will only serve static content as images, html files, css etc, while all dynamic php content will be served by php itself.</p>
<blockquote><p>gw1-livent:~# apt-get install apache2-mpm-worker libapache2-mod-fcgid<br />
Reading package lists&#8230; Done<br />
Building dependency tree&#8230; Done<br />
The following extra packages will be installed:<br />
apache2.2-common<br />
The following packages will be REMOVED:<br />
apache2-mpm-prefork libapache2-mod-php5<br />
The following NEW packages will be installed:<br />
apache2-mpm-worker libapache2-mod-fcgid<br />
The following packages will be upgraded:<br />
apache2.2-common<br />
1 upgraded, 2 newly installed, 2 to remove and 75 not upgraded.<br />
Need to get 1424kB of archives.<br />
After unpacking 5349kB disk space will be freed.<br />
Do you want to continue [Y/n]?</p></blockquote>
<p>Just pressing enter will continue with the installation of the necessary packages.<br />
The fastcgi module will be enabled at install time. You should see something like</p>
<blockquote><p>Setting up libapache2-mod-fcgid (1.10-2) &#8230;<br />
Module fcgid installed; run /etc/init.d/apache2 force-reload to enable.</p></blockquote>
<p>However, if you dont you will need to enable it manual using:</p>
<blockquote><p>gw1-livent:~# a2enmod fcgid</p></blockquote>
<p>And you should see the same message &#8220;Module fcgid installed; run /etc/init.d/apache2 force-reload to enable.&#8221;<br />
Make sure to edit you /etc/apache/mods-enabled/fcgid.conf so it looks like:</p>
<blockquote><pre class="brush: xml;">
&lt;IfModule mod_fcgid.c&gt;
AddHandler fcgid-script .fcgi
SocketPath /var/lib/apache2/fcgid/sock
IPCConnectTimeout 20
&lt;/IfModule&gt;
</pre>
</blockquote>
<p>Now that we are done with the fastcgi part we need to reinstall PHP5 which was previously uninstalled.</p>
<blockquote><p>gw1-livent:~# apt-get install php5-cgi php5-curl php5-gd php5-ldap php5-mysql php5-sqlite php5-xsl</p></blockquote>
<p>(Feel free to browse the php5 packages and modify the line above to suit your php5 extensions requirements)</p>
<p>In order to make use of the freshly installed php under fastcgi we will need to enable fastcgi/php support per virtualhost basis.<br />
So assuming you have the domain.com this is what the virtualhost configuration should look like:<br />
(You may have other config lines and stuff , i am just giving you an example)</p>
<blockquote><pre class="brush: xml;">
&lt;VirtualHost www.domain.com:80&gt;
ServerName www.domain.com
ServerAlias domain.net
ServerAdmin admin@domain.com
DocumentRoot /var/www/dn

&lt;Directory /var/www/domain&gt;
AddHandler fcgid-script .php
FCGIWrapper /usr/lib/cgi-bin/php5 .php
Options ExecCGI Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
&lt;/Directory&gt;

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
&lt;Directory &quot;/usr/lib/cgi-bin&quot;&gt;
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
&lt;/Directory&gt;

ErrorLog /var/log/apache2/domain-error.log
CustomLog /var/log/apache2/domain-access.log combined
LogLevel warn
ServerSignature On
&lt;/VirtualHost&gt;
</pre>
</blockquote>
<p>All the trick is done by these lines:</p>
<blockquote><p>
<strong>AddHandler fcgid-script .php<br />
FCGIWrapper /usr/lib/cgi-bin/php5 .php<br />
Options ExecCGI</strong>
</p></blockquote>
<p>Now you should just restart apache and test out your new domain by using</p>
<blockquote><pre class="brush: php;">
&lt;?php phpinfo(); ?&gt;
</pre>
</blockquote>
<p>inside a newly created index.php file. (or you can name whatever you want)</p>
<p>I hope this does help you folks<br />
Over and out</p>
<p>Andy</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalnerds.net/featured/apache2-worker-mpm-with-fastcgi-php5/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>VSFTPd with mysql backend</title>
		<link>http://www.digitalnerds.net/featured/vsftpd-with-mysql-backend/</link>
		<comments>http://www.digitalnerds.net/featured/vsftpd-with-mysql-backend/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 21:47:50 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux debian ftp]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[virtual ftp]]></category>
		<category><![CDATA[vsftpd]]></category>
		<category><![CDATA[vsftpd with mysql]]></category>

		<guid isPermaLink="false">http://www.digitalnerds.net/?p=66</guid>
		<description><![CDATA[To continue the saga of services running on mysql backend i'm presenting today the vsftpd server running on mysql for user virtualisation purposes.]]></description>
			<content:encoded><![CDATA[<p><center><script type="text/javascript"><!--
google_ad_client = "pub-7007755366569181";
/* 468x60, created 8/7/08 */
google_ad_slot = "6387267832";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center><br />
To continue the saga of services running on mysql backend i&#8217;m presenting today the vsftpd server running on mysql for user virtualisation purposes. The reason one might wanna use such a server is simple: the risk free operation of the server since it&#8217;s not working with local users. I&#8217;ll proceed to the howto without anymore introductions.<br />
Note that this setup is meant for debian. It may work on other systems as well but i&#8217;m not supporting question outside Debian scope.<br />
&#8212;&#8211;</p>
<p><strong>Chapter 1 &#8211; Basic configuration</strong></p>
<p>First we should have (i assume you already have) installed the vsftpd daemon and the libpam-mysql and mysql.</p>
<blockquote><p>
#apt-get install vsftpd libpam-mysql mysql-server
</p></blockquote>
<p>Even if the purpose of the howto is to work with mysql stored username we will need to create a local user. Create it and all aditional directories:</p>
<blockquote><p>
#mkdir /home/ftp<br />
#useradd ftpguest -d /home/ftp<br />
#chown ftpguest.nogroup /home/ftp
</p></blockquote>
<p>Next create the mysql ftp virtual user to operate on mysql:</p>
<blockquote><p>
#mysqladmin -u root -p create ftpvuser
</p></blockquote>
<p>Connect to the mysql server to create the database and to create the tables:</p>
<blockquote><p>
#mysql -u root -p<br />
mysql&gt; create database ftpvuser;<br />
Query OK, 1 row affected (0.00 sec)<br />
mysql&gt; use ftpvuser;<br />
Database changed<br />
mysql&gt; CREATE TABLE users (username varchar (20) NOT NULL,<br />
        -&gt; password varchar(40) NOT NULL,<br />
        -&gt; PRIMARY KEY (username)) TYPE=MyISAM;<br />
Query OK, 0 rows affected, 1 warning (0.00 sec)
</p></blockquote>
<p>then grant permission to an user to this database:</p>
<blockquote><p>
mysql&gt; grant select on ftpvuser.users to ftpguest@localhost identified by &#8216;YourPassword&#8217;;<br />
Query OK, 0 rows affected (0.04 sec)
</p></blockquote>
<p>This next step is necessary only if you are going to setup Chapter 2 configuration for different users with different permissions.</p>
<blockquote><p>
mysql&gt; insert into users (username,password) values (&#8216;normal&#8217;,'555555&#8242;);<br />
Query OK, 1 row affected (0.00 sec)<br />
mysql&gt; insert into users (username,password) values (&#8216;admin&#8217;,'666666&#8242;);<br />
Query OK, 1 row affected (0.00 sec)<br />
mysql&gt; insert into users (username,password) values (&#8216;webmaster&#8217;,'777777&#8242;);<br />
Query OK, 1 row affected (0.00 sec)<br />
mysql&gt;quit;
</p></blockquote>
<p>Next edit if it exists or create the vsftpd pam config under /etc/pam.d/vsftpd:</p>
<blockquote><p>
#nano -w /etc/pam.d/vsftpd
</p></blockquote>
<p>And add these lines:</p>
<blockquote><p>
auth required pam_mysql.so user=ftpguest passwd=YourPassword host=localhost db=ftpvuser table=users usercolumn=username passwdcolumn=password crypt=0<br />
account required pam_mysql.so user=ftpguest passwd=YourPassword host=localhost db=ftpvuser table=users usercolumn=username passwdcolumn=password crypt=0
</p></blockquote>
<p>Now open up your /etc/vsftpd.conf. Edit it as you may see fit and setup all options you like then restart your vsftpd server:</p>
<blockquote><p>
#/etc/init.d/vsftpd stop<br />
#/etc/init.d/vsftpd start
</p></blockquote>
<p>For the record some vsftpd.conf options that you will need to set are:</p>
<blockquote><p>
# comment this line to disable anonymous logins<br />
#anonymous_enable=YES<br />
# enable local access<br />
local_enable=YES<br />
# enable guest access<br />
guest_enable=YES<br />
guest_username=ftpguest<br />
# chroot local users<br />
chroot_local_user=YES
</p></blockquote>
<p>Now test your ftp server quickly. If you cannot login and you get the errror 500 OOPS : cap_set_proc that its because of the SELinux. To fix this problem you will need to load the capability module into your running kernel:</p>
<blockquote><p>
#modprobe capability
</p></blockquote>
<p>To load this module automatically at each server restart add the capability module to your /etc/modules.</p>
<p>If you would like to restrict access to the ftp server and allow it only from certain IP addresses you will need to make use of the tcp_wrappers and enable it in your /etc/vsftpd.conf:</p>
<blockquote><p>
# TCP Wrappers<br />
tcp_wrappers=YES
</p></blockquote>
<p>Deny all incoming connections by default in /etc/hosts.deny by adding:</p>
<blockquote><p>
vsftpd: ALL
</p></blockquote>
<p>Specify the allowed connection in /etc/hosts.allow by adding:</p>
<blockquote><p>
vsftpd: 192.168.0.,210.83.200.200 : setenv VSFTPD_LOAD_CONF /etc/vsftpd/vsftpd.anonymous<br />
vsftpd: ALL : setenv VSFTPD_LOAD_CONF /etc/vsftpd/vsftpd.virtual
</p></blockquote>
<p>Next create the necessary files:</p>
<blockquote><p>
#mkdir /etc/vsftpd/<br />
#nano -w /etc/vsftpd/vsftpd.anonymous
</p></blockquote>
<p>and add to it:</p>
<blockquote><p>
anonymous_enable=YES
</p></blockquote>
<p>then</p>
<blockquote><p>
#nano -w /etc/vsftpd/vsftpd.virtual
</p></blockquote>
<p>and add to it:</p>
<blockquote><p>
anonymous_enable=NO
</p></blockquote>
<p>Note you should add the ftp users into your mysql database using phpmyadmin or by building your own web app to do that. I dont cover this aspect here.</p>
<p><strong>Chapter 2 &#8211; Different users with different permissions (optional)</strong></p>
<p>This is a standalone chapter apart form the original configuration. It shows how to create different users with different permissions using vsftpd configuration files. We have performed the mysql users config for this chapter in the previous step adding in the `users` table the users &#8220;normal&#8221;, &#8220;admin&#8221; and &#8220;webmaster&#8221;.</p>
<blockquote><p>
#nano -w /etc/vsftpd.conf
</p></blockquote>
<p>and add to it:</p>
<blockquote><p>
user_config_dir=/etc/vsftpd/vsftpd_user_conf
</p></blockquote>
<p>Now we should allow ordinary users to download/upload. For this we should do the following:</p>
<blockquote><p>
#mkdir /etc/vsftpd/vsftpd_user_conf<br />
#nano /etc/vsftpd/vsftpd_user_conf/normal
</p></blockquote>
<p>with the following content</p>
<blockquote><p>
anon_world_readable_only=NO<br />
write_enable=YES<br />
anon_upload_enable=YES<br />
anon_mkdir_write_enable=YES
</p></blockquote>
<p>Also we need to allow admins to download/upload/delete and so on:</p>
<blockquote><p>
#cp /etc/vsftpd/vsftpd_user_conf/normal /etc/vsftpd/vsftpd_user_conf/admin<br />
#nano -w /etc/vsftpd/vsftpd_user_conf/admin
</p></blockquote>
<p>and make it look like:</p>
<blockquote><p>
# Allow rename and delete the file<br />
anon_other_write_enable=YES<br />
# Users have to be a local user with the same permissions<br />
virtual_use_local_privs=YES<br />
# allows documents attributes modifications<br />
chmod_enable=YES
</p></blockquote>
<p>And the webmaster configuration file:</p>
<blockquote><p>
#cp /etc/vsftpd/vsftpd_user_conf/admin /etc/vsftpd/vsftpd_user_conf/webmaster
</p></blockquote>
<p>Edit the webmaster configuration files to look like:</p>
<blockquote><p>
#FTP home directory at the website&#8217;s home directory<br />
local_root=/var/www<br />
# Because the uploaded files are owned by ftpguest<br />
# other users are not allowed to access these files<br />
# and especially the apache user www-data. To fix this<br />
# we specify the local umask to 033<br />
local_umask=033
</p></blockquote>
<p>With all these being said i hope this helps you.<br />
I have been looking long time ago for this kind of setup. I wrote this tutorial like 2 years ago and it used to be on my website before i  had to shut it down. Then i lost my db backups and all my tutorials got lost. But i am re-writting them one by one and hopefully even more.</p>
<p>Thank you</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalnerds.net/featured/vsftpd-with-mysql-backend/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To Install Bind9+MySQL</title>
		<link>http://www.digitalnerds.net/featured/how-to-install-bind9-with-mysql/</link>
		<comments>http://www.digitalnerds.net/featured/how-to-install-bind9-with-mysql/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 23:13:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bind9]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[isc]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.digitalnerds.net/?p=44</guid>
		<description><![CDATA[I used to have this tutorial some time ago online but due to some unfortunate circumstances i lost the database backup holding it.
]]></description>
			<content:encoded><![CDATA[<p><center><script type="text/javascript"><!--
google_ad_client = "pub-7007755366569181";
/* 468x60, created 8/7/08 */
google_ad_slot = "6387267832";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center><br />
I used to have this tutorial some time ago online but due to some unfortunate circumstances i lost the database backup holding it.<br />
Therefore i&#8217;m coming back with a revised edition of it for those in need of a bind9 with mysql installation.<br />
At the time of this article writing the bind9 sources from Debian Etch are patched for the latest cache-poisoning vulnerability found by Mr. <a href="http://www.doxpara.com/" target="_blank">Dan Kaminsky</a><br />
Once again this tutorial is strictly Debian Etch compatible. You may however reproduce this install on other Linux distros but i&#8217;m not gonna support any question related to other installations.<br />
Enough said let&#8217;s proceed.</p>
<p>I assume you&#8217;ve already logged in on your server. Allright. Let&#8217;s go to /usr/src.</p>
<blockquote><p>gw1-livent:~# cd /usr/src/<br />
gw1-livent:/usr/src#</p></blockquote>
<p>We get the bind9 source.</p>
<blockquote><p>gw1-livent:/usr/src# apt-get source bind9<br />
Reading package lists&#8230; Done<br />
Building dependency tree&#8230; Done<br />
Need to get 4347kB of source archives.<br />
Get:1 http://ftp.debian.org etch/main bind9 1:9.3.4-2etch3 (dsc) [897B]<br />
Get:2 http://ftp.debian.org etch/main bind9 1:9.3.4-2etch3 (tar) [4044kB]<br />
Get:3 http://ftp.debian.org etch/main bind9 1:9.3.4-2etch3 (diff) [302kB]<br />
Fetched 4347kB in 1s (2971kB/s)<br />
dpkg-source: extracting bind9 in bind9-9.3.4<br />
dpkg-source: unpacking bind9_9.3.4.orig.tar.gz<br />
dpkg-source: applying ./bind9_9.3.4-2etch3.diff.gz<br />
gw1-livent:/usr/src#</p></blockquote>
<p>We download the mysql-bind.tar.gz package from sourceforge.net (you may as well pick other mirror as i used Switch)</p>
<blockquote><p>gw1-livent:/usr/src# wget http://switch.dl.sourceforge.net/sourceforge/mysql-bind/mysql-bind.tar.gz<br />
&#8211;18:56:17&#8211; http://switch.dl.sourceforge.net/sourceforge/mysql-bind/mysql-bind.tar.gz<br />
=&gt; `mysql-bind.tar.gz&#8217;<br />
Resolving switch.dl.sourceforge.net&#8230; 130.59.138.20, 2001:620:0:1b::20<br />
Connecting to switch.dl.sourceforge.net|130.59.138.20|:80&#8230; connected.<br />
HTTP request sent, awaiting response&#8230; 200 OK<br />
Length: 14,019 (14K) [application/x-tar]</p>
<p>100%[==============================================&gt;] 14,019 &#8211;.&#8211;K/s</p>
<p>18:56:18 (93.41 KB/s) &#8211; `mysql-bind.tar.gz&#8217; saved [14019/14019]</p>
<p>gw1-livent:/usr/src#</p></blockquote>
<p>We unpack it and go into the newly created directory.</p>
<blockquote><p>gw1-livent:/usr/src# tar zxvf mysql-bind.tar.gz<br />
mysql-bind/<br />
mysql-bind/COPYING<br />
mysql-bind/mysqldb.h<br />
mysql-bind/ChangeLog<br />
mysql-bind/.cvsignore<br />
mysql-bind/mysqldb.c~<br />
mysql-bind/ChangeLog~<br />
mysql-bind/CVS/<br />
mysql-bind/CVS/Entries<br />
mysql-bind/CVS/Root<br />
mysql-bind/CVS/Repository<br />
mysql-bind/mysqldb.c<br />
mysql-bind/README<br />
mysql-bind/README~<br />
mysql-bind/zonetodb.c<br />
gw1-livent:/usr/src# cd mysql-bind<br />
gw1-livent:/usr/src/mysql-bind#</p></blockquote>
<p>Now we will need to copy the necessary files into the bind9 source directory.</p>
<blockquote><p>gw1-livent:/usr/src/mysql-bind# cp mysqldb.c ../bind9-9.3.4/bin/named/<br />
gw1-livent:/usr/src/mysql-bind# cp mysqldb.c ../bind9-9.3.4/bin/named/include/<br />
gw1-livent:/usr/src/mysql-bind# cp mysqldb.h ../bind9-9.3.4/bin/named/<br />
gw1-livent:/usr/src/mysql-bind# cp mysqldb.h ../bind9-9.3.4/bin/named/include/</p></blockquote>
<p>Now we will need to edit some files on the bind9 source before actually compiling it. But before we will need to install some other pre-requisites for this installation. As Debian default install doesnt have some packages that we need we will install them now.</p>
<blockquote><p>
gw1-livent:/usr/src/mysql-bind# apt-get install fakeroot debhelper libmysqlclient15-dev
</p></blockquote>
<p>We will edit the Makefile.in file in /usr/src/bind9-9.3.4/bin/named/ and add some proper values to DBDRIVER_OBJS, DBDRIVER_SRCS, DBDRIVER_INCLUDES and DBDRIVER_LIBS parameters. Now open /usr/src/bind9-9.3.4/bin/named/Makefile.in with your favourite editor and search for:</p>
<blockquote><p>#<br />
# Add database drivers here.<br />
#<br />
DBDRIVER_OBJS =<br />
DBDRIVER_SRCS =<br />
DBDRIVER_INCLUDES =<br />
DBDRIVER_LIBS =</p></blockquote>
<p>.. which should at this step look like</p>
<blockquote><p>#<br />
# Add database drivers here.<br />
#<br />
DBDRIVER_OBJS = mysqldb.@O@<br />
DBDRIVER_SRCS = mysqldb.c<br />
DBDRIVER_INCLUDES =<br />
DBDRIVER_LIBS =</p></blockquote>
<p>For the next two values we will need to find out mysql configuration values that we will insert.<br />
First let&#8217;s find for DBDRIVER_INCLUDES:</p>
<blockquote><p>gw1-livent:/usr/src/bind9-9.3.4/bin/named# mysql_config &#8211;cflags<br />
-I/usr/include/mysql -DBIG_JOINS=1<br />
gw1-livent:/usr/src/bind9-9.3.4/bin/named#</p></blockquote>
<p>Second DBDRIVER_LIBS &#8230;</p>
<blockquote><p>gw1-livent:/usr/src/bind9-9.3.4/bin/named# mysql_config &#8211;libs<br />
-L/usr/lib/mysql -lmysqlclient<br />
gw1-livent:/usr/src/bind9-9.3.4/bin/named#</p></blockquote>
<p>Now we add these values to the same part in Makefile.in so it looks like:</p>
<blockquote><p>#<br />
# Add database drivers here.<br />
#<br />
DBDRIVER_OBJS = mysqldb.@O@<br />
DBDRIVER_SRCS = mysqldb.c<br />
DBDRIVER_INCLUDES = -I/usr/include/mysql -DBIG_JOINS=1<br />
DBDRIVER_LIBS = -L/usr/lib/mysql -lmysqlclient</p></blockquote>
<p>Ok, we are done with this file. We are gonna edit now /usr/src/bind9-9.3.4/bin/named/main.c. Open it in your favorite editor and look for:</p>
<blockquote>
<pre class="brush: cpp;">
#include &lt;dst /result.h&gt;

/*
* Defining NS_MAIN provides storage declarations (rather than extern)
* for variables in named/globals.h.
*/</pre>
<p></dst></p></blockquote>
<p>After #include on a new line add #include &#8220;include/mysqldb.h&#8221; so it looks like:</p>
<blockquote>
<pre class="brush: cpp;">
#include &lt;dst /result.h&gt;
#include &quot;include/mysqldb.h&quot;

/*
* Defining NS_MAIN provides storage declarations (rather than extern)
* for variables in named/globals.h.
*/
</pre>
<p></dst></p></blockquote>
<p>In the same file main.c search for:</p>
<blockquote><p>/*<br />
* Add calls to register sdb drivers here.<br />
*/<br />
/* xxdb_init(); */</p>
<p>ns_server_create(ns_g_mctx, &amp;ns_g_server);<br />
}</p></blockquote>
<p>and change it so it looks like</p>
<blockquote><p>/*<br />
* Add calls to register sdb drivers here.<br />
*/<br />
/* xxdb_init(); */<br />
mysqldb_init();<br />
ns_server_create(ns_g_mctx, &amp;ns_g_server);<br />
}</p></blockquote>
<p>then search for:</p>
<blockquote><p>/*<br />
* Add calls to unregister sdb drivers here.<br />
*/<br />
/* xxdb_clear(); */</p>
<p>isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,</p></blockquote>
<p>and make sure it looks like:</p>
<blockquote><p>/*<br />
* Add calls to unregister sdb drivers here.<br />
*/<br />
/* xxdb_clear(); */<br />
mysqldb_clear();<br />
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,</p></blockquote>
<p>Save the file main.c and exit now. We are gonna make one more change in the file mysqldb.c that came in the mysql-bind package since it&#8217;s broken.<br />
Open the file /usr/src/bind9-9.3.4/bin/named/mysqldb.c in your favorite text editor and look for the last include line that should look like:</p>
<blockquote><pre class="brush: cpp;">#include &lt;named /mysqldb.h&gt;</pre>
<p></named></p></blockquote>
<p>Change the line so it looks:</p>
<blockquote><p>#include &#8220;include/mysqldb.h&#8221;</p></blockquote>
<p>As we are done editing the files we can now proceed with the build of bind9-mysql debian packages. Change the directory to /usr/src/bind9-9.3.4</p>
<blockquote><p>gw1-livent:/usr/src/bind9-9.3.4/bin/named# cd ../../<br />
gw1-livent:/usr/src/bind9-9.3.4#</p></blockquote>
<p>Build it.</p>
<blockquote><p>gw1-livent:/usr/src/bind9-9.3.4# dpkg-buildpackage -rfakeroot -b</p></blockquote>
<p>If you get a message like:</p>
<blockquote><p>dpkg-buildpackage: source package is bind9<br />
dpkg-buildpackage: source version is 1:9.3.4-2etch3<br />
dpkg-buildpackage: source changed by LaMont Jones<br />
dpkg-buildpackage: host architecture i386<br />
dpkg-buildpackage: source version without epoch 9.3.4-2etch3<br />
dpkg-checkbuilddeps: Unmet build dependencies: bison texlive-latex-base xsltproc<br />
dpkg-buildpackage: Build dependencies/conflicts unsatisfied; aborting.<br />
dpkg-buildpackage: (Use -d flag to override.)</p></blockquote>
<p>then you will need to install the extra required packages by issuing:</p>
<blockquote><p>gw1-livent:/usr/src/bind9-9.3.4# apt-get install bison texlive-latex-base xsltproc</p></blockquote>
<p>The apt-get install process will ask your confirmation regarding the installation of these packages and as soon as you agree it will go downloading and installing them. Assuming you didnt need to do this step or that you didnt even encountered we continue.<br />
After the dpkg-buildpackage is done and successfull you should see at the end among the last few lines:</p>
<blockquote><p>dpkg-deb: building package `bind9&#8242; in `../bind9_9.3.4-2etch3_i386.deb&#8217;.<br />
dpkg-deb: building package `bind9-host&#8217; in `../bind9-host_9.3.4-2etch3_i386.deb&#8217;.<br />
dpkg-deb: building package `libbind-dev&#8217; in `../libbind-dev_9.3.4-2etch3_i386.deb&#8217;.<br />
dpkg-deb: building package `libbind9-0&#8242; in `../libbind9-0_9.3.4-2etch3_i386.deb&#8217;.<br />
dpkg-deb: building package `libdns22&#8242; in `../libdns22_9.3.4-2etch3_i386.deb&#8217;.<br />
dpkg-deb: building package `libisc11&#8242; in `../libisc11_9.3.4-2etch3_i386.deb&#8217;.<br />
dpkg-deb: building package `liblwres9&#8242; in `../liblwres9_9.3.4-2etch3_i386.deb&#8217;.<br />
dpkg-deb: building package `libisccc0&#8242; in `../libisccc0_9.3.4-2etch3_i386.deb&#8217;.<br />
dpkg-deb: building package `libisccfg1&#8242; in `../libisccfg1_9.3.4-2etch3_i386.deb&#8217;.<br />
dpkg-deb: building package `dnsutils&#8217; in `../dnsutils_9.3.4-2etch3_i386.deb&#8217;.<br />
dpkg-deb: building package `lwresd&#8217; in `../lwresd_9.3.4-2etch3_i386.deb&#8217;.</p></blockquote>
<p>That means that all required bind9 debian packages were built and they are available one directory before the bind9 source. Therefore we go up one directory:</p>
<blockquote><p>gw1-livent:/usr/src/bind9-9.3.4# cd ../<br />
gw1-livent:/usr/src#</p></blockquote>
<p>and install our fresh built bind9 with mysql backend with all the other bind9 related libraries and utilities:</p>
<blockquote><p>gw1-livent:/usr/src# dpkg -i bind9_9.3.4-2etch3_i386.deb bind9-doc_9.3.4-2etch3_all.deb bind9-host_9.3.4-2etch3_i386.deb dnsutils_9.3.4-2etch3_i386.deb libbind9-0_9.3.4-2etch3_i386.deb libbind-dev_9.3.4-2etch3_i386.deb libdns22_9.3.4-2etch3_i386.deb libisc11_9.3.4-2etch3_i386.deb libisccc0_9.3.4-2etch3_i386.deb libisccfg1_9.3.4-2etch3_i386.deb liblwres9_9.3.4-2etch3_i386.deb lwresd_9.3.4-2etch3_i386.deb</p></blockquote>
<p>This is about all about building bind9 with mysql on Debian Etch.</p>
<p>Now you will need a basic structure for your mysql domain database and an example of how to add a domain to your named.conf.</p>
<p>The entry in named.conf will look something like this:</p>
<blockquote><p>zone &#8220;mydomain.com&#8221; {<br />
type master;<br />
notify no;<br />
database &#8220;mysqldb dbname tablename hostname user password&#8221;;<br />
};</p></blockquote>
<p>You should create a database for the driver and add one table for each domain. The following SQL will create a table for one domain. Change mydomain to something that will represent the domain more clearly.</p>
<blockquote><p>CREATE TABLE mydomain (<br />
name varchar(255) default NULL,<br />
ttl int(11) default NULL,<br />
rdtype varchar(255) default NULL,<br />
rdata varchar(255) default NULL<br />
) TYPE=MyISAM;</p></blockquote>
<p>The following is an SQL dump of an example table for a domain. The entries should be familiar to anyone who is familiar with BIND zone files. Change it to match your domain.</p>
<blockquote><p>INSERT INTO mydomain VALUES (&#8216;mydomain.com&#8217;, 259200, &#8216;SOA&#8217;, &#8216;mydomain.com. www.mydomain.com. 200309181 28800 7200 86400 28800&#8242;);<br />
INSERT INTO mydomain VALUES (&#8216;mydomain.com&#8217;, 259200, &#8216;NS&#8217;, &#8216;ns0.mydomain.com.&#8217;);<br />
INSERT INTO mydomain VALUES (&#8216;mydomain.com&#8217;, 259200, &#8216;NS&#8217;, &#8216;ns1.mydomain.com.&#8217;);<br />
INSERT INTO mydomain VALUES (&#8216;mydomain.com&#8217;, 259200, &#8216;MX&#8217;, &#8216;10 mail.mydomain.com.&#8217;);<br />
INSERT INTO mydomain VALUES (&#8216;w0.mydomain.com&#8217;, 259200, &#8216;A&#8217;, &#8216;192.168.1.1&#8242;);<br />
INSERT INTO mydomain VALUES (&#8216;w1.mydomain.com&#8217;, 259200, &#8216;A&#8217;, &#8216;192.168.1.2&#8242;);<br />
INSERT INTO mydomain VALUES (&#8216;mydomain.com&#8217;, 259200, &#8216;Cname&#8217;, &#8216;w0.mydomain.com.&#8217;);<br />
INSERT INTO mydomain VALUES (&#8216;mail.mydomain.com&#8217;, 259200, &#8216;Cname&#8217;, &#8216;w0.mydomain.com.&#8217;);<br />
INSERT INTO mydomain VALUES (&#8216;ns0.mydomain.com&#8217;, 259200, &#8216;Cname&#8217;, &#8216;w0.mydomain.com.&#8217;);<br />
INSERT INTO mydomain VALUES (&#8216;ns1.mydomain.com&#8217;, 259200, &#8216;Cname&#8217;, &#8216;w1.mydomain.com.&#8217;);<br />
INSERT INTO mydomain VALUES (&#8216;www.mydomain.com&#8217;, 259200, &#8216;Cname&#8217;, &#8216;w0.mydomain.com.&#8217;);<br />
INSERT INTO mydomain VALUES (&#8216;ftp.mydomain.com&#8217;, 259200, &#8216;Cname&#8217;, &#8216;w0.mydomain.com.&#8217;);</p></blockquote>
<p>With all these being said i really hope this article helps many of you. It took some time to elaborate and make it step by step but it worths. I will also attach the packages built for this tutorial for those that will simply want to get them, install them and have it running.</p>
<p><strong><span style="color: #ff0000;">Note: </span></strong>the downloads below are available only for registered members of Digitalnerds.</p>
<p>Thank you very much for your attention.</p>
<p>The Digitalnerd</p>
Note: There is a file embedded within this post, please visit this post to download the file.
]]></content:encoded>
			<wfw:commentRss>http://www.digitalnerds.net/featured/how-to-install-bind9-with-mysql/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Iphone Nano for Christmas?</title>
		<link>http://www.digitalnerds.net/featured/iphone-nano-for-christmas/</link>
		<comments>http://www.digitalnerds.net/featured/iphone-nano-for-christmas/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 23:03:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iphone 3g]]></category>
		<category><![CDATA[iphone nano]]></category>
		<category><![CDATA[iphone shuffle]]></category>

		<guid isPermaLink="false">http://www.digitalnerds.net/?p=18</guid>
		<description><![CDATA[As many of you may already know Apple let rumors escape about the iPhone Nano about a year ago regarding a patent registration application with United ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">As many of you may already know Apple let rumors escape about the iPhone Nano about a year ago regarding a patent registration application with United States Patents &amp; Trademarks Office.<br />
However this week rumors about the almosr forgotten iPhone Nano are hitting the web once again.<br />
<a href="http://www.dailymail.co.uk/sciencetech/article-1041006/Apple-launch-iPhone-nano-time-Christmas.html?ITO=1490" target="_blank">The Daily Mail</a>Â announced that iPhone Nano will be available in UK around Christmas at a Â£150 for pay-as-you-go customers by O2, the mobile phone group owned by Spain&#8217;s Telefonica.Â <br />
According to the source one expert suggested that iPhone Nano would have a touch wheel on the back and display on the front so that number can be dialled from behind. This kind of backs up theÂ images present in Apple&#8217;s patent application, but who really knows?.<br />
IÂ guess we will need to wait until Christmas to see.
</p>
<p style="text-align: center;"><a href="http://www.digitalnerds.net/wp-content/uploads/2008/08/iphone_prossimamente.jpg"></a></p>
<p style="text-align: center;"><a href="http://www.digitalnerds.net/wp-content/uploads/2008/08/iphone_2.png"><img class="aligncenter size-full wp-image-23" title="iphone_2" src="http://www.digitalnerds.net/wp-content/uploads/2008/08/iphone_2.png" alt="" width="435" height="355" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalnerds.net/featured/iphone-nano-for-christmas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linus Torvalds bashes OpenBSD</title>
		<link>http://www.digitalnerds.net/featured/linus-torvalds-bashes-openbsd/</link>
		<comments>http://www.digitalnerds.net/featured/linus-torvalds-bashes-openbsd/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 16:53:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linus Torvalds]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.digitalnerds.net/?p=6</guid>
		<description><![CDATA[What does Linus Torvalds think about BSD? It&#8217;s not too pleasant.
Linus Torvalds &#8211; the creator of the Linux kernel and ...]]></description>
			<content:encoded><![CDATA[<div>What does Linus Torvalds think about BSD? It&#8217;s not too pleasant.</div>
<p>Linus Torvalds &#8211; the creator of the Linux kernel and its current maintainer &#8211; is by all accounts a brilliant human being. He can also be incredibly crass and rude. Case in point is <a href="http://article.gmane.org/gmane.linux.kernel/706950" target="_blank">a post</a> he made to the Linux Kernel mailing list (LKML) yesterday, where he offered his opinion on security research and specifically the OpenBSD operating system (which is security centric).</p>
<p>It&#8217;s soo rude that it&#8217;s &#8216;funny&#8217; &#8211; that is if you&#8217;re not an OpenBSD developer or have a particular affection for monkeys.</p>
<p>Torvalds wrote:</p>
<blockquote><p><strong>Security people are often the black-and-white kind of people that I can&#8217;tÂ  stand. I think the OpenBSD crowd is a bunch of masturbating monkeys, in that they make such a big deal about concentrating on security to the point where they pretty much admit that nothing else matters to them.</strong></p></blockquote>
<p>The gist of Torvalds&#8217; longer argument is that there are more interesting bugs out there than just security bugs. On that topic I heartily agree with the God of Linux. While I am also a contributor to the security bug hype often focusing stories that I write on those issues, as a user I know full well that it&#8217;s often the &#8216;regular&#8217; bugs that are the issues that actually affect me the most.</p>
<div>Source: <a href="http://blog.internetnews.com/skerner/2008/07/what-linus-torvalds-thinks-abo.html">http://blog.internetnews.com/skerner/2008/07/what-linus-torvalds-thinks-abo.html</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalnerds.net/featured/linus-torvalds-bashes-openbsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
