Mar/090
Building Apache and Mod Perl on Mac OS X
I’ve finally had my work laptop upgraded to Leopard!!!
As such, I’ve just spent the last couple of days getting things all set-up nicely so that I can get on with my work. Most of the work that I do is web development orientated, and mainly using Perl and Catalyst, so an install of Apache and mod_perl is needed.
OS X does come with a complete install of Apache (even with mod_perl!) out of the box and ready to go (info on using this set-up can be found here), but I’m also working on another project that may involve the use of Jaxer, and this requires a newer build of Apache than the one shipped with Leopard.
Thankfully building these tools isn’t too complicated, here’s a quick dump of my notes on getting this done. Note, I’m installing them into /usr/local so that I don’t mess with any of the OS X internals that I shouldn’t be touching - this is completely removable.
First, make a work area for building:
sudo mkdir -p /usr/local/src sudo chgrp admin /usr/local/src sudo chmod -R 775 /usr/local/src cd /usr/local/src
Apache
curl -O http://apache.mirror.infiniteconflict.com/httpd/httpd-2.2.11.tar.gz tar zxvf httpd-2.2.11.tar.gz cd httpd-2.2.11
Now here’s the big one - the Apache configuration. This compiles a heap of modules I probably don’t need, but it’s nice to have them there in case I do ever need them…
CFLAGS="-O3" CXXFLAGS="-O3" \ ./configure --prefix=/usr/local/apache2 \ --enable-autoindex \ --enable-cache \ --enable-cgi \ --enable-deflate \ --enable-dir \ --enable-disk_cache \ --enable-fastcgi \ --enable-file_cache \ --enable-headers \ --enable-include \ --enable-info \ --enable-log_config \ --enable-log_forensic \ --enable-logio \ --enable-mem_cache \ --enable-mime \ --enable-mime_magic \ --enable-negotiation \ --enable-perl \ --enable-proxy \ --enable-proxy-balancer \ --enable-proxy-http \ --enable-rewrite \ --enable-speling \ --enable-status \ --enable-suexec \ --enable-userdir \ --enable-usertrack \ --enable-version \ --enable-vhost_alias \ --enable-so \ --enable-mods-shared=all
Then the standard make and install:
make make test sudo make install
Now to add some configuration so that Apache starts on system boot, first we need to create a startup script:
cd /System/Library/StartupItems/ sudo mkdir Apache cd Apache sudo touch Apache sudo chmod a+x Apache mate Apache
Paste this content into the file:
#!/bin/sh ## # Apache HTTP Server ## . /etc/rc.common StartService () { ConsoleMessage "Starting Apache web server" /usr/local/apache2/bin/apachectl start } StopService () { ConsoleMessage "Stopping Apache web server" /usr/local/apache2/bin/apachectl stop } RestartService () { ConsoleMessage "Restarting Apache web server" /usr/local/apache2/bin/apachectl restart } RunService "$1"
Then a configuration file:
sudo touch StartupParameters.plist mate StartupParameters.plist
Paste this content into the file:
{ Description = "Apache web server"; Provides = ("Web Server"); Requires = ("DirectoryServices"); Uses = ("Disks","Network Time"); OrderPreference = "None"; }
Then reboot and open up http://localhost to make sure things have worked.
Mod Perl
This is a lot more straight forward:
cd /usr/local/src curl -O http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz tar zxvf mod_perl-2.0-current.tar.gz cd mod_perl-2.0.4 perl Makefile.PL MP_AP_PREFIX=/usr/local/apache2 make make test sudo make install
Now all you have to do is add the following line to your Apache httpd.conf (/usr/local/apache2/conf/httpd.conf) with all of the LoadModule entries:
LoadModule perl_module modules/mod_perl.so
All done!
Jan/090
Want Git Preinstalled on Next Mac OS X?
Yes would be my answer. It sounds like a good idea, but I’m not sure if Apple will appreciate the ticket spam though…
I have a dream wherein future developers don’t even have to install Git for themselves in order to be able to use it. Apple has shown a very forward thinking attitude towards shipping OS X with various programming languages and version control systems. Right now is a critical time in which we can help push to have Git preinstalled on the next version of their operating system. The more people that use Git, the better the ecosystem becomes, and removing the installation barrier is a big step in that direction.
I’m told, on good authority, that the best way to make this happen is to let Apple know that it’s something we desire. So if you’d like to be able to fire up a fresh Mac and type
gitwithout ever installing it, open a ticket on Apple’s bug reporting site:Let them know that you’re using Git on your mac, and that you’d love to see it shipped with the next version of OS X so that even more developers can experience the joy of distributed version control!
via Github
Nov/080
Install PostgreSQL on Mac OS X Leopard
This type of guide is all over the internet, but I’m too lazy to search for one every time I want to do this.
So here’s a brief overview of how I got PostgreSQL set-up nicely on Mac OS 10.5…
Setting Up Our Environment
Using a text editor of your choice, add the following lines to the bottom of the /etc/profile file (you’ll need to be an administrator to do this):
# MacPorts export PATH=/opt/local/bin:/opt/local/sbin:$PATH # PostgreSQL export PATH=/opt/local/lib/postgresql83/bin:$PATH
Now before we move on, make sure that you have MacPorts installed.
Nov/084
Sync Your Things Database via Dropbox
Dropbox is a great service, I’m using it happily to keep my files in sync across multiple computers - I’m even using it to keep all of my passwords in sync, but I’ve thought of another great use… How about syncing my Things database between my macs (as this is my to-do list manager of choice)?
This is not fully tested yet, (just thought of it this morning) so i’ll update a bit later and report on as to wether things goes completely mental, but the way I’ve done this is as follows…
Make sure Things is completely shut down, then open up a terminal and type in the following commands:
cd ~/Library/Application\ Support/Cultured\ Code/
This moves us into the correct directory. First, to be on the safe side - we’ll take a backup of our files…
cp -R Things Things.bak
Now just move the Things directory into your dropbox and create a symbolic link in its place.
mv Things ~/Dropbox/ ln -s ~/Dropbox/Things Things
Fingers crossed this should have the desired results!
Update: It works!!!
On the second computer all you need to do to get the ball rolling is to close down Things, open up a terminal and type the following commands:
cd ~/Library/Application\ Support/Cultured\ Code/ rm -rf Things ln -s ~/Dropbox/Things Things
Note - my 2nd mac only had a fresh install of Things - no data. I installed it, opened it up (so the initial database was created), then did the above.
Jul/080
VMWare Fusion 2 Beta 2
It’s got friggin’ Unity for Linux!!! This looks good…
The VMWare team has just released the second beta for VMWare Fusion 2.0, the company’s popular virtualization program for the Mac.
The new beta adds a TON of new features, as the video above demonstrates. I got a chance to talk to VMWare today about the new beta and it is HOT. I’ll be posting a more in-depth overview tomorrow, but until then, here are some of the highlights:
- Unity 2.0 - The newest version of Fusion is really focused on better Windows-Mac integration. You can now launch Windows programs from the dock or access Mac programs from within your virtual machine. You can also link folders like Documents, Pictures and Music on your virtual machine with those folders on your Mac.
- Multiple Snapshots VMWare has worked really hard to bring a Time Machine-like ease to backing up and protecting your virtual machine. You can now designate how often you want to take full system snapshots of your VM, whether once an hour, once a day or once a week, and how many copies you want to keep.
- Better Video and Graphics Graphics and shading support has been improved for Macs that have higher-end graphics cards, and even integrated Macs can now play 1080p HD video in virtual machines with considerably less CPU overhead.
- Support for more client OSs, including Leopard Server You can now run Leopard Server as a VM in OS X 10.4 and 10.5, even on client machines (virtualizing Mac OS X client is blocked by Apple’s license terms). Support for the latest version of Ubuntu (Hardy Heron) is also available right out of the box with Unity integration. Power users can now designate up to four virtual CPUs per virtual machine, which is great for anyone wanting to take an XServe or Mac Pro to the next level.
VMWare Fusion 2.0 beta 2 is available for Intel Macs running OS X 10.4 or OS X 10.5. New users can try the beta for free and the upgrade path (including future betas and the full version of Fusion 2.0) is free for all existing Fusion 1.0 customers.
via TUAW
May/081
Trash Stuff From the Command Line
A great little command-line tool for Leopard:
osx-trashmanipulates the Mac OS X trash from the command line, just like the Finder does. It uses AppleScript via Scripting Bridge on top of to communicate with the Finder. You can move files to the trash, empty the trash, and list items currently in the trash.
May/080
Installing VMware Tools on Ubuntu 8.04 (Hardy)
If you’re a VMware user and want to play around with the latest version of Ubuntu in a VM (like me), you’ll need to get the vmware-tools installed. Unfortunately, things are not quite as straight forward as the previous release of Ubuntu yet, but it was a pretty easy thanks to this great guide.
The latest version of Ubuntu (8.04 a.k.a. Ubuntu Hardy - the world’s most popular Linux distribution) came out yesterday on April 24th. I downloaded it right away to play with on VMware Fusion, my Mac virtualization tool of choice (though I’ve now been told this works in VMware Workstation and VMware Player on the PC too!). It worked pretty well out of the box, with even seamless mouse support working right away, but I needed, of course, to install VMware Tools too, as any good VMware user would do. From there, things turned sour, and I was bombarded with error messages …
Apr/080
Spanning Sync 2.0 to Add Contact Sync
I’m already a lover of Spanning Sync, version 2 promises to have contact syncing between all your Google apps with the Mac address book. This could be very very good. Check the link for a video of it in action.
People know Spanning Sync for its ability to sync Apple iCal with Google Calendar. In fact, more than 70,000 people have used Spanning Sync to do just that. But calendars are only one part of the equation.
Our users tell us that they also need to be able to sync their Mac Address Book with their contacts in Gmail and Google Apps. So Spanning Sync 2.0 does both—calendars and contacts.
Apr/080
10 Ways to Instantly DEcrease Productivity on Your Mac
A great guide to help you in not getting things done.
Sure, we’ve all read those lists of tweaks you can make to your system to increase productivity, but what if you’re not in such an all-fired hurry to get things done? What if you’re already plenty efficient, and actually need to slow things down a bit until that five o’clock whistle blows? Well, lucky for you, we’ve compiled a list of the top ten best ways to slow down your system, and decrease productivity. Please feel free to add your favorites in the comments. (Oh, and we by no means recommend you do any of these to your friends’ computers, even if it IS April 1st).
Mar/080
Unix Toolbox
Found this via a post on Digg. A very useful read if you want to get some more advanced things done in Unix.
This document is a collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users. This is a practical guide with concise explanations, however the reader is supposed to know what s/he is doing.