Home arrow Site Administration arrow Page 5 - How To Build the Apache of Your Dreams

Diversion: Layouts - Administration

The best part about Apache is that you can custom build it to include exactly what you need. The defaultconfiguration is a good one, but its far-too-general nature is, by definition, not the best choice for the majority of installations. With a host of plug-in modules available for free over the Internet, customizing Apache to its fullest extent is not only fast and easy, but well worth the time spent.

TABLE OF CONTENTS:
  1. How To Build the Apache of Your Dreams
  2. Building Apache
  3. Module Definitions and Groupings
  4. Diversion: Shared Modules (mod_so)
  5. Diversion: Layouts
  6. Building Apache, Really
  7. Last Thoughts
  8. References
By: Darren Chamberlain
Rating: starstarstarstarstar / 3
September 19, 2000

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
Using --with-layout you can easily indicate where should Apache go after it's compiled. Locations for binaries, man pages, configuration files, and the like can be set using specific options to the configure script, or they can be defined all at once in a layout. Layouts are defined in the config.layout file, in the root of the Apache source. There are several layouts prefined, including Mac OS X server, BeOS, a typical GNU layout, and others. We'll use the layout named Apache as an example, since it's the default; if a layout is not specified, configure uses the Apache layout as a base, and any command l ine options overrride individual directives. (The comments on the right hand side of this table indicate the command line options that can be used for overrides.)

<Layout Apache> prefix: /usr/local/apache # --prefix=DIR exec_prefix: $prefix # --exec-prefix=DIR bindir: $exec_prefix/bin # --bindir=DIR sbindir: $exec_prefix/bin # --sbindir=DIR libexecdir: $exec_prefix/libexec # --libexecdir=DIR mandir: $prefix/man # --mandir=DIR sysconfdir: $prefix/conf # --sysconfdir=DIR datadir: $prefix # --datadir=DIR iconsdir: $datadir/icons # --iconsdir=DIR htdocsdir: $datadir/htdocs # --htdocsdir=DIR cgidir: $datadir/cgi-bin # --cgidir=DIR includedir: $prefix/include # --includedir=DIR localstatedir: $prefix # --localstatedir=DIR runtimedir: $localstatedir/logs # --runtimedir=DIR logfiledir: $localstatedir/logs # --logfiledir=DIR proxycachedir: $localstatedir/proxy # --proxycachedir=DIR </Layout>
These sections define where the various pieces of the final package will go. The whole thing will based in /usr/local/apache, with all binaries (httpd and the support programs) in /usr/local/apache/bin, man pages based in /usr/local/apache/man, configuration files in /usr/local/apache/conf, and so on. Changes to the layout can be made to one of the existing <Layout> sections, or a new one can be added by copying and pasting.

Here is the layout similar to the one that I generally use:

<Layout MyLayout> prefix: /usr/local/apache exec_prefix: $prefix bindir: $exec_prefix/bin sbindir: $exec_prefix/bin libexecdir: $exec_prefix/libexec mandir: /usr/local/man sysconfdir: /etc/apache datadir: $prefix iconsdir: $datadir/icons htdocsdir: $datadir/html cgidir: $datadir/cgi-bin includedir: /usr/include/apache localstatedir: /var/apache runtimedir: $localstatedir/logs logfiledir: $localstatedir/logs proxycachedir: $localstatedir/proxy </Layout>
This is very similar to the Apache layout, except for a few things: man pages go into /usr/local/man, so they can be easily retrieved with a regular call to 'man httpd'; include files go into /usr/include/apache, so that they can be more easily used when I write to the Apache API, and configuration files go into /etc/apache. Logs, proxy stuff, and things like PID files go into /var/apache; I mount a separate partition as /var so my root filesystem doesn't fill up with logs, which makes it an ideal place for webserver logs.



 
 
>>> More Site Administration Articles          >>> More By Darren Chamberlain
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: