Apache
  Home arrow Apache arrow Page 4 - Getting Started with Apache 2.0, Part ...
Dev Shed Forums 
Administration  
AJAX  
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 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
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

Getting Started with Apache 2.0, Part 1
By: Harish Kamath
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 26
    2005-03-07

    Table of Contents:
  • Getting Started with Apache 2.0, Part 1
  • Getting Off the Blocks
  • Compiling Apache
  • Configuration Options
  • The "httpd.conf" Configuration File: a Quick Overview
  • PHP 5.0.3 with Apache 2.0.52
  • Conclusion

  • 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

    Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!

    Getting Started with Apache 2.0, Part 1 - Configuration Options


    (Page 4 of 7 )

    In the previous section, I've demonstrated how you can get off the blocks by installing an "out-of-box" configuration of the Apache Web server. However, the primary advantage of Open Source software is the ability to customize and fine-tune the software as per your whim and fancy - and the Apache Web server is no different.

    In this section, I will outline the options that one can use with the "configure" command - this helps you to compile a Web server that you want rather than force you to use a version that everyone else uses. Talk about power!

    Before I list them, I would like to point out that most options, which require you to specify a value, have the following general syntax:

    --option_name=option_value_comes_here

    You've already been introduced to the "--prefix" option. Now its time to say hello to the "--exec-prefix" option, that allows you to specify the location for the "architecture-dependent" files. All the binary files, C library files,  manual files and so forth are stored under this location. So, you might want to do a re-think before you decide to specify a custom value for this parameter. For the record, this defaults to value specified in the "prefix" option.

    Next, you have a bunch of options that allow you to further fine-tune the location of different files, listed in the above paragraph. As the name of each option (in the list below) suggests, each is specific to a particular set of files whose location it controls:

    • the "--bindir" option: you can specify the location for different Apache executables such as httpd, htpasswd, and so forth.

    • the "--includedir" option: the location of the C header files are governed by this parameter.

    • the "--mandir" option allows us to customize where we can install the manual files.

    • the "--sysconfdir" option controls the folder where the configuration files such as the "httpd.conf" are installed.

    As already mentioned, one of the distinct advantages of Apache is the ability to fine-tune your local installation because of its modular structure. Each add-on feature, supported by the Web server, is available in the form of a module that can be either compiled statically into the binary or loaded dynamically as a DSO module when the server starts. For example, if you wish to enable LDAP with your Apache installation, you'll need to enable the "mod_ldap" module.

    A little note about DSO (an acronym for Dynamic Shared Objects) modules would be appropriate before I proceed further. It is quite possible that the default configuration of Apache does not support modules that you may need in the future. Consider the "mod_ldap" LDAP module. When you compiled Apache for the first time, you did not foresee the need for this module. However, a few months later, you are asked to enable it. The only option, then, would be to go through the entire rigmarole of compiling the server all over again.

    This is not how it works with DSO modules. You can compile the modules that you may (or may not) require in the future as DSO modules (I'll show you how, in a moment) and then you can tweak the Apache configuration file to load them at start-up, as required.

    Coming back to our "configure" command - note that you can disable any modules that are compiled, by default, in the current version of Apache using the following generic syntax:

    --disable-MODULE_NAME

    Here are some of the modules that you can disable with the "configure" command:

    • "--disable-auth" disables the features provided by the "mod_auth" module.

    • "--disable-autoindex" does not allow the server to display directory listings.

    • "--disable-cgi" prevents CGI scripts from being executed on the server.

    • "--disable-include" turns off Server Side Includes in your Web pages.

    • "--disable-http" disables the HTTP protocol itself - DO NOT even think about using this option unless you are really sure of what you're doing.

    That was a just a partial list. The URL at the end of this section will provide you with a complete list of all such modules.

    Now that you've seen how to disable modules compiled into the Web server, you'll be surprised to learn that there are some modules which are compiled but not enabled. In order to enable these modules, we have two options: you can use "--enable-mods-shared" that allows us to dynamically load the list of modules, or use the "--enable-modules" option to bind a set of modules statically, as shown below:

    $ ./$configure --prefix=/usr/local/apache --enable-mods-
    shared='ldap auth-ldap proxy-http'

    The above command will dynamically load the following modules: mod_ldap, mod_auth_ldap and mod_proxy_http where the next command will bind the same modules statically:

    $ ./$configure --prefix=/usr/local/apache --enable-modules
    ='ldap auth-ldap proxy-http'

    And if you are feeling too lazy to list the modules at the command line, you can opt for the "most" and "all" keywords with the "--enable-mods-shared" option, which will compile "most" and "all" modules as DSO modules.

    But, there are always a few who love to type;they can use module specific options to enable the corresponding modules. The general syntax for such options is as follows:

    --enable-MODULE_NAME=shared

    This builds the specified module as a DSO where as the following syntax will compile the same module, statically:

    --enable-MODULE_NAME=static

    You can view a list of all such modules at the following URL:
    http://httpd.apache.org/docs-2.0/programs/configure.html#installationdirectories

    Finally, there are always some modules that are not a part of the Apache project. For example, if you wish to configure PHP to work with the Apache Web server, you'll need a generic mechanism that allows you to load third-party Apache modules at start-up. This is where the "--enable-so" option comes in handy - this allows you to load such third-party libraries as the server starts.

    That's about it as far as the powerful "configure" command is concerned. Before you proceed to the next section, take a look at the following URL for more details about the installation process: http://httpd.apache.org/docs-2.0/install.html

    More Apache Articles
    More By Harish Kamath


       · It is great to see some documentation on how to get started with Apache, as I was...
       · Hi there,What is the issue that you are facing with the installation of Apache?...
     

       

    APACHE ARTICLES

    - Creating a VAMP (Vista, Apache, MySQL, PHP) ...
    - 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...





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