Home » 2005 » February (Page 3)

Monthly Archives: February 2005

The Most Versatile VoIP Provider: FREE PORTING

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.

blankSMTP 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 NetIdentity.com. 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 127.0.0.1. 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 mundy.org. 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:

blank

  • 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, 127.0.0.1, 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 DynDNS.org. 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 wmundyhome.dyndns.org 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.