self

Web Serving Made Easy Part 4

By: Jon Gales

Alright. By now you’ve got PHP running and know how to do CGI scripts. If
you’ve forgotten, check last
week’s
column. There is some good and bad news this week. The good news
is that this is a pretty darn long/good/amazing article. The bad news is that
it’s the end of the series. if you’ve enjoyed or even just followed this series
I’d like to hear from you. PowerUser Monday
isn’t going away–just the web serving series. Also, if you’ve gotten a website
set up from this I’d like to get your link so I
can
add them
to the bottom of this page (hopefully
get you some traffic as well).

Now we’re going to install MySQL. It’s the most popular open source database
in the world and it just rocks. It’s often used with PHP and web applications
because:

  • It’s free
  • It kicks serious butt
  • It runs on Windows, *nix and OS X

Instead of downloading source code and having the joys of learning how to
compile it, we’re going to cheat and use a package made by the MySQL people.
This is new to version 4.0 (just came out) and it rocks. Visit this
page
and
download the file. Be nice and give them your info–they aren’t spammers. They
have given a good chunk of their lives for this software… Give them honest
answers. It’s a 7.1 meg download which isn’t bad for what you get.

You’ll find the downloaded file in your default downloads folder called, “mysql-standard-4.0.12.dmg“.
Just double click on it like any other DMG. Inside you’ll find a package (yep,
that’s what that those box icon thingies are)–double click it. The installer
is self explanatory.

Since it’s unix software you won’t see a GUI application. To start it up you
must delve into the terminal. If you feel inclined (you should) install a
script by Marc
Liyanage
that boots MySQL at startup. To start it without having to restart
your computer just pop open the terminal and type the following:

shell> cd /usr/local/mysql
shell> sudo ./bin/mysqld_safe
(Enter your password)
(Press CTRL+Z)
shell> bg
(Press CTRL+D to exit the shell)

If you have problems, refer to MySQL’s
OS X installation guide
. It sums it
all up well.

Now, you need to set your password. Enter the terminal again and type:

mysqladmin -u root password YOURNEWPASSWORD

Try to make this secure, you won’t need to type it in much and it’s important.

Now, we want to do something with our newfound database. You can download
a great Cocoa app called YourSQL that will log in for you and let you muck
around a little easier than in the Terminal. It’s free and I use it all the
time. However, the remainder of this app will focus on setting up a CMS that
uses MySQL, not MySQL (that’s another week folks).

Weblogs are hot right now and a lot of people either have or want to have
one. If you’re one in the second category wish no longer. Go to pMachine.com and
download a copy (it’s free). I use it and love it. There are lots of other
great free Content Management Systems like MovableType, PHP Nuke, and B2 but
pMachine is just plain easy (and the programmer is a big Mac guy).

Go to /Library/WebServer/Documents/ and drag all of the files
from the pMachineFree2.2.1
folder to it. Once that’s done point your browser to http://localhost/pm/install.php
and follow the on screen directions. Below are some pointers.

It will probably say you have to mess with config.php. Just open it up (it’s
in the pm directory) in a text editor and make the following changes:

$hostname = "localhost";

$dbusername = "root";

$dbpassword = "YOURNEWPASSWORD";

Obviously YOURNEWPASSWORD is what you entered prior in the MySQL installation.
If all goes well you should see some green when you refresh step two. The rest
of the installer is self explanatory. When you get to the part where it asks
for the domain make sure you don’t leave it as localhost if you’ve registered
a domain. if you need help on this, check part
2
.

You’ve now got a dynamic database powered weblog hosted off your computer!
You can administer things via http://localhost/pm/.

If you don’t like the template, feel free to change it. All it takes is a
text editor (yes, Dreamweaver or GoLive will work) and mess with the files
in /Library/WebServer/Documents/. For instance, weblog.php is the main
page. It’s pretty easy hacking. My weblog is powered by pMachine if you want an example of what can be done (don’t use mine as a high bar, it sucks icon razz Web Serving Made Easy Part 4 ).

Again, let me know how it goes. I love
feedback.Many thanks to Marc for the great
reference
he’s got. Check it out–he’s
a God send.

User submitted sites:

Colin Lochhead

Blambot’s FREE font for September– Self Destruct

selfdestruct 20080902 200828 Blambots FREE font for September   Self DestructBlambot’s Nate Piekos has create a simple, clean and geeky font and offered it up free for us all to enjoy. It’s called “Self Destruct.” In the artists own words…

I found myself in a conundrum when I was lettering a book that was in lowercase and I didn’t have a groovy enough lowercase computer-style font for a certain Golden Avenger… so I whipped up this little gem and now it’s yours! Comes with Regular, Italic and Bold.

Also be sure to check out Blambot’s beautiful and reasonably-priced pro fonts.

Note:

My Top 5 favorite screen savers for Mac OS X 10.5

People like screen savers. Computers don’t need them nearly as much when the first screen savers were introduced, but people like them anyway. They are like ringtones; they offer an outlet for self expression.

That said, the top 5 list that follows represents the 5 screen savers that satisfy this blogger’s need for self expression and may not do the trick for you. Personally, I like a screen saver to foster the kind of curiousity that makes people have to ask “what is that?” They don’t have to have complicated visuals but it doesn’t hurt.

Here’s the list:

  1. Filigree – My current favorite Screen Saver paints beautiful glowing pinstriping across your Mac’s screen and gently spins it in three dimensions. From the same guy who brought you Strands this one seems to breathe new life into the tired “random drawing thing” screen saver genre.
    filigree 20080527 224308 My Top 5 favorite screen savers for Mac OS X 10.5
  2. Word Clock – This is a screen saver I just found out about today and it’s already rocketted to number 2 on my top 5 list. It fills your screen with all the words necessary to tell you any date (except for the year) and time and highlights the appropriate words to do so right down to the second. Program your favorite colors and fonts and make the screen your own. [ Via TUAW ] wordclock 20080527 224511 My Top 5 favorite screen savers for Mac OS X 10.5
  3. Electric Sheep – It’s name is a reference to a Philip K. Dick novel that inspired a pretty well-loved movie. The screen saver requires an internet connection to work as it displays “the collective dream of sleeping computers from all over the internet. It’s a distributed screen saver that harnesses idle computers into a render farm with the purpose of animating and evolving artificial life-forms.” Each “electric sheep” you Mac dreams lasts about 4 seconds and, if you especially like it, you can “vote” for it. Popular sheep live longer and “reproduce.” Trippy.

    Other downsides besides the need for an internet connection include the requirement for drive space to download sheep data and the time it takes to buffer enough of that data to display the first “electric sheep.

    esheep 20080527 225355 My Top 5 favorite screen savers for Mac OS X 10.5
  4. Leopard’s Photo Mosiac Screen Saver – This one is built right into the OS. If you have a hefty collection of images on your computer, this one can be breathtaking. Simply put, it take one image from your collection and builds it out of small versions of all your other images.
    mosaic 20080527 224024 My Top 5 favorite screen savers for Mac OS X 10.5
  5. Tron – This one is simple, but oddly captivating. It spins 3 transparent, nested cubes and cycles their color as it goes. Named for the 1982 Disney flick but, as far as I can tell, it doesn’t reference any specific visual from the film.
    tron 20080527 223659 My Top 5 favorite screen savers for Mac OS X 10.5

That’s the list. All the screen savers listed are freeware with the possible exception of Leopard’s Photo Mosiac Screen Saver which comes free with Mac OS X 10.5.
Note: