OS X is the easiest platform for a personal or SOHO Web site. Mac Advisor hed: Be a webmaster with Mac OS X dek: OS X is the easiest platform for a personal or SOHO Web site. by Dennis Sellers
Did you know that if you can point and click, you can be a webmaster and run an Apache Web server on your Mac, especially if you’re using Mac OS X?
But wait–let’s back up and explain. You probably know that Mac OS X is Apple’s new operating system, which puts a Mac user interface body on a Unix engine. Not only can it run classic Mac software and applications built especially for it, but it also runs some of the best open-source programs, including Apache, a Web server that, in fact, forms the basis for Mac OS X’s file-sharing capabilities.
Open source is a term for the historical development model used by the Internet community to facilitate the distributed development of software. The basic idea: involve as many people as possible in writing and debugging code by publishing the source code and encouraging the formation of a large community of developers who will submit modifications and enhancements.
Apache is a powerful, flexible, HTTP/1.1-compliant Web server known for its stability. It’s highly configurable, and can be extended with third-party modules. Apache is the world’s most popular Web server, powering more than 60 percent of Internet domains, according to Netcraft’s June 2001 Web Server Survey.
Mac OS X has a Web Sharing feature. But, you may say, the “traditional” Mac operating system has included a personal Web server in the past. And you’d be right. However, X’s Web Sharing is very different. It’s a fully functional installation of the aforementioned Apache Web server.
When you first install Mac OS X, Web Sharing is inactive by default. And unlike Web Sharing in previous versions of the Mac operating system, you don’t have to enable file sharing. Since Mac OS X is designed as a multi-user system, it presumes that file sharing is on.
In fact, multiple users can have multiple Web sites operating from the same Mac with Mac OS X. However, since Mac OS X is a multi-user system, the start-up process for this can be relatively fast or a bit slow. It all depends on how many user accounts are configured on your Mac, as well as how many files and folders are in the serving content locations. No matter how many users there are, when the Web Sharing process is finished, the Start button will change to a Stop button.
You can set up your Web site simply by adding HTML pages and images to the Sites folder in your Home folder. This means that if someone’s browsing the Net and types in your computer’s name, they can’t run wild with access to your computer and all its files.
You can place HTML docs in your Sites folder and make them accessible by appending ~username/ to the URL of your Web server. You can use the short user name that’s assigned to you. For example, if my Web server’s IP address is 615.859.1.2, the URL, http://615.859.1.2/~dsellers, would cause the page, index.html, to load from the Sites folder. If your Mac’s Web server is accessible through a domain name address, such as www.dsellers.com, then user sites can be accessed with a URL address such as http://www.dsellers.com/~dsellers.
You can place new pages in your Sites folder and create subfolders-e.g., “Docs,” “Images,” “Text”-within it.
Once you’ve started Web Sharing, it’ll keep on keepin’ on until you tell it otherwise or until you shut down your Mac. But when you restart your system, the process will automatically be implemented. To disable Web Sharing, open the Sharing System Preferences and click the Stop button.
Web Sharing only works when your Mac is connected to the Internet. If, like many folks, you access the Internet by modem, the downside to this is that your server will only be on the Internet when you’ve dialed up and made a modem connection. If you’re not connected, your server’s not available. You can still Web Share, but you’ll have to spread the word about when your Web site is actually available.
By the way, all Web servers have a default home page. Web Sharing uses a file named index.html, the default file name specified in the configuration files for the Apache Web server. In other words, it’s the default for serving HTML documents in each directory in the Web server. This can only be overridden with the Terminal application or a product such as iTools. More on both of those in a moment.
Once you’ve got your Web server up and going, you can test it by using the Mac that’s working as the server, or from another machine. If your Mac has a fixed IP (Internet Protocol) address on the Internet, you can access it by typing the address in a Web browser that’s Internet connected. If your computer or network has its own domain name, you can access the server by typing in its server name (the old faithful “www” moniker) and domain name (dennis-sellers, for example) together (www.dennis-sellers.com).
However, if your Web server isn’t connected to the Internet, you can enter the server’s private IP address from your own Mac or from another Mac on your local network. Ditto if you’re connecting from behind a firewall on a private IP network. (A firewall is a computer or router configured to act as a security gateway between your LAN and the Internet.)
Either way, an Apache default document should download from the Web server to your client Mac and pop up on-screen. The default page tells you what type of server (Apache, naturally) is being used to serve up your Web documents, and provides links for more information. Eventually, you’ll want to replace the default page with your own files.
What’s nifty about Apple’s new operating system is that it hides all of Apache’s expansion modules and configuration options. All of the Web server’s advanced options are still there; Apple has just chosen to cloak them under a friendly user interface.
Although Apple has hidden Apache’s advanced options, power users can still access them via the included Terminal application, which offers command-line access to the Unix core that hums beneath Mac OS X’s Aqua interface. If you’re a Unix guru, you can go ahead and test-drive the command line to get familiar with the characteristics of the Unix shell in Mac OS X.
However, if you’re not a Unix-head, prepare for some initial intimidation. You’ll want to check out the Terminal to see that it’s not really that difficult to use the command line for certain tasks. The best way to get started is to walk through Apple’s online Terminal tutorial.
Tenon Intersystems’ iTools provides a Web-based graphical administration interface to Apache and a comprehensive suite of Internet server tools. The latest release, version 6, lets you configure and remotely manage Apache, DNS, and FTP, along with a range of other Mac OS X Internet services, by using a standard browser on any platform.
The centerpiece of iTools is the Administration Server, which extends Apache in two important ways. First, you get a graphical interface that manages the syntactically demanding Apache configuration file. And you can access this interface from any Web browser, which by definition gives you the ability to configure Apache remotely.
With Tenon’s new Aqua graphical user interface, webmasters will also be able to manipulate Apache, DNS, and FTP directly on Apple’s Aqua desktop. The new graphical user interface (GUI) will co-exist with Tenon’s secure, remote browser-based administration, enabling webmasters to switch between desktop management and “anywhere, anytime” browser-based control.
Because all the needed Web server capabilities will be available using Tenon’s iTools 6 on Mac OS X, webmasters will only need to consider Apple’s upcoming new server product if they need additional file sharing, NetBoot, or other advanced hardware features.
And if you really need more powerful Web-serving features, you’ll want to look into Mac OS X Server, Mac OS X’s big brother. It’s designed to combine the strengths of AppleShare IP with the power of Mac OS X, integrating services for file sharing, Internet and Web serving, networking, client management, and e-mail. Mac OS X Server, which ranges in price from $499 for a 10-user license to $999 for an “unlimited” license, comes bundled with Apache, mySQL, and PHP (also known as AMP). With PHP, you can develop and host a wide variety of sites for delivering content, conducting e-commerce, or any application that requires connecting to a database server and extracting its data.
Mac OS X is satisfactory for developers who want to download and install PHP themselves. For those who want the software pre-installed and ready to go, Mac OS X Server is the way to go. For more info, go to the Mac OS X Server Web site.
By the way, the Apache Web server is open-source software overseen by the Apache Software Foundation, which exists to ensure “that the Apache projects continue to exist beyond the participation of individual volunteers, to enable contributions of intellectual property and funds on a sound basis, and to provide a vehicle for limiting legal exposure while participating in open-source software projects.”