Herself's Webtools

Scripts, HowTos, Templates, Plugins, Widgets, Tips

Archive for the ‘osx’ Category

How to set up WordPress on Leopard

with 6 comments

Gad, it is just as miserable and painful as it was under Panther.

1) Install MySQL 4.1 or 5.x

2) Turn on PHP in Apache

3) Fix broken socket

4) Download and install WordPress

Step 1 MySQL:

- Download MySQL 4.1
Unpack it and install and tell it to start on startup.

- Turn on SU account. Open up a Terminal Window and type:
sudo passwd root
Give it a good password. You’ll need su to edit files in a bit

- Configure MySQL
cd /usr/local/mysql/bin
./mysqladmin -u root password
[Give it a good password, if it refuses to connect reboot your computer. Also check in your System Preferences MySQL that MySQL is running and told to turn on at boot. ]

- Once you have the root user set up on MySQL set up an account for yourself
./mysql -u root -pYOURPASSWORD

- You should now see a sql> prompt
GRANT ALL PRIVILEGES ON *.* TO username@localhost IDENTIFIED BY ‘userPassword’ WITH GRANT OPTION;
exit;

- Make sure it worked
mysql -u username -puserPassword
Did you get a sql> prompt? If so you’re cool, if not reboot, I’m finding that helps and if not try again. You need to get MySQL running to use WordPress.

- Life is much easier if you set up a link in your path to mysql

as su

cd /usr/bin

ln -s /usr/local/mysql/bin mysql

Now you should be able to access mysql from any where on the computer.


Step 2: Turn on PHP in Apache

- Turn on WebSharing in System Preferences Sharing

cd /etc/apache2

- Edit httpd.conf , you need to uncomment the line
LoadModule php5_module libexec/apache2/libphp5.so
Thanks and more info here if you are stuck

Step 3 Fix broken socket
- cd/etc/
- copy php.ini.default to php.ini
- edit php.ini
Change the 3 locations where you find /var/mysql/mysql.sock to /tmp/mysql.sock

Thanks and more help here if you need it for this step

Step 4 WordPress:

- Download and unpack your favorite version to /Library/WebServer/Documents

- Edit config.php to use the password, and user name and database you created in step 1. If you didn’t create a database do so now.

- type 127.0.0.1/wordpress/ in your browser window and you should see the familiar WP set up screen.
If you do not see the set up screen try this: create this test.php file and it should tell you what is your problem:
if ( $cn = mysql_connect ( “localhost”, “username”, “password” )){
echo “connected”;
}else{
echo “not connected – ” .mysql_error();
}

Use the username and password you set up in mysql.

NOTES:

If you decide to wipe and re-install everything on your computer, you must get PHP/Apache/MySQL up and running BEFORE you do the 10.5.1 update.

If after installing MySQL you are unable to create a database ( errno 13 ) then log on to a terminal as root and change the owner / group of everything in the mysql directories to mysql/mysql.

> chgrp -R mysql *

> chown -R mysql *

You must also create a var and run directory in your /usr/local/mysql directory and make sure they are owned and in the group mysql.

Written by Linda MacPhee-Cobb

October 26th, 2007 at 5:18 pm

Posted in how to,osx,wordpress

Bulk Image Processing for websites using Image Magick

without comments

You might be developing a site to show off someone’s photos. Or maybe you are building an online store and you have hundreds of images to process. Well we all love GIMP but re-sizing 500 photos for thumbnails would give anyones mouse hand a cramp if you did them one by one.

When you have lots and lots of photos to process you will want to set aside GIMP and use ImageMagick. There are binary versions available for Unix/Windows/OSX and source code versions available for those of you who prefer to compile your own. This is Open Source, free for you to use software.

Directions for installing ImageMagick (* see note for OSX at bottom of post )

Now I’m old school and often work from a command line or terminal. Those of you who would rather have a graphical interface might want to check out JMagick, a Java interface for working with ImageMagick. This is just an interface, ImageMagick will need to be properly installed first for the interface to work.

Once you have it up and running you can batch process your images.

For instance if you want to create thumbnails for 100 jpg images:
Open up a terminal window ( Command in Windows Terminal in OSX )
cd to the directory with the images
type at the command prompt and hit enter
convert *.jpg -resize 100 thumbnail%03.png

This will convert all files ending in .jpg in this directory to png files that have a width of 100 pixels and are named thumbnail000.png to thumbnail099.png.

You can convert jpgs to png to gif and any which way between them.

You can do any of the following conversions to the files:
[-adaptive-blur • -adaptive-resize • -adaptive-sharpen • -adjoin • -affine • -annotate • -antialias • -append • -authenticate • -auto-orient • -average • -backdrop • -background • -bias • -black-point-compensation • -black-threshold • -blue-primary • -blur • -border • -bordercolor • -borderwidth • -cache • -channel • -charcoal • -chop • -clip • -clip-mask • -clip-path • -clip-path • -clone • -coalesce • -colorize • -colormap • -colors • -colorspace • -combine • -comment • -compose • -composite • -compress • -contrast • -contrast-stretch • -convolve • -crop • -cycle • -debug • -deconstruct • -define • -delay • -delete • -density • -depth • -descend • despeckle • -displace • -display • -dispose • -dissolve • -distort • -dither • -draw • -edge • -emboss • -encoding • -endian • -enhance • -equalize • -evaluate • -extent • -extract • -fill • -filter • -flatten • -flip • -flop • -font • -foreground • -format • -format • -frame • -frame • -fuzz • -fx • -gamma • -gaussian-blur • -geometry • -gravity • -green-primary • -help • -iconGeometry • -iconic • -identify • -immutable • -implode • -insert • -intent • -interlace • -interpolate • -label • -lasso • -lat • -layers • -level • -limit • -linear-stretch • -linewidth • -list • -log • -loop • -magnify • -map • -map • -mask • -matte • -mattecolor • -mask • -median • -metric • -mode • -modulate • -monitor • -monochrome • -morph • -mosaic • -motion-blur • -name • -negate • -noise • -normalize • -opaque • -ordered-dither • -orient • -page • -paint • -path • -pause • -pause • -pen • -ping • -pointsize • -polaroid • -posterize • -preview • -print • -process • -profile • -quality • -quantize • -quiet • -radial-blur • -raise • -random-threshold • -recolor • -red-primary • -regard-warnings • -region • -remote • -render • -repage • -resample • -resize • -reverse • -roll { • -rotate • -sample • -sampling-factor • -scale • -scene • -scenes • -screen • -seed • -segment • -separate • -sepia-tone • -set • -shade • -shadow • -shared-memory • -sharpen • -shave • -shear • -sigmoidal-contrast • -silent • -size • -sketch • -snaps • -solarize • -splice • -spread • -stegano • -stereo • -storage-type • -strip • -stroke • -strokewidth • -support • -swap • -swirl • -text-font • -texture • -threshold • -thumbnail • -tile • -tile-offset • -tint • -title • -transform • -transparent • -transparent-color • -transpose • -transverse • -treedepth • -trim • -type • -undercolor • -unique-colors • -units • -unsharp • -update • -verbose • -version • -view • -vignette • -virtual-pixel • -visual • -watermark • -wave • -white-point • -white-threshold • -window • -window-group • -write]

There are hundreds of detailed examples here: ( ImageMagick Examples )

*Note for OSX installations:
You will need to edit your .bash_profile file. It is in your home directory, and add the following lines.

#ImageMagick Stuff
export MAGICK_HOME=”/usr/local/ImageMagick”
PATH=$PATH:$MAGICK_HOME/bin
export PATH
export DYLD_LIBRARY_PATH=”$MAGICK_HOME/lib”
# end Image Magick Stuff

Save the file, close the terminal window and open a new one to cause .bash_profile to run.

Written by Linda MacPhee-Cobb

July 20th, 2007 at 12:00 pm