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

March 20, 2008

Loading The Laptop With DesktopBSD

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

Hi everyone,

As you may have noticed, I’m a pretty big proponent of FreeBSD. Lately, I’ve been interested in building a laptop that is light, has long battery life, can do basic email checking/web site browsing/remote server admin over SSH/etc. A bonus would be if I could run FreeBSD in a VMware VM and work on my ports if I’m stuck on a long plane ride.

Wait a minute – forget the VM! I’ll just run DesktopBSD directly on the laptop and have everything I need:

  • Email – check (Thunderbird)
  • Web browsing – check (FF, natch)
  • SSH – check
  • Full /usr/ports tree – check!

I’ve got version 1.6 loaded up on my venerable IBM Thinkpad 600x that had been mothballed for a couple of years, and after replacing the CMOS battery (go away nasty POST 161/163 errors!), and replacing the first-gen wireless PCMCIA card with a Linksys WPC54G, things are humming along nicely.

I did have to wrestle with the drivers for the Linksys card, guided largely by a helpful post on TaoSecurity, but eventually I got it working.

I’m currently in building the OpenOffice 2.x port so I can really get things done remotely, but it has been compiling for 2+ days now (!), and there’s no indication when it will finish!

I’ll post more about DesktopBSD as I get further into it.


Call me - Greg Larkin: error

March 18, 2008

FreeBSD 7.0 VMware Image Available

Filed under: Operating Systems — Tags: , , — Greg Larkin @ 12:18 pm

Hi everyone,

Since FreeBSD 7.0 was recently released, I figured it’s a good time to put a VMware image together and have a look. Probably one of the most interesting new enhancements is the addition of the ZFS filesystem. I can’t wait to try that out, and it should make managing disk space a lot easier in the context of the SourceHosting.net service.

You can find the zipped image on the SourceHosting.net BitTorrent tracker. Some notes about the image:

  • The VM has been configured with 768Mb of memory. You can reduce it to 512Mb, but the ZFS documentation says “Me want more memory!
  • The root password is “password”
  • ZFS is enabled by default
  • The /usr/ports filesystem is located in a ZFS pool
  • The Ethernet interface is bridged to the host and uses DHCP

I tested this VM in VMware Server and VMware Player, and it seems to work fine. If you have any questions or problems, feel free to post comments here.


Call me - Greg Larkin: error

March 10, 2008

Installing VMware Tools In A FreeBSD 7.0 Guest

Filed under: Operating Systems — Tags: , — Greg Larkin @ 7:35 pm

Hi everyone,

I’ve got FreeBSD 7.0 downloaded and running as a VMware Server virtual machine so I can start checking it out and get a feel for how it works. Once ZFS is deemed stable for production, I’ll plan to migrate to the 7.x series.

The first thing I generally do after setting up a new VM is install VMware Tools. Wait – scratch that. The first thing I have to do before installing VMware Tools is install Perl, since it’s not part of the FreeBSD base system. That’s easy enough:

cd /usr/ports/lang/perl5.8 && make WITH_GDBM=yes install clean

Ok, on to the VMware Tools installer! After starting the vmware-install.pl script, I answered a bunch of questions (used all default responses), and finally was met with this somewhat odd message:

VMware Tools Installation Failure Under FreeBSD 7.0 Guest

Wait a minute – I’m pretty sure I’m installing in a virtual machine here! Initially, I pored through the installation Perl script and discovered that it executes vmware-checkvm to determine if it’s running inside a VM or not. Ok, let’s try that by hand:

vmware-checkvm Failure Under FreeBSD 7.0 Guest

That’s a problem! vmware-checkvm is a statically-linked binary, and to get it working, the FreeBSD compat6x port needs to be installed. The compat6x port installs a variety of libraries that were found in FreeBSD 6.x but have had their versions bumped for FreeBSD 7.0.

cd /usr/ports/misc/compat6x && make install clean

Hmm, still no joy after doing that – vmware-checkvm is still core dumping. After more Googling and nosing about in the VMware Tools installation script, I learned that VMware expects the libc.so.6 library installed by compat6x to be in /lib. However, all compat{3,4,5,6}x ports install their libraries in /usr/local/lib/compat to avoid messing with the base system.

A simple symbolic link gets libc.so.6 in place for VMware:

ln -s /usr/local/lib/compat/libc.so.6 /lib

And now success, right? Wrong!

VMware Tools Installation Fails Again

I’m not logged in over the network, so why am I getting this message? It turns out that tcsh (root shell in FreeBSD) is setting the REMOTEHOST environment variable, even though I’m logged in at the VM’s console.

The solution is a simple command:

unsetenv REMOTEHOST

Start up the VMware Tool installer one more time, and now it works!

Maybe the newest version of VMware Server supports FreeBSD 7.0 natively, so I’ll have to test that out soon. Details will be posted here when I do!


Call me - Greg Larkin: error

March 6, 2008

FreeBSD Port For CodeIgniter Upgraded to 1.6.1

Filed under: Software Development — Tags: , , , , , — Greg Larkin @ 7:01 pm

Hi everyone,

I’ve submitted some new FreeBSD port upgrades over the past week, including new support for CodeIgniter 1.6.1. In addition to the version bump of the upstream distribution, I also added some new bits to allow customization of certain CI files. The port is also careful to avoid removing those modified files when a new port upgrade comes along.

The reference for how to handle user-configurable files installed as part of a port can be found in the excellent FreeBSD Porter’s Handbook in the Configuration Files section.

In the new CodeIgniter port, the following user-configurable files are installed:


<INSTALL_DIR>/index.php
<INSTALL_DIR>/index.php.sample
<INSTALL_DIR>/system/application/config/autoload.php
<INSTALL_DIR>/system/application/config/autoload.php.sample
<INSTALL_DIR>/system/application/config/config.php
<INSTALL_DIR>/system/application/config/config.php.sample
<INSTALL_DIR>/system/application/config/database.php
<INSTALL_DIR>/system/application/config/database.php.sample
<INSTALL_DIR>/system/application/config/hooks.php
<INSTALL_DIR>/system/application/config/hooks.php.sample
<INSTALL_DIR>/system/application/config/mimes.php
<INSTALL_DIR>/system/application/config/mimes.php.sample
<INSTALL_DIR>/system/application/config/routes.php
<INSTALL_DIR>/system/application/config/routes.php.sample
<INSTALL_DIR>/system/application/config/smileys.php
<INSTALL_DIR>/system/application/config/smileys.php.sample
<INSTALL_DIR>/system/application/config/user_agents.php
<INSTALL_DIR>/system/application/config/user_agents.php.sample

What this does is install a reference copy of each file (*.sample) that is not expected to be edited by the user. The actual file that CodeIgniter uses to render pages (no .sample suffix) is user-configurable as needed.

Then some crazy-looking shell code in the pkg-plist file makes sure that any edited files are not removed if the port is deinstalled or upgraded (reformatted for readability):

@unexec if cmp -s %D/%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php.sample \

    %D/%%WWWDIR%/%%CI_CONF_DIR%%/autoload.php; then \

    rm -f %D/%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php; else \

    %%ECHO_MSG%% "===> Customized %D/%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php \

    has not been removed"; fi

%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php.sample

@exec if [ ! -f %D/%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php ]; then \

    cp -p %D/%F %B/autoload.php; fi

This concept needs to be implemented in several of the other ports that I maintain, including CakePHP and Prado. If anyone has a list of files that are user-configurable in each of those frameworks, please send it along!


Call me - Greg Larkin: error

February 6, 2008

RSS Feed for FreeBSD /usr/ports/UPDATING

Filed under: Operating Systems — Tags: , — Greg Larkin @ 10:44 am

Hi everyone,

Since I’ve transitioned to FreeBSD, one thing I haven’t done regularly is keep track of the /usr/ports/UPDATING file. This file contains important information about incompatible changes to ports that could cause a port upgrade to break or yield unexpected results. Therefore, it’s important to check it before running a wholesale upgrade on a production server.

I’ve been using Awasu as my desktop RSS reader, and every time I find something I want to keep track of without having to remember to do so, I look for an RSS feed. The contents of the UPDATING file seem a natural fit for delivery as an RSS feed, but a few Google searches yielded no results.

Finally, I went straight to the freebsd-ports mailing list archive, and simply searched for “rss”. Lo and behold, Alex Kapranoff set up a feed back in 2005: http://lists.freebsd.org/mailman/htdig/freebsd-ports/2005-June/024285.html

The feed URL is http://kapranoff.ru/~kappa/files/ports.UPDATING.rss20.xml, for anyone who’s interested. Thanks Alex!


Call me - Greg Larkin: error

February 1, 2008

Installing PHP Frameworks with the FreeBSD Ports Tree

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

Hi everyone,

Ok, let’s proceed to install the various PHP frameworks that we’ll use to create a sample application.

As I mentioned in a previous post, the basic command for installing any port in the tree is:

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

Let’s start with the CakePHP framework:
cd /usr/ports/www/cakephp && make install clean

After typing that command, you should see this on the screen:

FreeBSD Port Installation Options

Hmm, what is that screen for? The FreeBSD ports collection has a robust infrastructure for configuring software applications prior to installation. In this case, CakePHP works with multiple different database backends, so the port writer (i.e. me) decided to provide options so the prerequisite bits are installed before the port proper.

Looking at the options provided here, the first one named “PROD” determines the way that the Apache web server is configured for CakePHP. If this is a production server, this option should be selected so navigating to “http://<servername>/” displays the CakePHP welcome page. Since I am installing multiple frameworks on the same machine, I’ll leave this option unchecked. That way, each framework welcome page will be found at “http://<servername>/<frameworkname>/”.

I plan to use MySQL as a database backend, so the following screenshot shows the MYSQL option selected. The dialog box is navigated with the tab and arrow keys on your keyboard, and the spacebar toggles the option selections:

FreeBSD Port MySQL Option

Tab to the OK button and hit Enter, and the port build starts. Here is the full transcript of the process:

CakePHP Port Build Transcript

Notice that by selecting the MYSQL option prior to installation, the port build fetched and built the MySQL client library and the PHP MySQL module, as well as some other packages:

mysql-client-5.0.51
php5-pcre-5.2.5_1
php5-pdo-5.2.5_1
php5-pdo_mysql-5.2.5_1
php5-session-5.2.5_1

This helps us get a working PHP installation that supports CakePHP out of the box.

Now, it’s the moment of truth – does the CakePHP default page display correctly? In order to load the page on your host machine, find the VM’s IP address with the following command:

/sbin/ifconfig -a | grep -w inet | grep -v 127.0.0.1 | awk '{ print $2 }'

That gives me 192.168.95.128, so here’s the URL where I should find the CakePHP default page: http://192.168.95.128/cakephp/. The address will likely be different for you.

This looks good!

CakePHP Default Page

Now as an exercise for the reader, try installing the rest of the frameworks and make sure that they display their welcome pages:

CodeIgniter
PRADO
Zend Framework

If you have any trouble, write in with comments and feedback.


Call me - Greg Larkin: error

January 31, 2008

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/&lt;category&gt;/&lt;appname&gt; &amp;&amp; make install clean

e.g.
cd /usr/ports/databases/mysql50-server &amp;&amp; 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
Pages: Prev 1 2 3

Powered by WordPress