TweetFollow Us on Twitter

Nov 99 Online

Volume Number: 15 (1999)
Issue Number: 11
Column Tag: MacTech Online

MacTech Online

by Jeff Clites <online@mactech.com>

Apache, Of Course

Over the past several months we've touched on a variety of software packages which originated within the open-source and Unix communities, but which are poised to become important to the Macintosh with the advent of the Unix-based Mac OS X family. But we haven't yet covered one of the most important pieces - Apache. Despite all of the press which Linux gets, the Apache web server is probably the most successful open-source project of all time. To quote the famous statistic (from the Netcraft Web Server Survey), it serves over 55% of the sites on the internet, which according to the Apache FAQ amounts to over 3 million servers.

The Apache Software Foundation
http://apache.org/
The Netcraft Web Server Survey
http://www.netcraft.com/survey/
The Apache Server FAQ
http://apache.org/docs/misc/FAQ.html

On the face of it, there isn't much to talk about-Apache comes preinstalled with Mac OS X Server, and it just works; you don't have to port, compile, install, or really even configure it. If you are only interested in serving static HTML pages or WebObjects applications, you barely have to lift a finger. But if you want to go further and write modules for your web server's plug-in API, or take advantage of the availability of its source code, then the fun begins.

Using Apache

As your first step in going beyond the basics, you'll probably want some general information on running and administering Apache. The best place to start is Apache's online user manual, of course. For those who prefer printed material, O'Reilly and Associates has published Apache: The Definitive Guide (ISBN 1-56592-528-9), and there's even a sample chapter (on security) on their web site. If you prefer a more nuts-and-bolts reference, the Apache Server Administrator's Handbook (ISBN 0-7645-3306-1) looks promising. For those interested in diving into Apache's source code, check out Apache Server Commentary: Guide to Insider's Knowledge on Apache Server Code (ISBN 1-57610-468-0), which explains the innards in great detail.

Apache User's Guide
http://apache.org/docs/
Apache: The Definitive Guide
http://www.oreilly.com/catalog/apache2/

A great source for ongoing information is the Apache Week ezine, published every Friday. Recent issues have covered a variety of useful topics, notably an heads-up on what's coming in Apache 2.0 (and why a 2.0 version is needed at all), and an introduction to HTTP/1.1. And be sure not to miss their Hints and Tips section, which answers those questions you were just about to ask, and their very nice Links page, which will point you to a wealth of resources on server-related standards and technologies as well as further information about Apache itself.

Apache Week
http://www.apacheweek.com/
Apache 2.0 Preview
http://www.apacheweek.com/features/apache20
HTTP version 1.1
http://www.apacheweek.com/features/http11
Apache Hints and Tips
http://www.apacheweek.com/tips/tips
Apache Related Links
http://www.apacheweek.com/docs/links

Extending Apache

Once you know what it does, it's time to start mucking with it (the programmer's credo). As I touched on above, Apache has its own plug-in API; by writing Apache modules you can intercede at any of the eight steps of its request-handling process. This is similar to Netscape's server API, NSAPI, although Apache's approach lets you step in at a few more places. (If you are familiar with WebObjects' request-response loop, the process is conceptually very similar.) Apache takes this plug-in approach seriously, and in fact uses it to implement some of what could be considered the core functionality of a server-for instance, access to CGIs is handled by the mod_cgi module. Another important example is the mod_WebObjects module provided by Apple as a better-performing alternative to the default CGI-based adaptor for serving WebObjects applications. Check out the Apache API notes (again part of Apache's own documentation) for an introduction, and a paper which Robert Thau presented at the Fifth International World Wide Web Conference for an explanation of the considerations behind its design.

Apache API notes
http://www.apache.org/docs/misc/API.html
Design considerations for the Apache Server API
http://www5conf.inria.fr/fich_html/papers/P20/Overview.html

You can write Apache modules in C, but you can also write them in Perl, and if you are familiar with Perl or are interested in learning it, this is a perfect place to apply it. Perl's text-manipulation facilities and high-level data structures, combined with its own large body of powerful community-developed libraries, can make quick work of seemingly complex tasks. A great resource for learning about writing Apache modules comes once again in the form of an O'Reilly book, Writing Apache Modules with Perl and C (ISBN 1-56592-567-X), which will give you the full scoop on writing modules to extend Apache's functionality. (I'm beginning to sound like a broken record, but I promise I'm not on O'Reilly's payroll.) Several of its chapters are available online on the author's accompanying web site.

Writing Apache Modules with Perl and C
http://www.modperl.com/

Also, check out the Apache/Perl Integration Project site for more information about mod_perl. In addition to letting you write Apache modules in Perl, this module improves the performance or Perl-based CGI scripts by embedding a Perl interpreter within Apache itself, and caching scripts in such a way that they can respond to requests without the overhead of launching the interpreter and compiling the script again each time. (Usually, web servers handle CGI requests by launching the CGI application again for each incoming request.) Although this does require you to rewrite your CGI scripts slightly, the speedup can be dramatic, especially for short scripts, whose startup overhead consumes much more time than actually generating the response.

The Apache/Perl Integration Project
http://perl.apache.org/

Getting Involved

Although Mac developers don't need to worry about having to port Apache, that doesn't mean that there isn't work to be done. There are a number of spin-off projects which could use a hand, and the Apache GUI project, for instance, just has Macintosh written all over it. So if you want to get your hands dirty with the open source community, then check out the Related Projects page and you might find something which grabs your interest. (Java servlets, anyone?) And don't forget, working on a piece of software with millions of grateful users can do wonders for your résumé.

Projects of the Apache Software Foundation
http://apache.org/foundation/projects.html
Apache-Related Projects
http://apache.org/related_projects.html
Apache GUI-Dev Project
http://gui.apache.org/

Commercial Tools

It will be interesting, going forward, to see how Apple manages to make its server offering into an actual product, since it is based around tools you can get elsewhere for free. One approach is to provide a rich set of management tools which liberate you from the vagaries of complex configuration files. This seems to be the approach taken by Tenon Intersystems, vendors of WebTen, which brought Apache to the classic Mac OS by providing a Unix emulation environment. For Mac OS X Server they have developed iTools, which brings web-based configuration to Apache and provides additional services (such as DNS and SSL). For the near future, iTools is probably the easiest way to access and manage some of Apache's more advanced features, such as virtual hosting.

WebTen
http://www.tenon.com/products/webten/
iTools
http://www.tenon.com/products/itools/

Alternatives

If Apache's popularity and openness have failed to win you over, you might want to explore your options. Netcraft has an extensive list of links to web server companies, and you can probably find any server you've ever heard of listed here. For a little more guidance, intenet.com's WebServer Compare site lets you search for a server based on the features you want, or you can just look at their quick compare list to get and idea of what's available. Finally, the World Wide Web FAQ has brief descriptions of a number of popular servers-it's a bit out of date but still a good place to start if you really are not sure what server you want to use. Most of the servers listed on this site will be Unix-based, but if you are looking to replace Apache then I am going under the assumption that you are operating under Mac OS X Server. You have a smaller range of choices if you want to run your server under the "classic" Mac OS, but that's a topic for another column.

Netcraft's Directory of Web Server Home Sites
http://www.netcraft.com/Survey/servers.html
WebServer Compare
http://webservercompare.internet.com/
WebServer Quick Compare
http://webservercompare.internet.com/cgi-bin/quickcompare.pl
World Wide Web FAQ
http://www.boutell.com/faq/oldfaq/index.html

Finally, if you just want to update your Mac OS X Server Apache installation to the latest version, check out the article on Stepwise, which tells you how to do it and what to watch out for.

Building Apache 1.3.9 for Mac OS X Server
http://www.stepwise.com/Articles/Workbench/BuildingApache1.3.9.html

Once you've set up your server, come to ours and visit the MacTech Online web pages at www.mactech.com/online/, where you'll find links to even more useful things.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links... | Read more »
Price of Glory unleashes its 1.4 Alpha u...
As much as we all probably dislike Maths as a subject, we do have to hand it to geometry for giving us the good old Hexgrid, home of some of the best strategy games. One such example, Price of Glory, has dropped its 1.4 Alpha update, stocked full... | Read more »
The SLC 2025 kicks off this month to cro...
Ever since the Solo Leveling: Arise Championship 2025 was announced, I have been looking forward to it. The promotional clip they released a month or two back showed crowds going absolutely nuts for the previous competitions, so imagine the... | Read more »
Dive into some early Magicpunk fun as Cr...
Excellent news for fans of steampunk and magic; the Precursor Test for Magicpunk MMORPG Crystal of Atlan opens today. This rather fancy way of saying beta test will remain open until March 5th and is available for PC - boo - and Android devices -... | Read more »
Prepare to get your mind melted as Evang...
If you are a fan of sci-fi shooters and incredibly weird, mind-bending anime series, then you are in for a treat, as Goddess of Victory: Nikke is gearing up for its second collaboration with Evangelion. We were also treated to an upcoming... | Read more »
Square Enix gives with one hand and slap...
We have something of a mixed bag coming over from Square Enix HQ today. Two of their mobile games are revelling in life with new events keeping them alive, whilst another has been thrown onto the ever-growing discard pile Square is building. I... | Read more »
Let the world burn as you have some fest...
It is time to leave the world burning once again as you take a much-needed break from that whole “hero” lark and enjoy some celebrations in Genshin Impact. Version 5.4, Moonlight Amidst Dreams, will see you in Inazuma to attend the Mikawa Flower... | Read more »
Full Moon Over the Abyssal Sea lands on...
Aether Gazer has announced its latest major update, and it is one of the loveliest event names I have ever heard. Full Moon Over the Abyssal Sea is an amazing name, and it comes loaded with two side stories, a new S-grade Modifier, and some fancy... | Read more »
Open your own eatery for all the forest...
Very important question; when you read the title Zoo Restaurant, do you also immediately think of running a restaurant in which you cook Zoo animals as the course? I will just assume yes. Anyway, come June 23rd we will all be able to start up our... | Read more »
Crystal of Atlan opens registration for...
Nuverse was prominently featured in the last month for all the wrong reasons with the USA TikTok debacle, but now it is putting all that behind it and preparing for the Crystal of Atlan beta test. Taking place between February 18th and March 5th,... | Read more »

Price Scanner via MacPrices.net

AT&T is offering a 65% discount on the ne...
AT&T is offering the new iPhone 16e for up to 65% off their monthly finance fee with 36-months of service. No trade-in is required. Discount is applied via monthly bill credits over the 36 month... Read more
Use this code to get a free iPhone 13 at Visi...
For a limited time, use code SWEETDEAL to get a free 128GB iPhone 13 Visible, Verizon’s low-cost wireless cell service, Visible. Deal is valid when you purchase the Visible+ annual plan. Free... Read more
M4 Mac minis on sale for $50-$80 off MSRP at...
B&H Photo has M4 Mac minis in stock and on sale right now for $50 to $80 off Apple’s MSRP, each including free 1-2 day shipping to most US addresses: – M4 Mac mini (16GB/256GB): $549, $50 off... Read more
Buy an iPhone 16 at Boost Mobile and get one...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering one year of free Unlimited service with the purchase of any iPhone 16. Purchase the iPhone at standard MSRP, and then choose... Read more
Get an iPhone 15 for only $299 at Boost Mobil...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering the 128GB iPhone 15 for $299.99 including service with their Unlimited Premium plan (50GB of premium data, $60/month), or $20... Read more
Unreal Mobile is offering $100 off any new iP...
Unreal Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering a $100 discount on any new iPhone with service. This includes new iPhone 16 models as well as iPhone 15, 14, 13, and SE... Read more
Apple drops prices on clearance iPhone 14 mod...
With today’s introduction of the new iPhone 16e, Apple has discontinued the iPhone 14, 14 Pro, and SE. In response, Apple has dropped prices on unlocked, Certified Refurbished, iPhone 14 models to a... Read more
B&H has 16-inch M4 Max MacBook Pros on sa...
B&H Photo is offering a $360-$410 discount on new 16-inch MacBook Pros with M4 Max CPUs right now. B&H offers free 1-2 day shipping to most US addresses: – 16″ M4 Max MacBook Pro (36GB/1TB/... Read more
Amazon is offering a $100 discount on the M4...
Amazon has the M4 Pro Mac mini discounted $100 off MSRP right now. Shipping is free. Their price is the lowest currently available for this popular mini: – Mac mini M4 Pro (24GB/512GB): $1299, $100... Read more
B&H continues to offer $150-$220 discount...
B&H Photo has 14-inch M4 MacBook Pros on sale for $150-$220 off MSRP. B&H offers free 1-2 day shipping to most US addresses: – 14″ M4 MacBook Pro (16GB/512GB): $1449, $150 off MSRP – 14″ M4... Read more

Jobs Board

All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.