<?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>CB1, INC. &#187; ubuntu</title>
	<atom:link href="http://www.cb1inc.com/category/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cb1inc.com</link>
	<description></description>
	<lastBuildDate>Wed, 28 Sep 2011 17:54:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>CB1 Ubuntu 10.10 Linux Development Setup</title>
		<link>http://www.cb1inc.com/2010/10/16/cb1-ubuntu-10-10-linux-development-setup/</link>
		<comments>http://www.cb1inc.com/2010/10/16/cb1-ubuntu-10-10-linux-development-setup/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 02:36:52 +0000</pubDate>
		<dc:creator>Chris Barber</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[gearman]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.cb1inc.com/?p=1375</guid>
		<description><![CDATA[I use a MacBook Pro for my day-to-day operations here at CB1, INC. I&#8217;m a huge believer that a development environment should mimic the production environment, so I find myself running a couple virtual machines in VMware Fusion. The following guide is a reference for myself as well as possibly a helpful resource for setting [...]]]></description>
			<content:encoded><![CDATA[<p>I use a MacBook Pro for my day-to-day operations here at CB1, INC.  I&#8217;m a huge believer that a development environment should mimic the production environment, so I find myself running a couple virtual machines in VMware Fusion.</p>
<p>The following guide is a reference for myself as well as possibly a helpful resource for setting up your own Linux development environment. Here&#8217;s an checklist of the tasks to perform and software to install:</p>
<ul>
<li>Operating System
<ul>
<li><a href="http://www.ubuntu.com/" target="_blank">Ubuntu 10.10 64-bit</a>: I use Ubuntu Desktop in dev and Ubuntu Server in production</li>
<li>Package updates and upgrades</li>
<li>Network configuration (at least 2 static IP addresses)</li>
</ul>
</li>
<li>Development Tools
<ul>
<li>C/C++ development environment</li>
<li>Autotools</li>
<li>Sun Java JDK</li>
<li><a href="http://valgrind.org/" target="_blank">Valgrind</a></li>
<li>Version control: <a href="http://subversion.tigris.org/" target="_blank">Subversion</a>, <a href="http://bazaar.canonical.com/en/" target="_blank">Bazaar</a>, <a href="http://git-scm.com/" target="_blank">git</a></li>
<li><a href="http://developer.android.com/">Android SDK</a></li>
</ul>
</li>
<li>Servers
<ul>
<li><a href="http://www.samba.org/" target="_blank">Samba</a> (file sharing)</li>
<li>SSH (remote shell access)</li>
<li><a href="http://httpd.apache.org/" target="_blank">Apache 2.2</a> (web server)</li>
<li><a href="http://nginx.org/" target="_blank">nginx 0.8</a> (web server)</li>
<li><a href="http://www.php.net/" target="_blank">PHP 5.3.3</a> (application server)</li>
<li><a href="http://php-fpm.org/" target="_blank">PHP-FPM</a> (PHP&#8217;s FastCGI process manager)</li>
<li><a href="http://www.mysql.com/" target="_blank">MySQL 5.1</a> (database server)</li>
<li><a href="http://www.postgresql.org/" target="_blank">PostgreSQL</a> (database server)</li>
<li><a href="http://memcached.org/" target="_blank">memcached 1.4.5</a> (caching layer)</li>
<li><a href="http://gearman.org/" target="_blank">Gearman</a> (job queue manager)</li>
</ul>
</li>
<li>PHP Extensions
<ul>
<li><a href="http://pecl.php.net/package/memcached" target="_blank">memcached</a></li>
<li><a href="http://xdebug.org/" target="_blank">Xdebug</a></li>
<li><a href="http://pecl.php.net/package/gearman" target="_blank">Gearman</a></li>
<li><a href="http://pecl.php.net/package/APC" target="_blank">APC</a></li>
</ul>
</li>
<li>Desktop Applications
<ul>
<li><a href="http://www.google.com/chrome">Google Chrome</a></li>
<li>KCachegrind</li>
<li><a href="http://www.appcelerator.com/products">Appcelerator Titanium</a></li>
</ul>
</li>
</ul>
<h3>Operating System</h3>
<p><img class="aligncenter" src="http://cb1inc.com/wp-content/uploads/2010/10/ubuntu.png"/></p>
<p>Start by installing Ubuntu 10.10 Desktop (or server). I&#8217;m not going to cover installing Ubuntu since there are already several other resources out there. Once Ubuntu is installed, open a <strong>Terminal</strong>:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo passwd root</span>
[sudo] password for user: &lt;type your password&gt;
Enter new UNIX password: &lt;type new root password&gt;
Retype new UNIX password: &lt;type new root password again&gt;
passwd: password updated successfully

user@ubuntu:~# <span class="cmd">sudo apt-get update</span>
user@ubuntu:~# <span class="cmd">sudo apt-get upgrade</span>

user@ubuntu:~# <span class="cmd">mkdir ~/src</span>
</pre>
<h3>New File Permissions</h3>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo pico /etc/profile</span>
</pre>
<p>Change 022 to 002. This setting controls the default permissions when a new file or directory is created.  This is mostly useful when managing files over Samba.</p>
<h3>Network IP Addresses</h3>
<p>Optionally, you may want to assign a static IP address. I set up one IP address for Apache and another for nginx.</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo pico /etc/network/interfaces</span>
</pre>
<p>The following is a reference for adding two static IPs.  Change the IPs to meet your needs.</p>
<pre class="brush: plain; title: ;">
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
	address 192.168.1.200
	netmask 255.255.255.0
	gateway 192.168.1.1

auto eth0:1
iface eth0:1 inet static
	address 192.168.1.201
	netmask 255.255.255.0
</pre>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo /etc/init.d/networking restart</span>
</pre>
<h3>Packages</h3>
<p>Here&#8217;s a bunch of packages that will set up compilers, version control, Java, MySQL, Apache, PHP, Memcache, Gearman, Samba, and more.</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo apt-get install build-essential autotools-dev autoconf \
 autoconf2.13 openssh-server ethtool traceroute openjdk-6-jdk \
 mysql-server-5.1 bzr subversion subversion-tools ntp ntpdate \
 libpcre3-dev libevent-dev automake bison libtool scons  g++ \
 ncurses-dev libreadline-dev libz-dev libssl-dev  libcurl4-openssl-dev \
 ruby rubygems libzip-ruby1.8 libzip-ruby1.9.1 python-dev ruby-dev \
 libdbus-glib-1-dev uuid-dev libpam0g libpam0g-dev gperf samba valgrind \
 libxml2-dev libfreetype6-dev curl libcurl4-openssl-dev \
 libjpeg62-dev libpng12-dev sqlite3 libsqlite3-dev git-core \
 postgresql postgis gearman libgearman-dev php5 \
 libapache2-mod-php5 php5-dev memcached php5-memcached \
 php5-curl php5-gd php5-mysql php5-pgsql php-apc \
 php5-xdebug php5-fpm libapache2-mod-fastcgi</span>
</pre>
<h3>MySQL</h3>
<p>During the package install above, MySQL will prompt you for the root password.</p>
<p>After the packages are installed, we need to allow remote MySQL connections.</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo pico /etc/mysql/my.cnf</span>
</pre>
<p>Comment out the <em>bind-address</em> line.</p>
<pre class="brush: plain; title: ;">
# bind-address          = 127.0.0.1
</pre>
<h3>SSH</h3>
<p>Next, you may optionally increase the connection keep alive interval for remote ssh connections. Timeouts aren&#8217;t really an issue for SSH&#8217;ing into a local VM, but really helps for remote installs.</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo echo &quot;ClientAliveInterval 60&quot; &gt;&gt; /etc/ssh/sshd_config</span>
</pre>
<h3>Samba</h3>
<p>Samba allows me to drag and drop files between my Mac and Linux VM. I personally do <strong>not</strong> enable/install Samba on production servers.</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.orig</span>
user@ubuntu:~# <span class="cmd">sudo pico /etc/samba/smb.conf</span>
</pre>
<p>You can add a share such as the following:</p>
<pre class="brush: plain; title: ;">
[ubuntu]
        force user = &lt;your username&gt;
        writeable = yes
        create mode = 644
        path = /home/&lt;your username&gt;
        directory mode = 755
        force group = &lt;your username&gt;
</pre>
<p>Then create yourself a Samba user:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo smbpasswd -a &lt;your username&gt;</span>
</pre>
<h4>Apache 2</h4>
<p>Apache is mostly configured out of the box, but I like to enable rewrite and SSL so I can test production features.</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo a2enmod rewrite</span>
user@ubuntu:~# <span class="cmd">sudo a2enmod ssl</span>
</pre>
<p>Since I&#8217;m going to run Apache and nginx, I&#8217;m going bind Apache to <em>eth0</em>.</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo pico /etc/apache2/ports.conf</span>
</pre>
<pre class="brush: plain; title: ;">
NameVirtualHost 192.168.1.200:80
Listen 192.168.1.200:80

&lt;IfModule mod_ssl.c&gt;
    Listen 192.168.1.200:443
&lt;/IfModule&gt;
</pre>
<p>Now we need to add <em>eth0</em>&#8216;s IP to the default host:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo pico /etc/apache2/sites-enabled/000-default</span>
</pre>
<pre class="brush: plain; title: ;">
&lt;VirtualHost 192.168.1.200:80&gt;
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        &lt;Directory /&gt;
                Options FollowSymLinks
                AllowOverride None
        &lt;/Directory&gt;
        &lt;Directory /var/www/&gt;
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        &lt;/Directory&gt;

        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
&lt;/VirtualHost&gt;
</pre>
<p>Restart Apache for the changes to take effect.</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo apache2ctl restart</span>
</pre>
<h3>Gearman</h3>
<p>By default, Gearman uses memory to store pending jobs in the queue, but I prefer to use MySQL for persistent storage.  To do this, first create the queue database and table:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">mysqladmin -uroot -p123123 create gearman</span>
user@ubuntu:~# <span class="cmd">mysql -uroot -p123123 -e "CREATE TABLE gearman.gearman_queue (
  unique_key VARCHAR(64) NOT NULL,
  function_name VARCHAR(255) NULL,
  priority INT NULL,
  data LONGBLOB NULL,
  PRIMARY KEY (unique_key)
) ENGINE = InnoDB;"</span>
</pre>
<p>Next update the init script to tell Gearman to use the database:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo mv /etc/default/gearman-job-server /etc/default/gearman-job-server.bak</span>
user@ubuntu:~# <span class="cmd">sudo echo &quot;PARAMS=\&quot;-q libdrizzle --libdrizzle-host=127.0.0.1&quot; \
   &quot;--libdrizzle-user=root --libdrizzle-password=123123 --libdrizzle-db=gearman&quot; \
   &quot;--libdrizzle-table=gearman_queue --libdrizzle-mysql\&quot;&quot; &gt; /etc/default/gearman-job-server</span>
user@ubuntu:~# <span class="cmd">sudo /etc/init.d/gearman-job-server restart</span>
</pre>
<h3>Gearman PHP Extension</h3>
<p>We need to download and install the Gearman PHP extension if we want to write PHP workers or post jobs to the queue.</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">cd ~/src</span>
user@ubuntu:~/src# <span class="cmd">wget http://pecl.php.net/get/gearman-0.7.0.tgz</span>
user@ubuntu:~/src# <span class="cmd">tar xzf gearman-0.7.0.tgz</span>
user@ubuntu:~/src# <span class="cmd">rm gearman-0.7.0.tgz package.xml</span>
user@ubuntu:~/src# <span class="cmd">cd gearman-0.7.0</span>
user@ubuntu:~/src# <span class="cmd">phpize</span>
user@ubuntu:~/src# <span class="cmd">./configure</span>
user@ubuntu:~/src# <span class="cmd">make</span>
user@ubuntu:~/src# <span class="cmd">sudo make install</span>
</pre>
<p>Next, add the config file to load the Gearman PHP extension:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo echo &quot;extension=gearman.so&quot; &gt;&gt; /etc/php5/conf.d/gearman.ini</span>
</pre>
<h3>memcached PHP Extension</h3>
<p>Since we have memcached and the memcached PHP extension install, let&#8217;s use it for storing session data:</p>
<pre class="terminal">
user@ubuntu:~/src# <span class="cmd">sudo echo &quot;session.save_handler = memcached
session.save_path = \&quot;127.0.0.1:11211\&quot;&quot; &gt;&gt; /etc/php5/conf.d/memcached.ini</span>
</pre>
<h3>nginx</h3>
<p>nginx is web server that is really fast.  I use nginx as my primary development web server unless I&#8217;m running a web app that only works with Apache. You can choose to install nginx from package, but I like to live life on the bleeding edge, so I&#8217;ll be building nginx from source. To install nginx, we need to download the source, compile it, install it, and configure it.</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">cd ~/src</span>
user@ubuntu:~/src# <span class="cmd">wget http://nginx.org/download/nginx-0.8.52.tar.gz</span>
user@ubuntu:~/src# <span class="cmd">tar xzf nginx-0.8.52.tar.gz</span>
user@ubuntu:~/src# <span class="cmd">rm nginx-0.8.52.tar.gz</span>
user@ubuntu:~/src# <span class="cmd">cd nginx-0.8.52</span>
user@ubuntu:~/src# <span class="cmd">mkdir /var/lib/nginx</span>
user@ubuntu:~/src# <span class="cmd">./configure \
    --sbin-path=/usr/sbin \
    --conf-path=/etc/nginx/nginx.conf \
    --error-log-path=/var/log/nginx/error.log \
    --pid-path=/var/run/nginx.pid \
    --lock-path=/var/lock/nginx.lock \
    --http-log-path=/var/log/nginx/access.log \
    --http-client-body-temp-path=/var/lib/nginx/body \
    --http-proxy-temp-path=/var/lib/nginx/proxy \
    --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
    --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
    --http-scgi-temp-path=/var/lib/nginx/scgi \
    --with-http_stub_status_module</span>
user@ubuntu:~/src# <span class="cmd">make</span>
user@ubuntu:~/src# <span class="cmd">sudo make install</span>

user@ubuntu:~# <span class="cmd">sudo pico /etc/init.d/nginx</span>
</pre>
<p>Here&#8217;s the init script that will start nginx for us:</p>
<pre class="brush: bash; title: ;">
#! /bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/nginx
NAME=nginx
DESC=nginx
test -x $DAEMON || exit 0
case &quot;$1&quot; in
  start)
        echo -n &quot;Starting $DESC: &quot;
        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
        echo &quot;$NAME.&quot;
        ;;
  stop)
        echo -n &quot;Stopping $DESC: &quot;
        start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON
        echo &quot;$NAME.&quot;
        ;;
  restart|force-reload)
        echo -n &quot;Restarting $DESC: &quot;
        start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON
        sleep 1
        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
        echo &quot;$NAME.&quot;
        ;;
  reload)
        echo -n &quot;Reloading $DESC configuration: &quot;
        start-stop-daemon --stop --signal HUP --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON
        echo &quot;$NAME.&quot;
        ;;
  *)
        echo &quot;Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}&quot; &gt;&amp;2
        exit 1
        ;;
esac
exit 0
</pre>
<p>Now we need to make the init script executable and enable it:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo chmod +x /etc/init.d/nginx</span>
user@ubuntu:~# <span class="cmd">sudo update-rc.d nginx defaults</span>

user@ubuntu:~# <span class="cmd">sudo pico /etc/nginx/nginx.conf</span>
</pre>
<p>Here&#8217;s a starter nginx.conf with some basic settings:</p>
<pre class="brush: plain; title: ;">
user  www-data www-data;
worker_processes  2;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile                on;
    tcp_nodelay             on;
    tcp_nopush              on;
    keepalive_timeout       65;
    server_name_in_redirect off;
    server_tokens           off;

    add_header Strict-Transport-Security max-age=1800;
    add_header X-Frame-Options deny;

    gzip            on;
    gzip_buffers    16 8k;
    gzip_comp_level 9;
    gzip_types      text/plain text/xml application/x-javascript text/css;

    include /etc/nginx/sites/*;
}
</pre>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo mkdir /etc/nginx/sites</span>
user@ubuntu:~# <span class="cmd">sudo pico /etc/nginx/sites/default</span>
</pre>
<p>Now we need to set up a default host that supports PHP (via <a href="http://php-fpm.org/" target="_blank">PHP-FPM, PHP&#8217;s FastCGI Process Manager</a>) and we want the default host to use the <em>eth0:1</em> IP address:</p>
<pre class="brush: plain; title: ;">
server {
    listen       192.168.1.201:80 default;
    server_name  _;
    root   /var/www;
    index  index.php;
    location / {
        if (!-e $request_filename) {
            rewrite ^/(.*)$ /index.php?q=$1 last;
            break;
        }
    }
    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name;
        include        fastcgi_params;
    }
    location ~* (\.(htaccess|engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|Entries.*|Repository|Root|Tag|Template)$ {
        deny all;
    }
}
</pre>
<p>After the config files are good to go, start nginx:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo /etc/init.d/nginx start</span>
</pre>
<h3>Service Names</h3>
<p>I also like to add service names so I can see what ports are in use when I run <em>netstat</em>. I added drizzle and Cassandra for fun despite this post not including them.</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo cp /etc/services /etc/services.bak</span>
user@ubuntu:~# <span class="cmd">su</span>
root@ubuntu:~# <span class="cmd">echo &quot;drizzle     4427/tcp
drizzle     4427/udp
memcached   11211/tcp
memcached   11211/udp
gearmand    4730/tcp
gearmand    4730/udp
fastcgi     9000/tcp
cassandra   9160/tcp&quot; &gt;&gt; /etc/services</span>
root@ubuntu:~# <span class="cmd">exit</span>
</pre>
<h3>Android SDK</h3>
<p>The Android SDK is unfortunately not in package, so you&#8217;ll need to download it from the Android Developer site: <a href="http://developer.android.com/sdk/index.html">http://developer.android.com/sdk/index.html</a>.</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">wget http://dl.google.com/android/android-sdk_r07-linux_x86.tgz</span>
user@ubuntu:~# <span class="cmd">tar xzf android-sdk_r07-linux_x86.tgz</span>
user@ubuntu:~# <span class="cmd">rm android-sdk_r07-linux_x86.tgz</span>
user@ubuntu:~# <span class="cmd">sudo mv android-sdk-linux_x86 /usr/local</span>
user@ubuntu:~# <span class="cmd">sudo find /usr/local/android-sdk-linux_x86 -type d -exec chmod 777 {} \;</span>
</pre>
<p>You&#8217;ll need to add the Android SDK path near the top of your <code>~/.bash_profile</code> <em>or</em> <code>~/.bashrc</code>:</p>
<pre class="brush: plain; title: ;">
export PATH=${PATH}:/usr/local/android-sdk-linux_x86/tools
</pre>
<p>To manage your Android SDK packages and virtual devices, you&#8217;ll need to run the <em>android</em> app:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">android</span>
</pre>
<p>First go to <em>Available Packages</em> and download version <strong>1.6</strong> <em>and</em> <strong>2.2</strong> Android SDK packages.  You can also choose to download the documentation, samples, and Google APIs.</p>
<p><img class="aligncenter" src="http://cb1inc.com/wp-content/uploads/2010/10/android4.jpg"/></p>
<p><img class="aligncenter" src="http://cb1inc.com/wp-content/uploads/2010/10/android5.jpg"/></p>
<p>Downloading the package may take several minutes. You don&#8217;t have to create a virtual device right now if you are planning on installing Appcelerator&#8217;s Titanium platform.  You can exit the Android app when you&#8217;re done.</p>
<h3>Desktop Apps</h3>
<p>If you&#8217;re running Ubuntu Desktop, there are a couple handy apps I install.  The first is Google Chrome and can be directly downloaded from the <a href="http://www.google.com/chrome/eula.html">Google Chrome download page</a>.</p>
<p>I find <em>KCachegrind</em> and <em>GHex</em> to be useful:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo apt-get install kcachegrind ghex</span>
</pre>
<h3>Appcelerator Titanium</h3>
<p>Titanium is an awesome platform for developing desktop applications for Linux, Mac OS X, and Windows as well as mobile apps for iPhone and Android. We use Titanium Developer to create Titanium projects. Begin by downloading the 64-bit version of Titanium:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">wget -O titanium.tgz http://www.appcelerator.com/download-linux64</span>
</pre>
<p>There&#8217;s also a 32-bit version available at <code>http://www.appcelerator.com/download-linux32</code>.</p>
<p>Next we unpack Titanium Developer and move it to a safe place:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">tar xzf titanium.tgz</span>
user@ubuntu:~# <span class="cmd">rm titanium.tgz</span>
</pre>
<p>Next you need to run the installer by double-clicking the <em>Titanium Developer</em> executable. Run the executable and then click the <em>Install</em> button. You can try installing to <code>/opt/titanium</code>, but you might need root privileges.</p>
<p><img class="aligncenter" src="http://cb1inc.com/wp-content/uploads/2010/10/titanium1.jpg"/></p>
<p><img class="aligncenter" src="http://cb1inc.com/wp-content/uploads/2010/10/titanium2.jpg"/></p>
<p>Next, there are a few issues with outdated libraries, so we simply delete them:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">rm ~/.titanium/runtime/linux/1.0.0/libgobject-2.0.*</span>
user@ubuntu:~# <span class="cmd">rm ~/.titanium/runtime/linux/1.0.0/libglib-2.0.*</span>
user@ubuntu:~# <span class="cmd">rm ~/.titanium/runtime/linux/1.0.0/libgio-2.0.*</span>
user@ubuntu:~# <span class="cmd">rm ~/.titanium/runtime/linux/1.0.0/libgthread-2.0.*</span>
</pre>
<p>Titanium Developer also complains if <em>/bin/java</em> doesn&#8217;t exist, so create a quick link:</p>
<pre class="terminal">
user@ubuntu:~# <span class="cmd">sudo ln -s /usr/bin/java /bin/java</span>
</pre>
<p>Relaunch Titanium Developer and enter your login credentials.  If you don&#8217;t have a login, you can get a free account.</p>
<p><img class="aligncenter" src="http://cb1inc.com/wp-content/uploads/2010/10/titanium3.jpg"/></p>
<p>After signing in, you may notice there are some updates available in the upper right corner of the window. Click in the box and the updates will be downloaded and installed.</p>
<p><img class="aligncenter" src="http://cb1inc.com/wp-content/uploads/2010/10/titanium4.jpg"/></p>
<p>Optionally you can create a launcher icon for your GNOME panel. Don&#8217;t forget to escape spaces in the command with a backslash!</p>
<p><img class="aligncenter" src="http://cb1inc.com/wp-content/uploads/2010/10/titanium5.jpg"/></p>
<h3>Finishing Touches</h3>
<p>Lastly, I like to re-arrange my desktop to maximize my coding real estate.</p>
<p><img class="aligncenter" src="http://cb1inc.com/wp-content/uploads/2010/10/ubuntu_10-10.jpg"/></p>
<h3>Conclusion</h3>
<p>That should get you up and running with a neato dev environment.  If you need to run SSL, I wrote a post on <a href="http://www.cb1inc.com/2007/05/13/creating-self-signed-certs-on-apache-2-2/">Creating Self-Signed Certs on Apache 2.2</a> and <a href="http://www.cb1inc.com/2008/09/11/virtual-hosts-and-wildcard-ssl-certificates-with-apache-2-2/">Virtual Hosts and Wildcard SSL Certificates with Apache 2.2</a>.</p>
<p>If you find any typos or additions, please feel free to sound off in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cb1inc.com/2010/10/16/cb1-ubuntu-10-10-linux-development-setup/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>High Availability with DRBD and Heartbeat Presentation</title>
		<link>http://www.cb1inc.com/2008/06/10/high-availability-with-drbd-and-heartbeat-presentation/</link>
		<comments>http://www.cb1inc.com/2008/06/10/high-availability-with-drbd-and-heartbeat-presentation/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 16:51:55 +0000</pubDate>
		<dc:creator>Chris Barber</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[drbd]]></category>
		<category><![CDATA[heartbeat]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Here's my presentation I gave June 9, 2008, at the <a href="http://mysql.meetup.com/92/">Twin Cities MySQL and PHP User Group</a> about my highly available cluster using <a href="http://www.drbd.org">DRBD</a> and <a href="http://www.linux-ha.org/Heartbeat">Heartbeat</a>.

<div style="width:425px;text-align:left" id="__ss_458973"><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=high-availability-with-drbd-heartbeat-1213116273279688-9"/><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=high-availability-with-drbd-heartbeat-1213116273279688-9" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></div>

I added a few slides and cleaned things up a bit.  The presentation went well and we had a lot of good questions.

The MySQL and PHP User Group will be taking some time off over the summer.  There will be another meetup mid-summer to come up with some ideas for future meetings.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s my presentation I gave June 9, 2008, at the <a href="http://mysql.meetup.com/92/">Twin Cities MySQL and PHP User Group</a> about my highly available cluster using <a href="http://www.drbd.org">DRBD</a> and <a href="http://www.linux-ha.org/Heartbeat">Heartbeat</a>.</p>
<div style="margin:0 auto;width:425px;"><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=high-availability-with-drbd-heartbeat-1213116273279688-9"/><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=high-availability-with-drbd-heartbeat-1213116273279688-9" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></div>
<p>I added a few slides and cleaned things up a bit.  The presentation went well and we had a lot of good questions.</p>
<p>The MySQL and PHP User Group will be taking some time off over the summer.  There will be another meetup mid-summer to come up with some ideas for future meetings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cb1inc.com/2008/06/10/high-availability-with-drbd-and-heartbeat-presentation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing DRBD 8.2.5 on Ubuntu 8.04 Hardy Heron</title>
		<link>http://www.cb1inc.com/2008/05/18/installing-drbd-8-2-5-on-ubuntu-8-04-hardy-heron/</link>
		<comments>http://www.cb1inc.com/2008/05/18/installing-drbd-8-2-5-on-ubuntu-8-04-hardy-heron/#comments</comments>
		<pubDate>Sun, 18 May 2008 17:24:03 +0000</pubDate>
		<dc:creator>Chris Barber</dc:creator>
				<category><![CDATA[drbd]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<div class="messages">
<h4>Updated! 6/6/2008</h4>
I posted the amd64 version of the compiled DRBD 8.2.5 driver at the end of this post!
</div>

DRBD is a block device driver for Linux that allows you to mirror a partition between two servers.

<div align="center"><a href="http://www.drbd.org"><img src="http://www.cb1inc.com/sites/default/blog/drbd_logo.gif"/></a></div>

I had a single application server, but whenever a server failure occurred, my websites, Subversion repository, and e-mail would go down. In order to be highly available, I added a second server in the event of a failure.

<table><thead><tr><th>app1.cb1inc.com</th><th>app2.cb1inc.com</th></tr></thead>
<tbody><tr><td>AMD Opteron 180 2.4GHz dual-core<br/>4GB RAM DDR<br/>2 x 250GB SATA 7,200 hard drives (Software RAID 1)<br/>2 x Gigabit network cards</td>
<td>AMD Sempron 2800+<br/>3GB RAM DDR<br/>250GB IDE 7,200 hard drive<br/>2 x Gigabit network cards</td></tr></tbody></table>

I don't have a ton of load, so the second server doesn't have to be super powerful.

Each machine has 2 network cards: one for public and one for private traffic.  The public interfaces connect to my main switch on the 192.168.0.X network.  The private interfaces are connected via a <a href="http://en.wikipedia.org/wiki/Ethernet_crossover_cable">crossover cable</a> on the 10.26.210.X network.

Once you have installed <a href="http://www.ubuntu.com">Ubuntu 8.04 Server</a>, you need to install some build tools.  I don't know specifically which build packages you need, so I just install a bunch of them and it should work. :)

<pre><code>apt-get install build-essential binutils cpp gcc autoconf automake1.9 libtool 
autotools-dev g++ make flex</code></pre>

In theory, that should get all of the development tools installed that you'll need.

Next we need to get the entire kernel source code.  Just the kernel headers won't cut it.  We need to compile the kernel so that it builds some of the scripts needed to compile the DRBD driver. We'll also install the ncurses library so that menuconfig works.

<pre><code>apt-get install libncurses5-dev linux-source-2.6.24</code></pre>

Then extract the kernel source:

<pre><code>cd /usr/src
tar -xvf linux-source-2.6.24.tar.bz2
cd /usr/src/linux-source-2.6.24</code></pre>

Next, lets clean up any unneeded files (which there shouldn't be any the first time):

<pre><code>make mrproper</code></pre>

Before you can build the kernel, you need to copy your existing kernel build configuration into the kernel source directory:

<pre><code>cp /boot/config-2.6.24-16-server /usr/src/linux-source-2.6.24/.config</code></pre>

Now we run the menuconfig which will read in our kernel build configuration and build some version files.  As soon as the GUI appears, just exit immediately.  You don't have to change any of the settings.

<pre><code>make menuconfig</code></pre>

Finally we need to prepare the kernel and compile it.  This will take quite some time.

<pre><code>make prepare
make</code></pre>

Now that we have the kernel source compiled and ready to go, let's get the DRBD source.

<pre><code>cd /root
wget http://oss.linbit.com/drbd/8.2/drbd-8.2.5.tar.gz
tar -xvf drbd-8.2.5.tar.gz
cd /root/drbd-8.2.5</pre></code>

We need to build the DRBD driver and specify the path to the kernel source, then install the driver in the /lib path:

<pre><code>make KDIR=/usr/src/linux-source-2.6.24
make install</code></pre>

Once the driver is compiled, we need to move/copy it to the appropriate lib directory:

<pre><code>mv /lib/modules/2.6.24.3/kernel/drivers/block/drbd.ko 
    /lib/modules/2.6.24-16-server/kernel/drivers/block</code></pre>

Next we need to start the driver and tell Linux to load it the next time it boots:

<pre><code>modprobe drbd
echo 'drbd' >> /etc/modules
update-rc.d drbd defaults</code></pre>

Now that everything is installed, verify the driver is loaded:

<pre><code>lsmod &#124; grep drbd</code></pre>

It might be a good idea to reboot and make sure it loads.

At this point, you should set up the /etc/drbd.conf, which mine looks like this:

<pre><code>global {
  usage-count no;
}

common {
  protocol C;

  syncer {
    rate 30M;
    al-extents 1801;
  }

  startup {
    wfc-timeout  0;
    degr-wfc-timeout 15;
  }

  disk {

    on-io-error   detach;
    # fencing resource-and-stonith;
  }

  net {
    sndbuf-size 512k;
    timeout        60;   #  6 seconds  (unit = 0.1 seconds)
    connect-int    10;   # 10 seconds  (unit = 1 second)
    ping-int       10;   # 10 seconds  (unit = 1 second)
    ping-timeout   5;    # 500 ms (unit = 0.1 seconds)
    max-buffers    8000;
    max-epoch-size 8000;
    cram-hmac-alg  "sha1";
    shared-secret  "secret";
  }
}

resource r0 {
  on app1 {
    disk       /dev/md2;
    address    10.26.210.10:7788;
    device     /dev/drbd0;
    meta-disk  internal;
  }

  on app2 {
    disk      /dev/sda3;
    address   10.26.210.11:7788;
    device     /dev/drbd0;
    meta-disk  internal;
  }
}</code></pre>

Notice the disk is different for each machine.  The first machine is a software raid (md) while the second is a single drive (sda).  Your setup will most likely be <code>/dev/sdaX</code> if you are using SATA or a RAID card, but it could be <code>/dev/hdaX</code>. You can use <code>cfdisk</code> to quickly check your partitions.

With the configuration set, you need to restart/reload DRBD, create the meta disk, and bring the drive up:

<pre><code>/etc/init.d/drbd restart
drbdadm create-md r0
drbdadm up r0</code></pre>

At this point you can view the DRBD status:

<pre><code>chris@app1:~$ cat /proc/drbd
version: 8.0.11 (api:86/proto:86)
GIT-hash: b3fe2bdfd3b9f7c2f923186883eb9e2a0d3a5b1b build by phil@mescal, 2008-02-12
 0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
    ns:221871972 nr:7160 dw:3856764 dr:227396211 al:763 bm:17504 lo:0 pe:0 ua:0 ap:0
	resync: used:0/31 hits:13841287 misses:13628 starving:0 dirty:0 changed:13628
	act_log: used:0/1801 hits:961638 misses:790 starving:0 dirty:27 changed:763

chris@app1:~$ /etc/init.d/drbd status
drbd driver loaded OK; device status:
version: 8.0.11 (api:86/proto:86)
GIT-hash: b3fe2bdfd3b9f7c2f923186883eb9e2a0d3a5b1b build by phil@mescal, 2008-02-12
m:res  cs         st                 ds                 p  mounted    fstype
0:r0   Connected  Primary/Secondary  UpToDate/UpToDate  C  /mnt/data  ext3
</code></pre>

You're now ready to mount <code>/dev/drbd0</code> and put data on it.  There's still a couple other things you need to do if you plan on using <a href="http://www.linux-ha.org/Heartbeat">Heartbeat</a> for failover monitoring.

<h4>Download the Driver</h4>

If you are running an amd64 architecture, you can download the already compiled driver that was built with the steps above. Just to be clear, this was compiled for Ubuntu 8.04 with the 2.6.24-16-server kernel.

<ul><li><a href="http://www.cb1inc.com/sites/default/files/drbd.ko">drbd.ko [2.9MB]</a></li></ul>

Just put the file in the drivers folder and don't forget to set the proper owner.

<pre><code>wget http://www.cb1inc.com/sites/default/files/drbd.ko
chown root:root drbd.ko
mv drbd.ko /lib/modules/2.6.24-16-server/kernel/drivers/block</code></pre>

I hope this is of some help and good luck!
]]></description>
			<content:encoded><![CDATA[<div class="messages">
<h4>Updated! 6/6/2008</h4>
<p>I posted the amd64 version of the compiled DRBD 8.2.5 driver at the end of this post!
</p></div>
<p>DRBD is a block device driver for Linux that allows you to mirror a partition between two servers.</p>
<div align="center"><a href="http://www.drbd.org"><img src="/wp-content/uploads/2009/12/drbd_logo.gif"/></a></div>
<p>I had a single application server, but whenever a server failure occurred, my websites, Subversion repository, and e-mail would go down. In order to be highly available, I added a second server in the event of a failure.</p>
<table>
<thead>
<tr>
<th>app1.cb1inc.com</th>
<th>app2.cb1inc.com</th>
</tr>
</thead>
<tbody>
<tr>
<td>AMD Opteron 180 2.4GHz dual-core<br/>4GB RAM DDR<br/>2 x 250GB SATA 7,200 hard drives (Software RAID 1)<br/>2 x Gigabit network cards</td>
<td>AMD Sempron 2800+<br/>3GB RAM DDR<br/>250GB IDE 7,200 hard drive<br/>2 x Gigabit network cards</td>
</tr>
</tbody>
</table>
<p>I don&#8217;t have a ton of load, so the second server doesn&#8217;t have to be super powerful.</p>
<p>Each machine has 2 network cards: one for public and one for private traffic.  The public interfaces connect to my main switch on the 192.168.0.X network.  The private interfaces are connected via a <a href="http://en.wikipedia.org/wiki/Ethernet_crossover_cable">crossover cable</a> on the 10.26.210.X network.</p>
<p>Once you have installed <a href="http://www.ubuntu.com">Ubuntu 8.04 Server</a>, you need to install some build tools.  I don&#8217;t know specifically which build packages you need, so I just install a bunch of them and it should work. <img src='http://www.cb1inc.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush: bash; title: ;">
apt-get install build-essential binutils cpp gcc autoconf automake1.9 libtool autotools-dev g++ make flex
</pre>
<p>In theory, that should get all of the development tools installed that you&#8217;ll need.</p>
<p>Next we need to get the entire kernel source code.  Just the kernel headers won&#8217;t cut it.  We need to compile the kernel so that it builds some of the scripts needed to compile the DRBD driver. We&#8217;ll also install the ncurses library so that menuconfig works.</p>
<pre class="brush: bash; title: ;">
apt-get install libncurses5-dev linux-source-2.6.24
</pre>
<p>Then extract the kernel source:</p>
<pre class="brush: bash; title: ;">
cd /usr/src
tar -xvf linux-source-2.6.24.tar.bz2
cd /usr/src/linux-source-2.6.24
</pre>
<p>Next, lets clean up any unneeded files (which there shouldn&#8217;t be any the first time):</p>
<pre class="brush: bash; title: ;">
make mrproper
</pre>
<p>Before you can build the kernel, you need to copy your existing kernel build configuration into the kernel source directory:</p>
<pre class="brush: bash; title: ;">
cp /boot/config-2.6.24-16-server /usr/src/linux-source-2.6.24/.config
</pre>
<p>Now we run the menuconfig which will read in our kernel build configuration and build some version files.  As soon as the GUI appears, just exit immediately.  You don&#8217;t have to change any of the settings.</p>
<pre class="brush: bash; title: ;">
make menuconfig
</pre>
<p>Finally we need to prepare the kernel and compile it.  This will take quite some time.</p>
<pre class="brush: bash; title: ;">
make prepare
make
</pre>
<p>Now that we have the kernel source compiled and ready to go, let&#8217;s get the DRBD source.</p>
<pre class="brush: bash; title: ;">
cd /root
wget http://oss.linbit.com/drbd/8.2/drbd-8.2.5.tar.gz
tar -xvf drbd-8.2.5.tar.gz
cd /root/drbd-8.2.5
</pre>
<p>We need to build the DRBD driver and specify the path to the kernel source, then install the driver in the <code>/lib</code> path:</p>
<pre class="brush: bash; title: ;">make KDIR=/usr/src/linux-source-2.6.24
make install
</pre>
<p>Once the driver is compiled, we need to move/copy it to the appropriate lib directory:</p>
<pre class="brush: bash; title: ;">mv /lib/modules/2.6.24.3/kernel/drivers/block/drbd.ko
    /lib/modules/2.6.24-16-server/kernel/drivers/block
</pre>
<p>Next we need to start the driver and tell Linux to load it the next time it boots:</p>
<pre class="brush: bash; title: ;">
modprobe drbd
echo 'drbd' &gt;&gt; /etc/modules
update-rc.d drbd defaults
</pre>
<p>Now that everything is installed, verify the driver is loaded:</p>
<pre class="brush: bash; title: ;">
lsmod | grep drbd
</pre>
<p>It might be a good idea to reboot and make sure it loads.</p>
<p>At this point, you should set up the <code>/etc/drbd.conf</code>, which mine looks like this:</p>
<pre class="brush: jscript; title: ;">
global {
  usage-count no;
}

common {
  protocol C;

  syncer {
    rate 30M;
    al-extents 1801;
  }

  startup {
    wfc-timeout  0;
    degr-wfc-timeout 15;
  }

  disk {

    on-io-error   detach;
    # fencing resource-and-stonith;
  }

  net {
    sndbuf-size 512k;
    timeout        60;   #  6 seconds  (unit = 0.1 seconds)
    connect-int    10;   # 10 seconds  (unit = 1 second)
    ping-int       10;   # 10 seconds  (unit = 1 second)
    ping-timeout   5;    # 500 ms (unit = 0.1 seconds)
    max-buffers    8000;
    max-epoch-size 8000;
    cram-hmac-alg  &quot;sha1&quot;;
    shared-secret  &quot;secret&quot;;
  }
}

resource r0 {
  on app1 {
    disk       /dev/md2;
    address    10.26.210.10:7788;
    device     /dev/drbd0;
    meta-disk  internal;
  }

  on app2 {
    disk      /dev/sda3;
    address   10.26.210.11:7788;
    device     /dev/drbd0;
    meta-disk  internal;
  }
}
</pre>
<p>Notice the disk is different for each machine.  The first machine is a software raid (md) while the second is a single drive (sda).  Your setup will most likely be <code>/dev/sdaX</code> if you are using SATA or a RAID card, but it could be <code>/dev/hdaX</code>. You can use <code>cfdisk</code> to quickly check your partitions.</p>
<p>With the configuration set, you need to restart/reload DRBD, create the meta disk, and bring the drive up:</p>
<pre class="brush: bash; title: ;">
/etc/init.d/drbd restart
drbdadm create-md r0
drbdadm up r0
</pre>
<p>At this point you can view the DRBD status:</p>
<pre class="brush: bash; title: ;">
chris@app1:~$ cat /proc/drbd
version: 8.0.11 (api:86/proto:86)
GIT-hash: b3fe2bdfd3b9f7c2f923186883eb9e2a0d3a5b1b build by phil@mescal, 2008-02-12
 0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
    ns:221871972 nr:7160 dw:3856764 dr:227396211 al:763 bm:17504 lo:0 pe:0 ua:0 ap:0
	resync: used:0/31 hits:13841287 misses:13628 starving:0 dirty:0 changed:13628
	act_log: used:0/1801 hits:961638 misses:790 starving:0 dirty:27 changed:763

chris@app1:~$ /etc/init.d/drbd status
drbd driver loaded OK; device status:
version: 8.0.11 (api:86/proto:86)
GIT-hash: b3fe2bdfd3b9f7c2f923186883eb9e2a0d3a5b1b build by phil@mescal, 2008-02-12
m:res  cs         st                 ds                 p  mounted    fstype
0:r0   Connected  Primary/Secondary  UpToDate/UpToDate  C  /mnt/data  ext3
</pre>
<p>You&#8217;re now ready to mount <code>/dev/drbd0</code> and put data on it.  There&#8217;s still a couple other things you need to do if you plan on using <a href="http://www.linux-ha.org/Heartbeat">Heartbeat</a> for failover monitoring.</p>
<h4>Download the Driver</h4>
<p>If you are running an amd64 architecture, you can download the already compiled driver that was built with the steps above. Just to be clear, this was compiled for Ubuntu 8.04 with the 2.6.24-16-server kernel.</p>
<ul>
<li><a href="/files/drbd.ko">drbd.ko [2.9MB]</a></li>
</ul>
<p>Just put the file in the drivers folder and don&#8217;t forget to set the proper owner.</p>
<pre class="brush: bash; title: ;">
wget http://www.cb1inc.com/files/drbd.ko
chown root:root drbd.ko
mv drbd.ko /lib/modules/2.6.24-16-server/kernel/drivers/block
</pre>
<p>I hope this is of some help and good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cb1inc.com/2008/05/18/installing-drbd-8-2-5-on-ubuntu-8-04-hardy-heron/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>mod_dbd MySQL Driver Woes With Ubuntu 7.04</title>
		<link>http://www.cb1inc.com/2008/04/22/mod-dbd-mysql-driver-woes-with-ubuntu-7-04/</link>
		<comments>http://www.cb1inc.com/2008/04/22/mod-dbd-mysql-driver-woes-with-ubuntu-7-04/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 16:58:53 +0000</pubDate>
		<dc:creator>Chris Barber</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Apache has a neat module called <a href="http://httpd.apache.org/docs/2.2/mod/mod_dbd.html">mod_dbd</a> that allows your Apache modules to connect to a database.  mod_dbd interfaces with apr_dbd, an Apache Portable Runtime (APR) abstraction layer around database specific drivers.

Back when Ubuntu 7.04 (fiesty) was released, a MySQL driver was not bundled with Apache for licensing concerns.  So, in order to use mod_dbd to connect to a MySQL database, you need to get the MySQL driver source code from WebThing (<a href="http://apache.webthing.com/svn/apache/apr/apr_dbd_mysql.c">apr_dbd_mysql.c</a>) and manually re-compile apr-utils.

You also need the source code for Apache 2.2.3 (which includes <a href="http://packages.ubuntu.com/gutsy/i386/libaprutil1/filelist">apr-utils</a> 1.2.7) from the Ubuntu 7.04 repositories, then copy the apr_dbd_mysql.c file into the Apache source apr-utils/dbd directory.  The Ubuntu guys made a nice INSTALL.MySQL file in the apr-utils with some basic instructions.

What they don't tell you is you need to install the MySQL source.  To make matters worse, once you install it, the apr-utils 1.2.7 configure script can't find it, even if you tell it where it is.

<pre>&#60;snip&#62;
configure: checking for mysql in /usr/src/mysql-dfsg-5.0-5.0.38/include
checking mysql.h usability... no
checking mysql.h presence... no
checking for mysql.h... no
&#60;snip&#62;</pre>

This apparently was a <a href="http://www.techlists.org/archives/web/apache-users/2006-09/msg00540.shtml">known issue</a> and was fixed in apr-utils 1.2.8.

Starting with <a href="http://svn.apache.org/viewvc/apr/apr-util/tags/1.2.11/dbd/">apr-utils 1.2.11</a>, the MySQL driver is bundled with it.  Unfortunately, even Ubuntu 7.10 (gutsy) still ships with apr-utils 1.2.7.  So, you are forced to download the source and compile.

Or, you can wait a couple days and Ubuntu 8.04 (hardy) which has <a href="http://packages.ubuntu.com/hardy/web/apache2">Apache 2.2.8</a> and <a href="http://packages.ubuntu.com/hardy/amd64/libaprutil1/filelist">apr-utils 1.2.11</a>.  In theory the MySQL driver will work out of the box.

As for me, I'll be compiling Apache, PHP, MySQL, memcached, and &#60;insert essential infrastructure software&#62; from source like I should have done in the beginning.]]></description>
			<content:encoded><![CDATA[<p>Apache has a neat module called <a href="http://httpd.apache.org/docs/2.2/mod/mod_dbd.html">mod_dbd</a> that allows your Apache modules to connect to a database.  mod_dbd interfaces with apr_dbd, an Apache Portable Runtime (APR) abstraction layer around database specific drivers.</p>
<p>Back when Ubuntu 7.04 (fiesty) was released, a MySQL driver was not bundled with Apache for licensing concerns.  So, in order to use mod_dbd to connect to a MySQL database, you need to get the MySQL driver source code from WebThing (<a href="http://apache.webthing.com/svn/apache/apr/apr_dbd_mysql.c">apr_dbd_mysql.c</a>) and manually re-compile apr-utils.</p>
<p>You also need the source code for Apache 2.2.3 (which includes <a href="http://packages.ubuntu.com/gutsy/i386/libaprutil1/filelist">apr-utils</a> 1.2.7) from the Ubuntu 7.04 repositories, then copy the apr_dbd_mysql.c file into the Apache source apr-utils/dbd directory.  The Ubuntu guys made a nice INSTALL.MySQL file in the apr-utils with some basic instructions.</p>
<p>What they don&#8217;t tell you is you need to install the MySQL source.  To make matters worse, once you install it, the apr-utils 1.2.7 configure script can&#8217;t find it, even if you tell it where it is.</p>
<pre>&lt;snip&gt;
configure: checking for mysql in /usr/src/mysql-dfsg-5.0-5.0.38/include
checking mysql.h usability... no
checking mysql.h presence... no
checking for mysql.h... no
&lt;snip&gt;</pre>
<p>This apparently was a <a href="http://www.techlists.org/archives/web/apache-users/2006-09/msg00540.shtml">known issue</a> and was fixed in apr-utils 1.2.8.</p>
<p>Starting with <a href="http://svn.apache.org/viewvc/apr/apr-util/tags/1.2.11/dbd/">apr-utils 1.2.11</a>, the MySQL driver is bundled with it.  Unfortunately, even Ubuntu 7.10 (gutsy) still ships with apr-utils 1.2.7.  So, you are forced to download the source and compile.</p>
<p>Or, you can wait a couple days and Ubuntu 8.04 (hardy) which has <a href="http://packages.ubuntu.com/hardy/web/apache2">Apache 2.2.8</a> and <a href="http://packages.ubuntu.com/hardy/amd64/libaprutil1/filelist">apr-utils 1.2.11</a>.  In theory the MySQL driver will work out of the box.</p>
<p>As for me, I&#8217;ll be compiling Apache, PHP, MySQL, memcached, and &lt;insert essential infrastructure software&gt; from source like I should have done in the beginning.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cb1inc.com/2008/04/22/mod-dbd-mysql-driver-woes-with-ubuntu-7-04/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a Hello World! Apache Module with KDevelop on Ubuntu</title>
		<link>http://www.cb1inc.com/2007/12/24/creating-a-hello-world-apache-module-with-kdevelop-on-ubuntu/</link>
		<comments>http://www.cb1inc.com/2007/12/24/creating-a-hello-world-apache-module-with-kdevelop-on-ubuntu/#comments</comments>
		<pubDate>Mon, 24 Dec 2007 10:06:55 +0000</pubDate>
		<dc:creator>Chris Barber</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[kdevelop]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<iframe src="http://rcm.amazon.com/e/cm?t=ci09-20&#038;o=1&#038;p=8&#038;l=as1&#038;asins=0132409674&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;lc1=0000FF&#038;bc1=999999&#038;bg1=F6F6F6&#038;f=ifr" style="float:right;width:120px;height:240px;margin-left:10px;margin-bottom:10px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>

<p>The <a href="http://httpd.apache.org/">Apache HTTP Web Server</a> is a powerful and extensible web server that is the "A" in "LAMP". One of the neat things about Apache is its API for writing custom modules.</p>

<p><a href="http://people.apache.org/~niq/">Nick Kew</a> wrote an excellent book called <a href="http://www.amazon.com/dp/0132409674?tag=ci09-20&#038;camp=14573&#038;creative=327641&#038;linkCode=as1&#038;creativeASIN=0132409674&#038;adid=1MDYV18CJT05FYHY83PH&#038;">The Apache Modules Book</a>. Anyone who is serious about Apache module development must buy this book.</p>

<p>Modules can be written a number of ways, but the most common way is to use the C programming language. For an C/C++ development IDE, I use <a href="http://www.kdevelop.org/">KDevelop</a>. It is pretty easy to use once you figure out what you need to do.</p>

<p>It is possible to write modules in C++, but I don't recommend it if your module's source can't be contained in a single source file. There's all sorts of interesting issues with exported symbols and static function declarations. Another reason to stick with C is pretty much all core modules and examples are written using C. You may give it a try and determine that it works just fine for your project.</p>

<h4>Prerequisites</h4>

<p>Before you begin, there is a handful of applications and libraries you must have installed:
<ul>
<li>Apache 2</li>
<li>KDevelop 3.4</li>
<li>GCC (bundled with "build-essential" package)</li>
<li>automake</li>
<li>autoconf</li>
</ul></p>

<h4>Creating the Project</h4>

<p>Launch KDevelop and select "New Project" from the Project menu. Since we are focusing on using C, select "Simple Hello world program" under the "C" folder. Give your module an "Application name" and specify the location to create the project.</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-new-project-01.png" alt="KDevelop New Project"/></div>

<p>On the next page of the wizard, you must enter your name, but your email address is not required.</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-new-project-02.png" alt="KDevelop New Project"/></div>

<p>The next couple wizard screens ask about version control and source templates. After finishing the wizard, you will be back at the IDE with the new project created.</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-ide.png" alt="KDevelop IDE"/></div>

<h4>The Code</h4>

<p>Delete all of the source code that the editor created. Next paste the following code which originated from Nick's version on <a href="http://www.apachetutor.org/book/">The Apache Modules Book Companion site</a>.</p>

<pre>#include &#60;httpd.h&#62;
#include &#60;http_protocol.h&#62;
#include &#60;http_config.h&#62;

static int helloworld_handler(request_rec* r)
{
	if (!r-&#62;handler &#124;&#124; strcmp(r-&#62;handler, "helloworld"))
		return DECLINED;
	
	if (r-&#62;method_number != M_GET)
		return HTTP_METHOD_NOT_ALLOWED;
	
	ap_set_content_type(r, "text/html;charset=ascii");
	ap_rputs("&#60;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"&#62;n", r);
	ap_rputs("&#60;html&#62;&#60;head&#62;&#60;title&#62;Hello World!&#60;/title&#62;&#60;/head&#62;", r);
	ap_rputs("&#60;body&#62;&#60;h1&#62;Hello World!&#60;/h1&#62;&#60;/body&#62;&#60;/html&#62;", r);
	return OK;
}

static void register_hooks(apr_pool_t* pool)
{
	ap_hook_handler(helloworld_handler, NULL, NULL, APR_HOOK_MIDDLE);
}

module AP_MODULE_DECLARE_DATA helloworld_module = {
	STANDARD20_MODULE_STUFF,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	register_hooks
};
</pre>

<h4>Configuring the Project</h4>

<p>Next we need to reconfigure the build target to create a library instead of a normal program. Right-click the build target and click "Remove":</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-remove-target.png" alt="Remove build target"/></div>

<p>When the dialog displays, uncheck the "Also remove from disk" option before clicking "OK". Now we need to add a new build target. Right-click the "src" folder and select "Add Target":</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-add-target-01.png" alt="Add new build target"/></div>

<p>From the "Add Target" dialog, change the type to "Libtool Library" and enter the name of the module. Also check the "-avoid-version" and "-module" options.</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-add-target-02.png" alt="Add new build target dialog"/></div>

<p>As soon as the target is created, right-click on it and make sure the checked options saved properly.  Right-click on the target again and select "Make Target Active":</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-make-target-active.png" alt="Make target active"/></div>

<p>Edit the project's options by right-clicking the "src" folder and selecting "Options":</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-project-options-01.png" alt="Src dropdown menu"/></div>

<p>Since this is a C project, we want to add the following options to the "CFLAGS" field:</p>

<pre>-DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -pthread</pre>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-project-options-02.png" alt="Options - Compiler"/></div>

<p>From the "Includes" tab, add the following outside include directories:
<ul><li>/usr/includes/apr-1.0</li><li>/usr/includes/apache2</li></ul>
</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-project-options-03.png" alt="Options - Includes"/></div>

<p>Reorder the include paths so that "$(all_includes)" is first. Due to a bug or poor design, you must edit the two paths you just added and prepend a "-I":</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-project-options-04.png" alt="Include path prepend -I"/></div>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-project-options-05.png" alt="Include path prepend -I"/></div>

<p>Since we deleted the old build target, we need to add the source files to the target by right-clicking the target and selecting "Add Existing Files":</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-add-files-01.png" alt="Adding files to target"/></div>

<p>From the dialog, drag and drop the files you want to be apart of the target. For this simple example, we only move the "mod_helloworld.c" file.</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-add-files-02.png" alt="Adding files to target"/></div>

<h4>Building the Project</h4>

<p>We are all set to compile the project. From the "Build" menu, select "Build Active Target":</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-build-01.png" alt="Building the active target"/></div>

<p>If this is the first time you are performing the build, KDevelop will prompt you whether or not you want to run automake. Click the "Run Them" button to continue.</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-build-02.png" alt="Run automake dialog"/></div>

<p>When the build is finished, the "Messages" panel will show up and display the build results. If everything went as planned, the output will say the build was successful.</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-build-03.png" alt="Build results"/></div>

<h4>Deploying the Module</h4>

<p>The build process put the shared library file in the following location (assuming debug build):</p>

<pre>/path/to/mod_helloworld/debug/src/.libs/libmod_helloworld</pre>

<p>We need to install that file in the Apache modules directory which on Ubuntu is:</p>

<pre>/usr/lib/apache2/modules</pre>

<p>From a terminal, run the following command as root or sudo:</p>

<pre>cp /path/to/mod_helloworld/debug/src/.libs/libmod_helloworld 
    /usr/lib/apache2/modules/mod_helloworld.so</pre>

<p>Next you'll need to edit the Apache configuration file. In Ubuntu, the file is located at:

<pre>/etc/apache2/apache2.conf</pre>

<p>You need to add the <code>LoadModule</code> and <code>&#60;Location&#62;</code> directives so Apache knows when to invoke the module.</p>

<pre>LoadModule helloworld_module /usr/lib/apache2/modules/mod_helloworld.so
&#60;Location /helloworld&#62;
    SetHandler helloworld
&#60;/Location&#62;</pre>

<p>I've had spotty luck where to actually insert those settings. After the <code>LogLevel</code>, but before any other <code>LoadModule</code> entries seems to work for me. After you save the changes, restart Apache using the following command as root or sudo:</p>

<pre>apache2ctl restart</pre>

<p>If your Apache acts funny, try restarting it again.</p>

<h4>Testing the Module</h4>

<p>The last step is to test the module. Open up your favorite web browser and hit <code>http://localhost/helloworld</code>:</p>

<div align="center"><img src="http://cb1inc.com/sites/default/blog/20071224-browser.png" alt="Hello World in Firefox"/></div>

<p>If everything worked, you should see something similar to the image above.</p>

<h4>Where To Go From Here</h4>

<p>We have only scratched the surface. The Apache Portable Runtime (APR) provides a ton of functionality that makes developing modules much easier. <a href="http://www.amazon.com/dp/0132409674?tag=ci09-20&#038;camp=14573&#038;creative=327641&#038;linkCode=as1&#038;creativeASIN=0132409674&#038;adid=1MDYV18CJT05FYHY83PH&#038;">The Apache Modules Book</a> dives into several topics such as configuration settings, content generators, filters, and database connectivity.</p>

<p>Another great resource is Apache's own module source code in their Subversion repository: <a href="http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/">http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/</a>.</p>

]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://rcm.amazon.com/e/cm?t=ci09-20&#038;o=1&#038;p=8&#038;l=as1&#038;asins=0132409674&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;lc1=0000FF&#038;bc1=999999&#038;bg1=F6F6F6&#038;f=ifr" style="float:right;width:120px;height:240px;margin-left:10px;margin-bottom:10px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>
<p>The <a href="http://httpd.apache.org/">Apache HTTP Web Server</a> is a powerful and extensible web server that is the &#8220;A&#8221; in &#8220;LAMP&#8221;. One of the neat things about Apache is its API for writing custom modules.</p>
<p><a href="http://people.apache.org/~niq/">Nick Kew</a> wrote an excellent book called <a href="http://www.amazon.com/dp/0132409674?tag=ci09-20&#038;camp=14573&#038;creative=327641&#038;linkCode=as1&#038;creativeASIN=0132409674&#038;adid=1MDYV18CJT05FYHY83PH&#038;">The Apache Modules Book</a>. Anyone who is serious about Apache module development must buy this book.</p>
<p>Modules can be written a number of ways, but the most common way is to use the C programming language. For an C/C++ development IDE, I use <a href="http://www.kdevelop.org/">KDevelop</a>. It is pretty easy to use once you figure out what you need to do.</p>
<p>It is possible to write modules in C++, but I don&#8217;t recommend it if your module&#8217;s source can&#8217;t be contained in a single source file. There&#8217;s all sorts of interesting issues with exported symbols and static function declarations. Another reason to stick with C is pretty much all core modules and examples are written using C. You may give it a try and determine that it works just fine for your project.</p>
<h4>Prerequisites</h4>
<p>Before you begin, there is a handful of applications and libraries you must have installed:</p>
<ul>
<li>Apache 2</li>
<li>KDevelop 3.4</li>
<li>GCC (bundled with &#8220;build-essential&#8221; package)</li>
<li>automake</li>
<li>autoconf</li>
</ul>
<h4>Creating the Project</h4>
<p>Launch KDevelop and select &#8220;New Project&#8221; from the Project menu. Since we are focusing on using C, select &#8220;Simple Hello world program&#8221; under the &#8220;C&#8221; folder. Give your module an &#8220;Application name&#8221; and specify the location to create the project.</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-new-project-01.png" alt="KDevelop New Project"/></div>
<p>On the next page of the wizard, you must enter your name, but your email address is not required.</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-new-project-02.png" alt="KDevelop New Project"/></div>
<p>The next couple wizard screens ask about version control and source templates. After finishing the wizard, you will be back at the IDE with the new project created.</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-ide.png" alt="KDevelop IDE"/></div>
<h4>The Code</h4>
<p>Delete all of the source code that the editor created. Next paste the following code which originated from Nick&#8217;s version on <a href="http://www.apachetutor.org/book/">The Apache Modules Book Companion site</a>.</p>
<pre class="brush: cpp; title: ;">
#include &lt;httpd.h&gt;
#include &lt;http_protocol.h&gt;
#include &lt;http_config.h&gt;

static int helloworld_handler(request_rec* r)
{
	if (!r-&gt;handler || strcmp(r-&gt;handler, &quot;helloworld&quot;))
		return DECLINED;

	if (r-&gt;method_number != M_GET)
		return HTTP_METHOD_NOT_ALLOWED;

	ap_set_content_type(r, &quot;text/html;charset=ascii&quot;);
	ap_rputs(&quot;&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;&gt;n&quot;, r);
	ap_rputs(&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;Hello World!&lt;/title&gt;&lt;/head&gt;;&quot;, r);
	ap_rputs(&quot;&lt;body&gt;&lt;h1&gt;Hello World!&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;&quot;, r);
	return OK;
}

static void register_hooks(apr_pool_t* pool)
{
	ap_hook_handler(helloworld_handler, NULL, NULL, APR_HOOK_MIDDLE);
}

module AP_MODULE_DECLARE_DATA helloworld_module = {
	STANDARD20_MODULE_STUFF,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	register_hooks
};
</pre>
<h4>Configuring the Project</h4>
<p>Next we need to reconfigure the build target to create a library instead of a normal program. Right-click the build target and click &#8220;Remove&#8221;:</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-remove-target.png" alt="Remove build target"/></div>
<p>When the dialog displays, uncheck the &#8220;Also remove from disk&#8221; option before clicking &#8220;OK&#8221;. Now we need to add a new build target. Right-click the &#8220;src&#8221; folder and select &#8220;Add Target&#8221;:</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-add-target-01.png" alt="Add new build target"/></div>
<p>From the &#8220;Add Target&#8221; dialog, change the type to &#8220;Libtool Library&#8221; and enter the name of the module. Also check the &#8220;-avoid-version&#8221; and &#8220;-module&#8221; options.</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-add-target-02.png" alt="Add new build target dialog"/></div>
<p>As soon as the target is created, right-click on it and make sure the checked options saved properly.  Right-click on the target again and select &#8220;Make Target Active&#8221;:</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-make-target-active.png" alt="Make target active"/></div>
<p>Edit the project&#8217;s options by right-clicking the &#8220;src&#8221; folder and selecting &#8220;Options&#8221;:</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-project-options-01.png" alt="Src dropdown menu"/></div>
<p>Since this is a C project, we want to add the following options to the &#8220;CFLAGS&#8221; field:</p>
<pre class="brush: plain; title: ;">
-DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -pthread
</pre>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-project-options-02.png" alt="Options - Compiler"/></div>
<p>From the &#8220;Includes&#8221; tab, add the following outside include directories:</p>
<ul>
<li>/usr/includes/apr-1.0</li>
<li>/usr/includes/apache2</li>
</ul>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-project-options-03.png" alt="Options - Includes"/></div>
<p>Reorder the include paths so that &#8220;$(all_includes)&#8221; is first. Due to a bug or poor design, you must edit the two paths you just added and prepend a &#8220;-I&#8221;:</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-project-options-04.png" alt="Include path prepend -I"/></div>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-project-options-05.png" alt="Include path prepend -I"/></div>
<p>Since we deleted the old build target, we need to add the source files to the target by right-clicking the target and selecting &#8220;Add Existing Files&#8221;:</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-add-files-01.png" alt="Adding files to target"/></div>
<p>From the dialog, drag and drop the files you want to be apart of the target. For this simple example, we only move the &#8220;mod_helloworld.c&#8221; file.</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-add-files-02.png" alt="Adding files to target"/></div>
<h4>Building the Project</h4>
<p>We are all set to compile the project. From the &#8220;Build&#8221; menu, select &#8220;Build Active Target&#8221;:</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-build-01.png" alt="Building the active target"/></div>
<p>If this is the first time you are performing the build, KDevelop will prompt you whether or not you want to run automake. Click the &#8220;Run Them&#8221; button to continue.</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-build-02.png" alt="Run automake dialog"/></div>
<p>When the build is finished, the &#8220;Messages&#8221; panel will show up and display the build results. If everything went as planned, the output will say the build was successful.</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-build-03.png" alt="Build results"/></div>
<h4>Deploying the Module</h4>
<p>The build process put the shared library file in the following location (assuming debug build):</p>
<pre class="brush: plain; title: ;">
/path/to/mod_helloworld/debug/src/.libs/libmod_helloworld
</pre>
<p>We need to install that file in the Apache modules directory which on Ubuntu is:</p>
<pre class="brush: plain; title: ;">
/usr/lib/apache2/modules
</pre>
<p>From a terminal, run the following command as root or sudo:</p>
<pre class="brush: plain; title: ;">
cp /path/to/mod_helloworld/debug/src/.libs/libmod_helloworld /usr/lib/apache2/modules/mod_helloworld.so
</pre>
<p>Next you&#8217;ll need to edit the Apache configuration file. In Ubuntu, the file is located at:</p>
<pre class="brush: plain; title: ;">
/etc/apache2/apache2.conf
</pre>
<p>You need to add the <code>LoadModule</code> and <code>&lt;Location&gt;</code> directives so Apache knows when to invoke the module.</p>
<pre class="brush: plain; title: ;">
LoadModule helloworld_module /usr/lib/apache2/modules/mod_helloworld.so
&lt;Location /helloworld&gt;
    SetHandler helloworld
&lt;/Location&gt;
</pre>
<p>I&#8217;ve had spotty luck where to actually insert those settings. After the <code>LogLevel</code>, but before any other <code>LoadModule</code> entries seems to work for me. After you save the changes, restart Apache using the following command as root or sudo:</p>
<pre class="brush: plain; title: ;">
apache2ctl restart
</pre>
<p>If your Apache acts funny, try restarting it again.</p>
<h4>Testing the Module</h4>
<p>The last step is to test the module. Open up your favorite web browser and hit <code>http://localhost/helloworld</code>:</p>
<div align="center"><img src="/wp-content/uploads/2009/12/20071224-browser.png" alt="Hello World in Firefox"/></div>
<p>If everything worked, you should see something similar to the image above.</p>
<h4>Where To Go From Here</h4>
<p>We have only scratched the surface. The Apache Portable Runtime (APR) provides a ton of functionality that makes developing modules much easier. <a href="http://www.amazon.com/dp/0132409674?tag=ci09-20&#038;camp=14573&#038;creative=327641&#038;linkCode=as1&#038;creativeASIN=0132409674&#038;adid=1MDYV18CJT05FYHY83PH&#038;">The Apache Modules Book</a> dives into several topics such as configuration settings, content generators, filters, and database connectivity.</p>
<p>Another great resource is Apache&#8217;s own module source code in their Subversion repository: <a href="http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/">http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cb1inc.com/2007/12/24/creating-a-hello-world-apache-module-with-kdevelop-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ubuntu Live Day 1 Recap</title>
		<link>http://www.cb1inc.com/2007/07/23/ubuntu-live-day-1-recap/</link>
		<comments>http://www.cb1inc.com/2007/07/23/ubuntu-live-day-1-recap/#comments</comments>
		<pubDate>Mon, 23 Jul 2007 14:09:51 +0000</pubDate>
		<dc:creator>Chris Barber</dc:creator>
				<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Day 1 of the <a href="http://www.ubuntulive.com" target="_blank">Ubuntu Live</a> conference is over and I can't believe how worthless the sessions were.  The keynotes and networking was great, but the sessions just sucked.

<h4>Keynotes</h4>
The whole day was kicked off by the main guy at Ubuntu, Mark Shuttleworth.  According to Mark, we can expect another LTS (long-term support) release of Ubuntu around April 2008.  Eben Moglen also gave an awesome keynote and it's absolutely great to hear him speak about his thoughts of Redmond.  I have to say that the keynotes, which typically put me to sleep, were really quite good.  The speakers were funny, energetic, and interesting.

<h4>Sessions</h4>
I don't think I learned a thing.  It's either the content was way to high level or they never really got around to what the session was about.  I think part of the problem was 30 minute sessions.  This should have been closer to 45-50 minutes instead.  All in all, the sessions were a big let down.

<h4>Other Highlights</h4>
But not all sucked.  I got to meet Mark Shuttleworth, which was cool.  I also got to personally meet Eben Moglen, the legal genius behind GPL3.  I met lots of cool attendees from all over: Wired, Ars Technica, Google, and many more.  I got to hold a <a href="http://www.laptop.org/" target="_blank">OLPC</a>, which was pretty cool.  The most memorable moment of the day was meeting Mårten Mickos, the CEO of MySQL AB.  He was extremely approachable and great to talk to.  He didn't have one of those big CEO heads.  Just a great guy and I look forward to the next time our paths cross.]]></description>
			<content:encoded><![CDATA[<p>Day 1 of the <a href="http://www.ubuntulive.com" target="_blank">Ubuntu Live</a> conference is over and I can&#8217;t believe how worthless the sessions were.  The keynotes and networking was great, but the sessions just sucked.</p>
<h4>Keynotes</h4>
<p>The whole day was kicked off by the main guy at Ubuntu, Mark Shuttleworth.  According to Mark, we can expect another LTS (long-term support) release of Ubuntu around April 2008.  Eben Moglen also gave an awesome keynote and it&#8217;s absolutely great to hear him speak about his thoughts of Redmond.  I have to say that the keynotes, which typically put me to sleep, were really quite good.  The speakers were funny, energetic, and interesting.</p>
<h4>Sessions</h4>
<p>I don&#8217;t think I learned a thing.  It&#8217;s either the content was way to high level or they never really got around to what the session was about.  I think part of the problem was 30 minute sessions.  This should have been closer to 45-50 minutes instead.  All in all, the sessions were a big let down.</p>
<h4>Other Highlights</h4>
<p>But not all sucked.  I got to meet Mark Shuttleworth, which was cool.  I also got to personally meet Eben Moglen, the legal genius behind GPL3.  I met lots of cool attendees from all over: Wired, Ars Technica, Google, and many more.  I got to hold a <a href="http://www.laptop.org/" target="_blank">OLPC</a>, which was pretty cool.  The most memorable moment of the day was meeting Mårten Mickos, the CEO of MySQL AB.  He was extremely approachable and great to talk to.  He didn&#8217;t have one of those big CEO heads.  Just a great guy and I look forward to the next time our paths cross.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cb1inc.com/2007/07/23/ubuntu-live-day-1-recap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Live and OSCON</title>
		<link>http://www.cb1inc.com/2007/07/22/ubuntu-live-and-oscon/</link>
		<comments>http://www.cb1inc.com/2007/07/22/ubuntu-live-and-oscon/#comments</comments>
		<pubDate>Sun, 22 Jul 2007 14:10:52 +0000</pubDate>
		<dc:creator>Chris Barber</dc:creator>
				<category><![CDATA[oscon]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[About 2 months ago, <a href="http://cb1inc.com/2007/05/31/oscon-2007">I wrote</a> that I was heading to Portland for the O'Reilly Open Source Conference.  It turns out that O'Reilly is also hosting another conference about <a href="http://www.ubuntu.com" target="_blank">Ubuntu</a>, a very popular Linux distro.

When I signed up for OSCON, I elected to go to the tutorials, which consists for 4 tutorials spanned across 2 days.  Well, 2 of the 4 tutorials I signed up for were canceled.  Needless to say, I'm pretty bummed out.  But O'Reilly was nice enough to get me into the <a href="http://www.ubuntulive.com/" target="_blank">Ubuntu Live</a> Sunday, July 22nd, 2007.

So, here's the plan thus far for the first part of the week:

<h4>Sunday, July 22nd - Ubuntu Live</h4><table style="width:auto;">
<tbody><tr><td>8:00am - 9:00am</td><td>Breakfast</td></tr>
<tr><td>9:00am - 10:30am</td><td>Keynote: Mark Shuttleworth</td></tr>
<tr><td></td><td>Keynote: Stephen O'Grady</td></tr>
<tr><td></td><td>Keynote: Jeff Waugh</td></tr>
<tr><td>10:30am - 11:00am</td><td>Break</td></tr>
<tr><td>11:00am - 11:30am</td><td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/14444" target="_blank">Managing, maintaining, and securing Ubuntu machines</a></td></tr>
<tr><td>11:30am - 11:35am</td><td>Break</td></tr>
<tr><td>11:35am - 12:05pm</td><td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/13499" target="_blank">The 3 laws of IT and how open source can benefit</a></td></tr>
<tr><td>12:05pm - 12:10pm</td><td>Break</td></tr>
<tr><td>12:10pm - 12:40pm</td><td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/14435" target="_blank">The bleeding edge</a></td></tr>
<tr><td>12:40pm - 2:00pm</td><td>Lunch</td></tr>
<tr><td>2:00pm - 3:00pm</td><td> Keynote: Eben Moglen</td></tr>
<tr><td></td><td>Keynote: Mitchell Kapor</td></tr>
<tr><td></td><td>Keynote: Jim Zemlin</td></tr>
<tr><td>3:00pm - 3:30pm</td><td>Break</td></tr>
<tr><td>3:30pm - 4:00pm</td><td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/13488" target="_blank">Getting started with virtualization on Ubuntu</a></td></tr>
<tr><td>4:00pm - 4:05pm</td><td>Break</td></tr>
<tr><td>4:05pm - 4:35pm</td><td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/14441" target="_blank">Providing Your Software to Ubuntu Users</a></td></tr>
<tr><td>4:35pm - 4:40pm</td><td>Break</td></tr>
<tr><td>4:40pm - 5:10pm</td><td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/13503" target="_blank">Case studies: building virtual machines</a></td></tr>
<tr><td>5:10pm - 5:15pm</td><td>Break</td></tr>
<tr><td>5:15pm - 5:45pm</td><td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/13465" target="_blank">Success with Desktop Linux: Making Operating System Choice Irrelevant</a></td></tr>
<tr><td>6:00pm - 8:00pm</td><td>Food and fun</td></tr>
</tbody></table>

<h4>Monday, July 23rd - OSCON Tutorials</h4><table style="width:auto;"><tbody>
<tr><td>7:30am - 8:30am</td><td>Breakfast</td></tr>
<tr><td>8:30am - 12:00pm</td><td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/12829" target="_blank">Pthreads programming</a></td></tr>
<tr><td>12:00pm - 1:30pm</td><td>Lunch</td></tr>
<tr><td>1:30pm - 5:00pm</td><td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/12174" target="_blank">Linux performance monitoring</a></td></tr>
</tbody></table>

<h4>Tuesday, July 24th - OSCON Tutorials</h4><table style="width:auto;"><tbody>
<tr><td>7:30am - 8:30am</td><td>Breakfast</td></tr>
<tr><td>8:30am - 12:00pm</td><td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/13163" target="_blank">New parallel programming tools for a multicore world</a></td></tr>
<tr><td>12:00pm - 1:30pm</td><td>Lunch</td></tr>
<tr><td>1:30pm - 5:00pm</td><td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/12402" target="_blank">Creating a Linux based software appliance for SMBs</a></td></tr>
<tr><td>5:00pm - 6:00pm</td><td>Break</td></tr>
<tr><td>6:00pm - 7:00pm</td><td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/14747" target="_blank">Powell's technical books events</a></td></tr>
<tr><td>7:30pm - 10:00pm</td><td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/14294" target="_blank">Meet 'n Geek</a></td></tr>
<tr><td>8:00pm - 8:30pm</td><td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/14358" target="_blank">Google O'Reilly Open Source Awards</a></td></tr>
</tbody></table>

In the spare time, I plan to hit up the Expo and see if there is anything good.  I'm going to follow this plan, but if something else better comes up, I'll change things up a bit.  Stay tuned for more coverage of both the Ubuntu Live Conference and the Open Source Conference!]]></description>
			<content:encoded><![CDATA[<p>About 2 months ago, <a href="/2007/05/31/oscon-2007">I wrote</a> that I was heading to Portland for the O&#8217;Reilly Open Source Conference.  It turns out that O&#8217;Reilly is also hosting another conference about <a href="http://www.ubuntu.com" target="_blank">Ubuntu</a>, a very popular Linux distro.</p>
<p>When I signed up for OSCON, I elected to go to the tutorials, which consists for 4 tutorials spanned across 2 days.  Well, 2 of the 4 tutorials I signed up for were canceled.  Needless to say, I&#8217;m pretty bummed out.  But O&#8217;Reilly was nice enough to get me into the <a href="http://www.ubuntulive.com/" target="_blank">Ubuntu Live</a> Sunday, July 22nd, 2007.</p>
<p>So, here&#8217;s the plan thus far for the first part of the week:</p>
<h4>Sunday, July 22nd &#8211; Ubuntu Live</h4>
<table style="width:auto;">
<tbody>
<tr>
<td>8:00am &#8211; 9:00am</td>
<td>Breakfast</td>
</tr>
<tr>
<td>9:00am &#8211; 10:30am</td>
<td>Keynote: Mark Shuttleworth</td>
</tr>
<tr>
<td></td>
<td>Keynote: Stephen O&#8217;Grady</td>
</tr>
<tr>
<td></td>
<td>Keynote: Jeff Waugh</td>
</tr>
<tr>
<td>10:30am &#8211; 11:00am</td>
<td>Break</td>
</tr>
<tr>
<td>11:00am &#8211; 11:30am</td>
<td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/14444" target="_blank">Managing, maintaining, and securing Ubuntu machines</a></td>
</tr>
<tr>
<td>11:30am &#8211; 11:35am</td>
<td>Break</td>
</tr>
<tr>
<td>11:35am &#8211; 12:05pm</td>
<td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/13499" target="_blank">The 3 laws of IT and how open source can benefit</a></td>
</tr>
<tr>
<td>12:05pm &#8211; 12:10pm</td>
<td>Break</td>
</tr>
<tr>
<td>12:10pm &#8211; 12:40pm</td>
<td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/14435" target="_blank">The bleeding edge</a></td>
</tr>
<tr>
<td>12:40pm &#8211; 2:00pm</td>
<td>Lunch</td>
</tr>
<tr>
<td>2:00pm &#8211; 3:00pm</td>
<td> Keynote: Eben Moglen</td>
</tr>
<tr>
<td></td>
<td>Keynote: Mitchell Kapor</td>
</tr>
<tr>
<td></td>
<td>Keynote: Jim Zemlin</td>
</tr>
<tr>
<td>3:00pm &#8211; 3:30pm</td>
<td>Break</td>
</tr>
<tr>
<td>3:30pm &#8211; 4:00pm</td>
<td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/13488" target="_blank">Getting started with virtualization on Ubuntu</a></td>
</tr>
<tr>
<td>4:00pm &#8211; 4:05pm</td>
<td>Break</td>
</tr>
<tr>
<td>4:05pm &#8211; 4:35pm</td>
<td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/14441" target="_blank">Providing Your Software to Ubuntu Users</a></td>
</tr>
<tr>
<td>4:35pm &#8211; 4:40pm</td>
<td>Break</td>
</tr>
<tr>
<td>4:40pm &#8211; 5:10pm</td>
<td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/13503" target="_blank">Case studies: building virtual machines</a></td>
</tr>
<tr>
<td>5:10pm &#8211; 5:15pm</td>
<td>Break</td>
</tr>
<tr>
<td>5:15pm &#8211; 5:45pm</td>
<td><a href="http://www.ubuntulive.com/cs/ubuntu/view/e_sess/13465" target="_blank">Success with Desktop Linux: Making Operating System Choice Irrelevant</a></td>
</tr>
<tr>
<td>6:00pm &#8211; 8:00pm</td>
<td>Food and fun</td>
</tr>
</tbody>
</table>
<h4>Monday, July 23rd &#8211; OSCON Tutorials</h4>
<table style="width:auto;">
<tbody>
<tr>
<td>7:30am &#8211; 8:30am</td>
<td>Breakfast</td>
</tr>
<tr>
<td>8:30am &#8211; 12:00pm</td>
<td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/12829" target="_blank">Pthreads programming</a></td>
</tr>
<tr>
<td>12:00pm &#8211; 1:30pm</td>
<td>Lunch</td>
</tr>
<tr>
<td>1:30pm &#8211; 5:00pm</td>
<td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/12174" target="_blank">Linux performance monitoring</a></td>
</tr>
</tbody>
</table>
<h4>Tuesday, July 24th &#8211; OSCON Tutorials</h4>
<table style="width:auto;">
<tbody>
<tr>
<td>7:30am &#8211; 8:30am</td>
<td>Breakfast</td>
</tr>
<tr>
<td>8:30am &#8211; 12:00pm</td>
<td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/13163" target="_blank">New parallel programming tools for a multicore world</a></td>
</tr>
<tr>
<td>12:00pm &#8211; 1:30pm</td>
<td>Lunch</td>
</tr>
<tr>
<td>1:30pm &#8211; 5:00pm</td>
<td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/12402" target="_blank">Creating a Linux based software appliance for SMBs</a></td>
</tr>
<tr>
<td>5:00pm &#8211; 6:00pm</td>
<td>Break</td>
</tr>
<tr>
<td>6:00pm &#8211; 7:00pm</td>
<td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/14747" target="_blank">Powell&#8217;s technical books events</a></td>
</tr>
<tr>
<td>7:30pm &#8211; 10:00pm</td>
<td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/14294" target="_blank">Meet &#8216;n Geek</a></td>
</tr>
<tr>
<td>8:00pm &#8211; 8:30pm</td>
<td><a href="http://conferences.oreillynet.com/cs/os2007/view/e_sess/14358" target="_blank">Google O&#8217;Reilly Open Source Awards</a></td>
</tr>
</tbody>
</table>
<p>In the spare time, I plan to hit up the Expo and see if there is anything good.  I&#8217;m going to follow this plan, but if something else better comes up, I&#8217;ll change things up a bit.  Stay tuned for more coverage of both the Ubuntu Live Conference and the Open Source Conference!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cb1inc.com/2007/07/22/ubuntu-live-and-oscon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the Default JVM on Ubuntu</title>
		<link>http://www.cb1inc.com/2007/05/30/setting-the-default-jvm-on-ubuntu/</link>
		<comments>http://www.cb1inc.com/2007/05/30/setting-the-default-jvm-on-ubuntu/#comments</comments>
		<pubDate>Wed, 30 May 2007 18:13:17 +0000</pubDate>
		<dc:creator>Chris Barber</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[There are circumstances where you may need to have more than one version of Java installed, but how do you switch between them?

Execute the following command to list the installed JVMs:

<div class="cb1-docs-code"><pre>$ <b>sudo update-alternatives --config java</b>

There are 3 alternatives which provide `java'.

  Selection    Alternative
-----------------------------------------------
          1    /usr/bin/gij-wrapper-4.1
*         2    /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
 +        3    /usr/lib/j2se/1.4/bin/java

Press enter to keep the default[*], or type selection number: 
</pre></div>

Simply enter the number for the JVM to use.  The * shows the current selected JVM.]]></description>
			<content:encoded><![CDATA[<p>There are circumstances where you may need to have more than one version of Java installed, but how do you switch between them?</p>
<p>Execute the following command to list the installed JVMs:</p>
<pre class="brush: plain; title: ;">
sudo update-alternatives --config java
</pre>
<p>Which will output something similar to the following:</p>
<pre class="brush: plain; title: ;">
There are 3 alternatives which provide `java'.

  Selection    Alternative
-----------------------------------------------
          1    /usr/bin/gij-wrapper-4.1
*         2    /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
 +        3    /usr/lib/j2se/1.4/bin/java

Press enter to keep the default[*], or type selection number:
</pre>
<p>Simply enter the number for the JVM to use. The * shows the current selected JVM.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cb1inc.com/2007/05/30/setting-the-default-jvm-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Ubuntu 7.04 Feisty Fawn In Parallels On Mac OS X</title>
		<link>http://www.cb1inc.com/2007/04/21/installing-ubuntu-7-04-feisty-fawn-in-parallels-on-mac-os-x/</link>
		<comments>http://www.cb1inc.com/2007/04/21/installing-ubuntu-7-04-feisty-fawn-in-parallels-on-mac-os-x/#comments</comments>
		<pubDate>Sat, 21 Apr 2007 07:37:52 +0000</pubDate>
		<dc:creator>Chris Barber</dc:creator>
				<category><![CDATA[mac os x]]></category>
		<category><![CDATA[parallels]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Thursday, April 19th, the latest rev of the Linux distro <a href="http://ubuntu.com" target="_blank">Ubuntu 7.04 (Feisty Fawn)</a> was released. I wasted no time to download it and installing it in one of my trusty virtual machines.

I have a <a href="http://www.apple.com/macbookpro" target="_blank">Macbook Pro</a> and I use <a href="http://www.parallels.com/en/products/desktop" target="_blank">Parallels Desktop for Mac</a> as my VM software. Installing previous Ubuntu releases was a piece of cake, but Ubuntu 7.04 was being a little "feisty" to install.

After trying the DVD, Desktop, and Alternative versions, I still had no luck. It was hard to tell what the problem was on the DVD and Desktop editions since they were live CDs and the screen just went blank. The Alternative version gave me a clue that the installer couldn't load the CD/DVD drivers.

After doing <a href="https://launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/95830" target="_blank">some digging</a>, I discovered there is a problem with both Parallels CD/DVD driver and the latest Linux kernel that ships with 7.04.

To get around the problem, I changed the OS Type to "Solaris" and OS Version to "Other Solaris" and then tried again to install Ubuntu.

<div align="center"><img img="Parallels Configuration Editor" src="http://cb1inc.com/sites/default/blog/20070421-parallels.png" /></div>

Ubuntu's installer found the drive without a problem and successfully installed the operating system. After the installation was complete, I shutdown the VM and changed the OS Type back to "Linux" and OS Version to "Other Linux kernel 2.6". I have no idea if the CD/DVD drive works after changing these back, nor do I know if there are any issues with just leaving the OS Type as Solaris.

My hopes are that either a new kernel and/or Parallels releases an update to fix this problem. Honestly though, I have never used the CD/DVD drive in a Linux VM since everything I install is downloaded.

Has anybody else had this issue or come up with a better workaround?]]></description>
			<content:encoded><![CDATA[<p>Thursday, April 19th, the latest rev of the Linux distro <a href="http://ubuntu.com" target="_blank">Ubuntu 7.04 (Feisty Fawn)</a> was released. I wasted no time to download it and installing it in one of my trusty virtual machines.</p>
<p>I have a <a href="http://www.apple.com/macbookpro" target="_blank">Macbook Pro</a> and I use <a href="http://www.parallels.com/en/products/desktop" target="_blank">Parallels Desktop for Mac</a> as my VM software. Installing previous Ubuntu releases was a piece of cake, but Ubuntu 7.04 was being a little &#8220;feisty&#8221; to install.</p>
<p>After trying the DVD, Desktop, and Alternative versions, I still had no luck. It was hard to tell what the problem was on the DVD and Desktop editions since they were live CDs and the screen just went blank. The Alternative version gave me a clue that the installer couldn&#8217;t load the CD/DVD drivers.</p>
<p>After doing <a href="https://launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/95830" target="_blank">some digging</a>, I discovered there is a problem with both Parallels CD/DVD driver and the latest Linux kernel that ships with 7.04.</p>
<p>To get around the problem, I changed the OS Type to &#8220;Solaris&#8221; and OS Version to &#8220;Other Solaris&#8221; and then tried again to install Ubuntu.</p>
<div align="center"><img img="Parallels Configuration Editor" src="/wp-content/uploads/2009/12/20070421-parallels1.png" /></div>
<p>Ubuntu&#8217;s installer found the drive without a problem and successfully installed the operating system. After the installation was complete, I shutdown the VM and changed the OS Type back to &#8220;Linux&#8221; and OS Version to &#8220;Other Linux kernel 2.6&#8243;. I have no idea if the CD/DVD drive works after changing these back, nor do I know if there are any issues with just leaving the OS Type as Solaris.</p>
<p>My hopes are that either a new kernel and/or Parallels releases an update to fix this problem. Honestly though, I have never used the CD/DVD drive in a Linux VM since everything I install is downloaded.</p>
<p>Has anybody else had this issue or come up with a better workaround?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cb1inc.com/2007/04/21/installing-ubuntu-7-04-feisty-fawn-in-parallels-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

