Skip to content

Web nourishment by John Ford and crew

Tag Archive for Leopard

Installing ImageMagick/RMagick on Leopard

John Ford Nov 26, 2007

I’ve heard many horror stories of developers trying to install ImageMagick/RMagick to manipulate images. Fortunately, when I needed to install RMagick to use with the attachment_fu plugin, I ran across a fantastic script at OnRails.org by Solomon White (many thanks). It gave the steps to install RMagick from source without MacPorts or Fink.

I made the following minor changes to get it working for me and posted the script below.

  • Changed ‘wget’ to ‘curl -O’
  • Updated a couple of links that weren’t working for me
  • Updated sourceforge links to the east coast
  • Updated links to latest version of source code (as of today)
#!/bin/sh
curl -O http://download.savannah.gnu.org/releases/freetype/freetype-2.3.5.tar.gz
tar xzvf freetype-2.3.5.tar.gz
cd freetype-2.3.5
./configure --prefix=/usr/local
make
sudo make install
cd ..

curl -O http://superb-east.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.23.tar.bz2
tar jxvf libpng-1.2.23.tar.bz2
cd libpng-1.2.23
./configure --prefix=/usr/local
make
sudo make install
cd ..

curl -O http://www.ijg.org/files/jpegsrc.v6b.tar.gz
tar xzvf jpegsrc.v6b.tar.gz
cd jpeg-6b
ln -s `which glibtool` ./libtool
export MACOSX_DEPLOYMENT_TARGET=10.5
./configure --enable-shared --prefix=/usr/local
make
sudo make install
cd ..

curl -O ftp://ftp.remotesensing.org/libtiff/tiff-3.8.2.tar.gz
tar xzvf tiff-3.8.2.tar.gz
cd tiff-3.8.2
./configure --prefix=/usr/local
make
sudo make install
cd ..

curl -O http://superb-east.dl.sourceforge.net/sourceforge/wvware/libwmf-0.2.8.4.tar.gz
tar xzvf libwmf-0.2.8.4.tar.gz
cd libwmf-0.2.8.4
make clean
./configure
make
sudo make install
cd ..

curl -O http://www.littlecms.com/lcms-1.17.tar.gz
tar xzvf lcms-1.17.tar.gz
cd lcms-1.17
make clean
./configure
make
sudo make install
cd ..

curl -O http://superb-east.dl.sourceforge.net/sourceforge/ghostscript/ghostscript-8.61.tar.gz
tar zxvf ghostscript-8.61.tar.gz
cd ghostscript-8.61/
./configure  --prefix=/usr/local
make
sudo make install
cd ..

curl -O http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/current/ghostscript-fonts-std-8.11.tar.gz
tar zxvf ghostscript-fonts-std-8.11.tar.gz
sudo mv fonts /usr/local/share/ghostscript

curl -O ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.3.7-1.tar.gz
tar xzvf ImageMagick-6.3.7-1.tar.gz
cd ImageMagick-6.3.7
export CPPFLAGS=-I/usr/local/include
export LDFLAGS=-L/usr/local/lib
./configure --prefix=/usr/local --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --with-gs-font-dir=/usr/local/share/ghostscript/fonts
make
sudo make install
cd ..

To test that ImageMagick was installed properly you can check the version number.

convert -version

[you should see something like this]
Version: ImageMagick 6.3.7 11/26/07 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLC

To test that ImageMagick is working properly you can run the following test. It will create a copy of the ImageMagick logo.

convert logo: logo.gif

Getting Apache & PHP to work with Leopard (OS X 10.5)

John Ford Oct 28, 2007

I ran into a snag today while trying to get the websites on my local machine running with Leopard. The first thing was that the config file in the new version of Apache is in a different location (/etc/apache2/httpd.conf instead of /etc/httpd/httpd.conf). Once I changed the settings I kept getting 403 Forbidden messages every time I loaded a page (the default in the new httpd.conf is ‘Deny from all’ for all directories). I finally figured things out and here’s what I did:

  1. Open the httpd.conf file for editing (sudo vi /etc/apache2/httpd.conf).
  2. Uncomment the line
    LoadModule php5_module     libexec/apache2/libphp5.so
    by removing the ‘#’ from the front of the line. This will enable PHP 5. The php5.conf file is loaded automatically from /private/etc/apache2/other/.
  3. Create a file called _sites.conf in your Sites folder. I like to keep my site configuration in the Sites folder to make it more easily accessible as I’m doing development.
  4. Add the following line to the very bottom of the httpd.conf file:
    Include /Users/yourusername/Sites/_sites.conf
    That will make Apache load all the configuration settings from your _sites.conf file.
  5. Add the following information to your _sites.conf file.
# Enable named virtual hosts
NameVirtualHost *:80

# Override the default httpd.conf directives.  Make sure to
# use 'Allow from all' to prevent 403 Forbidden message.
<Directory />
	Options ExecCGI FollowSymLinks
	AllowOverride all
	Allow from all
</Directory>

# A basic virtual host config
<VirtualHost *:80>
	# Add yoursite to your /etc/hosts file so you can
	# type it directly in your browser
	ServerName yoursite

	DocumentRoot /Users/yourusername/Sites/yoursite
</VirtualHost>

Now you just need to start/restart Apache and the sites should load. PHP should be working and no more 403 Forbidden message.

OS X Leopard

John Ford Oct 26, 2007

CompUSA is running a $30 rebate special today and tomorrow on OS X 10.5 (Leopard). Now is a great time to pick up a copy if you’re planning on upgrading. As you can see, I’ll be installing mine after I finish this post (and backup my stuff).

OS X Leopard