home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


O'Reilly Network    Published on the O'Reilly Network (http://www.oreillynet.com/)
   http://www.onlamp.com/pub/a/apache/2000/11/17/wrangler.html
   See this if you're having trouble printing code examples


LAMP Lighter: The Apache Toolbox

by Rael Dornfest
11/17/2000

The Apache Toolbox exemplifies the growing concept of LAMP: Linux, Apache, MySQL, and {Perl,Python,PHP}.

If you're involved in any sort of web development, while the acronym LAMP might not be familiar to you, the popular combo of the Linux operating system, Apache Web Server, MySQL database, and PHPherlthon (that's PHP, Perl, and/or Python) scripting languages should definitely ring a bell or three. This dynamic quadro powers an amazing number of your favourite web sites and you're almost sure to have at least three in your current open source development arsenal.

While Linux is the predominant operating system, one should not dismiss *BSD as a powerful player in this field. And while PHP is the scripting cornerstone of LAMP, Perl and Python are the rather obvious swap-ins.

Apache Toolbox

While the LAMP concept is (to quote a friend) "all the rage in Europe" and well understood, it's sometimes difficult for beginners (and, yes, sometime experts) to compile, install, and configure. Bryan Andrew's Apache Toolbox is a Swiss army knife of a script, providing a customisable, menu-driven interface to downloading and compiling a LAMP installation (minus the Linux bit, mind you)--and more! The Apache Toolbox has out of the box support for:

  • Apache - our favourite web server
  • SSL - Secure Sockets Layer for secure web server interactions
  • PHP, mod_perl, and mod_fastcgi - for speedy scripting language support
  • MySQL - the ubiquitous lightning fast database server
  • OpenLDAP, mod_auth_ldap, mod_auth_radius, mod_auth_pop3, mod_auth_sys and mod_accessref - various means of authentication and authorisation
  • WebDAV and mod_layout - for simple, yet powerful Web design functionality
  • mod_dynvhost, mod_throttle, mod_gzip, and mod_bandwidth - for efficient hosting and server control
  • And more! Apache Toolbox is customisable and has support (it's just a shell script after all) for anything else you'd care to plug in.

Apache Toolbox comes in two different flavours: a) just the script, which will download the various component sources as needed, or b) the full package, including the script and all required sources. The toolbox even catches RPM conflicts should they arise.

The Apache Toolbox itself is simply a shell script that runs from the command-line. It must be run as root (as it'll remind you) to install all the various bits into their appropriate locations. The first step is a menu-driven GUIsh interface to selecting the various packages you wish to install:

-----------------------------------------------------------------
                    Apache Toolbox 1.4.7
                http://www.apachetoolbox.com/
-----------------------------------------------------------------
        [+] 1)  GD 1.8.3
        [-] 2)  MySQL 3.22.32
        [+] 3)  PHP 4.0.3pl1
        [-] a)     IMAP  functions in PHP
        [-] b)     FTP   functions in PHP
        [-] c)     MySQL already installed on this system
        [-] d)     Postgres already installed on this system
        [-] e)     mcrypt support
        [-] f)     mhash support
        [-] 4)     Zend Optimizer (php4 20%-100% faster!)
        [-] 5)  SSL
[-] 6) -Mod Throttle 211    [-] 7) -WebDAV 1.0.2-1.3.6
[-] 8) FastCGI              [-] 9) -Mod AuthNDS 0.5
[-] 10) -Mod Layout         [-] 11) -Mod GZIP 1.3.14.5
[-] 12) -Mod DynaVHost      [-] 13) -Mod Ro AuthSYS
[-] 16) -Mod Bandwidth      [-] 17) -Mod Perl 1.24_01
[-] 18) -Mod Auth LDAP      [-] X) OpenLDAP Required (auth_ldap)
[-] 19) -Mod Auth Radius    [-] 20) -Mod Auth POP3
                   go)  -=CONTINUE=-
                   q)     -=EXIT=-
                   99)   Descriptions
-----------------------------------------------------------------

Not sure what all these goodies are? Type 99<enter> for complete descriptions. After putting together your grocery list of preferred features, type go<enter> and the toolbox springs into action. First stop... RPM conflict checks:

-------------------------------------------------------
-------------- Scanning for RPM's ---------------------
-------------------------------------------------------
Testing for PHP RPM... not found.
Testing for PHP IMAP RPM... not found.
Testing for GD RPM... not found.
Testing for GD Devel RPM... not found.
Testing for Apache RPM... not found.
...
Testing for OpenLDAP RPM... not found.
Testing for OpenLDAP Devel RPM... not found.
[+] Wget found!
-------------------------------------------------------

The toolbox confirms Apache install path (/usr/local/apache), allowing you to change the final destination per your preference, then continues on its way.

Any time a source (tar.gz archive) isn't found, the toolbox script prompts you for permission to download it:

[+] Setting up Apache source...
[-] apache_1.3.14.tar.gz detection failed
Do you wish to download it now? [y/n] y

--21:35:40-- 
--ftp://mirrors.partnersforever.net:21/pub/apache/dist/
  apache_1.3.14.tar.gz => `apache_1.3.14.tar.gz'
Connecting to mirrors.partnersforever.net:21... connected!
Logging in as anonymous ... Logged in!
==> TYPE I ... done.  ==> CWD pub/apache/dist ... done.
==> PORT ... done.    ==> RETR apache_1.3.14.tar.gz ... done.
Length: 1,813,581 (unauthoritative)

 0K -> .......... .......... .......... .......... [  2%]
50K -> .......... .......... .......... .......... [  5%]
...

The toolbox then silently hums away configuring, integrating, pre-heating, and so on...

[+]  Uncompressed Apache source...
[+]  Getting apache pre-configured
[+]  Apache pre-configured
[+]  Apache httpd.conf-dist updated for SSI support
[+] Getting GD lib's with PNG and zlib support ready...
...

After a short while, the toolbox gives you the chance to edit the Apache configuration script, if you're just that bold. If all's well you should end up with a rather familiar site if you've ever configured Apache before:

Configuring for Apache, Version 1.3.14
 + using installation path layout: Apache (config.layout)
 + activated php4 module (modules/php4/libphp4.a)
 + Warning: You have enabled the suEXEC feature. Be aware 
 + that you need root privileges to complete the final 
 + installation step.
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
 + configured for Linux platform
...
Creating Makefile in src/modules/standard
Creating Makefile in src/modules/php4
[+] Done Configuring Apache source

----------------------------------------------------------
If there where _no_ errors run "cd apache_1.3.14;make" now.
Start debugging and have a blast...
Run "make install" in the apache source
directory to install apache 1.3.14  
----------------------------------------------------------

Mosey on over to the apache directory, as specified, make, make test, and make install! For further information on building Apache, visit one of the previous HTTP Wrangler columns.

Resources

The following is a list of starting points from which to explore further some of the topics covered (or not) in this article.

Rael Dornfest is a researcher at O'Reilly & Associates.

Return to Related Articles from the O'Reilly Network .


Library Navigation Links

oreillynet.com Copyright © 2003 O'Reilly & Associates, Inc.