Apache
  Home arrow Apache arrow Page 6 - Building Apache the Way You Want It
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
APACHE

Building Apache the Way You Want It
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 11
    2005-08-18

    Table of Contents:
  • Building Apache the Way You Want It
  • Building Apache from Source
  • General Options
  • Enabling or Disabling Modules in Bulk
  • Changing the Module Order (Apache 1.3)
  • Building Apache from Source As an RPM (Apache 2)
  • Advanced Configuration
  • Determining Apache’s Locations Individually
  • Choosing a MultiProcessing Module (Apache 2)
  • Building Apache with suExec support
  • Configuring Apache 2 for Cross-Platform Builds
  • Configuring the Build Environment
  • Building Modules with apxs

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Route your faxes to your email inbox. Private, secure fax numbers available from CallWave. Choose your fax number.

    Building Apache the Way You Want It - Building Apache from Source As an RPM (Apache 2)
    (Page 6 of 13 )

    Recent releases of the Apache 2 source distribution contain an RPM .spec file that you can use to build Apache as an installable RPM. The httpd.spec file contains all the details needed to build a default Apache installation and can be used without even unpacking the source archive with this:

    $ rpm -tb httpd-2.0.47.tar.gz

    This tells the RPM tool to look inside a .tar file for the .spec file (-t) and to build only binary RPMs (-b). Configuration and building of Apache takes place automatically and should result in four RPM files being generated in /usr/src/packages/RPMS/i386 (this path may vary according to Linux distribution and processor architecture):

    httpd-2.0.47-1.rpm
    httpd-devel-2.0.47-1.rpm
    httpd-ssl-2.0.47-1.rpm

    For the build to be successful, you’ll need to have several other packages installed first, notably perl and findutils, but the build prerequisites also include pkgconfig, expat-devel, db3-devel, and openldap-devel. To get SSL support, you also need openssl-devel. Each of the -devel packages in turn needs its parent package, and these in turn may have other dependencies.

    This is, however, misleading: It’s possible you might need all of these packages, but you can also build an RPM package that doesn’t. You can—and should—edit the httpd.spec file to eliminate dependencies you don’t require. For example, openldap is needed only if you want mod_ldap, and mod_auth_ldap.pkgconfig is needed only on some Linux distributions. Likewise, db3 is needed only if you want mod_auth_dbm to be able to handle Berkeley DB format databases. Similarly, expat-devel is needed only if you want Apache to build with an existing Expat XML parser installation; otherwise, it’ll happily build using the cut-down version that’s included in the Apache source.

    These dependences exist because the build instructions in httpd.spec include the modules that require them, but you can remove unnecessary packages from the BuildReq: line so long as you also remove the dependant modules. At the same time, if you want to ensure that the optional httpd-ssl package is built (in other words, make it mandatory), you add openssl-devel:

    BuildPrereq: openldap-devel, db3-devel, expat-devel, findutils, perl, pkgconfig

    becomes this:

    BuildReq: perl, findutils, openssl-devel

    Within the httpd.spec file is a configure command, which is most easily locatable by searching for a --prefix command line argument. You can customize this using all the criteria and strategies I’ve already discussed for a stand-alone configure command, with the advantage of creating an installable package as the end product. You should remove any part of the command you don’t need—particularly modules that you don’t need but also directory locations. You should also add a layout to provide the basic structure of the installed server. You can even merge the SSL package into the main server, if you want to eliminate it as a separately installable component.

    Because you want to edit the .spec file, it’s easiest to extract it singly from the archive and then build it using the -b option to RPM. This requires that the original archive file is present where rpm looks for it, in the SOURCES subdirectory of the RPM system:

    $ tar zxvf httpd-2.0.47.tar.gz httpd-2.0.47/httpd.spec
    $ mv httpd-2.0.47/httpd.spec .
    ...edit httpd.spec...
    $ cp httpd-2.0.47.tar.gz /usr/src/packages/SOURCES
    $ rpm -bb httpd.spec

    If all goes well, this should generate Apache RPMs built according to your precise specifications, including whichever modules and features you want included. You can store the httpd.spec file somewhere safe and reuse it any time to regenerate your Apache setup. As new releases of Apache are made available, you can move your changes into the new httpd.spec (assuming it has changed) with a minimum of fuss and build those according to the same criteria as before.

    More Apache Articles
    More By Apress Publishing


       · This article (chapter) is better then most full books I have on Apache and I do have...
     

    Buy this book now. This article is from chapter three of the book Pro Apache third edition, written by Peter Wainwright (Apress, 2004; ISBN: 1590593006). Check it out at your favorite bookstore. Buy this book now.

       

    APACHE ARTICLES

    - Putting Apache in Jail
    - Containing Intrusions in Apache
    - Server Limits for Apache Security
    - Setting Permissions in Apache
    - Installing Apache
    - Apache Installation and Configuration
    - Apache Tapestry and Custom Components: DateI...
    - Tapestry and AJAX: Autocompleter and InlineE...
    - PropertySelection and IPropertySelectionMode...
    - The DatePicker and Shell Components of Apach...
    - Apache Tapestry: ASO and More Components
    - Apache Tapestry and DirectLink, IoC and DI
    - Making a CelebrityCollector with Apache Tape...
    - Apache Tapestry and Listener Methods, Condit...
    - The Properties of Tapestry Pages

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway