shell

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

iPhone Unleased– Freeware to Expand your iPhones Reach

Once you’ve watched your Pirates of the Caribbean and ordered your calamari, you’re going to look longingly towards your desktop or laptop Mac. With this week’s selections, you can use the beauty of your handheld web browser to tap in to your Mac’s files and more.

If you don’t have an iPhone, get the Freeloader alternative here for $150.

telekinesis

telekinesis iPhone Unleased   Freeware to Expand your iPhones Reach

This Tiger application runs on your Mac, and opens up your Mac’s media to your iPhone. You can stream music and video, control iTunes, browse files and even execute AppleScripts and Spotlight searches. From the couch!

SoonR

SoonR is a cool, web-based service that lets you access your Mac without opening/forwarding ports. Connecting from your iPhone is as easy as logging into your SoonR account. Access documents remotely, browse your Microsoft Outlook contacts, calendar and mail and even initiate Skype calls.

soonr iPhone Unleased   Freeware to Expand your iPhones Reach

SoonR is free and supports PCs as well as Macs. It even lets you access files when your machine is offline.

Phone Home

Turn your iPhone into a remote for Keynote, DVD Player and iTunes with Phone Home. The author promises more remotes in the future. In the mean time, the iTunes remote supports playlists and podcasts.

WebShell

webshell iPhone Unleased   Freeware to Expand your iPhones Reach

GUI to fruity for you? Get serious with an iPhone browser-based shell. – web based SSH shell. It is a simple install on your Mac that allows you SSH access to your box and beyond. You do have to start the server from the command line, but that should no bother you if you’re dying to get a command line on your iPhone.

IActivator

Iactivator iPhone Unleased   Freeware to Expand your iPhones Reach

Get this bonus treat while it lasts. This application (registration required for download) takes the ugly hacks out of activating your iPhone. This application does NOT allow you to use your iPhone with another service. It simply allows you to use it as a browser and iPod without activating the AT&T service plan.

Get all that? There’s a ton of fun for you and your iPhone (or analogous, unhyped alternative device).

Brian

FastMac MacBook Pro Battery

image scale 20080206 082801 FastMac MacBook Pro BatteryOver the last few days I have had the opportunity to test the FastMac MacBook Pro 17″ Battery. This is one of only a handful of third party replacement batteries for the MacBook Pro. It is contained within a shell identical to that of the original battery, and even has status LEDs. Throughout my testing this battery preformed equal or better to the Apple MacBook Pro Battery. I highly recommend it to all users who are interested in a second or replacement battery.

For the battery geeks out there, this battery uses Lithium-Polymer cells. For all the tests I charged the batteries up to 100%, then recorded the percentage remaining once the test was complete.

In my first test of battery life, I first opened up Photoshop, and left it idle until the battery was drained and compared the times of the Apple battery against the FastMac. The FastMac battery won this test hands down. For my second test, I compressed a roughly 42 minute DV video clip into H.264, and once again the FastMac Battery had a higher percentage remaining then the Apple.

I next decided to do a test that I thought the Apple battery would exceed in. I charged both batteries up to 100%, then left the MacBook Pro sleeping, lid closed for 30 minutes, and recording the percentage remaining when I opened it. For this test, the two batteries scored the exact same, both still had 100% remaining, according to the menu bar status.

So overall the FastMac battery has done a very good job stacking up to its USD$129 counterpart. If you are wondering why I did not publish exact numbers, all the tests I did are approximate for showing the performance of the FastMac battery in comparison Apple supplied one. I would suggest this battery to anyone that wants a new battery.

Product Info:

Name: Battery, Rechargeable: MacBook Pro 17, TruePower
Price: $99.95
Warranty: 1 Year