The Most Versatile VoIP Provider: FREE PORTING

ISP-In-A-Box: The $500 Mac mini (Part IV, PHP)

We've been exploring the possibilities of the Mac mini for the past couple weeks with a series of articles covering first what it would take to turn the Mac mini into a Home Automation Server. And then we built a Computer Telephony Server. This week we're using the Mac mini to build a full-featured Internet Hosting Server a.k.a an ISP-In-A-Box. This is the fourth installment in our five-part ISP-In-A-Box series. If you're just joining us, you might want to start at the beginning and read the articles from the bottom up using this link. On the first day, we covered hardware requirements and installation and operation of the Apache Web Server. Day Two added mail services including SMTP, POP3, and IMAP servers. And yesterday we installed MySQL to handle all our data base chores.

Today we'll cover installation of PHP, a pedal-to-the-metal scripting and programming language that you can use to build or run web applications for just about anything. As we mentioned yesterday, adding PHP to the server with MySQL gives you access to literally thousands of free, commercial-quality applications that already have been written by talented programmers all over the world. Here's a partial list from just one of dozens of web sites that catalog these things. After we get PHP up and running, we'll install phpMyAdmin, your first PHP application. We'll use it to manage and create MySQL databases, and you can kiss the MySQL command prompt goodbye ... forever.

For those of you who are programmers or wannabe's, one of the beauties of PHP is its extensibility. In addition to the functions provided in the basic language, others have added function libraries for PHP covering almost every programming discipline you can imagine including imaging, printing, emailing, data base integration with virtually every DBMS on the planet, XML, SOAP, PDF, compression technologies, date, time, calendaring, TCP, URL and socket functions ... and we've barely scratched the surface. The documentation alone (in over two dozen languages) runs well over 1,000 pages. Assuming you decide to develop your own applications, if you've learned any other programming or scripting language including ASP or Visual Basic on the Microsoft platform or C on any platform, then you'll be right at home with PHP. If you're just getting started with programming, find a PHP course at your local community college or university. They all love PHP! But, as we noted earlier, one of the real beauties of PHP is not having to write any applications unless you want to. If there's some web-based application you needed yesterday for a project, chances are someone already has written it for you using PHP.

To simplify the installation process, we're going to use a PHP installation image (.dmg) file rather than a tarball just as we did with MySQL. We're going to install PHP 4.3.10 for OS X v10.3. Make sure you have applied the latest Apple patches to Panther before we begin. As already mentioned, PHP 5 is also available, but it is not yet in widespread use by ISP's, and many of the best PHP applications still require version 4. Click on this link for documentation about this PHP build and for other installation images. When you're ready to begin the actual download we'll be using, click here. The download is 26MB so a modem is probably not the optimal approach. When the download completes, the image file should automatically mount on your Mac desktop. If not, double click on the .dmg file to open the folder. Now double-click on php-4.3.10.pkg. Let it check the compatibility of your Mac. Then select your default drive, provide your admin password, and PHP will be installed. When the installation completes, you can eject the image file from your desktop.

[Update: On some machines, a minor adjustment in the Apache configuration file may be necessary to support PHP. Open a terminal window (Go to Applications/Utilities and double-click on Terminal icon). Type sudo su and press enter to switch to the root user. Type cd  /etc/httpd and enter to move to the Apache config directory. Type pico httpd.conf and enter to load the Pico editor and edit the Apache config file. Be careful here! Press Ctrl-W, type php4, and press enter to search for the word "php4." You should be positioned on a line which begins #LoadModule php4_module .... If there is a pound sign (#) at the beginning of the line, we need to remove it. Don't hit delete! If you did, just backspace over the weird characters. Position the cursor under the # sign and press Ctrl-D. Now press Ctrl-W and enter to find the next occurrence of php4. Do this a couple times until you get to a line that begins #AddModule mod_php4.c. If there is a pound sign (#) at the beginning of the line, delete it by positioning the cursor under the # sign and pressing Ctrl-D. That's it for the changes. Now save the file by pressing Ctrl-X, then Y, then enter. Exit gracefully from the terminal window by typing exit and pressing enter, repeat it, and then Command-Q. Now we need to stop and restart the Apache Web Server for the changes to take effect. Click on the Apple icon in the upper left corner of the screen and choose System Preferences. Double-click on the Sharing folder. Deselect Personal Web Sharing by clicking on the check mark beside this option. Wait for the web server to stop. Then select Personal Web Sharing by clicking on the check mark box beside it again. Wait for the web server to start up again, and then close System Preferences by pressing Command-Q. ]

Now let's be sure PHP installed properly. Make sure your Apache web server is running (consult the previous column on Apache if you need further assistance or a refresher course). Now open TextEdit in your Applications folder. Change the editor to plain text format by clicking Format, Make Plain Text. Now type the three lines shown in the left inset ending each line with a carriage return. Then save the file to your desktop as test4u.php in Unicode (UTF-8) format. When prompted whether to append .txt to the file name, choose "Don't append." Now use Finder and click on your local hard disk. Then navigate to /Library/WebServer/Documents. Now drag and drop test4u.php in this folder. Using your web browser, type in this address: http://localhost/test4u.php. You should see a PHP-generated page displaying everything you ever wanted to know about your computer. If not, recheck to make sure your web server is running and that you don't have a typo or missing semicolon in your test4u.php file. If all else fails, try reinstalling PHP or call your favorite Mac guru (not me!) for a little assistance. [Update: Once you've tested your system, move the test4u.php file out of your web site folder to prevent misuse.] Congratulations. You've just earned your first programming merit badge!

Now it's time to install our first PHP application, phpMyAdmin. This is a complete web front-end for MySQL that let's you create, delete, modify, and do just about anything else to any and all MySQL databases. Here are a few warnings to get you started. As with any powerful tool, be careful. Don't muck around in the database called mysql or MySQL itself may come to a screeching halt. If you want to experiment, then create your own database and play there. Leave databases connected to applications you need alone. And, finally, here's a word about security. We plugged a hole in MySQL to keep outsiders out yesterday. When you install phpMyAdmin, you're letting them right back in unless you complete all the steps outlined here. You also will want to RTFM (read the manual) and decide for yourself whether additional security measures are warranted because of where your machine is placed. If you are sitting in the middle of a fraternity house and half of your brothers belong to the 'Nerd of the Month' Club, all bets are off. If you're in a private residence with fairly trustworthy relatives around, the security outlined here is probably enough to keep someone from hacking into your new Mac. End of Sermon.

By now you should know the drill fairly well. First, make sure your Mac is running Mac OS X v10.3 and is up to date with Apple patches. Second, we need to download the phpMyAdmin software. Go to the Sofotex web site and click Download Now. Be patient for a few seconds, and your download should begin automatically. If not, choose a mirror site from the list. This will deposit a phpMyAdmin tarball (.tar) on your desktop which should decompress into a folder named phpMyAdmin-2.6.1. If not, double-click on the tarball to decompress it. Now let's open the folder by double-clicking on it. Find the file and Control-Click on it and choose to open it with TextEdit. When the file opens, choose File/Print and print just pages 1 through 4 of the file. While your file is printing, click on the Apple, choose System Preferences, click on the Sharing folder, and then click on the words "Personal Web Sharing." Be careful not to deselect the option or you'll shut down your web server. Now look at the bottom of the display and write down the IP address that's shown after the words "View this computer's website at http://." Press Command-Q to close your System Preferences window. Click in your TextEdit window and then press Command-Q to close it as well. Now close the phpMyAdmin-2.6.1 folder. Click once on the folder's file name and rename it to php and press enter. Now we're going to drag the folder to its permanent home. Open a Finder window, click on your local hard disk icon, and move to /Library/WebServer/Documents. Now drag and drop the php folder from your desktop into the Documents folder, which is as you'll recall the root folder for your computer's web server. Open a web browser, and go to http://localhost/php/. Assuming your Apache web server and your MySQL server are running, you should see a snazzy phpMyAdmin web page with at least the name of your mysql database in the left column and a bunch of nasty, red security messages at the bottom of the screen. If not, check to be sure Apache and MySQL are both running. As the red messages say, YOUR SYSTEM IS NOT SECURE at this point so don't be quitting just yet. Close the web browser, and let's plug the security hole. You're gonna need those four pages you printed and the IP address you wrote down.

We're going to secure your computer now so PAY ATTENTION! We need to edit a few lines in the phpMyAdmin config file to tell it to only let you run the program. Otherwise, anyone with a web browser can type your IP address and then /php to do exactly what you just did. Not good! Move back to your Finder window which should be positioned in the /Library/WebServer/Documents folder. If not, move there again. Then double-click on the php folder to open it. Find the file and Control-Click on it and choose to open it with TextEdit. Now let's look at your printout and mark what needs to be changed. Then you can make the changes CAREFULLY with TextEdit and save the file (Alt -S). First go to page 2. At the top of page 2 should be a line that says $cfg['PmaAbsoluteUri_DisableWarning'] = FALSE;. We want to change only the word FALSE to TRUE. Don't mess up the existing punctuation and quotes! Now go to page 4. About two-thirds of the way down the page are several lines that look like the following. Be very careful in searching for these because there are two more sets of identical lines further down in the configuration file. We don't want to change those.

$cfg['Servers'][$i]['AllowRoot'] = TRUE; // whether to allow root login
$cfg['Servers'][$i]['AllowDeny']['order'] // Host authentication order, leave blank to not use
= '';
$cfg['Servers'][$i]['AllowDeny']['rules'] // Host authentication rules, leave blank for defaults
= array();

Now, here's what it should look like after you fix it except you need to replace the IP number with the number you wrote down on your piece of paper.

$cfg['Servers'][$i]['AllowRoot'] = TRUE; // whether to allow root login
$cfg['Servers'][$i]['AllowDeny']['order'] // Host authentication order, leave blank to not use
= 'deny,allow';
$cfg['Servers'][$i]['AllowDeny']['rules'] // Host authentication rules, leave blank for defaults
= array('deny root from all','allow root from localhost','allow root from',);

I'm not even going to tell you how important the correct punctuation is, but if you screw it up, you'll know shortly. Once you save the changes, open a web browser, and go to http://localhost/php/. If this didn't work, try using your own IP address, of course. Do you finally see the same lovely phpMyAdmin? If so, at least you can get in. If not and you see an Access Denied message, check for typos and make sure you put in the correct IP address. Once you can access phpMyAdmin successfully, then we need to make sure no one else can (from anywhere). If you have another machine on your network, use a web browser to go to substituting your IP address from your trusty sheet of paper again. You should see the phpMyAdmin heading with an Access Denied message. If you have no other machines on your network, visit a friend and try to access your phpMyAdmin site in the same way using your Internet IP address (if you have a firewall/router, you first need to configure it to pass port 80 traffic to your private IP address). You still will see a big red message saying you're using a root account for MySQL with no password. While this is true, it is only accessible while sitting in front of your Mac and NOT from elsewhere assuming you carefully followed the MySQL tutorial yesterday. phpMyAdmin unfortunately isn't smart enough to know the difference. If you want to make this message go away (and that's all we're doing!), open main.php in the /Library/WebServer/Documents/php folder using TextEdit, search (Command-F) for the first occurrence of the word root, and replace it with toot (or any other word but root), and save the file (Command-S). Now close your web browser, reopen it, and go to http://localhost/php/ or using your own IP address. Whew! Once again you've passed with flying colors.

That's it for today. In our next session, we'll tie up all the loose ends, do a little experimenting with phpMyAdmin, and I'll provide some sample code and point you to some great books to get you started with your new PHP/MySQL programming career. And we'll share some great news about the future of our ISP-In-A-Box series. Thanks for visiting. Have a great weekend!

ISP-In-A-Box: The $500 Mac mini (Part III, MySQL)

This is the third installment in our five-part series on building a full-featured Internet hosting server with a Mac mini. On the first day, we covered hardware requirements and installation and operation of the Apache Web Server. Day two added mail services including SMTP, POP3, and IMAP servers. Today we begin the fun part of being the master of your own Internet universe with the installation of the MySQL data base management system. Why would you want a data base server in general and MySQL in particular? The short answer is that installation of MySQL today and PHP tomorrow truly opens up the Internet universe and gives you access to literally hundreds of fantastic, free, commercial-quality applications. These include blogs such as WordPress (which you are reading now), photo galleries such as Coppermine, content management applications such as phpWebSite, discussion boards such as phpBB2, project management apps such as PHProjekt, customer service systems such as PHP Support Tickets, polling and surveying systems such as phpESP and PHPsurveyor, wikis such as PhpWiki, mailing lists such as phpList, and other terrific applications including PHPauction, phpCOIN, phpFormGenerator, WebCalendar and on and on the list goes. Plus, you can build your own databases and applications to your heart's content without spending a dime for the software or the tools. So let's get started.

Our game plan is to get MySQL installed on your Mac today and give you the rest of the day to play with it. We're going to install MySQL 4.1 even though version 5 is also available. The reason is that most ISPs still run version 4.1, and many of the applications we listed above are not yet compatible with version 5. Then tomorrow we'll add PHP and PHPmyAdmin to the mix, and you'll never have to stare at a MySQL command prompt again... unless you want to. But, it's fun once so just play along. First things first. We need to download the correct version of MySQL to match the correct operating system and correct version of that operating system. This began as a Mac mini project so we're assuming you're running Mac OS X v10.3 aka Panther. If not, you need to make the necessary adjustments as we go along. If you haven't already done so, load the latest Apple patches on your system so that you are current before we begin this installation. Now choose a mirror site that's close to you from this list and download the MySQL installer to your desktop. Once the .dmg image file downloads, it should automatically mount on your desktop. If not, double click on it to mount it now. In the image folder, there are two package files, a preference pane installer to install MySQL in your System Preferences tray, and a readme file. Drag the readme.txt file to your desktop for safekeeping.

Now we're ready to begin the MySQL installation. First, we will install MySQL. Next, we'll install the automatic startup package which is responsible for making sure the MySQL daemon always starts up when you boot up your Mac. And finally, we'll install the new preference pane to start and stop the MySQL server. To get started, double-click on the mysql-standard package. Answer the prompts, choose your default drive, agree to the license, and enter your administrator password. If there is a problem during the installation, consult the readme file. Otherwise, you'll see a message in a minute or so indicating that the installation was successful. Now double-click on the MySQLStartupItem package, choose your default drive, enter your administrator password, and wait for the installation to complete. Lastly, double-click on the PrefPane icon, tell it to install for you (the administrator) only, and wait for the installation to complete. Just to be sure everything went according to plan, restart your Mac.

When your Mac comes back to life, click on the Apple icon in the upper-left corner of the screen, choose System Preferences, and then click on the MySQL icon in the bottom of your System Preferences tray. It should show MySQL running with a check mark next to the option to automatically start during system startup. If not, make the necessary corrections to start MySQL and to assure that it automatically starts in the future. The MySQL installation is now complete, but MySQL is not yet secure! So ... keep reading.

Don't ask me why but MySQL's default installation sets up anonymous and admin user accounts that are wide open (i.e. password-free) for all the world to hack, and they have. Kinda reminds you of another company in the great Northwest, doesn't it. If you don't plug this security hole, any person that discovers your IP address can totally destroy every MySQL database you build and take remote control of your machine! In short, you're toast! It should be noted that the anonymous and admin accounts for localhost access (which are separate accounts) are also password-free, but this shouldn't be a problem so long as you have control of your physical machine. So let's fix the mess and set up MySQL so it's easy to access (for you and your web server, not the world). Open a terminal window by choosing the Terminal application in your Applications/Utilities folder. Type sudo su and press the enter key.

You now can connect to your MySQL server by typing /usr/local/mysql/bin/mysql at a bash command prompt. Let's do it now. You should then see a MySQL command prompt that looks like this: mysql>. First think up a very secure password for remote access to your MySQL server (you're never going to use it probably so make it a good one). Now you're ready to type the following command substituting your new password for the word "secret" and don't forget the two pairs of single quotes and the semi-colon on the end of the command:

  • update mysql.user set password = password('secret') where host<>'localhost' ;
  • When you press the enter key, MySQL should report that two records were changed. If not, try again. Cut and paste the command above if you have to. Once you get the "two records changed" message, double-check your work by typing this command:

  • select host,user,password from mysql.user ;
  • MySQL should list four accounts. The two localhost accounts should have blank passwords, and the other two should have passwords that you can't decipher. If not, repeat the drill until you get it, or you might just as well never use MySQL. My apologies for the diatribe. You'll thank me in ten years when you never get hacked. Here are the last two commands to enter in MySQL for now. The first makes certain that your changes get written to disk, and the second gets you out of MySQL gracefully. Once back at a bash command prompt, type exit and enter twice and then Command-Q to close the terminal window.

  • flush privileges ;
  • q
  • Your homework for tonight is to take a look at the MySQL documentation so that you get a feel for what can be done with a relational database. Using Safari or any web browser, open the MySQL documentation by entering this address: file:///usr/local/mysql/docs/manual.html#Tutorial . To get back to the MySQL command shell: open a terminal window, type /usr/local/mysql/bin/mysql and press enter. Have fun! Don't forget to end your commands with a semicolon, or MySQL just sits there. Don't forget to exit gracefully (q) when you're finished.

    Feb. 9 Supplement. Several common questions have arisen since this article first appeared. I wanted to address them in the body of the article for the benefit of new visitors who might not read the comments.

    Missing Preference Pane. On some older Macs (apparently not Mac mini's), there is no Preference Pane option in the MySQL installation folder to install in System Preferences. This is not a big deal. All this preference pane does is allow you to stop and start MySQL. You can do the same thing from a Terminal window (opened from Applications/Utilities):

  • To start MySQL manually: sudo /library/startupitems/mysql/mysql start
  • To stop MySQL manually: sudo /library/startupitems/mysql/mysql stop
  • To restart MySQL manually: sudo /library/startupitems/mysql/mysql restart
  • Uninstalling MySQL. Here are the steps. Don't skip any! You cannot undo these deletions!! All your data will be lost, too!!! If something goes wrong in a step, do not go to the next step. Send me an email. First open a Terminal window (opened from Applications/Utilities):

  • Switch to root user access: sudo su
  • Provide admin password if prompted: type your password
  • Move to the folder where MySQL is stored: cd /usr/local
  • List the contents of the folder: ls
  • Write down the exact file names of all files beginning with mysql : there should be two, a file and a directory
  • Stop MySQL manually and make sure it says it is stopped: sudo /library/startupitems/mysql/mysql stop
  • Delete the MySQL symbolic link file: rm mysql
  • Delete the MySQL directory and subdirectories using the long file name you wrote down above: rm -rf
  • Move to the Receipts folder: cd /library/receipts
  • Delete the MySQL directory and subdirectories using the long file name you wrote down above: rm -rf
  • Move to the startup folder: cd /library/startupitems
  • Delete the MySQL startup directory: rm -rf mysql
  • Delete the other possible MySQL startup directory: rm -rf mysqlcom
  • ISP-In-A-Box: The $500 Mac mini (Part II, Mail Services)

    We began our five-part series on building a full-featured Internet hosting server with a Mac mini yesterday and covered the recommended hardware for the server as well as basic instructions for setting up an Apache Web Server. Today we’ll show you how to turn your Mac mini into a full-blown mail server with SMTP, POP3, and IMAP support. Before doing that, let me first define what SMTP, POP3, and IMAP are. And then I want to offer a word of caution about why setting up these services (especially POP3 and IMAP) for most folks is probably a bad idea.

    SMTP or Simple Mail Transfer Protocol is a collection of services to send email messages between servers. It also accepts messages from mail clients for delivery to others. Messages are retrieved with a mail client which "talks" to either a POP3 or IMAP server which manages the flow of incoming messages between an SMTP server and the mail client. While there are exceptions, the fundamental distinction between a POP3 client and an IMAP client is that POP3 clients download messages and manage them on a local machine while IMAP clients download copies of messages which are generally stored on a server. At the risk of oversimplifying, if you have one computer and one email account, POP3 is more than adequate. If you have multiple computers that all need access to your email messages or if you need web access to your email messages, IMAP is probably a better choice because it is more robust particularly in handling deletions of messages from a variety of locations.

    Rather than telling you not to install an email server, let me try to define when it would be appropriate and leave the rest to you. Every ISP on the Planet provides SMTP services for its customer base. If you have Internet access, you generally also have SMTP services to handle delivery of your outgoing email messages. One advantage in setting up your own SMTP server is you will always know its address or domain name. If you travel extensively or spend lots of time in Wi-Fi HotSpots of different vendors, then SMTP services for outgoing mail can be painful because you generally have to reconfigure your email client to tell it the address of your SMTP server before you can send or reply to email. This is not always the case, however. Most modern WiFi HotSpot routers now transparently reconfigure your SMTP settings when you connect to their services. And having your own SMTP server doesn’t always mean you can send email because more and more ISPs are blocking SMTP activity from downstream computers (i.e.. computers located inside your ISP’s firewall and routers) as a way to better control the proliferation of SPAM.

    Almost every ISP on the Planet also provides POP3 mail services for customers, and most provide IMAP and webmail access as well. In addition, for mail delivery and storage, there are numerous other free services including Gmail from Google, HotMail from Microsoft, and Yahoo Mail from Yahoo as well as low-cost vanity email providers such as Unless email between numerous users in your local area network is significant and uploading and downloading of messages to and from an ISP causes inordinate delays in the delivery of email, I can think of no sound reason to deploy either a POP3 or IMAP server on your local system. And there are some very good reasons for not doing it. First, it all but requires that you have a good grasp of DNS principles and that you properly configure your mail domain. If you’re saying, "What’s that," then you definitely do not need a POP3 or IMAP mail server. Second, if you don’t know what you are doing with DNS and your POP3 and IMAP settings, you run the very real risk of losing all of your incoming mail or having it bounce back to the senders. Third, most ISPs back up their servers fairly regularly. Do you plan to do the same? It’s your email! Finally, mail server services can be processor intensive and eat into your available resources. Keep in mind that these services have to run regularly to determine whether there is incoming or outgoing mail and, if so, to process it. Is it worth the computing resources to duplicate a service that skilled personnel already handle for free at your neighborhood ISP? End of lecture.

    So you want to be a mail administrator. Great! Assuming you’ve mastered DNS (which is beyond the scope of this tutorial … and me), setting up SMTP and optionally POP3 and IMAP services couldn’t be easier on the Mac mini. Step 1: Go to this web site or this one and download Postfix Enabler. Step 2: Print a copy of the web page while you are there. This is the installation and operating instructions. Step 3: Decompress the archive and drag the Postfix Enabler icon to your Applications folder. Step 4: Run the application and provide your Admin password. Step 5: Click the Enable Postfix button. You now have a fully functional SMTP server. Step 6: If you want POP3 or IMAP servers enabled, reread the warnings above (hint!), and then read the Postfix Enabler documentation for installation and configuration instructions. Step 7: Send the author a small donation. Postfix Enabler is shareware. Having dabbled in shareware myself once upon a time, I can tell you it’s one of the best things that ever happened to keep the computer industry honest and competitively priced.

    Note: Unlike Windows machines which all have their special quirks, all Macs pretty much work the same way so everything we’re discussing will work just as well on an iMac, or Powerbook, or Power Mac G5, or eMac, or iBook so long as you’re running an up-to-date version of OS X v10.3, aka Panther. If you have a Mac mini, then you have OS X v10.3. If you have a different Mac and you’re using an earlier version of OS X, then pretty much everything is different insofar as mail services (even the SMTP server is different) so you can stop reading now.

    To test your new SMTP server, start up your mail client and reconfigure your client’s SMTP server settings to point to Now send a message you don’t mind losing to someone you know and ask them to reply. Or just send a message to yourself. Wait a few minutes and refresh your mailbox. Keep in mind that a number of ISPs block all SMTP-generated email messages from end-users (that’s you!). If it doesn’t work, it’s probably your ISP that’s the problem, not Postfix. I told you not to do it. Didn’t I?

    In our next installment, we really will be installing something you need, the MySQL data base management system, one of the fastest and most reliable DBMS products in the marketplace. It also happens to be free for most purposes. What can you do with MySQL? Just about anything. Take a look at our main web page at It is completely generated from a MySQL database. Or visit one of our beach webcam sites at Pawleys Island or Surfside Beach. All of the tide, sunrise, and sunset data for these sites is generated from a 100-year table of data stored in, you guessed it, a MySQL database. So join us back here tomorrow.

    ISP-In-A-Box: The $500 Mac mini

    Today we begin our five-part series on building a full-featured Internet hosting server with a Mac mini. If you’ve followed our previous advice and are considering a move to a hosting provider for your web sites, then this series will show you how to build the perfect staging server, a place to experiment with new code before moving it to a production environment. Over a year ago, we undertook a similar project on the Windows XP platform. The difference in performance, security, and ease of deployment on the Mac platform is the difference in night and day so you’re in for a treat! For those unable to afford the move to a hosting provider at this time, you can use a Mac mini as your host for the time being. Functionally, there’s nothing a hosting provider would give you that can’t be replicated for free on the Mac mini. Other than bandwidth and slightly better performance, the Mac mini will provide an almost identical hosting environment to what you’d be using with a commercial hosting provider. In fact, we recommend installing application versions which match what most reputable hosting providers use, and we will do that here. If you later decide to make the move to a hosting provider, everything you’ve built on your Mac mini can be transferred with ease. Listed below are the pieces we’ll be putting into place over the next week or so to complete our ISP-In-A-Box project:

  • Apache 1.3 Web Server
  • Postfix Mail Server (SMTP, POP3, and IMAP)
  • MySQL 4.0.23
  • PHP 4.3.10 and PHPmyadmin 2.6.1
  • WebMin, Pico Editor, CronTab and other goodies
  • Our focus today will be on the hardware and web server software you’ll need for this project, and then we’ll get the Apache Web Server up and running to host your first two web sites. Luckily for you, Apple has made this project incredibly easy … and cheap. You’ll need a Mac mini which includes Mac OS X and FreeBSD ($499). Like Linux, FreeBSD is another UNIX derivative so most of the rock-solid Internet applications available for Linux have also been ported to FreeBSD. And, also like Linux, most of these applications are free at least for non-commercial use. Unlike Microsoft where security has been an afterthought and Linux where you have to track down patches and dependencies yourself, Apple takes security seriously and automatically notifies you when patches become necessary to keep your machine safe and secure. One button click and an admin password, and you’re up to date with the latest fixes and enhancements. If you’re serious about having web applications accessible from the Internet, there really are no sane options other than the Mac platform or contracting out your web hosting. Then again, perhaps you need another full-time job in which case Linux or Windows servers will gladly suck up every free minute of your day.

    Hardware. Since the Mac mini only has one RAM slot and because Apple has made Mac mini hardware upgrades difficult (but not impossible), you may want to consider at least bumping the machine up to 512MB ($75) when you initially order it. This will almost double the performance of the box for applications such as those we’re going to be deploying. Extra RAM is particularly important once we get all of the ISP functions (shown above) running simultaneously. The other option that’s too inexpensive to pass up is increasing the hard disk size from 40GB to 80GB. For $50, you’ll never be sorry. If $499 is your absolute budget, then fine. Everything outlined here will chug along on a $499 Mac mini. If you can scrape together another $125, you’ll have a much more capable system down the road when you really start exercising the server capabilities of the Mac OS X platform.

    Unlike Microsoft, which cripples Windows XP Home Edition by not including a web server, Apple has taken just the opposite approach with Mac OS X, the operating system which is included with your Mac mini. Because Mac OS X is built on top of the FreeBSD platform, Apple has included most of the FreeBSD development tools in its software distribution. Enabling the Apache Web Server on your Mac mini may just be the easiest thing you ever do on the computer. Click on the upper left corner of your display and then choose System Preferences. When the System Preferences window appears, click on the Sharing folder under Internet & Network options. Under the Services tab, place a check mark in the box beside Personal Web Sharing. If the system won’t let you select this option, click the Lock and enter your administrator password. If you want people on the Internet or your local network to be able to access your web site, you also need to enable Personal Web Sharing under the Firewall tab. You do have your firewall enabled, don’t you? If not, do it now! Once you complete these steps, open your web browser and enter localhost as the destination address to find. You should see the Test Page for the Apache web server with the Apache logo. Congratulations! You’re now a webmaster.

    Actually, your Mac mini is now hosting at least two different web sites. The main web site which is accessible at localhost,, or your Internet IP address is the one we’ve already accessed. If you open a Finder window and select your local drive icon, this will move you to the root directory. Then choose Library, Webserver, and Documents to move to the directory where HTML pages for your main web server are stored. The default web page is index.html or index.html.en if you’re supporting multiple languages and English is your computer’s native tongue. There’s also a web site for each user account on your Mac. Documents for these sites are stored in the Sites folder of your home directory. You can access this web site at the following address: http://localhost/~yourname where yourname is the account name you set up when you first turned on your Mac. When you access this site, Apple even provides instructions for building your first web page. Your personal web page can be accessed from the Internet with an address such as http://nnn.nnn.nnn.nnn/~yourname where nnn.nnn.nnn.nnn represents the IP address provided by your ISP.

    Finally, you’re probably whining because most folks don’t access web sites with an IP number and most ISP’s assign dynamic IP addresses which are always changing. Right you are to complain, on both counts! Here’s what you need. First download DNSupdate and install it on your Mac. This software regularly talks to a DNS server to tell it what your current IP address is. Next, set yourself up a dynamic DNS name on Once you complete both these steps, people can access your web site on your home network using a domain name just like mine. Using a web browser, type in to see how it actually works.

    Tomorrow we’ll get your email server up and running on the Mac mini with about the same amount of effort it took to activate Apache. Until then, here’s hoping you enjoy your first day as a webmaster. Click here to read the rest of the articles in this series.

    Ultimate Computer Telephony Server: The $500 Mac mini

    If you’ve always wanted a complete Computer Telephony Integration (CTI) solution for your small business or home office but were put off by mega-thousand dollar sticker shock, there’s good news. Your clean living finally has paid off. Thanks to Apple’s introduction of the $499 Mac mini and Ovolab’s 2.0 release of their $150 Phlink telephony server, you now can build an Interactive Voice Response (IVR) call center and auto-attendant with complete messaging, voice mailing, call routing, data base lookuping, out-dialing, faxing, and email message forwarding for under $650 … in one afternoon. And, yes, I’ve done it so this isn’t a sales pitch. Need support for additional incoming lines? Just add additional $150 Phlink server modules, and you’re in business. If you’re contemplating building the Home Automation Server we discussed last week, then this telephony server is a perfect complement. All you’ll really need is Phlink and a little additional RAM when you purchase your Mac mini.

    Here’s a quick introduction to Ovolab Phlink’s feature set. Using any phone line with caller ID (including VOIP lines such as those we’ve previously recommended), you can build customized solutions to answer and route calls based upon the caller’s identity. This customization includes user-specific IVR menus to retrieve customer data, weather reports, sales figures, or virtually anything else you need. After retrieval, the caller can use a touch tone phone to route a fax or email to a specific phone number or email address. Or you can use the IVR capabilities to capture voice mail messages which immediately can be retrieved using any web browser or emailed to you or your cell phone. All you need is an Ovolab-provided script. If you need to turn on the sprinkler system in your front yard while away on vacation, that’s no problem either. Just phone home, key in your secret sprinkler watering code, and Phlink will pass the instruction along to the Home Automation Server we built on the same Mac mini last week using Indigo. Another great use of this system is to route telemarketers and folks on your personal do-not-call list into that special place: IVR Hell, an endless variety of choices to press 1 for this and press 2 for that. It can entertain obnoxious sales people for hours at a time, and you’ll never even know the phone rang. Or, if you prefer, Phlink can just disconnect these calls. Finally, you can use the Mac’s powerful text-to-speech capabilities which are incorporated into Phlink to build customized responses to queries from callers. For example, a customer could be provided a current inventory status based upon a customer-initiated query. The possibilities are endless. And if you’re not that imaginative, Ovolab has assembled an incredible array of scripts to get you started. Some of you probably are shaking your head saying, "I’ve tried cheap IVR solutions before, and the touch-tone commands just weren’t reliable." Well, Phlink is bundled with a USB hardware adapter to handle caller ID and touch-tone translation, and I have found it to be just as accurate as corporate systems costing thousands of dollars. You won’t be disappointed. Just send me a check for half your savings, and we’ll call it a day. Enjoy!

    Turn Your Mac Mini Into A Media Center

    Engadget’s terrific HOW-TO on turning your Mac mini into a media center hub is a must read.

    Blogging with Style

    WordPress is the terrific piece of software that makes blogs like this one feasible without the water torture of dealing with the HTML markup language, XHTML, and CSS. That’s not to say that others haven’t dedicated enormous personal energy (and talent) to making this a great experience for writers and readers as well. If you decide to create your own blog, our web hosting HOW-TO article will tell you just about everything you need to know. Once you’re set up, run Fantastico from the cPanel admin panel and install WordPress. Configure WordPress using the simple user interface for the program and you’re all set. If you decide to offer your readers some alternative styles (other than the WordPress default which is not bad), you can thank Alex King and some very talented designers for making it incredibly easy. Install WP Style Switcher, and then just choose the styles you wish to offer, drag them to folders on your blog’s web site, and you’re done. Thanks to some jerks who have nothing better to do than try to turn blogs into the SPAM nightmare that email has become, you’ll also want to install WordPress Hashcash to eliminate the gambling and Viagra ads. The entire process can be completed in less than an hour.

    For the blog reader, there’s more good news. You can navigate this WordPress blog in a format that suits your reading style. And, yes, we all are different about that. If you’re using a Mac or a PC, the simplest method for choosing a new style is to click on several in the Style section of the margin of this blog until you find one you like. WordPress generally remembers your choice with cookies so you don’t have to go through the drill each time you visit the site. If you’re using a cell phone (particularly one with the Blazer browser found on the Treo’s), it’s not quite as easy, but almost. As mentioned previously, the default style for this site (and many others) displays in Blazer with one character per screen line which can get tedious after the first couple words. Instead, you can start up the blog with a default style of your choosing with the following syntax: where mystyle is your preferred site style. The style we recommend is Type, but you may want to experiment with some others. For Mac addicts, don’t miss Panther. It’s a knockoff knockout.

    The correct syntax to load Type as your default style is without a trailing period. Our personal favorite and this site’s default is Rubric by Hadley Wickham of the University of Auckland in New Zealand, but it was a difficult choice. Chances are you’re looking at it. Enjoy!

    Ultimate Home Automation Server: The $500 Mac Mini, Part III

    Our final installment in the HOW-TO Build a Home Automation Server series delves into the software that is available to make your home come to life. The first installment provided an overview of building such a system, and we covered much of the recommended hardware for such a system in the second installment. As mentioned previously, the brain of this system is a clever piece of software called Indigo (see inset).

    With Indigo, you first define all of the X10 components that have been installed in and around your home: sensors, motion detectors, lamp modules, appliance modules, door chimes, and on, and on. Next, you define what you want to happen with each device and when. These actions occur because of one of two types of triggers: time/date matches or external triggers. For Time/Date Actions you define (1) a Time/Date Trigger, (2) a Condition, and (3) an Action. The Time/Date trigger can be a specific time, or a time within so many minutes of sunrise or sunset, or a repetitive time every so many hours or minutes. The date can be one or more days of the week, a specific date, or every day. Conditions let you limit actions to only during daytime or nighttime or based upon the value of a certain variable which you also can control. An Action can be either turning a specific device on or off, dimming a light, executing a combination of predefined actions, setting a variable, executing an Applescript, or sending an e-mail. All of these events can be randomized within a specified range of minutes or hours. As you can see the flexibility is virtually limitless. Finally, all Indigo actions can be enabled for use from two other pieces of software: Ovolab Phlink and Salling Clicker. Phlink is a complete telephony server for your Mac. Salling Clicker lets you control many Mac functions including Indigo using almost any Bluetooth-enabled cell phone.

    The other powerful component of Indigo is Trigger Actions. Instead of a time and date, these actions are programmed to take place when a specific triggering event occurs. Triggering events include motion detection, darkness or daylight detection, power failure, device state change, receipt of an X10 command, receipt of an email message containing certain letters or words in the subject or received from a particular email address, or a change in the value of an Indigo variable. As with other actions, you can specify conditions for these actions which must be met, and you can define what actions or combinations of actions occur when the condition is met. As mentioned in the first installment, Indigo also can be used to download most of its actions and triggered actions into a PowerLinc Controller which obviates the need to have an always-on computer to manage your Home Automation System.

    The only real limitation to Indigo is your imagination. If you’re not that imaginative, then you might want to visit the Indigo online forum which has hundreds of tips and suggestions to get you started. In addition, there is a voluminous script library that supports Indigo, Phlink, and Salling Clicker functions as well as a web interface to virtually all Indigo functions and controls. We’ll save an in depth discussion of Ovolab Phlink and Salling Clicker for next week, but these two software products will make your Home Automation Server something that no PC on the planet can rival … at any price.