Subversion hosting, CVS hosting, Trac hosting, Bugzilla hosting and software collaboration Providing hosted Subversion, CVS, Trac and Bugzilla repositories
 

January 31, 2008

Apache Auto-configuration with a Dynamic IP Address

Filed under: Operating Systems — Tags: , , — Greg Larkin @ 6:02 pm

Hi everyone,

As I was setting up the new FreeBSD 6.2 VM with Apache 2.2 preinstalled in it, I ran into a problem. The VM’s virtual Ethernet adapter is configured for DHCP, and the VMware software acts as a DHCP server to hand out IP addresses as VMs are started.

The problem is that Apache likes to know the IP address of the machine it’s running on, and in some cases, it won’t start unless it does. Luckily, the DHCP client in FreeBSD, and likely other operating systems, calls separate hook scripts (if they exist) before and after configuring the adapter with a dynamic address.

In my case, I wanted to automatically create a ServerName directive for Apache with the dynamic address. The default Apache 2.2 installation on FreeBSD provides a user configuration file include directory at /usr/local/etc/apache22/Includes. As it starts up, Apache loads any file placed in that directory and named with the “.conf” suffix. I think we’ve got a solution!

It’s also necessary to tweak the contents of the /etc/hosts file so that the VM can resolve its own hostname. I wrote a DHCP client exit hook script that configures both Apache and the /etc/hosts file. This script should be easily adaptable to other operating systems, as it uses the standard Bourne shell syntax.

Simply download the script, unzip the contents into /etc, and let me know what you think!


Call me - Greg Larkin: error

Updated FreeBSD 6.2 VMware Images And BitTorrent

Filed under: Operating Systems — Tags: , , , — Greg Larkin @ 5:28 pm

Hi everyone,

As I got further into configuring my sample VM, I decided it would make sense to provide a few different VM flavors for folks who don’t want to configure Apache, PHP, and other ports to get the PHP frameworks installed and working.

I’ve set up a BitTorrent tracker at http://torrents.sourcehosting.net:10692/, and I’ll place the various VMs there from now on. The installation process is as follows:

  • Download and install a BitTorrent client, if you don’t already have one. I recommend Azureus.
  • Grab the UsrPorts torrent.
  • Grab a FreeBSD 6.2 Basic Installation torrent, such as the Bare Bones VM, or the VM pre-configured with Apache. Check the main tracker site for other options, and view the torrent info page to find out what ports have been preinstalled.
  • Once the UsrPorts.zip file has been fetched by your BitTorrent client, extract the contents to a new directory.
  • Extract your selected FreeBSD 6.2 VM .zip file to the same directory and start up the VM with VMware Player or VMware Server.

The UsrPorts.zip file contains the /usr/ports filesystem that’s mounted in the VM. Since this filesystem is typically kept up to date by running portsnap while the VM is running, I’ve provided an initial snapshot for you, but it’s not necessary to keep re-downloading when I provide a new FreeBSD VM that you’d like to try out.

I hope this system works better for folks, and please consider seeding the torrents as you download the .zip files.


Call me - Greg Larkin: error

January 28, 2008

Update the FreeBSD Ports Tree

Filed under: Software Development — Tags: , — Greg Larkin @ 2:18 pm

Hi everyone,

Now that we’ve got the FreeBSD 6.2 VM booted up under VMware Player or VMware Server, we need to make sure that we’ve got the latest version of the ports tree installed. Since you may be reading this well after I build the original VM image, the FreeBSD ports tree has probably changed a lot, and it’s possible that new versions of the PHP frameworks are available.

First of all, what is the ports tree? Quite simply, it’s a large collection of directories (18,000+ at last count!), one for every 3rd party software package that has been ported to FreeBSD. What does this gain you? The idea is that any piece of ported software can be installed on your FreeBSD system as easily as typing the following command in the appropriate directory:

cd /usr/ports/<category>/<appname> && make install clean

e.g.
cd /usr/ports/databases/mysql50-server && make install clean

That’s it! The same command will install anything from a simple Perl module to the Java development kit.

The command to update your FreeBSD VM with the latest ports tree is equally simple. Log in as root and type the following:

portsnap fetch update

You’ll see some output like this:

Sample FreeBSD portsnap run

Now we’re ready to install some PHP frameworks, but that’s a post for another day!


Call me - Greg Larkin: error

January 25, 2008

Booting Your First VMware Virtual Machine

Filed under: Software Development — Tags: , , , — Greg Larkin @ 11:13 am

Hello everyone,

Now that we’ve got some example virtual machines to play around with, let’s move on to the next step and get one running.

I’m using VMware Player on Windows XP, and the VM files have been extracted to My Documents\My Virtual Machines. The folder contents look like this:

VMware Installation Directory

Digging into the VM installation directory proper, you see all of the files that make up your virtual machine:

Virtual Machine Directory

The .vmx file is a text file that contains all of the virtual machine configuration options. You can change the VM memory allocation, add/remove devices, etc. just by editing that file. The .vmdk files are the virtual machine’s disks and store its state across reboots.

If your VM ever runs out of disk space and you still have room on your host operating system, you can create additional vmdk files and attach them to the VM. That sure is easier than cracking open a server case and physically installing new drives!

Next, double-click on the FreeBSD 6.2 Basic Installation.vmx file, and VMware Player starts up and boots the VM:

FreeBSD Boot Menu

After the usual messages, the virtual machine has booted, and you see the familiar UNIX login prompt:

FreeBSD Boot Completion

Next time, we’ll dive into installing the various PHP frameworks under FreeBSD. The FreeBSD ports system is designed for ease of use, and you’ll see how simple it is to get a software package and all of its dependencies installed with one command.


Call me - Greg Larkin: error

January 18, 2008

FreeBSD 6.2 VMware Image for the PHP Framework Face-Off

Filed under: Software Development — Tags: , , , , , , — Greg Larkin @ 9:30 pm

Hi all,

After my last post, I realized it might be nice to provide a clean VMware image of FreeBSD 6.2 for folks who want to follow along as I try out the various PHP frameworks.

The first thing you’ll need to start up the virtual machine is one of the following free VMware tools:

Both of these tools allow you to run virtual machines on your server and/or desktop. The VMware Player is most useful if you just want to run pre-built virtual machines and use them for experimentation and evaluation. VMware Server gives the ability to create your own custom virtual machines and install your choice of operating system.

Once you have one of those tools installed on your machine, download a FreeBSD 6.2 VMware image from the SourceHosting.net BitTorrent tracker. You can find detailed instructions on setting up the VMware image in a subsequent blog posting.

The OS install is configured as follows:

  • Root user has no password
  • Networking is configured with DHCP and uses NAT for outbound connections
  • Extracted size is 11Gb
  • FreeBSD ports tree is installed in /usr/ports and is current as of 01/30/08
  • Latest security patches as of 01/17/08 have been applied

Extract the downloaded file somewhere on your drive and fire up VMware Player or VMware Server and follow the prompts to start the VM.

In case you’re new to FreeBSD, there’s a wealth of information in the Handbook. After you’ve logged in and had a look around, you can use the following command to shut the VM down cleanly:

/sbin/shutdown -p now

Look for a new post soon describing how to install each of the PHP frameworks.


Call me - Greg Larkin: error

January 15, 2008

PHP Framework Face-Off

Filed under: Software Development — Tags: , , , — Greg Larkin @ 3:22 pm

Hello everyone,

I recently created a FreeBSD port for each of the following PHP frameworks:

I originally started with the Zend Framework port a while back, thinking I would use it to rebuild the SourceHosting.net web site. Since I want all software on the SourceHosting.net FreeBSD servers to be installed and upgraded using the ports system, I had to build the ZF port first. The only problem with building a port is that it doesn’t always require you to learn the ins and outs of actually using the software that you are porting.

The web site rebuilding project is still in the planning phases, and now that I’ve created ports for some additional PHP frameworks, I thought it might be useful to put together a simple web site using each one. I’ve read a lot of comments about each one, the strong points and weaknesses, but I think a hands-on experiment with each one will help a lot to narrow down the final choice.

A slightly more advanced “Hello, world.” program than the one in my original dog-eared copy of K&R ought to make the final choice easy to make. I’ll post progress here, and send any comments you have along the way.


Call me - Greg Larkin: error

January 11, 2008

How Mountain Bike Riding At Night Taught Me About Business Planning – Part 3

Filed under: Business — Tags: , , — Greg Larkin @ 7:14 pm

Hello again everyone,

I hope you all had a nice holiday break, and I’m back with the final installment of my “bicycling for business planning” posting arc.

To refresh your memory, in the last post I broke down how I spend my time while I’m riding my mountain bike at night:

  • 85% of the time – focused on a spot 3 to 6 feet in front of my wheel
  • 10% of the time – last-minute steering corrections
  • 5% of the time – looking further up the trail, but can’t see more than 30 feet ahead

I plan to apply similar ratios to business planning to help answer the perennial question “What should be worked on next?”

These ratios map to the following tasks:

  • Spend 85% of time on Important tasks (business planning, market research, adding technical features, CRM tasks, etc.)
  • Spend 10% of time on Urgent tasks (reactive support issues, special customer requests and the like)
  • Spend 5% of time thinking about everything that could be done, but don’t get too wrapped around the axle trying to predict the future!

I don’t want to minimize the importance of the last bullet point with its small percentage of mindshare, because any business still needs folks holding brainstorming sessions and thinking about new possibilities. However, once the primary direction of the business is set, it’s extremely important to review those ideas in that context. Otherwise, expect to be going sideways more than forward!

Comments and feedback are welcome, and if you have any methods that have worked well for your business, let me know.


Call me - Greg Larkin: error

Powered by WordPress