Amiga Apache HTTP Server Version 1.3
Overview of new features
New Features with Amiga Apache 1.3
Every new Feature in the apache1.3b3 release is available in the Amiga Apache1.3b3
version, but there is a difference. Amiga Apache is also capable of treating AREXX
scripts the same way as it does with perl & sh scripts. Interfacing with Amiga
programs supporting AREXX is easy. Below is a list of changes in the core code
of Apache.
New Features with Apache 1.3
New features with this release, as extensions of the Apache
functionality. Because the core code has changed so
significantly, there are certain liberties that earlier versions of
Apache (and the NCSA daemon) took that recent Apache versions are
pickier about - please check the
compatibility notes if you have any
problems.
In addition to a number of bug fixes and internal performance
enhancements, Apache
1.3 has the following specific new user features:
- Optional «Spelling Correction» module added to distribution
This optional module corrects frequently occurring spelling errors in
document names requested from the server. This includes the correction
of miscapitalized requests (as was available in a separately available
mod_speling module as of Apache 1.1 already) but extends
spelling correction to single inserted, omitted, transposed or
mistyped characters. This catches the majority of mistyped requests.
To make use of this module, it must be enabled in the server's
Configuration file, and the
CheckSpelling
directive must be set to on.
- Enhanced Conditional Setting of Environment Variables
The
BrowserMatch*
directives of Apache 1.2 have been joined by some more powerful
brethren:
SetEnvIf
and
SetEnvIfNoCase. These allow you to set environment
variables for server and CGI use based upon all sorts of
attributes of the request.
- Better Logging for Proxy Connect Errors
In Apache 1.2 and earlier, when the proxy had difficulty connecting to
a system it would log the error but no details. It now includes the
IP address and port to which it couldn't connect.
- Enhanced SSI String Comparisons
The string-based server-side include (SSI) flow-control directives
provided by
mod_include
now include comparison for less-than (<), less-than-or-equal
(<=), greater-than (>), and greater-than-or-equal (>=).
Previously comparisons could only be made for equality or inequality.
- Re-organised Sources
The source files for Apache have been re-organised. The main difference
for Apache users is that the "Module" lines in Configuration
have been replaced with "AddModule" with a slightly different syntax.
For module authors there are some changes designed to make it
easier for users to add their module.
- Default Apache directory path changed to /usr/local/apache/
The default directory for the apache ServerRoot changed from the NCSA-compatible
/usr/local/etc/httpd/ to /usr/local/apache/.
This change covers only the default setting (and the documentation); it
is of course possible to override it using the
-d ServerRoot and -f httpd.conf switches when starting apache.
The Amiga version of Apache has always the APACHE: path. You need to assign it in the
s:user-startup to a directory of your choice (preferred location: usr:local/apache)
- Sortable Directory Listings
If a directory listing is displayed using
FancyIndexing,
clicking on a column title will now sort the listing in
order by the values in that column. Selecting the column
repeatedly will toggle between ascending and descending order.
This feature can be disabled with the SuppressColumnSorting
IndexOptions
keyword.
- SuppressHTMLPreamble Option for
FancyIndexed Directories
If a directory is marked for display with FancyIndexing, the listing
page usually follows a predefined format using server-generated HTML.
If the IndexOptions directive for the directory
includes the SuppressHTMLPreamble option,
and a file specified by the
HeaderName
directive is found in the directory, and the header
file is recognized as containing HTML (determined by the file
extension), then the module will assume that the
header file contains the necessary introductory HTML tags and will not
generate them itself.
- Less Buffering of CGI Script Output
In previous versions of Apache, the output from CGI scripts would be
internally buffered by the server, and wouldn't be forwarded to the
client until either the buffers were full or the CGI script completed.
As of Apache 1.3, the buffer to the client is flushed any time it
contains something and the server is waiting for more information from
the script. This allows CGI script to provide partial status reports
during long processing operations.
- Support for Windows NT/95
Apache now supports the Windows NT and Windows 95 operating systems,
as well as the Unix systems supported in previos releases. Although the
Windows version of Apache may not be perform as well as on the Unix
systems for which Apache was originally written, the ability to run on
Windows gives Apache the ability to run on a large number of web
servers it was not previously able to.
- Regular Expression support for
Alias and Redirect
New AliasMatch,
ScriptAliasMatch, and
RedirectMatch
directives allow for the use of regular expression matching.
Additionally, new
<DirectoryMatch>,
<LocationMatch>,
and
<FilesMatch>
sections provide a new syntax for regular expression sectioning.
- New "Magic" MIME-typing
module
A new module, the optional mod_mime_magic, has been
added. It uses "magic numbers" and other hints from a file's contents
to figure out what the contents are. It then uses this information to
set the file's media type, if it cannot be determined by the file's
extension.
- Directory indexing modules split
The mod_dir module has been split in two, with
mod_dir handling directory index
files, and mod_autoindex
creating directory listings. Thus allowing folks to remove
the indexing function from critical servers.
- Support for Directory Icon Sizing
The
mod_autoindex
module provides listings of directory contents when appropriate. If
the FancyIndexing option is enabled, each file in the
list is preceded by an icon representing the content type. In earlier
versions of Apache, the HTML IMG tags for these icons
weren't sized, so the browser had to wait until the images were loaded
before it could lay out the page. With 1.3, the
IndexOptions
directive has two new keywords which allow you to control whether
pre-sized IMG tags are used. This can substantially
speed up the display of large directory listings.
- AccessFileName
Enhancement
The AccessFileName directive can now take more than one
filename. This lets sites serving pages from network file systems and
more than one Apache web server, configure access based on the server
through which shared pages are being served.
- HostNameLookups now defaults to "Off"
The HostNameLookups
directive now defaults to "Off". This means that, unless explictly
turned on, the server will not resolve IP addresses into names. This
was done to spare the Internet from unnecessary DNS traffic.
- Double-Reverse DNS enforced
The
HostnameLookups
directive
now supports double-reverse DNS. (Known as PARANOID in the
terminology of tcp_wrappers.) An IP address passes a double-reverse
DNS test if the forward map of the reverse map includes the original
IP. Regardless of the HostnameLookups setting,
mod_access access lists using DNS
names require all names to pass a double-reverse DNS test.
(Prior versions of Apache required a compile-time switch to enable
double-reverse DNS.)
- CIDR and Netmask access control
mod_access directives now support
CIDR (Classless Inter-Domain Routing) style prefixes, and netmasks for
greater control over IP access lists.
- NoProxy
and ProxyDomain
directives added to proxy, useful for intranets.
- AddModuleInfo
directive added to mod_info
Allows additional information to be listed along with a specified module.
- Performance Improvements
- IP-based virtual hosts are looked up via hash table,
giving a performance boost on servers with large numbers of vhosts.
- <Directory> parsing of requests has been vastly improved, giving
speedups on configs with a lot of sections.
- The critical path for static requests has fewer system calls. This
generally helps all requests. (45 syscalls for a static request
in 1.2 versus 22 in 1.3 in a well tuned configuration).
- ReceiveBufferSize
directive gives
mod_proxy's outgoing connections
larger network buffers, for increased throughput.
- The low level I/O routines use
writev (where available)
to issue multiple writes with a single system call. They also avoid
copying memory into buffers as much as possible. The result is
less CPU time spent on transferring large files.
- Static requests are served using
mmap, which means bytes are only copied from the
disk buffer to the network buffer directly by the kernel. The
program never copies bytes around, which reduces CPU time.
(Only where available/tested.)
- When presented with a load spike, the server quickly adapts by
spawning children at faster rates.
- The code which dispatches modules was optimized to avoid repeatedly
skipping over modules that don't implement certain phases of the
API. (This skipping showed up as 5% of the cpu time on profiles of
a server with the default module mix.)
- Revamp of the Unix scoreboard management code so that less time is
spent counting children in various states. Previously a scan was
performed for each hit, now it is performed only once per second.
This should be noticeable on servers running with hundreds of
children and high loads.
- New serialization choices improve performance on Linux, Solaris,
and IRIX.
mod_log_config
can be compile-time configured to buffer writes.
See the new performance
documentation for more information.
- Unique Identifiers
mod_unique_id can be included
to generate a unique identifier that distinguishes a hit from every
other hit. ("Unique" has some restrictions on it.) The identifier
is available in the environment variable UNIQUE_ID.
- Reliable Piped Logs
On almost all Unix architectures Apache now implements "reliable"
piped logs in mod_log_config.
Where reliable means that if the logging child dies for whatever
reason, Apache will recover and respawn it without having to restart
the entire server. Furthermore if the logging child becomes "stuck"
and isn't reading its pipe frequently enough Apache will also restart
it. This opens up more opportunities for log rotation, hit filtering,
real-time splitting of multiple vhosts into separate logs, and
asynchronous DNS resolving on the fly.
- ServerRoot relative auth filenames
Auth filenames for the various authentication modules are now treated
as relative to the ServerRoot if they are not full paths.
- Include directive
The
Include
directive includes other config files immediately at that
point in parsing.
- Absence of any TransferLog disables logging
If no TransferLog
directive is given then no log is written. This supports co-existence
with other logging modules.
- Ability to name logging formats
The
LogFormat
directive has been enhanced to allow you to give nicknames to
specific logging formats. You can then use these nicknames in other
LogFormat
and
CustomLog
directives, rather than having to spell out the complete log format
string each time.
- mod_cern_meta configurable per-directory
mod_cern_meta is now configurable
on a per-directory basis.
- Detaching from stdin/out/err
On boot Apache will now detach from stdin, stdout, and stderr. It
does not detach from stderr until it has successfully read the config
files. So you will see errors in the config file. This should make
it easier to start Apache via rsh or crontab.
- Improved HTTP/1.1-style Virtual Hosts
The new
NameVirtualHost
directive is used to list IP address:port
pairs on which HTTP/1.1-style virtual hosting occurs. This is
vhosting based on the Host: header from the client.
Previously this address was implicitly the same as the "main address"
of the machine, and this caused no end of problems for users, and
was not powerful enough.
Please see the Apache Virtual Host
documentation for further details on configuration.
- API Additions
For all those module writers and code hackers:
child_init function for module API
A new phase for Apache's API is called once per "heavy-weight process,"
before any requests are handled. This allows the module to set up
anything that need to be done once per processes. For example,
connections to databases.
child_exit function for module API
A new phase called once per "heavy-weight process," when it is
terminating. Note that it can't be called in some fatal cases (such
as segfaults and kill -9). The child_init and
child_exit functions are passed a pool whose lifetime is
the same as the lifetime of the child (modulo completely fatal
events in which apache has no hope of recovering). In contrast,
the module init function is passed a pool whose lifetime
ends when the parent exits or restarts.
child_terminate
Used in the child to indicate the child should exit after finishing
the current request.
register_other_child
See http_main.h. This is used in the parent to register
a child for monitoring. The parent will report status to a supplied
callback function. This allows modules to create their own children
which are monitored along with the httpd children.
piped_log
See http_log.h. This API provides the common code for
implementing piped logs. In particular it implements a reliable piped
log on architectures supporting it (i.e., Unix at the moment).
- MD5 functions renamed
ap_*
MD5 functions renamed to avoid conflicts with other libraries.
- scoreboard format changed
The scoreboard format is quite different. It is considered a
"private" interface in general, so it's only mentioned here as an FYI.
set_last_modified split into three
The old function set_last_modified performed multiple
jobs including the setting of the Last-Modified header, the
ETag header, and processing conditional requests (such as
IMS). These functions have been split into three functions:
set_last_modified, set_etag, and
meets_conditions. The field mtime has been
added to request_rec to facilitate
meets_conditions.
- New error logging function:
aplog_error
All old logging functions are deprecated, we are in the process of
replacing them with a single function called aplog_error.
This is still a work in progress.
set_file_slot for config parsing
The set_file_slot routine provides a standard routine that
prepends ServerRoot to non-absolute paths.
post_read_request module API
This request phase occurs immediately after reading the request (headers),
and immediately after creating an internal redirect. It is most useful
for setting environment variables to affect future phases.
psocket, and popendir
The psocket and pclosesocket functions allow
for race-condition free socket creation with resource tracking.
Similarly popendir and pclosedir protect
directory reading.
is_initial_req
Test if the request is the initial request (i.e., the one
coming from the client).
kill_only_once
An option to spawn_child functions which prevents Apache
from aggressively trying to kill off the child.
alloc debugging code
Defining ALLOC_DEBUG provides a rudimentary memory
debugger which can be used on live servers with low impact --
it sets all allocated and freed memory bytes to 0xa5. Defining
ALLOC_USE_MALLOC will cause the alloc code to use
malloc() and free() for each object. This
is far more expensive and should only be used for testing with tools
such as Electric Fence and Purify. See main/alloc.c
for more details.
- Year-2000 Improvements
The default timefmt string used by
mod_include
has been modified to display the year using four digits rather than the
two-digit format used previously. The
mod_autoindex
module has also been modified to display years using four digits in
FancyIndexed directory listings.
- ap_*() Routines Moving to a Separate Library
There are a number of functions and routines that have been developed
for the Apache project that supplement or supersede library routines
that differ from one operating system to another. While most of these
are used only by the Apache server itself, some are referenced by
supporting applications (such as htdigest), and these
other applications would fail to build because the routines were built
only into the server. These routines are now being migrated to a
separate subdirectory and library so they can be used by other
applications than just the server.
Apache HTTP Server Version 1.3