Web Servers Galore
If you’re hosting your own Web site, you have to get a Web server, install it, configure it, and keep it running. Choosing the UNIX Web server package that’s best for you is a question of finding the right set of features at the right price. (In the case of Apache, the right price happens to be free.) Linux Most UNIX and Linux distributions include, for free, Web servers along with server software for other Internet resources, such as databases, e-mail, news, and FTP. Lots of Web servers are available, but the one most people use is Apache.Turn the wayback machine to 1994 — the Pleistocene era in the computer world. A fellow named Rob McCool is about to leave the hallowed halls of the National Center for Supercomputing Applications (NCSA) at the University of Illinois. His legacy: The most popular Web server software in the world, the HTTP daemon, or HTTPd.After Rob leaves the NCSA, work on HTTPd pretty much stops. Webmasters hooked on HTTPd, however, keep on using it. Because they’re resourceful UNIX hackers, many of them add new stuff and fix broken stuff. A year later, so many of these additions and fixes (called patches in computer lingo) exist that intrepid Bay Area hackers Brian Behlendorf and Cliff Skolnick decide to recruit a few stalwarts like themselves to pull together, test, and publish all these patches in a new release of HTTPd. The result is the first official version of the Apache server, which sees the light of day in April 1995.Why Apache? Because it’s “a patchy server,” based on some existing code and a slew of patches. Well, you asked.Over the years, the original team of eight contributors grows to about 20, with hundreds of users weighing in with ideas, new code, and documentation. This team of about 20 volunteers from around the world makes up the Apache Group. The Apache Group uses “the Internet and the Web to communicate, plan, and develop the server and its related documentation.”For the Apache server, 1998 was a banner year. As of June 1998, Apache ran on more than 48 percent of all Web sites (an estimated 1,100,000 sites). Running a distant second were Microsoft (non-UNIX) servers, at about 22 percent of all Web sites. Netscape servers accounted for less than 10 percent of all Web sites.Turn the clock ahead to 2003, and Apache continues its dominance, despite Microsoft’s best efforts to push its Windows-based servers. Surveys consistently show upwards of 60 percent of all Web sites run Apache, with Microsoft’s IIS a distant second at about 25 percent.
Apache and PHP are king
The Apache Web server is free and fast and popular. It runs on every UNIX you can think of, including Linux. (Versions for Windows are also available, but much less popular.) In fact, it’s the most popular Web server of any kind in use today (see the sidebar “Not too patchy” for details). If you’re on the Web, surf to the home page of the Apache HTTP Server Project, at www.apache.org , for information and downloads.PHP is a programming language designed to be built into Web pages. Although it’s developed separately from Apache, PHP is designed to be easy to integrate with Apache, and most pre-configured versions of Apache include PHP. By putting little bits of PHP into a Web page, you can make minor customizations on the fly. For example, in our home page at http://net.gurus.com , the Reader Quote of the Day section uses some PHP code to insert the current day’s comment from a daily file so we don’t have to edit the Web page every night. Using a lot of PHP, you can write large, beautiful Web applications, as you see in the next section.
The other popular language people use for Web work is Perl, often described as the duct tape of the Internet. Although building bits of Perl into Web pages is possible, more commonly it’s used in CGI scripts, programs that run in a response to a request from a browser and build a Web page from scratch. As programming languages go, Perl is relatively easy to learn and use, although it’s still definitely a programming language. Perl For Dummies, 4th Edition, by our friend Paul Hoffman, tells you more.Most sophisticated Web applications also need a database to hold the dynamic data for the site. Fortunately, UNIX has plenty of those available, too. The two most popular free ones are MySQL and PostgreSQL, both of which are packaged with most UNIX and Linux systems. They both work well; MySQL is faster while PostgreSQL has more complete data management abilities. If you need a really serious database, Oracle or IBM is happy to sell you all the database you need to run on your UNIX or Linux system.
Building a Web site with almost no work
Use someone else’s work, of course. A remarkably large amount of PHP and Perl code is available for free on the Internet, some of which is quite good. Drop by our sister site http://privacyfordummies.com , for example. We put in the beautiful graphics and sparkling and witty contents (well, one of our co-authors did), but all of the technical code that manages the articles, counts votes in polls, handles user registrations, and all of the other flashy features of the site come from a package with the odd name of Postnuke, an extremely powerful and flexible content management system written in PHP and MySQL and available for free at www.postnuke.com . You need to download Postnuke, or at least the parts of it you need, install it as a Web site on your server, and then start it up and configure it. A fair amount of work is involved, but it’s about 0.1 percent of the work of writing something like that from scratch.If you look around, you can find everything from online calendars to blogging packages to shopping carts to online photo albums available for free in PHP or Perl. A good place to start looking is http://dmoz.org/Computers/Programming/Internet/Server_Side_Scripting .
Hey, stop laughing. Believe it or not, it’s true. AOL has one of the world’s busiest Web sites, and it all runs on an open source server called AOLserver, available for free download at http://aolserver.com . It’s the only plausible alternative to Apache for busy Web sites.AOLserver is definitely intended for serious Web developers. The documentation is practically non-existent, the Web page programming is in an arcane language called TCL (sort of like PHP, but not very), and you have to know enough about programming to download the source code, configure it including setting up a connection to whatever database you’re using, build a running version on your system, install it, and start it up. We did it in an afternoon, but it took a fair amount of geeky skill.Once you have it running, AOLserver is really fast. The best-known AOLserver site other than AOL is http://photo.net , which reports that using a largish Sun database server running Oracle and a handful of PC Web servers running AOLserver on Linux and Solaris, it handles 6 million hits a day serving about 56GB, peaking at 520,000 hits an hour. That’s a lot of pictures.