From: (no author) <(no author)@unknown> Date: Wed, 20 Mar 2002 05:54:26 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch 'avendor'. X-Git-Tag: PCRE_3_9~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0422abcb411682021eba8960ae701100a38fed43;p=thirdparty%2Fapache%2Fhttpd.git This commit was manufactured by cvs2svn to create branch 'avendor'. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/avendor@94035 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/BuildBin.dsp b/BuildBin.dsp new file mode 100644 index 00000000000..628c7b6d679 --- /dev/null +++ b/BuildBin.dsp @@ -0,0 +1,97 @@ +# Microsoft Developer Studio Project File - Name="BuildBin" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) External Target" 0x0106 + +CFG=BuildBin - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "BuildBin.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "BuildBin.mak" CFG="BuildBin - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "BuildBin - Win32 Release" (based on "Win32 (x86) External Target") +!MESSAGE "BuildBin - Win32 Debug" (based on "Win32 (x86) External Target") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" + +!IF "$(CFG)" == "BuildBin - Win32 Release" + +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /f makefile.win" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "\Apache2.0\bin\Apache.exe" +# PROP BASE Bsc_Name ".\Browse\BuildBin.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /f makefile.win INSTDIR="\Apache2" _dummy" +# PROP Rebuild_Opt "" +# PROP Target_File "\Apache2\bin\Apache.exe" +# PROP Bsc_Name ".\Browse\Apache.bsc" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "BuildBin - Win32 Debug" + +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "" +# PROP BASE Intermediate_Dir "" +# PROP BASE Cmd_Line "NMAKE /f makefile.win" +# PROP BASE Rebuild_Opt "/a" +# PROP BASE Target_File "\Apache2.0\bin\Apache.exe" +# PROP BASE Bsc_Name ".\Browse\BuildBin.bsc" +# PROP BASE Target_Dir "" +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "" +# PROP Cmd_Line "NMAKE /f makefile.win INSTDIR="\Apache2" _dummy" +# PROP Rebuild_Opt "" +# PROP Target_File "\Apache2\bin\Apache.exe" +# PROP Bsc_Name ".\Browse\Apache.bsc" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "BuildBin - Win32 Release" +# Name "BuildBin - Win32 Debug" + +!IF "$(CFG)" == "BuildBin - Win32 Release" + +!ELSEIF "$(CFG)" == "BuildBin - Win32 Debug" + +!ENDIF + +# Begin Source File + +SOURCE=.\os\win32\BaseAddr.ref +# End Source File +# Begin Source File + +SOURCE=.\CHANGES +# End Source File +# Begin Source File + +SOURCE=.\Makefile.win +# End Source File +# Begin Source File + +SOURCE=.\STATUS +# End Source File +# End Target +# End Project diff --git a/NWGNUmakefile b/NWGNUmakefile new file mode 100644 index 00000000000..39af31185e1 --- /dev/null +++ b/NWGNUmakefile @@ -0,0 +1,400 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + srclib\apr \ + build \ + support \ + modules \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(AP_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/include/arch/NetWare \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/include \ + $(AP_WORK)/modules/filters/ \ + $(AP_WORK)/modules/generators/ \ + $(AP_WORK)/modules/http/ \ + $(AP_WORK)/modules/loggers/ \ + $(AP_WORK)/modules/mappers/ \ + $(AP_WORK)/modules/proxy/ \ + $(AP_WORK)/os/NetWare \ + $(AP_WORK)/server/mpm/NetWare \ + $(AP_WORK)/srclib/pcre \ + $(NWOS) \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = Apache2 + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Apache Web Server + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = Apache +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 65536 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = _LibCCheckUnload + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/Apache2.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/buildmark.o \ + $(OBJDIR)/config.o \ + $(OBJDIR)/connection.o \ + $(OBJDIR)/core.o \ + $(OBJDIR)/error_bucket.o \ + $(OBJDIR)/http_core.o \ + $(OBJDIR)/http_protocol.o \ + $(OBJDIR)/http_request.o \ + $(OBJDIR)/listen.o \ + $(OBJDIR)/log.o \ + $(OBJDIR)/main.o \ + $(OBJDIR)/mod_access.o \ + $(OBJDIR)/mod_actions.o \ + $(OBJDIR)/mod_alias.o \ + $(OBJDIR)/mod_asis.o \ + $(OBJDIR)/mod_auth.o \ + $(OBJDIR)/mod_autoindex.o \ + $(OBJDIR)/mod_dir.o \ + $(OBJDIR)/mod_env.o \ + $(OBJDIR)/mod_imap.o \ + $(OBJDIR)/mod_include.o \ + $(OBJDIR)/mod_log_config.o \ + $(OBJDIR)/mod_mime.o \ + $(OBJDIR)/mod_negotiation.o \ + $(OBJDIR)/mod_nw_ssl.o \ + $(OBJDIR)/mod_setenvif.o \ + $(OBJDIR)/mod_so.o \ + $(OBJDIR)/mod_userdir.o \ + $(OBJDIR)/modules.o \ + $(OBJDIR)/mpm_common.o \ + $(OBJDIR)/mpm_netware.o \ + $(OBJDIR)/pcre.o \ + $(OBJDIR)/pcreposix.o \ + $(OBJDIR)/protocol.o \ + $(OBJDIR)/request.o \ + $(OBJDIR)/rfc1413.o \ + $(OBJDIR)/scoreboard.o \ + $(OBJDIR)/util.o \ + $(OBJDIR)/util_cfgtree.o \ + $(OBJDIR)/util_charset.o \ + $(OBJDIR)/util_filter.o \ + $(OBJDIR)/util_md5.o \ + $(OBJDIR)/util_nw.o \ + $(OBJDIR)/util_script.o \ + $(OBJDIR)/util_time.o \ + $(OBJDIR)/util_xml.o \ + $(OBJDIR)/vhost.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + Libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @netware.imp \ + @$(APR)/aprlib.imp \ + @libc.imp \ + @ws2nlm.imp \ + GetCurrentAddressSpace \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + @$(NWOS)/httpd.imp \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + copy $(OBJDIR)\Apache2.nlm $(INSTALL)\Apache2\*.* + -copy ABOUT_APACHE $(INSTALL)\Apache2\*.* + -copy README $(INSTALL)\Apache2\*.* + -copy STATUS $(INSTALL)\Apache2\*.* + -copy LICENSE $(INSTALL)\Apache2\*.* + -copy docs\cgi-examples\*. $(INSTALL)\Apache2\cgi-examples\*.* + -copy docs\conf\httpd-std.conf $(INSTALL)\Apache2\conf\httpd.conf + -copy docs\conf\magic $(INSTALL)\Apache2\conf\magic + -copy docs\conf\mime.types $(INSTALL)\Apache2\conf\mime.types + -copy docs\error\*.* $(INSTALL)\Apache2\error\*.* + -copy docs\error\include\*.* $(INSTALL)\Apache2\error\include\*.* + -copy docs\docroot\*.* $(INSTALL)\Apache2\htdocs\*.* + -copy docs\icons\*.* $(INSTALL)\Apache2\icons\*.* + -copy docs\icons\small\*.* $(INSTALL)\Apache2\icons\small\*.* + -copy docs\man\*.* $(INSTALL)\Apache2\man\*.* + -copy docs\manual\*.* $(INSTALL)\Apache2\manual\*.* + -copy docs\manual\developer\*.* $(INSTALL)\Apache2\manual\developer + -copy docs\manual\faq\*.* $(INSTALL)\Apache2\manual\faq + -copy docs\manual\howto\*.* $(INSTALL)\Apache2\manual\howto + -copy docs\manual\images\*.* $(INSTALL)\Apache2\manual\images + -copy docs\manual\misc\*.* $(INSTALL)\Apache2\manual\misc + -copy docs\manual\mod\*.* $(INSTALL)\Apache2\manual\mod + -copy docs\manual\platform\*.* $(INSTALL)\Apache2\manual\platform + -copy docs\manual\programs\*.* $(INSTALL)\Apache2\manual\programs + -copy docs\manual\search\*.* $(INSTALL)\Apache2\manual\search + -copy docs\manual\vhosts\*.* $(INSTALL)\Apache2\manual\vhosts + +installdev :: FORCE + -copy $(subst /,\,$(AP_WORK))\include\*.h $(INSTALL)\Apache2\include\*.* + -copy $(subst /,\,$(AP_WORK))\os\netware\*.h $(INSTALL)\Apache2\include\*.* + -copy $(subst /,\,$(NWOS))\include\*.h $(INSTALL)\Apache2\include\*.* + -copy $(subst /,\,$(NWOS))\*.imp $(INSTALL)\Apache2\lib\*.* + -copy $(subst /,\,$(APR))\include\*.h $(INSTALL)\Apache2\include\*.* + -copy $(subst /,\,$(APR))\arch\netware\include\*.h $(INSTALL)\Apache2\include\*.* + -copy $(subst /,\,$(APRUTIL))\include\*.h $(INSTALL)\Apache2\include\*.* + -copy $(subst /,\,$(APR))\*.imp $(INSTALL)\Apache2\lib\*.* + +# +# Any specialized rules here +# + +$(OBJDIR)/%.o: server/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +$(OBJDIR)/%.o: modules/arch/netware/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +$(OBJDIR)/%.o: modules/http/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +$(OBJDIR)/%.o: modules/aaa/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +$(OBJDIR)/%.o: modules/mappers/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +$(OBJDIR)/%.o: modules/generators/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +$(OBJDIR)/%.o: modules/metadata/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +$(OBJDIR)/%.o: modules/filters/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +$(OBJDIR)/%.o: modules/loggers/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +$(OBJDIR)/%.o: os/netware/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +$(OBJDIR)/%.o: server/mpm/netware/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +$(OBJDIR)/%.o: srclib/pcre/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/ROADMAP b/ROADMAP new file mode 100644 index 00000000000..cd45d6d5b58 --- /dev/null +++ b/ROADMAP @@ -0,0 +1,39 @@ +APACHE 2.1+ ROADMAP: + +Last modified at [$Date: 2001/11/27 05:19:39 $] + +DEFERRRED FOR APACHE 2.1 + + * Source code should follow style guidelines. + OK, we all agree pretty code is good. Probably best to clean this + up by hand immediately upon branching a 2.1 tree. + Justin's voulenteered to hand-edit the entire source tree ;) + + * revamp the input filter syntax to provide for ordering of + filters created with the Set{Input|Output}Filter and the + Add{Input|Output}Filter directives. A 'relative to filterx' + syntax is definately preferable, but not realistic for 2.0. + + * Platforms that do not support fork (primarily Win32 and AS/400) + Architect start-up code that avoids initializing all the modules + in the parent process on platforms that do not support fork. + Better yet - not only inform the startup of which phase it's in, + but allow the parent 'process' to initialize shared memory, etc, + and create a module-by-module stream to pass to the child, so the + parent can actually arbitrate the important stuff. + + * Replace stat [deferred open] with open/fstat in directory_walk. + Justin, Ian, OtherBill all interested in this. Implies setting up + the apr_file_t member in request_rec, and having all modules use + that file, and allow the cleanup to close it [if it isn't a shared, + cached file handle.] + + * Refactor auth into auth protocols and auth database stores. + Many interested hackers, too destabilizing for 2.0 inclusion. + +DEFERRRED FOR APACHE 3.0 + + * The Async Apache Server implemented in terms of APR. + [Bill Stoddard's pet project.] + + diff --git a/apachenw.mcp.zip b/apachenw.mcp.zip new file mode 100644 index 00000000000..645099f0737 Binary files /dev/null and b/apachenw.mcp.zip differ diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc new file mode 100644 index 00000000000..76149ad0c8d --- /dev/null +++ b/build/NWGNUenvironment.inc @@ -0,0 +1,286 @@ +# +# Setup needed Tools and Libraries +# + +ifeq "$(wildcard $(AP_WORK)\NWGNUcustom.ini)" "$(AP_WORK)\NWGNUcustom.ini" +include $(AP_WORK)\NWGNUcustom.ini +CUSTOM_INI = $(AP_WORK)\NWGNUcustom.ini +endif + +ifndef VERBOSE +.SILENT: +endif + +# +# Treat like an include +# +ifndef EnvironmentDefined + +# +# simple macros for parsing makefiles +# +EOLIST:= +EMPTY := +COMMA := , +SPACE := $(EMPTY) $(EMPTY) + +# +# Base environment +# + +# Try and handle case issues +ifndef NOVELLLIBC +ifdef NovellLibC +NOVELLLIBC = $(NovellLibC) +endif +endif + +ifndef NOVELLLIBC +NOVELLLIBC = C:/novell/ndk/libc +endif + +# This is a placeholder +# ifndef LDAPSDK +# LDAPSDK = C:/novell/ndk/cldapsdk +# endif + +ifndef METROWERKS +METROWERKS = C:\Program Files\Metrowerks\CodeWarrior +endif + +# If LM_LICENSE_FILE isn't defined, define a variable that can be used to +# restart make with it defined +ifndef LM_LICENSE_FILE +NO_LICENSE_FILE = NO_LICENSE_FILE +endif + +# +# Set the Release type that you want to build, possible values are: +# +# debug - full debug switches are set +# noopt - normal switches are set (default) +# optimized - optimization switches are set + +ifdef reltype +RELEASE=$(reltype) +endif + +ifdef RELTYPE +RELEASE=$(RELTYPE) +endif + +ifdef debug +RELEASE=debug +endif + +ifdef DEBUG +RELEASE=debug +endif + +ifdef optimized +RELEASE=optimized +endif + +ifdef OPTIMIZED +RELEASE=optimized +endif + +ifndef RELEASE +RELEASE = optimized +endif + +ifeq "$(RELEASE)" "debug" +OBJDIR = Debug +endif + +ifeq "$(RELEASE)" "noopt" +OBJDIR = Noopt +endif + +ifeq "$(RELEASE)" "optimized" +OBJDIR = Release +endif + +# +# Setup compiler information +# + +# MetroWerks NLM tools +CC = mwccnlm +CPP = mwccnlm +LINK = mwldnlm +LIB = mwldnlm -type library -w nocmdline + +NOVI = $(NOVELLLIBC)\imports + +INCDIRS = $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock; + +DEFINES = -DNETWARE + +# +# MetroWerks static Libraries + +CLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\Runtime\mwcrtl.lib +MATH3S = +PLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\MSL C++\MWCPP.lib + +# Base compile flags +# and prefix or precompiled header added here. + +# The default flags are as follows: +# +# -c compile only, no link +# -nosyspath treat #include <...> like #include "..." +# -Cpp_exceptions off disable C++ exceptions +# -RTTI off disable C++ run-time typing information +# -align 4 align on 4 byte bounderies +# -w nocmdline disable command-line driver/parser warnings +# -proc PII generate code base on Pentium II instruction set +# -inst mmx use MMX extensions + +CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII -inst mmx + +# -g generate debugging information +# -O1 level 1 optimizations + +ifeq "$(RELEASE)" "debug" +CFLAGS += -g -O1 +endif + +# -O4,p level 4 optimizations, optimize for speed +ifeq "$(RELEASE)" "optimized" +CFLAGS += -O4,p +endif + +# -prefix pre_nw.h #include pre_nw.h for all files + +CFLAGS += -prefix pre_nw.h + + +PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools + +# +# Declare major project deliverables output directories here +# + +ifdef DEST +INSTALL = $(DEST) +ifeq (\, $(findstring \,$(INSTALL))) +INSTDIRS = $(DEST) +endif +endif + +ifdef dest +INSTALL = $(dest) +ifeq (\, $(findstring \,$(INSTALL))) +INSTDIRS = $(dest) +endif +endif + +ifndef INSTALL +INSTALL = $(AP_WORK)\..\Dist +INSTDIRS = $(AP_WORK)\..\Dist +endif + +INSTDEVDIRS := \ + $(INSTDIRS) \ + $(INSTALL)\Apache2\include \ + $(INSTALL)\Apache2\lib \ + +INSTDIRS += \ + $(INSTALL)\Apache2 \ + $(INSTALL)\Apache2\cgi-examples \ + $(INSTALL)\Apache2\conf \ + $(INSTALL)\Apache2\error \ + $(INSTALL)\Apache2\error\include \ + $(INSTALL)\Apache2\htdocs \ + $(INSTALL)\Apache2\icons \ + $(INSTALL)\Apache2\icons\small \ + $(INSTALL)\Apache2\logs \ + $(INSTALL)\Apache2\man \ + $(INSTALL)\Apache2\manual \ + $(INSTALL)\Apache2\manual\developer \ + $(INSTALL)\Apache2\manual\faq \ + $(INSTALL)\Apache2\manual\howto \ + $(INSTALL)\Apache2\manual\images \ + $(INSTALL)\Apache2\manual\misc \ + $(INSTALL)\Apache2\manual\mod \ + $(INSTALL)\Apache2\manual\platform \ + $(INSTALL)\Apache2\manual\programs \ + $(INSTALL)\Apache2\manual\search \ + $(INSTALL)\Apache2\manual\ssl \ + $(INSTALL)\Apache2\manual\vhosts \ + $(INSTALL)\Apache2\modules \ + +# +# Declare Command and tool macros here +# + +# Os2LibPath is an extra check to see if we are on NT +ifdef Os2LibPath +OS = Windows_NT +endif + +ifeq "$(OS)" "Windows_NT" +CMD=cmd /C +CHK=cmd /C if exist +CHKNOT=cmd /C if not exist +DEL = del /F +DELTREE = cmd /C rd /s/q +WINNT=1 +else +CMD=command /C +CHK=command /C if exist +CHKNOT=command /C if not exist +DEL = del +DELTREE = deltree /y +endif + + +# +# Setup base C compiler flags +# + +# +# Common directories +# + +STDMOD = $(AP_WORK)/modules +NWOS = $(AP_WORK)/os/netware +SERVER = $(AP_WORK)/server +SRC = $(AP_WORK) +APR = $(AP_WORK)/srclib/apr +APRUTIL = $(AP_WORK)/srclib/apr-util +SUPMOD = $(AP_WORK)/support +PCRE = $(AP_WORK)/srclib/pcre +APRTEST = $(AP_WORK)/srclib/apr/test +HTTPD = $(AP_WORK)/modules/http +XML = $(AP_WORK)/srclib/apr-util/xml + +# +# Internal Libraries +# + +APRLIB = $(APR)/$(OBJDIR)/aprlib.lib +APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib +STMODLIB = $(STDMOD)/$(OBJDIR)/stdmod.lib +PCRELIB = $(PCRE/$(OBJDIR)/pcre.lib +NWOSLIB = $(NWOS)/$(OBJDIR)/netware.lib +SERVLIB = $(SERVER)/$(OBJDIR)/server.lib +HTTPDLIB = $(HTTPD)/$(OBJDIR)/httpd.lib +XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib + +# +# Additional general defines +# +VERSION = 2,0,0 + +EnvironmentDefined = 1 +endif # ifndef EnvironmentDefined + +# This is always set so that it will show up in lower directories + +ifdef Path +Path = $(PATH) +endif + diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc new file mode 100644 index 00000000000..71855ab3cd3 --- /dev/null +++ b/build/NWGNUhead.inc @@ -0,0 +1,103 @@ +# +# Obtain the global build environment +# + +include $(AP_WORK)\build\NWGNUenvironment.inc + +# +# Define base targets and rules +# + +TARGETS = libs nlms install clobber_libs clobber_nlms clean installdev + +.PHONY : $(TARGETS) default all help $(NO_LICENSE_FILE) + +# Here is where we will use the NO_LICENSE_FILE variable to see if we need to +# restart the make with it defined + +ifdef NO_LICENSE_FILE + +default: NO_LICENSE_FILE + +all: NO_LICENSE_FILE + +install :: NO_LICENSE_FILE + +installdev :: NO_LICENSE_FILE + +NO_LICENSE_FILE : + $(MAKE) $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(METROWERKS)\license.dat" + +else # LM_LICENSE_FILE must be defined so use the real targets + +default: $(SUBDIRS) libs nlms + +all: $(SUBDIRS) libs nlms install + +$(TARGETS) :: $(SUBDIRS) + +install :: nlms $(INSTDIRS) + +installdev :: $(INSTDEVDIRS) + +$(INSTDIRS) :: + $(CHKNOT) $@\NUL mkdir $@ + +$(INSTDEVDIRS) :: + $(CHKNOT) $@\NUL mkdir $@ + +endif #NO_LICENSE_FILE check + +help : + @echo targets for RELEASE=$(RELEASE): + @echo (default) . . . . libs nlms + @echo all . . . . . . . does everything (libs nlms install) + @echo libs. . . . . . . builds all libs + @echo nlms. . . . . . . builds all nlms + @echo install . . . . . builds libs and nlms and copies install files to + @echo "$(INSTALL)" + @echo clean . . . . . . deletes $(OBJDIR) dirs, *.err, and *.map + @echo clobber_all . . . deletes all possible output from the make + @echo clobber_install . deletes all files in $(INSTALL) + @$(CMD) echo. + @echo Multiple targets can be used on a single nmake command line - + @echo (i.e. $(MAKE) clean all) + @$(CMD) echo. + @echo You can also specify RELEASE=debug, RELEASE=noopt, or RELEASE=optimized + @echo The default is RELEASE=optimized + +clobber_all :: clean clobber_install + +clobber_install :: + -$(DELTREE) $(INSTALL) 2>NUL + +# +# build recursive targets +# + +$(SUBDIRS) : FORCE +ifneq "$(MAKECMDGOALS)" "clean" + $(CMD) echo. + @echo Building $(CURDIR)/$@ +endif + $(MAKE) -C $@ $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(LM_LICENSE_FILE)" + $(CMD) echo. + +FORCE: + +# +# Standard targets +# + +clean :: $(SUBDIRS) + @echo Cleaning up $(CURDIR) + -$(DELTREE) $(OBJDIR) 2> NUL + $(CHK) *.err $(DEL) *.err + $(CHK) *.map $(DEL) *.map + $(CHK) *.d $(DEL) *.d + $(CHK) *.tmp $(DEL) *.tmp + -$(DELTREE) $(OBJDIR) 2> NUL + +$(OBJDIR) :: + $(CHKNOT) $(OBJDIR)\nul mkdir $(OBJDIR) + diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile new file mode 100644 index 00000000000..deeef84fa27 --- /dev/null +++ b/build/NWGNUmakefile @@ -0,0 +1,80 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(AP_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +FILES_prebuild_headers = \ + $(APR)/include/apr.h \ + $(APRUTIL)/include/apu.h \ + $(APRUTIL)/include/apr_ldap.h \ + $(PCRE)/config.h \ + $(PCRE)/pcre.h \ + $(EOLIST) + +nlms :: $(NWOS)/httpd.imp + +$(NWOS)/httpd.imp : make_nw_export.awk nw_export.i + @echo Generating $(subst /,\,$@) + awk -f make_nw_export.awk nw_export.i | sort >$(NWOS)/httpd.imp + +nw_export.i : nw_export.inc $(FILES_prebuild_headers) cc.opt + @echo Generating $(subst /,\,$@) + $(CC) $< @cc.opt + +cc.opt : NWGNUmakefile $(AP_WORK)\build\NWGNUenvironment.inc $(AP_WORK)\build\NWGNUtail.inc $(AP_WORK)\build\NWGNUhead.inc + $(CHK) $@ $(DEL) $@ + @echo -P >> $@ + @echo -EP >> $@ + @echo -nosyspath >> $@ + @echo -w nocmdline >> $@ + @echo -DNETWARE >> $@ + @echo -DCORE_PRIVATE >> $@ + @echo -I..\include >> $@ + @echo -I..\modules\http >> $@ + @echo -I..\os\netware >> $@ + @echo -I..\server\mpm\netware >> $@ + @echo -I..\srclib\apr\include >> $@ + @echo -I..\srclib\apr-util\include >> $@ + @echo -ir $(NOVELLLIBC) >> $@ + +$(APR)/include/%.h: $(subst /,\,$(APR))\include\%.hnw + @echo Creating $(subst /,\,$@) + copy $< $(subst /,\,$(APR))\include\$(@F) + +$(APRUTIL)/include/%.h: $(subst /,\,$(APRUTIL))\include\%.hnw + @echo Creating $(subst /,\,$@) + copy $< $(subst /,\,$(APRUTIL))\include\$(@F) + +$(PCRE)/%.h: $(subst /,\,$(PCRE))\%.hw + @echo Creating $(subst /,\,$@) + copy $< $(subst /,\,$(PCRE))\$(@F) + +# +# You can use this target if all that is needed is to copy files to the +# installation area +# +install :: nlms FORCE + + +clean :: + $(CHK) nw_export.i $(DEL) nw_export.i + $(CHK) cc.opt $(DEL) cc.opt + $(CHK) $(subst /,\,$(APR))\include\apr.h $(DEL) $(subst /,\,$(APR))\include\apr.h + $(CHK) $(subst /,\,$(APRUTIL))\include\apu.h $(DEL) $(subst /,\,$(APRUTIL))\include\apu.h + $(CHK) $(subst /,\,$(APRUTIL))\include\apr_ldap.h $(DEL) $(subst /,\,$(APRUTIL))\include\apr_ldap.h + $(CHK) $(subst /,\,$(PCRE))\config.h $(DEL) $(subst /,\,$(PCRE))\config.h + $(CHK) $(subst /,\,$(PCRE))\pcre.h $(DEL) $(subst /,\,$(PCRE))\pcre.h + $(CHK) $(subst /,\,$(NWOS))\httpd.imp $(DEL) $(subst /,\,$(NWOS))\httpd.imp + diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc new file mode 100644 index 00000000000..015f197cbc4 --- /dev/null +++ b/build/NWGNUtail.inc @@ -0,0 +1,287 @@ +# +# This contains final targets and should be included at the end of any +# NWGNUmakefile file +# + +# +# If we are going to create an nlm, make sure we have assigned variables to +# use during the link. +# +echo NLM_NAME=$(NLM_NAME) +ifndef NLM_NAME +NLM_NAME = $(TARGET_nlm) +endif + +ifndef NLM_DESCRIPTION +NLM_DESCRIPTION = $(NLM_NAME) +endif + +ifndef NLM_THREAD_NAME +NLM_THREAD_NAME = $(NLM_NAME) Thread +endif + +# +# Create dependency lists based on the files available +# + +CCOPT_DEPENDS = \ + $(AP_WORK)\build\NWGNUhead.inc \ + $(AP_WORK)\build\NWGNUenvironment.inc \ + $(AP_WORK)\build\NWGNUtail.inc \ + NWGNUmakefile \ + $(CUSTOM_INI) \ + $(EOLIST) + +CPPOPT_DEPENDS = \ + $(AP_WORK)\build\NWGNUhead.inc \ + $(AP_WORK)\build\NWGNUenvironment.inc \ + $(AP_WORK)\build\NWGNUtail.inc \ + NWGNUmakefile \ + $(CUSTOM_INI) \ + $(EOLIST) + +$(NLM_NAME)_LINKOPT_DEPENDS = \ + $(TARGET_lib) \ + $(AP_WORK)\build\NWGNUenvironment.inc \ + NWGNUmakefile \ + $(AP_WORK)\build\NWGNUtail.inc \ + $(CUSTOM_INI) \ + $(EOLIST) + +ifeq "$(words $(strip $(TARGET_lib)))" "1" +LIB_NAME = $(basename $(notdir $(TARGET_lib))) +$(LIB_NAME)_LIBLST_DEPENDS = \ + $(FILES_lib_objs) \ + $(AP_WORK)\build\NWGNUenvironment.inc \ + NWGNUmakefile \ + $(AP_WORK)\build\NWGNUtail.inc \ + $(CUSTOM_INI) \ + $(EOLIST) +endif + +ifeq "$(wildcard NWGNU$(LIB_NAME))" "NWGNU$(LIB_NAME)" +$(LIB_NAME)_LIBLST_DEPENDS += NWGNU$(LIB_NAME) +endif + +ifeq "$(wildcard NWGNU$(NLM_NAME))" "NWGNU$(NLM_NAME)" +$(NLM_NAME)_LINKOPT_DEPENDS += NWGNU$(NLM_NAME) +CCOPT_DEPENDS += NWGNU$(NLM_NAME) +CPPOPT_DEPENDS += NWGNU$(NLM_NAME) +endif + +# +# Generic compiler rules +# + +$(OBJDIR)/%.o: %.c $(OBJDIR)\cc.opt + @echo Compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +$(OBJDIR)\cc.opt: $(CCOPT_DEPENDS) + $(CHK) $@ $(DEL) $@ + @echo Generating $@ +ifneq "$(strip $(CFLAGS))" "" + @echo $(CFLAGS) >> $@ +endif +ifneq "$(strip $(XCFLAGS))" "" + @echo $(XCFLAGS) >> $@ +endif +ifneq "$(strip $(XINCDIRS))" "" + @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@ +endif +ifneq "$(strip $(INCDIRS))" "" + @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@ +endif +ifneq "$(strip $(DEFINES))" "" + @echo $(DEFINES) >> $@ +endif +ifneq "$(strip $(XDEFINES))" "" + @echo $(XDEFINES) >> $@ +endif + +$(OBJDIR)/%.o: %.cpp $(OBJDIR)\cpp.opt + @echo Compiling $< + $(CPP) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cpp.opt + +$(OBJDIR)\cpp.opt: $(CPPOPT_DEPENDS) + $(CHK) $@ $(DEL) $@ + @echo Generating $@ +ifneq "$(strip $(CFLAGS))" "" + @echo $(CFLAGS) >> $@ +endif +ifneq "$(strip $(XCFLAGS))" "" + @echo $(XCFLAGS) >> $@ +endif +ifneq "$(strip $(XINCDIRS))" "" + @echo $(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir)) >> $@ +endif +ifneq "$(strip $(INCDIRS))" "" + @echo $(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir)) >> $@ +endif +ifneq "$(strip $(DEFINES))" "" + @echo $(DEFINES) >> $@ +endif +ifneq "$(strip $(XDEFINES))" "" + @echo $(XDEFINES) >> $@ +endif + +# +# Rules to build libraries +# + +# If we only have one target library then build it + +ifeq "$(words $(strip $(TARGET_lib)))" "1" + +$(TARGET_lib) : $(OBJDIR)\$(LIB_NAME)_lib.lst + @echo Generating $@ + $(CHK) $(OBJDIR)\$(@F) $(DEL) $(OBJDIR)\$(@F) + $(LIB) -o $(OBJDIR)\$(@F) @$? + +$(OBJDIR)\$(LIB_NAME)_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS) + $(CHK) $@ $(DEL) $@ + @echo Generating $@ +ifneq "$(strip $(FILES_lib_objs))" "" + @echo $(foreach objfile,$(FILES_lib_objs),$(subst /,\,$(objfile)) ) >> $@ +endif + +else # We must have more than one target library so load the individual makefiles + +$(OBJDIR)/%.lib: NWGNU% $(AP_WORK)\build\NWGNUhead.inc $(AP_WORK)\build\NWGNUtail.inc $(AP_WORK)\build\NWGNUenvironment.inc FORCE + @echo Calling $< + $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE) + +endif + +# +# Rules to build nlms. +# + +vpath libcpre.o $(NOVELLLIBC)\imports + +# If we only have one target NLM then build it +ifeq "$(words $(strip $(TARGET_nlm)))" "1" + +$(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)\$(NLM_NAME)_link.opt + @echo Linking $@ + $(LINK) @$(OBJDIR)\$(NLM_NAME)_link.opt + +# This will force the link option file to be rebuilt if we change the +# corresponding makefile + +$(OBJDIR)\$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) + $(CHK) $(OBJDIR)\$(@F) $(DEL) $(OBJDIR)\$(@F) + $(CHK) $(OBJDIR)\$(NLM_NAME)_link.def $(DEL) $(OBJDIR)\$(NLM_NAME)_link.def + @echo Generating $@ + @echo -warnings off >> $@ + @echo -zerobss >> $@ + @echo -desc "$(NLM_DESCRIPTION)" >> $@ + @echo -o $(TARGET_nlm) >> $@ +ifneq "$(FILE_nlm_copyright)" "" + @-type $(FILE_nlm_copyright) >> $@ +endif +ifeq "$(RELEASE)" "debug" + @echo -g >> $@ + @echo -sym internal >> $@ + @echo -sym codeview4 >> $@ + @echo -osym $(OBJDIR)\$(NLM_NAME).sym >> $@ +else + @echo -sym internal >> $@ +endif + @echo -screenname "Apache for NetWare" >> $@ +ifneq "$(NLM_VERSION)" "" + @echo -nlmversion=$(NLM_VERSION) >> $@ +else + @echo -nlmversion=$(VERSION) >> $@ +endif + @echo -l $(NWOS) >> $@ + @echo -l $(AP)/$(OBJDIR) >> $@ + @echo -l $(APR)/$(OBJDIR) >> $@ + @echo -l $(APRUTIL)/$(OBJDIR) >> $@ + @echo -l $(PCRE)/$(OBJDIR) >> $@ + @echo -l $(HTTPD)/$(OBJDIR) >> $@ + @echo -l $(SERVER)/$(OBJDIR) >> $@ + @echo -l $(STDMOD)/$(OBJDIR) >> $@ + @echo -l $(NWOS)/$(OBJDIR) >> $@ + @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime" >> $@ + @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++" >> $@ + @echo -l $(NOVELLLIBC)/imports >> $@ +ifneq "$(LDAPSDK)" "" + @echo -l $(LDAPSDK)/lib/nlm >> $@ +endif + @echo -l $(XML)/$(OBJDIR) >> $@ + @echo -nodefaults >> $@ + @echo -map $(OBJDIR)\$(NLM_NAME).map>> $@ + @echo -threadname "$(NLM_THREAD_NAME)" >> $@ +ifneq "$(NLM_STACK_SIZE)" "" + @echo -stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $@ +else + @echo -stacksize 64000 >> $@ +endif +ifneq "$(NLM_ENTRY_SYM)" "" + @echo -entry $(NLM_ENTRY_SYM) >> $@ +endif +ifneq "$(NLM_EXIT_SYM)" "" + @echo -exit $(NLM_EXIT_SYM) >> $@ +endif +ifneq "$(NLM_CHECK_SYM)" "" + @echo -check $(NLM_CHECK_SYM) >> $@ +endif +ifneq "$(NLM_FLAGS)" "" + @echo -flags $(NLM_FLAGS) >> $@ +endif +ifneq "$(strip $(FILES_nlm_objs))" "" + @echo $(foreach objfile,$(strip $(FILES_nlm_objs)),$(subst /,\,$(objfile))) >> $@ +endif +ifneq "$(FILES_nlm_libs)" "" + @echo $(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(subst /,\,$(libfile))) >> $@ +endif + @echo -commandfile $(OBJDIR)\$(NLM_NAME)_link.def >> $@ +ifneq "$(FILE_nlm_msg)" "" + @echo Messages $(FILE_nlm_msg) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(FILE_nlm_hlp)" "" + @echo Help $(FILE_nlm_hlp) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(FILES_nlm_modules)" "" + @echo module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(subst /,\,$(module))) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(FILES_nlm_Ximports)" "" + @echo Import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(subst /,\,$(import))) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(FILES_nlm_exports)" "" + @echo Export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(subst /,\,$(export))) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +ifneq "$(strip $(XLFLAGS))" "" + @echo $(XLFLAGS) >> $(OBJDIR)\$(NLM_NAME)_link.def +endif + +# if APACHE_UNIPROC is defined, don't include XDCData +ifndef APACHE_UNIPROC +ifneq "$(string $(XDCDATA))" "" + @echo XDCData $(XDCDATA) >> $(OBJDIR)\$(NLM_NAME)_link.def +else + @echo XDCData $(NWOS)\apache.xdc >> $(OBJDIR)\$(NLM_NAME)_link.def +endif +endif + +else # more than one target so look for individual makefiles. + +# Only include these if NO_LICENSE_FILE isn't set to prevent excessive +# recursion + +ifndef NO_LICENSE_FILE + +$(OBJDIR)/%.nlm: NWGNU% $(AP_WORK)\build\NWGNUhead.inc $(AP_WORK)\build\NWGNUtail.inc $(AP_WORK)\build\NWGNUenvironment.inc $(CUSTOM_INI) FORCE + @echo Calling $< + $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE) + $(CMD) echo. + +else + +$(TARGET_nlm): + +endif # NO_LICENSE_FILE + +endif + diff --git a/build/install-bindist.sh.in b/build/install-bindist.sh.in new file mode 100755 index 00000000000..0c8a23ed71a --- /dev/null +++ b/build/install-bindist.sh.in @@ -0,0 +1,130 @@ +#!/bin/sh +# +# Usage: install-bindist.sh [ServerRoot] +# This script installs the Apache binary distribution and +# was automatically created by binbuild.sh. + +lmkdir() +{ + path="" + dirs=`echo $1 | sed -e 's%/% %g'` + mode=$2 + + set -- ${dirs} + + for d in ${dirs} + do + path="${path}/$d" + if test ! -d "${path}" ; then + mkdir ${path} + if test $? -ne 0 ; then + echo "Failed to create directory: ${path}" + exit 1 + fi + chmod ${mode} ${path} + fi + done +} + +lcopy() +{ + from=$1 + to=$2 + dmode=$3 + fmode=$4 + + test -d ${to} || lmkdir ${to} ${dmode} + (cd ${from} && tar -cf - *) | (cd ${to} && tar -xf -) + + if test "X${fmode}" != X ; then + find ${to} -type f -print | xargs chmod ${fmode} + fi + if test "X${dmode}" != X ; then + find ${to} -type d -print | xargs chmod ${dmode} + fi +} + +## +## determine path to (optional) Perl interpreter +## +PERL=no-perl5-on-this-system +perls='perl5 perl' +path=`echo $PATH | sed -e 's/:/ /g'` + +for dir in ${path} ; do + for pperl in ${perls} ; do + if test -f "${dir}/${pperl}" ; then + if `${dir}/${pperl} -v | grep 'version 5\.' >/dev/null 2>&1` ; then + PERL="${dir}/${pperl}" + break + fi + fi + done +done + +if [ .$1 = . ] +then + SR=@default_dir@ +else + SR=$1 +fi +echo "Installing binary distribution for platform i686-pc-linux" +echo "into directory $SR ..." +lmkdir $SR 755 +lmkdir $SR/proxy 750 +lmkdir $SR/logs 750 +lcopy bindist/man $SR/man 755 644 +if [ -d bindist/modules ] +then + lcopy bindist/modules $SR/modules 750 750 +fi +lcopy bindist/include $SR/include 755 644 +lcopy bindist/icons $SR/icons 755 644 +lcopy bindist/cgi-bin $SR/cgi-bin 750 750 +lcopy bindist/bin $SR/bin 750 750 +if [ -d $SR/conf ] +then + echo "[Preserving existing configuration files.]" + cp bindist/conf/*-std.conf $SR/conf/ +else + lcopy bindist/conf $SR/conf 750 640 + sed -e "s%@default_dir@%$SR%" $SR/conf/httpd-std.conf > $SR/conf/httpd.conf +fi +if [ -d $SR/htdocs ] +then + echo "[Preserving existing htdocs directory.]" +else + lcopy bindist/htdocs $SR/htdocs 755 644 +fi +if [ -d $SR/error ] +then + echo "[Preserving existing error documents directory.]" +else + lcopy bindist/error $SR/error 755 644 +fi + +sed -e "s;^#!/.*;#!$PERL;" -e "s;\@prefix\@;$SR;" -e "s;\@sbindir\@;$SR/bin;" \ + -e "s;\@libexecdir\@;$SR/libexec;" -e "s;\@includedir\@;$SR/include;" \ + -e "s;\@sysconfdir\@;$SR/conf;" bindist/bin/apxs > $SR/bin/apxs +sed -e "s;^#!/.*;#!$PERL;" bindist/bin/dbmmanage > $SR/bin/dbmmanage +sed -e "s%@default_dir@%$SR%" \ + -e "s%^HTTPD=.*$%HTTPD=\"$SR/bin/httpd -d $SR\"%" bindist/bin/apachectl > $SR/bin/apachectl + +echo "Ready." +echo " +--------------------------------------------------------+" +echo " | You now have successfully installed the Apache @ver@ |" +echo " | HTTP server. To verify that Apache actually works |" +echo " | correctly you should first check the (initially |" +echo " | created or preserved) configuration files: |" +echo " | |" +echo " | $SR/conf/httpd.conf" +echo " | |" +echo " | You should then be able to immediately fire up |" +echo " | Apache the first time by running: |" +echo " | |" +echo " | $SR/bin/apachectl start " +echo " | |" +echo " | Thanks for using Apache. The Apache Group |" +echo " | http://www.apache.org/ |" +echo " +--------------------------------------------------------+" +echo " " diff --git a/build/instdso.sh b/build/instdso.sh new file mode 100755 index 00000000000..c7b5d615648 --- /dev/null +++ b/build/instdso.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# +# instdso.sh - install Apache DSO modules +# +# usually this just passes through to libtool but on a few +# platforms libtool doesn't install DSOs exactly like we'd +# want so more effort is required + +if test "$#" != "3"; then + echo "wrong number of arguments to instdso.sh" + echo "Usage: instdso.sh SH_LIBTOOL-value dso-name path-to-modules" + exit 1 +fi + +SH_LIBTOOL=`echo $1 | sed -e 's/^SH_LIBTOOL=//'` +DSOARCHIVE=$2 +TARGETDIR=$3 +DSOBASE=`echo $DSOARCHIVE | sed -e 's/\.la$//'` +TARGET_NAME="$DSOBASE.so" + +# special logic for systems where libtool doesn't install +# the DSO exactly like we'd want + +SYS=`uname -s` +case $SYS in + AIX) + # on AIX, shared libraries remain in storage even when + # all processes using them have exited; standard practice + # prior to installing a shared library is to rm -f first + CMD="rm -f $TARGETDIR/$TARGET_NAME" + echo $CMD + $CMD || exit $? + CMD="cp .libs/lib$DSOBASE.so.0 $TARGETDIR/$TARGET_NAME" + echo $CMD + $CMD || exit $? + ;; + HP-UX) + CMD="cp .libs/$DSOBASE.sl $TARGETDIR/$TARGET_NAME" + echo $CMD + $CMD || exit $? + ;; + OSF1) + CMD="cp .libs/lib$DSOBASE.so $TARGETDIR/$TARGET_NAME" + echo $CMD + $CMD || exit $? + ;; + *) + CMD="$SH_LIBTOOL --mode=install cp $DSOARCHIVE $TARGETDIR" + echo $CMD + $CMD || exit $? + ;; +esac + +exit 0 diff --git a/build/make_nw_export.awk b/build/make_nw_export.awk new file mode 100644 index 00000000000..317e4bc7c36 --- /dev/null +++ b/build/make_nw_export.awk @@ -0,0 +1,113 @@ +# Based on apr's make_export.awk, which is +# based on Ryan Bloom's make_export.pl + +# List of functions that we don't support, yet?? +/apr_##name##_set_inherit/{next} +/apr_##name##_unset_inherit/{next} +/apr_compare_groups/{next} +/apr_compare_users/{next} +/apr_find_pool/{next} +/apr_generate_random_bytes/{next} +/apr_lock_create_np/{next} +/apr_md5_set_xlate/{next} +/apr_mmap_create/{next} +/apr_mmap_delete/{next} +/apr_mmap_offset/{next} +/apr_os_thread_get/{next} +/apr_os_thread_put/{next} +/apr_pool_free_blocks_num_bytes/{next} +/apr_pool_join/{next} +/apr_pool_num_bytes/{next} +/apr_proc_mutex_child_init/{next} +/apr_proc_mutex_create/{next} +/apr_proc_mutex_create_np/{next} +/apr_proc_mutex_destroy/{next} +/apr_proc_mutex_lock/{next} +/apr_proc_mutex_trylock/{next} +/apr_proc_mutex_unlock/{next} +/apr_proc_other_child_check/{next} +/apr_proc_other_child_read/{next} +/apr_proc_other_child_register/{next} +/apr_proc_other_child_unregister/{next} +/apr_sendfile/{next} +/apr_shm_avail/{next} +/apr_shm_calloc/{next} +/apr_shm_destroy/{next} +/apr_shm_free/{next} +/apr_shm_init/{next} +/apr_shm_malloc/{next} +/apr_shm_name_get/{next} +/apr_shm_name_set/{next} +/apr_shm_open/{next} +/apr_signal/{next} +/apr_signal_thread/{next} +/apr_socket_from_file/{next} +/apr_thread_once/{next} +/apr_thread_once_init/{next} +/apr_xlate_close/{next} +/apr_xlate_conv_buffer/{next} +/apr_xlate_conv_byte/{next} +/apr_xlate_conv_char/{next} +/apr_xlate_get_sb/{next} +/apr_xlate_open/{next} +/apr_brigade_consume/{next} +/apr_bucket_mmap_create/{next} +/apr_bucket_mmap_make/{next} +/apr_bucket_type_mmap/{next} +/apr_md4_set_xlate/{next} +#/XML_ParserFree/{next} +#/XML_ParserCreate/{next} +#/XML_SetUserData/{next} +#/XML_SetElementHandler/{next} +#/XML_SetCharacterDataHandler/{next} +#/XML_Parse/{next} +#/XML_GetErrorCode/{next} +#/XML_ErrorString/{next} + + +function add_symbol (sym_name) { + if (count) { + found++ + } +# for (i = 0; i < count; i++) { +# line = line "\t" +# } + line = line sym_name ",\n" + + if (count == 0) { + printf(" %s", line) + line = "" + } +} + +/^[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)]([^ ]* )*[^(]+[(]/ { + sub("[ \t]*AP[RU]?_DECLARE[^(]*[(][^)]*[)][ \t]*", "") + sub("[(].*", "") + sub("([^ ]* (^([ \t]*[(])))+", "") + + add_symbol($0) + next +} + +/^[ \t]*AP_DECLARE_HOOK[^(]*[(][^)]*[)]/ { + split($0, args, ",") + symbol = args[2] + sub("^[ \t]+", "", symbol) + sub("[ \t]+$", "", symbol) + + add_symbol("ap_hook_" symbol) + add_symbol("ap_hook_get_" symbol) + add_symbol("ap_run_" symbol) + next +} + +/^[ \t]*AP[RU]?_DECLARE_DATA .*;$/ { + varname = $NF; + gsub( /[*;]/, "", varname); + gsub( /\[.*\]/, "", varname); + add_symbol(varname); +} + +#END { +# printf(" %s", line) +#} diff --git a/build/mkconfNW.awk b/build/mkconfNW.awk new file mode 100644 index 00000000000..3ec7a51bb19 --- /dev/null +++ b/build/mkconfNW.awk @@ -0,0 +1,59 @@ + + +BEGIN { + + A["ServerRoot"] = "SYS:\APACHE2" + A["Port"] = "80" + +} + +/@@LoadModule@@/ { + print "#LoadModule auth_anon_module modules/authanon.nlm" + print "#LoadModule auth_dbm_module modules/authdbm.nlm" + print "#LoadModule auth_digest_module modules/digest.nlm" + print "#LoadModule cern_meta_module modules/cernmeta.nlm" + print "#LoadModule dav_module modules/mod_dav.nlm" + print "#LoadModule dav_fs_module modules/moddavfs.nlm" + print "#LoadModule expires_module modules/expires.nlm" + print "#LoadModule file_cache_module modules/filecach.nlm" + print "#LoadModule headers_module modules/headers.nlm" + print "#LoadModule info_module modules/info.nlm" + print "#LoadModule mime_magic_module modules/mimemagi.nlm" + print "#LoadModule proxy_module modules/proxy.nlm" + print "#LoadModule proxy_connect_module modules/proxy_connect.nlm" + print "#LoadModule proxy_http_module modules/proxy_http.nlm" + print "#LoadModule proxy_ftp_module modules/proxy_ftp.nlm" + print "#LoadModule rewrite_module modules/rewrite.nlm" + print "#LoadModule speling_module modules/speling.nlm" + print "#LoadModule status_module modules/status.nlm" + print "#LoadModule unique_id_module modules/uniqueid.nlm" + print "#LoadModule usertrack_module modules/usertrk.nlm" + print "#LoadModule vhost_alias_module modules/vhost.nlm" + print "" + next +} + +match ($0,/@@.*@@/) { + s=substr($0,RSTART+2,RLENGTH-4) +# substr($0,RSTART,RLENGTH) = A[s] + sub(/@@.*@@/,A[s],$0) +# print +} + + +{ + print +} + + +END { + print + print "#" + print "# SecureListen: Allows you to securely bind Apache to specific IP addresses " + print "# and/or ports." + print "#" + print "# Change this to SecureListen on specific IP addresses as shown below to " + print "# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)" + print "#" + print "#SecureListen 443 \"SSL CertificateIP\"" +} diff --git a/build/nw_export.inc b/build/nw_export.inc new file mode 100644 index 00000000000..27185ead300 --- /dev/null +++ b/build/nw_export.inc @@ -0,0 +1,47 @@ +/* Must include ap_config.h first so that we can redefine + the standard prototypes macros after it messes with + them. */ +#include "ap_config.h" + +/* Define all of the standard prototype macros as themselves + so that httpd.h will not mess with them. This allows + them to pass untouched so that the AWK script can pick + them out of the preprocessed result file. */ +#define AP_DECLARE AP_DECLARE +#define AP_CORE_DECLARE AP_CORE_DECLARE +#define AP_DECLARE_NONSTD AP_DECLARE_NONSTD +#define AP_CORE_DECLARE_NONSTD AP_CORE_DECLARE_NONSTD +#define AP_DECLARE_HOOK AP_DECLARE_HOOK +#define AP_DECLARE_DATA AP_DECLARE_DATA + +#include "httpd.h" + +/* Preprocess all of the standard HTTPD headers. */ +#include "ap_compat.h" +#include "ap_listen.h" +#include "ap_mmn.h" +#include "ap_mpm.h" +#include "ap_release.h" +#include "http_config.h" +#include "http_connection.h" +#include "http_core.h" +#include "http_log.h" +#include "http_main.h" +#include "http_protocol.h" +#include "http_request.h" +#include "http_vhost.h" +#include "mpm_common.h" +#include "pcreposix.h" +#include "rfc1413.h" +#include "scoreboard.h" +#include "util_cfgtree.h" +#include "util_charset.h" +#include "util_ebcdic.h" +#include "util_filter.h" +/*#include "util_ldap.h"*/ +#include "util_md5.h" +#include "util_script.h" +#include "util_time.h" +#include "util_xml.h" + +#include "mod_core.h" diff --git a/build/prebuildNW.bat b/build/prebuildNW.bat new file mode 100755 index 00000000000..d82be4e6d16 --- /dev/null +++ b/build/prebuildNW.bat @@ -0,0 +1,24 @@ +@echo off +rem # As part of the pre-build process, the utilities GenChars.NLM +rem # (Gen Test Chars) and DFTables.NLM (dftables) must be built, +rem # copied to a NetWare server and run using the following commands: +rem # +rem # genchars >test_char.h +rem # dftables >chartables.c +rem # +rem # The files "sys:\test_chars.h" and "sys:\chartables.c" must be +rem # copied to "httpd\os\netware" on the build machine. + +@echo Fixing up the APR headers +copy ..\srclib\apr\include\apr.hnw ..\srclib\apr\include\apr.h + +@echo Fixing up the APR-Util headers +copy ..\srclib\apr-util\include\apu.h.in ..\srclib\apr-util\include\apu.h + +@echo Fixing up the pcre headers +copy ..\srclib\pcre\config.hw ..\srclib\pcre\config.h +copy ..\srclib\pcre\pcre.hw ..\srclib\pcre\pcre.h + +@echo Generating the import lists... +awk95 -f make_nw_export.awk ..\srclib\apr\include\*.h |sort > ..\os\netware\aprlib.imp +awk95 -f make_nw_export.awk ..\srclib\apr-util\include\*.h |sort > ..\os\netware\aprutil.imp \ No newline at end of file diff --git a/docs/error/README b/docs/error/README new file mode 100644 index 00000000000..6856b7c7eec --- /dev/null +++ b/docs/error/README @@ -0,0 +1,27 @@ + + Multi Language Custom Error Documents + ------------------------------------- + + The 'error' directory in the document root directory contains HTTP error + messages in multiple languages. If the preferred language of client is + available it is selected automatically via the MultiViews feature. + You may configure the design and markup of the documents by modifying + the HTML files in the directory '/error/includes', especially the + file 'config.html'. + + + Supported Languages: + + +------------------+------------------------------------------+ + | Language | Contributed by | + +------------------+------------------------------------------+ + | English (en) | Lars Eilebrecht | + | German (de) | Lars Eilebrecht | + | Spanish (es) | Karla Quintero | + | French (fr) | Cecile de Crecy | + +------------------+------------------------------------------+ + (Please see http://httpd.apache.org/docs-project/ if you would + like to contribute the pages in an additional language.) + + + Copyright (c) 2001 The Apache Software Foundation. All rights reserved. diff --git a/docs/manual/developer/filters.html b/docs/manual/developer/filters.html new file mode 100644 index 00000000000..b8ac610025b --- /dev/null +++ b/docs/manual/developer/filters.html @@ -0,0 +1,168 @@ + + + + + + + Request Processing in Apache 2.0 + + + + + + +

How filters work in Apache 2.0

+ +

Warning - this is a cut 'n paste job from an email: + <022501c1c529$f63a9550$7f00000a@KOJ>

+ +
+There are three basic filter types (each of these is actually broken
+down into two categories, but that comes later).
+
+CONNECTION:  Filters of this type are valid for the lifetime of this
+             connection.
+
+PROTOCOL:    Filters of this type are valid for the lifetime of this
+             request from the point of view of the client, this means
+             that the request is valid from the time that the request
+             is sent until the time that the response is received.
+
+RESOURCE:    Filters of this type are valid for the time that this
+             content is used to satisfy a request.  For simple
+             requests, this is identical to PROTOCOL, but internal redirects
+             and sub-requests can change the content without ending
+             the request.
+
+It is important to make the distinction between a protocol and a
+resource filter.  A resource filter is tied to a specific resource, it
+may also be tied to header information, but the main binding is to a
+resource.  If you are writing a filter and you want to know if it is
+resource or protocol, the correct question to ask is:  "Can this filter
+be removed if the request is redirected to a different resource?"  If
+the answer is yes, then it is a resource filter.  If it is no, then it
+is most likely a protocol or connection filter.  I won't go into
+connection filters, because they seem to be well understood.
+
+With this definition, a few examples might help:
+Byterange:  We have coded it to be inserted for all
+requests, and it is removed if not used.  Because this filter is active
+at the beginning of all requests, it can not be removed if it is
+redirected, so this is a protocol filter.
+
+http_header:  This filter actually writes the headers to the
+network.  This is obviously a required filter (except in the asis case
+which is special and will be dealt with below) and so it is a protocol
+filter.
+
+Deflate:  The administrator configures this filter based on
+which file has been requested.  If we do an internal redirect from an
+autoindex page to an index.html page, the deflate filter may be added or
+removed based on config, so this is a resource filter.
+
+The further breakdown of each category into two more filter types is
+strictly for ordering.  We could remove it, and only allow for one
+filter type, but the order would tend to be wrong, and we would need to
+hack things to make it work.  Currently, the RESOURCE filters only have
+one filter type, but that should change.
+
+How are filters inserted?
+This is actually rather simple in theory, but the code is
+complex.  First of all, it is important that everybody realize that
+there are three filter lists for each request, but they are all
+concatenated together.  So, the first list is r->output_filters, then
+r->proto_output_filters, and finally r->connection->output_filters.
+These correspond to the RESOURCE, PROTOCOL, and CONNECTION filters
+respectively.  The problem previously, was that we used a singly linked
+list to create the filter stack, and we started from the "correct"
+location.  This means that if I had a RESOURCE filter on the stack, and
+I added a CONNECTION filter, the CONNECTION filter would be ignored.
+This should make sense, because we would insert the connection filter at
+the top of the c->output_filters list, but the end of r->output_filters
+pointed to the filter that used to be at the front of c->output_filters.
+This is obviously wrong.  The new insertion code uses a doubly linked
+list.  This has the advantage that we never lose a filter that has been
+inserted.  Unfortunately, it comes with a separate set of headaches.
+
+The problem is that we have two different cases were we use subrequests.
+The first is to insert more data into a response.  The second is to
+replace the existing response with an internal redirect.  These are two
+different cases and need to be treated as such.
+
+In the first case, we are creating the subrequest from within a handler
+or filter.  This means that the next filter should be passed to
+make_sub_request function, and the last resource filter in the
+sub-request will point to the next filter in the main request.  This
+makes sense, because the sub-request's data needs to flow through the
+same set of filters as the main request.  A graphical representation
+might help:
+
+Default_handler --> includes_filter --> byterange --> content_length ->
+etc
+
+If the includes filter creates a sub request, then we don't want the
+data from that sub-request to go through the includes filter, because it
+might not be SSI data.  So, the subrequest adds the following:
+
+Default_handler --> includes_filter -/-> byterange --> content_length -> etc
+                                    /
+Default_handler --> sub_request_core
+
+What happens if the subrequest is SSI data?  Well, that's easy, the
+includes_filter is a resource filter, so it will be added to the sub
+request in between the Default_handler and the sub_request_core filter.
+
+The second case for sub-requests is when one sub-request is going to
+become the real request.  This happens whenever a sub-request is created
+outside of a handler or filter, and NULL is passed as the next filter to
+the make_sub_request function.
+
+In this case, the resource filters no longer make sense for the new
+request, because the resource has changed.  So, instead of starting from
+scratch, we simply point the front of the resource filters for the
+sub-request to the front of the protocol filters for the old request.
+This means that we won't lose any of the protocol filters, neither will
+we try to send this data through a filter that shouldn't see it.
+
+The problem is that we are using a doubly-linked list for our filter
+stacks now. But, you should notice that it is possible for two lists to
+intersect in this model.  So, you do you handle the previous pointer?
+This is a very difficult question to answer, because there is no "right"
+answer, either method is equally valid.  I looked at why we use the
+previous pointer.  The only reason for it is to allow for easier
+addition of new servers.  With that being said, the solution I chose was
+to make the previous pointer always stay on the original request.
+
+This causes some more complex logic, but it works for all cases.  My
+concern in having it move to the sub-request, is that for the more
+common case (where a sub-request is used to add data to a response), the
+main filter chain would be wrong.  That didn't seem like a good idea to
+me.
+
+asis:
+The final topic.  :-)  Mod_Asis is a bit of a hack, but the
+handler needs to remove all filters except for connection filters, and
+send the data.  If you are using mod_asis, all other bets are off.
+
+The absolutely last point is that the reason this code was so hard to
+get right, was because we had hacked so much to force it to work.  I
+wrote most of the hacks originally, so I am very much to blame.
+However, now that the code is right, I have started to remove some
+hacks.  Most people should have seen that the reset_filters and
+add_required_filters functions are gone.  Those inserted protocol level
+filters for error conditions, in fact, both functions did the same
+thing, one after the other, it was really strange.  Because we don't
+lose protocol filters for error cases any more, those hacks went away.
+The HTTP_HEADER, Content-length, and Byterange filters are all added in
+the insert_filters phase, because if they were added earlier, we had
+some interesting interactions.  Now, those could all be moved to be
+inserted with the HTTP_IN, CORE, and CORE_IN filters.  That would make
+the code easier to follow.
+
+ + + + + diff --git a/docs/manual/mod/allmodules.xml b/docs/manual/mod/allmodules.xml new file mode 100644 index 00000000000..ddf557d601a --- /dev/null +++ b/docs/manual/mod/allmodules.xml @@ -0,0 +1,46 @@ + +core.xml +mod_access.xml +mod_actions.xml +mod_alias.xml +mod_asis.xml +mod_auth.xml +mod_auth_anon.xml +mod_auth_dbm.xml +mod_auth_digest.xml +mod_autoindex.xml +mod_cern_meta.xml +mod_cgi.xml +mod_cgid.xml +mod_charset_lite.xml +mod_dav.xml +mod_deflate.xml +mod_dir.xml +mod_env.xml +mod_example.xml +mod_ext_filter.xml +mod_file_cache.xml +mod_headers.xml +mod_imap.xml +mod_include.xml +mod_info.xml +mod_isapi.xml +mod_log_config.xml +mod_mime.xml +mod_mime_magic.xml +mod_negotiation.xml +mod_proxy.xml +mod_rewrite.xml +mod_setenvif.xml +mod_so.xml +mod_speling.xml +mod_status.xml +mod_suexec.xml +mod_unique_id.xml +mod_userdir.xml +mod_usertrack.xml +mod_vhost_alias.xml +mpm_common.xml +mpm_winnt.xml +prefork.xml + \ No newline at end of file diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml new file mode 100644 index 00000000000..2eb6527b2dc --- /dev/null +++ b/docs/manual/mod/core.xml @@ -0,0 +1,2480 @@ + + ]> + + + +core +Core +Core Apache HTTP Server features that are always +available + + +AcceptPathInfo +Controls whether requests can contain trailing pathname information +AcceptPathInfo On|Off|Default +AcceptPathInfo Default +server config +virtual hostdirectory +.htaccess +Available in Apache 2.0.30 and later + + + +

This directive controls whether requests that contain trailing + pathname information that follows an actual filename (or + non-existent file in an existing directory) will be accepted or + rejected. The trailing pathname information can be made + available to scripts in the PATH_INFO environment variable.

+ +

For example, assume the location /test/ points to + a directory that contains only the single file + here.html. Then requests for + /test/here.html/more and + /test/nothere.html/more both collect + /more as PATH_INFO.

+ +

The three possible arguments for the + AcceptPathInfo directive are:

+
+
off
A request will only be accepted if it + maps to a literal path that exists. Therefore a request with + trailing pathname information after the true filename such as + /test/here.html/more in the above example will return + a 404 NOT FOUND error.
+ +
on
A request will be accepted if a + leading path component maps to a file that exists. The above + example /test/here.html/more will be accepted if + /test/here.html maps to a valid file.
+ +
default
The treatment of requests with + trailing pathname information is determined by the handler responsible for the request. + The core handler for normal files defaults to rejecting PATH_INFO. + Handlers that serve scripts, such as cgi-script and isapi-isa, generally accept PATH_INFO by + default.
+
+ +

The primary purpose of the AcceptPathInfo + directive is to allow you to override the handler's choice of + accepting or rejecting PATH_INFO. This override is required, for + example, when you use a filter, such + as INCLUDES, to generate content + based on PATH_INFO. The core handler would usually reject the + request, so you can use the following configuration to enable + such a script:

+ +<Files "mypaths.shtml">
+ Options +Includes
+ SetOutputFilter INCLUDES
+ AcceptPathInfo on
+</Files> +
+
+
+ + +AccessFileName +Sets the name of the .htaccess file +AccessFileName filename [filename] ... +AccessFileName .htaccess +server configvirtual host + + + +

When returning a document to the client the server looks for + the first existing access control file from this list of names + in every directory of the path to the document, if access + control files are enabled for that directory. For example:

+ + +AccessFileName .acl + + +

before returning the document + /usr/local/web/index.html, the server will read + /.acl, /usr/.acl, + /usr/local/.acl and /usr/local/web/.acl + for directives, unless they have been disabled with

+ + +<Directory />
+  AllowOverride None
+</Directory> +
+
+AllowOverride +Configuration Files +
+ + +AddDefaultCharset +Specifies the default character set to be added for a +response without an explicit character set +AddDefaultCharset On|Off|charset +server config +virtual hostdirectory +.htaccess +AddDefaultCharset Off + + + +

This directive specifies the name of the character set that + will be added to any response that does not have any parameter on + the content type in the HTTP headers. This will override any + character set specified in the body of the document via a + META tag. A setting of AddDefaultCharset + Off disables this + functionality. AddDefaultCharset On enables + Apache's internal default charset of iso-8859-1 as + required by the directive. You can also specify an alternate + charset to be used. For example:

+ + + AddDefaultCharset utf-8 + +
+
+ + +AddModule +AddModule module [module] ... +server config + + +

The server can have modules compiled in which are not + actively in use. This directive can be used to enable the use + of those modules. The server comes with a pre-loaded list of + active modules; this list can be cleared with the ClearModuleList directive.

+ +

For example:

+ +AddDefaultCharset utf-8 + +
+
+ + +AllowOverride +Sets the types of directives that are allowed in +.htaccess files +AllowOverride All|None|directive-type [directive-type] ... +AllowOverride All +directory + + +

When the server finds an .htaccess file (as specified by AccessFileName) it needs to know + which directives declared in that file can override earlier + access information.

+ +

When this directive is set to None, then + .htaccess files are completely ignored. In this case, the + server will not even attempt to read .htaccess files in the + filesystem.

+ +

When this directive is set to All, then any + directive which has the .htaccess Context is allowed in + .htaccess files.

+ +

The directive-type can be one of the following + groupings of directives.

+ +
+
AuthConfig
+ +
+ + Allow use of the authorization directives (AuthDBMGroupFile, + AuthDBMUserFile, + AuthGroupFile, + AuthName, + AuthType, AuthUserFile, Require, etc.).
+ +
FileInfo
+ +
+ Allow use of the directives controlling document types (DefaultType, ErrorDocument, ForceType, LanguagePriority, + SetHandler, SetInputFilter, SetOutputFilter, and + mod_mime Add* and Remove* + directives, etc.).
+ +
Indexes
+ +
+ Allow use of the directives controlling directory indexing + (AddDescription, + AddIcon, AddIconByEncoding, + AddIconByType, + DefaultIcon, DirectoryIndex, FancyIndexing, HeaderName, IndexIgnore, IndexOptions, ReadmeName, + etc.).
+ +
Limit
+ +
+ Allow use of the directives controlling host access (Allow, Deny and Order).
+ +
Options
+ +
+ Allow use of the directives controlling specific directory + features (Options and + XBitHack).
+
+ +

Example:

+ + AllowOverride AuthConfig Indexes +
+ +AccessFileName +Configuration Files +
+ + +AuthName +Sets the authorization realm for use in HTTP +authentication +AuthName auth-domain +directory.htaccess + +AuthConfig + + +

This directive sets the name of the authorization realm for a + directory. This realm is given to the client so that the user + knows which username and password to send. + AuthName takes a single argument; if the + realm name contains spaces, it must be enclosed in quotation + marks. It must be accompanied by AuthType and Require directives, and directives such + as AuthUserFile and + AuthGroupFile to + work.

+ +

For example:

+ + AuthName "Top Secret" + +

The string provided for the AuthRealm is what will + appear in the password dialog provided by most browsers.

+
+Authentication, Authorization, and + Access Control +
+ + +AuthType +Selects the type of user authentication +AuthType Basic|Digest +directory.htaccess +AuthConfig + + +

This directive selects the type of user authentication for a + directory. Only Basic and Digest are + currently implemented. + + It must be accompanied by AuthName and Require directives, and directives such + as AuthUserFile and + AuthGroupFile to + work.

+
+Authentication, Authorization, +and Access Control +
+ + +ContentDigest +Enables the generation of Content-MD5 HTTP Response +headers +ContentDigest on|off +ContentDigest off +server configvirtual host +directory.htaccess + +Options +Experimental +Available in Apache 1.1 and later + + +

This directive enables the generation of + Content-MD5 headers as defined in RFC1864 + respectively RFC2068.

+ +

MD5 is an algorithm for computing a "message digest" + (sometimes called "fingerprint") of arbitrary-length data, with + a high degree of confidence that any alterations in the data + will be reflected in alterations in the message digest.

+ +

The Content-MD5 header provides an end-to-end + message integrity check (MIC) of the entity-body. A proxy or + client may check this header for detecting accidental + modification of the entity-body in transit. Example header:

+ + Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA== + + +

Note that this can cause performance problems on your server + since the message digest is computed on every request (the + values are not cached).

+ +

Content-MD5 is only sent for documents served + by the core, and not by any module. For example, SSI documents, + output from CGI scripts, and byte range responses do not have + this header.

+
+
+ + +DefaultType +Sets the MIME content-type that will be sent if the +server cannot determine a type in any other way +DefaultType MIME-type +DefaultType text/html +server configvirtual host +directory.htaccess + +FileInfo + + +

There will be times when the server is asked to provide a + document whose type cannot be determined by its MIME types + mappings.

+ +

The server must inform the client of the content-type of the + document, so in the event of an unknown type it uses the + DefaultType. For example:

+ + + DefaultType image/gif + + would be appropriate for a directory which contained many gif + images with filenames missing the .gif extension. + +

Note that unlike ForceType, this directive is only + provides the default mime-type. All other mime-type definitions, + including filename extensions, that might identify the media type + will override this default.

+
+
+ + +Directory +Enclose a group of directives that apply only to the +named file-system directory and sub-directories +<Directory directory-path> +... </Directory> +server configvirtual host + + + +

Directory and + </Directory> are used to enclose a group of + directives which will apply only to the named directory and + sub-directories of that directory. Any directive which is allowed + in a directory context may be used. Directory-path is + either the full path to a directory, or a wild-card string. In a + wild-card string, `?' matches any single character, and `*' + matches any sequences of characters. You may + also use `[]' character ranges like in the shell. Also as of + Apache 1.3 none of the wildcards match a `/' character, which more + closely mimics the behavior of Unix shells. Example:

+ + <Directory /usr/local/httpd/htdocs>
+  Options Indexes FollowSymLinks
+ </Directory>
+
+ +

Extended regular + expressions can also be used, with the addition of the + ~ character. For example:

+ + <Directory ~ "^/www/.*/[0-9]{3}"> + + would match directories in /www/ that consisted of three + numbers. + +

If multiple (non-regular expression) directory sections + match the directory (or its parents) containing a document, + then the directives are applied in the order of shortest match + first, interspersed with the directives from the .htaccess files. For example, + with

+ + + <Directory />
+   AllowOverride None
+ </Directory>
+
+ <Directory /home/*>
+   AllowOverride FileInfo
+ </Directory> +
+

for access to the document /home/web/dir/doc.html + the steps are:

+ +
    +
  • Apply directive AllowOverride None + (disabling .htaccess files).
  • + +
  • Apply directive AllowOverride FileInfo (for + directory /home/web).
  • + +
  • Apply any FileInfo directives in + /home/web/.htaccess
  • +
+ +

Regular expressions are not considered until after all of the + normal sections have been applied. Then all of the regular + expressions are tested in the order they appeared in the + configuration file. For example, with

+ +<Directory ~ abc$>
+ ... directives here ...
+ </Directory>
+
+ +

The regular expression section won't be considered until after + all normal <Directory>s and .htaccess files + have been applied. Then the regular expression will match on + /home/abc/public_html/abc and be applied.

+ +

Note that the default Apache access for + <Directory /> is Allow from All. This means + that Apache will serve any file mapped from an URL. It is + recommended that you change this with a block such + as

+ + + <Directory />
+   Order Deny,Allow
+   Deny from All
+ </Directory> +
+ +

and then override this for directories you + want accessible. See the Security Tips page for more + details.

+ +

The directory sections typically occur in + the access.conf file, but they may appear in any configuration + file. Directory directives + cannot nest, and cannot appear in a Limit or LimitExcept section.

+
+How + Directory, Location and Files sections work for an + explanation of how these different sections are combined when a + request is received +
+ + +DirectoryMatch +Enclose a group of directives that apply only to +file-system directories that match a regular expression and their +subdirectories +<Directory regex> +... </Directory> +server configvirtual host + + + +

DirectoryMatch and + </DirectoryMatch> are used to enclose a group + of directives which will apply only to the named directory and + sub-directories of that directory, the same as Directory. However, it + takes as an argument a regular expression. For example:

+ + <DirectoryMatch "^/www/.*/[0-9]{3}"> + + +

would match directories in /www/ that consisted of three + numbers.

+
+Directory for +a description of how regular expressions are mixed in with normal +<Directory>s +How Directory, Location and Files sections +work for an explanation of how these different sections are +combined when a request is received +
+ + +DocumentRoot +Sets the directory that forms the main document tree visible +from the web +DocumentRoot directory-path +DocumentRoot /usr/local/apache/htdocs +server configvirtual host + + + +

This directive sets the directory from which httpd will + serve files. Unless matched by a directive like Alias, the + server appends the path from the requested URL to the document + root to make the path to the document. Example:

+ + DocumentRoot /usr/web + +

then an access to + http://www.my.host.com/index.html refers to + /usr/web/index.html.

+ +

The DocumentRoot should be specified without + a trailing slash.

+
+Mapping URLs to Filesystem +Location +
+ + +ErrorDocument +Specifies what the server will return to the client +in case of an error +ErrorDocument error-code document +server configvirtual host +directory.htaccess + +FileInfo +Quoting syntax for text messages is different in Apache +2.0 + + +

In the event of a problem or error, Apache can be configured + to do one of four things,

+ +
    +
  1. output a simple hardcoded error message
  2. + +
  3. output a customized message
  4. + +
  5. redirect to a local URL-path to handle the + problem/error
  6. + +
  7. redirect to an external URL to handle the + problem/error
  8. +
+ +

The first option is the default, while options 2-4 are + configured using the ErrorDocument + directive, which is followed by the HTTP response code and a URL + or a message. Apache will sometimes offer additional information + regarding the problem/error.

+ +

URLs can begin with a slash (/) for local URLs, or be a full + URL which the client can resolve. Alternatively, a message can + be provided to be displayed by the browser. Examples:

+ + + ErrorDocument 500 + http://foo.example.com/cgi-bin/tester
+ ErrorDocument 404 /cgi-bin/bad_urls.pl
+ ErrorDocument 401 /subscription_info.html
+ ErrorDocument 403 "Sorry can't allow you access + today" +
+ +

Note that when you specify an ErrorDocument + that points to a remote URL (ie. anything with a method such as + "http" in front of it), Apache will send a redirect to the + client to tell it where to find the document, even if the + document ends up being on the same server. This has several + implications, the most important being that the client will not + receive the original error status code, but instead will + receive a redirect status code. This in turn can confuse web + robots and other clients which try to determine if a URL is + valid using the status code. In addition, if you use a remote + URL in an ErrorDocument 401, the client will not + know to prompt the user for a password since it will not + receive the 401 status code. Therefore, if you use an + "ErrorDocument 401" directive then it must refer to a local + document.

+ +

Prior to version 2.0, messages were indicated by prefixing + them with a single unmatched double quote character.

+
+ +documentation of + customizable responses +
+ + +ErrorLog +Sets the name of the file to which the server +will log errors + ErrorLog file-path|syslog[:facility] +ErrorLog logs/error_log (Unix) +ErrorLog logs/error.log (Windows and OS/2) +server configvirtual host + + + +

The ErrorLog directive sets the name of + the file to which the server will log any errors it encounters. If + the file-path does not begin with a slash (/) then it is + assumed to be relative to the ServerRoot. If the file-path + begins with a pipe (|) then it is assumed to be a command to spawn + to handle the error log.

+ +

Using syslog instead of a filename enables logging + via syslogd(8) if the system supports it. The default is to use + syslog facility local7, but you can override this by + using the syslog:facility syntax where + facility can be one of the names usually documented in + syslog(1).

+ +

SECURITY: See the security tips + document for details on why your security could be compromised + if the directory where logfiles are stored is writable by + anyone other than the user that starts the server.

+
+LogLevel +Apache Log Files +
+ + +FileETag +Configures the file attributes used to create the ETag +HTTP response header +FileETag component ... +server configvirtual host +directory.htaccess + +FileInfo + + +

+ The FileETag directive configures the file + attributes that are used to create the ETag (entity tag) response + header field when the document is based on a file. (The ETag + value is used in cache management to save network bandwidth.) In + Apache 1.3.22 and earlier, the ETag value was always formed + from the file's inode, size, and last-modified time (mtime). The + FileETag directive allows you to choose which of these -- if any + -- should be used. The recognized keywords are: +

+
+
INode
+
The file's i-node number will be included in the calculation
+
MTime
+
The date and time the file was last modified will be included
+
Size
+
The number of bytes in the file will be included
+
All
+
All available fields will be used (equivalent to + 'FileETag INode MTime Size')
+
None
+
If a document is file-based, no ETag field will be included in the + response
+
+

+ The INode, MTime, and Size keywords may be prefixed with either '+' + or '-', which allow changes to be made to the default setting + inherited from a broader scope. Any keyword appearing without + such a prefix immediately and completely cancels the inherited + setting. +

+

+ If a directory's configuration includes + 'FileETag INode MTime Size', and a + subdirectory's includes 'FileETag -INode', + the setting for that subdirectory (which will be inherited by + any sub-subdirectories that don't override it) will be equivalent to + 'FileETag MTime Size'. +

+
+
+ + +Files +Contains that directives that apply to matched +filenames +<Files filename> ... </Files> +server configvirtual host +directory.htaccess + + + +

The Files directive + provides for access control by filename. It is comparable to the + Directory + directive and Location directives. It should be + matched with a </Files> directive. The + directives given within this section will be applied to any object + with a basename (last component of filename) matching the + specified filename. Files + sections are processed in the order they appear in the + configuration file, after the Directory sections and + .htaccess files are read, but before Location sections. Note + that Files can be nested + inside Directory sections to restrict the + portion of the filesystem they apply to.

+ +

The filename argument should include a filename, or + a wild-card string, where `?' matches any single character, and + `*' matches any sequences of characters. Extended regular + expressions can also be used, with the addition of the + ~ character. For example:

+ + <Files ~ "\.(gif|jpe?g|png)$"> + +

would match most common Internet graphics formats. In Apache 1.3 + and later, FilesMatch is preferred, however.

+ +

Note that unlike Directory and Location sections, Files sections can be used inside + .htaccess files. This allows users to control access to their own + files, at a file-by-file level.

+ +
+How + Directory, Location and Files sections work for an + explanation of how these different sections are combined when a + request is received +
+ + +FilesMatch +Contains that directives that apply to regular-expression matched +filenames +<FilesMatch regex> ... </FilesMatch> +server configvirtual host +directory.htaccess + + + +

The FilesMatch directive + provides for access control by filename, just as the Files directive + does. However, it accepts a regular expression. For example:

+ + <FilesMatch "\.(gif|jpe?g|png)$"> + + +

would match most common Internet graphics formats.

+
+ +How + Directory, Location and Files sections work for an + explanation of how these different sections are combined when a + request is received +
+ + +ForceType +Forces all matching files to be served with the specified +MIME content-type +ForceType mime-type +directory.htaccess + +Moved to the core in Apache 2.0 + + +

When placed into an .htaccess file or a + Directory, or + Location or + Files + section, this directive forces all matching files to be served + with the content type identification given by + mime-type. For example, if you had a directory full of + GIF files, but did not want to label them all with ".gif", you + might want to use:

+ + ForceType image/gif + + +

Note that unlike DefaultType, + this directive overrides all mime-type associations, including + filename extensions, that might identify the media type.

+
+
+ + +HostnameLookups +Enables DNS lookups on client IP addresses +HostnameLookups on|off|double +HostnameLookups off +server configvirtual host +directory + + +

This directive enables DNS lookups so that host names can be + logged (and passed to CGIs/SSIs in REMOTE_HOST). + The value double refers to doing double-reverse + DNS. That is, after a reverse lookup is performed, a forward + lookup is then performed on that result. At least one of the ip + addresses in the forward lookup must match the original + address. (In "tcpwrappers" terminology this is called + PARANOID.)

+ +

Regardless of the setting, when mod_access is + used for controlling access by hostname, a double reverse lookup + will be performed. This is necessary for security. Note that the + result of this double-reverse isn't generally available unless you + set HostnameLookups double. For example, if only + HostnameLookups on and a request is made to an object + that is protected by hostname restrictions, regardless of whether + the double-reverse fails or not, CGIs will still be passed the + single-reverse result in REMOTE_HOST.

+ +

The default is off in order to save the network + traffic for those sites that don't truly need the reverse + lookups done. It is also better for the end users because they + don't have to suffer the extra latency that a lookup entails. + Heavily loaded sites should leave this directive + off, since DNS lookups can take considerable + amounts of time. The utility logresolve, provided in + the /support directory, can be used to look up host + names from logged IP addresses offline.

+
+
+ + +IdentityCheck +Enables logging of the RFC1413 identity of the remote +user +IdentityCheck on|off +IdentityCheck off + + +

This directive enables RFC1413-compliant logging of the + remote user name for each connection, where the client machine + runs identd or something similar. This information is logged in + the access log.

+ +

The information should not be trusted in any way except for + rudimentary usage tracking.

+ +

Note that this can cause serious latency problems accessing + your server since every request requires one of these lookups + to be performed. When firewalls are involved each lookup might + possibly fail and add 30 seconds of latency to each hit. So in + general this is not very useful on public servers accessible + from the Internet.

+
+
+ + +IfDefine +Encloses directives that will be processed only +if a test is true at startup +<IfDefine [!]parameter-name> ... + </IfDefine> +server configvirtual host +directory.htaccess + + + +

The <IfDefine + test>...</IfDefine> section is used to + mark directives that are conditional. The directives within an + IfDefine section are only + processed if the test is true. If test is false, + everything between the start and end markers is ignored.

+ +

The test in the IfDefine section directive can be one + of two forms:

+ +
    +
  • parameter-name
  • + +
  • !parameter-name
  • +
+ +

In the former case, the directives between the start and end + markers are only processed if the parameter named + parameter-name is defined. The second format reverses + the test, and only processes the directives if + parameter-name is not defined.

+ +

The parameter-name argument is a define as given on + the httpd command line via + -Dparameter-, at the time the server was + started.

+ +

IfDefine sections are + nest-able, which can be used to implement simple + multiple-parameter tests. Example:

+
+  $ httpd -DReverseProxy ...
+
+  # httpd.conf
+  <IfDefine ReverseProxy>
+  LoadModule rewrite_module modules/mod_rewrite.so
+  LoadModule proxy_module   modules/libproxy.so
+  </IfDefine>
+
+ +
+
+ + +IfModule +Encloses directives that are processed conditional on the +presence of absence of a specific module +<IfModule [!]module-name> ... + </IfModule> +server configvirtual host +directory.htaccess + + + +

The <IfModule + test>...</IfModule> section is used to + mark directives that are conditional. The directives within an + IfModule section are only + processed if the test is true. If test is false, + everything between the start and end markers is ignored.

+ +

The test in the IfModule section directive can be one + of two forms:

+ +
    +
  • module name
  • + +
  • !module name
  • +
+ +

In the former case, the directives between the start and end + markers are only processed if the module named module + name is included in Apache -- either compiled in or + dynamically loaded using LoadModule. The second format + reverses the test, and only processes the directives if module + name is not included.

+ +

The module name argument is the file name of the + module, at the time it was compiled. + For example, mod_rewrite.c.

+ +

IfModule sections are + nest-able, which can be used to implement simple multiple-module + tests.

+
+
+ + +Include +Includes other configuration files from within +the server configuration files +Include file-path|directory-path +server config + + +

This directive allows inclusion of other configuration files + from within the server configuration files.

+ +

If Include points to a directory, rather than a + file, Apache will read all files in that directory, and any + subdirectory, and parse those as configuration files.

+ +

The file path specified may be a fully qualified path (i.e. + starting with a slash), or may be relative to the + ServerRoot directory.

+ +

Examples:

+ + + Include /usr/local/apache/conf/ssl.conf
+ Include /usr/local/apache/conf/vhosts/ +
+ +

Or, providing paths relative to your ServerRoot + directory:

+ + + Include conf/ssl.conf
+ Include conf/vhosts/ +
+ +

Make sure that an included directory does not contain any stray + files, such as editor temporary files, for example, as Apache will + attempt to read them in and use the contents as configuration + directives, which may cause the server to fail on start up. + Running apachectl configtest will give you a list of + the files that are being processed during the configuration + check:

+ +
+ root@host# apachectl configtest
+  Processing config directory: /usr/local/apache/conf/vhosts
+  Processing config file: /usr/local/apache/conf/vhosts/vhost1
+  Processing config file: /usr/local/apache/conf/vhosts/vhost2
+ Syntax OK
+
+ +

This will help in verifying that you are getting only the files + that you intended as part of your configuration.

+
+ +apachectl +
+ + +KeepAlive +Turns on or off HTTP persistent connections. +KeepAlive on|off +KeepAlive On +server config + + +

The Keep-Alive extension to HTTP/1.0 and the persistent + connection feature of HTTP/1.1 provide long-lived HTTP sessions + which allow multiple requests to be sent over the same TCP + connection. In some cases this has been shown to result in an + almost 50% speedup in latency times for HTML documents with + many images. To enable Keep-Alive connections in Apache 1.2 and + later, set KeepAlive On.

+ +

For HTTP/1.0 clients, Keep-Alive connections will only be + used if they are specifically requested by a client. In + addition, a Keep-Alive connection with an HTTP/1.0 client can + only be used when the length of the content is known in + advance. This implies that dynamic content such as CGI output, + SSI pages, and server-generated directory listings will + generally not use Keep-Alive connections to HTTP/1.0 clients. + For HTTP/1.1 clients, persistent connections are the default + unless otherwise specified. If the client requests it, chunked + encoding will be used in order to send content of unknown + length over persistent connections.

+
+ +MaxKeepAliveRequests +
+ + +KeepAliveTimeout +Sets the amount of time the server will wait for subsequent +requests on a persistent connection +KeepAliveTimeout seconds +KeepAliveTimeout 15 +server config + + +

The number of seconds Apache will wait for a subsequent + request before closing the connection. Once a request has been + received, the timeout value specified by the + Timeout directive applies.

+ +

Setting KeepAliveTimeout to a high value + may cause performance problems in heavily loaded servers. The + higher the timeout, the more server processes will be kept + occupied waiting on connections with idle clients.

+
+
+ + +Limit +Restrict access controls to only certain HTTP +methods +<Limit method [method] ... > ... + </Limit> +server configvirtual host +directory.htaccess + + + +

Access controls are normally effective for + all access methods, and this is the usual + desired behavior. In the general case, access control + directives should not be placed within a + limit section.

+ +

The purpose of the Limit + directive is to restrict the effect of the access controls to the + nominated HTTP methods. For all other methods, the access + restrictions that are enclosed in the <Limit> + bracket will have no effect. The following + example applies the access control only to the methods POST, PUT, + and DELETE, leaving all other methods unprotected:

+ + + <Limit POST PUT DELETE>
+   Require valid-user
+ </Limit>
+
+

The method names listed can be one or more of: GET, POST, PUT, + DELETE, CONNECT, OPTIONS, TRACE, PATCH, PROPFIND, PROPPATCH, + MKCOL, COPY, MOVE, LOCK, and UNLOCK. The method name is + case-sensitive. If GET is used it will also restrict + HEAD requests.

+
+
+ + +LimitExcept +Restrict access controls to all HTTP methods +except the named ones +<LimitExcept method [method] ... > ... + </LimitExcept> +server configvirtual host +directory.htaccess + + + +

LimitExcept and + </LimitExcept> are used to enclose a group of + access control directives which will then apply to any HTTP access + method not listed in the arguments; i.e., it is + the opposite of a Limit section and can be used to control + both standard and nonstandard/unrecognized methods. See the + documentation for Limit for more details.

+
+
+ + +LimitRequestBody +Restricts the total size of the HTTP request body sent +from the client +LimitRequestBody bytes +LimitRequestBody 0 +server configvirtual host +directory.htaccess + + + +

This directive specifies the number of bytes from 0 + (meaning unlimited) to 2147483647 (2GB) that are allowed in a + request body. The default value is defined by the compile-time + constant DEFAULT_LIMIT_REQUEST_BODY (0 as + distributed).

+ +

The LimitRequestBody directive allows + the user to set a limit on the allowed size of an HTTP request + message body within the context in which the directive is given + (server, per-directory, per-file or per-location). If the client + request exceeds that limit, the server will return an error + response instead of servicing the request. The size of a normal + request message body will vary greatly depending on the nature of + the resource and the methods allowed on that resource. CGI scripts + typically use the message body for passing form information to the + server. Implementations of the PUT method will require a value at + least as large as any representation that the server wishes to + accept for that resource.

+ +

This directive gives the server administrator greater + control over abnormal client request behavior, which may be + useful for avoiding some forms of denial-of-service + attacks.

+
+
+ + +LimitRequestFields +Limits the number of HTTP request header fields that +will be accepted from the client +LimitRequestFields number +LimitRequestFields 100 +server config + + +

Number is an integer from 0 (meaning unlimited) to + 32767. The default value is defined by the compile-time + constant DEFAULT_LIMIT_REQUEST_FIELDS (100 as + distributed).

+ +

The LimitRequestFields directive allows + the server administrator to modify the limit on the number of + request header fields allowed in an HTTP request. A server needs + this value to be larger than the number of fields that a normal + client request might include. The number of request header fields + used by a client rarely exceeds 20, but this may vary among + different client implementations, often depending upon the extent + to which a user has configured their browser to support detailed + content negotiation. Optional HTTP extensions are often expressed + using request header fields.

+ +

This directive gives the server administrator greater + control over abnormal client request behavior, which may be + useful for avoiding some forms of denial-of-service attacks. + The value should be increased if normal clients see an error + response from the server that indicates too many fields were + sent in the request.

+
+
+ + +LimitRequestFieldSize +Limits the size of the HTTP request header allowed from the +client +LimitRequestFieldsize bytes +LimitRequestFieldsize 8190 +server config + + +

This directive specifies the number of bytes from 0 + to the value of the compile-time constant + DEFAULT_LIMIT_REQUEST_FIELDSIZE (8190 as + distributed) that will be allowed in an HTTP request + header.

+ +

The LimitRequestFieldsize directive + allows the server administrator to reduce the limit on the allowed + size of an HTTP request header field below the normal input buffer + size compiled with the server. A server needs this value to be + large enough to hold any one header field from a normal client + request. The size of a normal request header field will vary + greatly among different client implementations, often depending + upon the extent to which a user has configured their browser to + support detailed content negotiation.

+ +

This directive gives the server administrator greater + control over abnormal client request behavior, which may be + useful for avoiding some forms of denial-of-service attacks. + Under normal conditions, the value should not be changed from + the default.

+
+
+ + +LimitRequestLine +Limit the size of the HTTP request line that will be accepted +from the client +LimitRequestLine bytes +LimitRequestLine 8190 +server config + + +

This directive sets the number of bytes from 0 to + the value of the compile-time constant + DEFAULT_LIMIT_REQUEST_LINE (8190 as distributed) + that will be allowed on the HTTP request-line.

+ +

The LimitRequestLine directive allows + the server administrator to reduce the limit on the allowed size + of a client's HTTP request-line below the normal input buffer size + compiled with the server. Since the request-line consists of the + HTTP method, URI, and protocol version, the + LimitRequestLine directive places a + restriction on the length of a request-URI allowed for a request + on the server. A server needs this value to be large enough to + hold any of its resource names, including any information that + might be passed in the query part of a GET request.

+ +

This directive gives the server administrator greater + control over abnormal client request behavior, which may be + useful for avoiding some forms of denial-of-service attacks. + Under normal conditions, the value should not be changed from + the default.

+
+
+ + +LimitXMLRequestBody +Limits the size of an XML-based request body +LimitXMLRequestBody number +LimitXMLRequestBody 1000000 +server config + + +

Limit (in bytes) on maximum size of an XML-based request + body. A value of 0 will disable any checking.

+
+
+ + +Location +Applies the enclosed directives only to matching +URLs +<Location + URL-path|URL> ... </Location> +server configvirtual host + + + +

The Location directive + provides for access control by URL. It is similar to the + Directory + directive, and starts a subsection which is terminated with a + </Location> directive. Location sections are processed in the + order they appear in the configuration file, after the Directory sections and + .htaccess files are read, and after the Files sections.

+ +

Note that URLs do not have to line up with the filesystem at + all, it should be emphasized that <Location> operates + completely outside the filesystem.

+ +

For all origin (non-proxy) requests, the URL to be matched + is of the form /path/, and you should not include + any http://servername prefix. For proxy requests, + the URL to be matched is of the form + scheme://servername/path, and you must include the + prefix.

+ +

The URL may use wildcards In a wild-card string, `?' matches + any single character, and `*' matches any sequences of + characters.

+ +

Extended regular + expressions can also be used, with the addition of the + ~ character. For example:

+ + <Location ~ "/(extra|special)/data"> + + +

would match URLs that contained the substring "/extra/data" or + "/special/data". In Apache 1.3 and above, a new directive + LocationMatch + exists which behaves identical to the regex version of + Location.

+ +

The Location + functionality is especially useful when combined with the + SetHandler + directive. For example, to enable status requests, but allow them + only from browsers at foo.com, you might use:

+ + <Location /status>
+ SetHandler server-status
+ Order Deny,Allow
+ Deny from all
+ Allow from .foo.com
+ </Location> +
+ +Note about / (slash)

The slash character has +special meaning depending on where in a URL it appears. People may be +used to its behavior in the filesystem where multiple adjacent slashes +are frequently collapsed to a single slash (i.e., +/home///foo is the same as /home/foo). In +URL-space this is not necessarily true. The LocationMatch directive and the regex +version of Location require you +to explicitly specify multiple slashes if that is your intention. For +example, <LocationMatch ^/abc> would match the +request URL /abc but not the request URL +//abc. The (non-regex) Location directive behaves similarly when +used for proxy requests. But when (non-regex) Location is used for non-proxy requests it +will implicitly match multiple slashes with a single slash. For +example, if you specify <Location /abc/def> and the +request is to /abc//def then it will match.

+
+
+How + Directory, Location and Files sections work for an + explanation of how these different sections are combined when a + request is received +
+ + +LocationMatch +Applies the enclosed directives only to regular-expression +matching URLs +<LocationMatch + regex> ... </Location> +server configvirtual host + + + +

The LocationMatch directive + provides for access control by URL, in an identical manner to + Location. However, it takes a regular + expression as an argument instead of a simple string. For + example:

+ + <LocationMatch "/(extra|special)/data"> + + +

would match URLs that contained the substring "/extra/data" + or "/special/data".

+
+ +How + Directory, Location and Files sections work for an + explanation of how these different sections are combined when a + request is received +
+ + +LogLevel +Controls the verbosity of the ErrorLog +LogLevel level +LogLevel warn +server configvirtual host + + + +

LogLevel adjusts the verbosity of the + messages recorded in the error logs (see ErrorLog directive). The following + levels are available, in order of decreasing + significance:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Level Description
+ Example
emerg Emergencies - system is unusable.
+ "Child cannot open lock file. Exiting"
alert Action must be taken immediately.
+ "getpwuid: couldn't determine user name from uid"
crit Critical Conditions.
+ "socket: Failed to get a socket, exiting child"
error Error conditions.
+ "Premature end of script headers"
warn Warning conditions.
+ "child process 1234 did not exit, sending another + SIGHUP"
notice Normal but significant condition.
+ "httpd: caught SIGBUS, attempting to dump core in + ..."
info Informational.
+ "Server seems busy, (you may need to increase + StartServers, or Min/MaxSpareServers)..."
debug Debug-level messages
+ "Opening config file ..."
+ +

When a particular level is specified, messages from all + other levels of higher significance will be reported as well. + E.g., when LogLevel info is specified, + then messages with log levels of notice and + warn will also be posted.

+ +

Using a level of at least crit is + recommended.

+
+
+ + +MaxKeepAliveRequests +Sets the number of requests allowed on a persistent +connection +MaxKeepAliveRequests number +MaxKeepAliveRequests 100 +server config + + +

The MaxKeepAliveRequests directive + limits the number of requests allowed per connection when + KeepAlive is on. If it is + set to "0", unlimited requests will be allowed. We + recommend that this setting be kept to a high value for maximum + server performance.

+
+
+ + +NameVirtualHost +Configures an IP address for name-virtual +hosting +NameVirtualHost addr[:port] +server config + + +

The NameVirtualHost directive is a + required directive if you want to configure name-based virtual hosts.

+ +

Although addr can be hostname it is recommended + that you always use an IP address, e.g.

+ +NameVirtualHost 111.22.33.44 + +

With the NameVirtualHost directive you + specify the IP address on which the server will receive requests + for the name-based virtual hosts. This will usually be the address + to which your name-based virtual host names resolve. In cases + where a firewall or other proxy receives the requests and forwards + them on a different IP address to the server, you must specify the + IP address of the physical interface on the machine which will be + servicing the requests. If you have multiple name-based hosts on + multiple addresses, repeat the directive for each address.

+ +

Note: the "main server" and any _default_ servers will + never be served for a request to a + NameVirtualHost IP Address (unless for some + reason you specify NameVirtualHost but then + don't define any VirtualHosts for that address).

+ +

Optionally you can specify a port number on which the + name-based virtual hosts should be used, e.g.

+ +NameVirtualHost 111.22.33.44:8080 + +

IPv6 addresses must be enclosed in square brackets, as shown + in the following example:

+ +NameVirtualHost [fe80::a00:20ff:fea7:ccea]:8080 + +
+
+ + +Options +Configures what features are available in a particular +directory +Options + [+|-]option [[+|-]option] ... +Options All +server configvirtual host +directory.htaccess + +Options + + +

The Options directive controls which + server features are available in a particular directory.

+ +

option can be set to None, in which + case none of the extra features are enabled, or one or more of + the following:

+ +
+
All
+ +
All options except for MultiViews. This is the default + setting.
+ +
ExecCGI
+ +
+ Execution of CGI scripts is permitted.
+ +
FollowSymLinks
+ +
+ + The server will follow symbolic links in this directory.
+ Note: even though the server follows the + symlink it does not change the pathname used to match + against Directory sections.
+ Note: this option gets ignored if set inside a + Location + section.
+ +
Includes
+ +
+ Server-side includes are permitted.
+ +
IncludesNOEXEC
+ +
+ + Server-side includes are permitted, but the #exec command and + #exec CGI are disabled. It is still possible to #include + virtual CGI scripts from ScriptAliase'd directories.
+ +
Indexes
+ +
+ If a URL which maps to a directory is requested, and the + there is no DirectoryIndex (e.g., index.html) in + that directory, then the server will return a formatted + listing of the directory.
+ +
MultiViews
+ +
+ Content negotiated + MultiViews are allowed.
+ +
SymLinksIfOwnerMatch
+ +
+ + The server will only follow symbolic links for which the target + file or directory is owned by the same user id as the link.
Note: this option gets ignored if set inside + a Location + section.
+
+

Normally, if multiple Options could apply to a + directory, then the most specific one is taken complete; the + options are not merged. However if all the options on + the Options directive are preceded by a + or - + symbol, the options are merged. Any options preceded by a + are + added to the options currently in force, and any options + preceded by a - are removed from the options currently in + force.

+ +

For example, without any + and - symbols:

+ + +<Directory /web/docs>
+ Options Indexes FollowSymLinks
+ </Directory>
+ <Directory /web/docs/spec>
+ Options Includes
+ </Directory> +
+

then only Includes will be set for the + /web/docs/spec directory. However if the second + Options directive uses the + and - symbols:

+ + + <Directory /web/docs>
+ Options Indexes FollowSymLinks
+ </Directory>
+ <Directory /web/docs/spec>
+ Options +Includes -Indexes
+ </Directory> +
+

then the options FollowSymLinks and + Includes are set for the /web/docs/spec directory.

+ + +

Note: Using -IncludesNOEXEC or + -Includes disables server-side includes completely + regardless of the previous setting.

+ +

The default in the absence of any other settings is + All.

+
+
+ + +Require +Selects which authenticated users can access +a resource +Require entity-name [entity-name] ... +directory.htaccess + +AuthConfig + + +

This directive selects which authenticated users can access + a directory. The allowed syntaxes are:

+ +
    +
  • + Require user userid [userid] ... + +

    Only the named users can access the directory.

    +
  • + +
  • + Require group group-name [group-name] ... + + +

    Only users in the named groups can access the + directory.

    +
  • + +
  • + Require valid-user + +

    All valid users can access the directory.

    +
  • +
+ +

Require must be accompanied by + AuthName and AuthType directives, and directives such + as AuthUserFile + and AuthGroupFile (to + define users and groups) in order to work correctly. Example:

+ + + AuthType Basic
+ AuthName "Restricted Directory"
+ AuthUserFile /web/users
+ AuthGroupFile /web/groups
+ Require group admin
+
+ +

Access controls which are applied in this way are effective for + all methods. This is what is normally + desired. If you wish to apply access controls only to + specific methods, while leaving other methods unprotected, then + place the Require statement into a + Limit + section.

+
+Satisfy +mod_access +
+ + +RLimitCPU +Limits the CPU consumption of processes launched +by Apache children +RLimitCPU number|max [number|max] +Unset; uses operating system defaults +>server configvirtual host + +Moved in version 2.0 to + the MPMs + + +

Takes 1 or 2 parameters. The first parameter sets the soft + resource limit for all processes and the second parameter sets + the maximum resource limit. Either parameter can be a number, + or max to indicate to the server that the limit should + be set to the maximum allowed by the operating system + configuration. Raising the maximum resource limit requires that + the server is running as root, or in the initial startup + phase.

+ +

This applies to processes forked off from Apache children + servicing requests, not the Apache children themselves. This + includes CGI scripts and SSI exec commands, but not any + processes forked off from the Apache parent such as piped + logs.

+ +

CPU resource limits are expressed in seconds per + process.

+
+RLimitMEM +RLimitNPROC +
+ + +RLimitMEM +Limits the memory consumption of processes launched +by Apache children +RLimitMEM number|max [number|max] +Unset; uses operating system defaults +server configvirtual host + +Moved in version 2.0 to the MPMs. + + +

Takes 1 or 2 parameters. The first parameter sets the soft + resource limit for all processes and the second parameter sets + the maximum resource limit. Either parameter can be a number, + or max to indicate to the server that the limit should + be set to the maximum allowed by the operating system + configuration. Raising the maximum resource limit requires that + the server is running as root, or in the initial startup + phase.

+ +

This applies to processes forked off from Apache children + servicing requests, not the Apache children themselves. This + includes CGI scripts and SSI exec commands, but not any + processes forked off from the Apache parent such as piped + logs.

+ +

Memory resource limits are expressed in bytes per + process.

+
+RLimitCPU +RLimitNPROC +
+ + +RLimitNPROC +Limits the number of processes that can be launched by +processes launched by Apache children +RLimitNPROC number|max [number|max] +Unset; uses operating system defaults +server configvirtual host + +Moved in version 2.0 to the MPMs. + + +

Takes 1 or 2 parameters. The first parameter sets the soft + resource limit for all processes and the second parameter sets + the maximum resource limit. Either parameter can be a number, + or max to indicate to the server that the limit + should be set to the maximum allowed by the operating system + configuration. Raising the maximum resource limit requires that + the server is running as root, or in the initial startup + phase.

+ +

This applies to processes forked off from Apache children + servicing requests, not the Apache children themselves. This + includes CGI scripts and SSI exec commands, but not any + processes forked off from the Apache parent such as piped + logs.

+ +

Process limits control the number of processes per user.

+ +

Note: If CGI processes are not running + under userids other than the web server userid, this directive + will limit the number of processes that the server itself can + create. Evidence of this situation will be indicated by + cannot fork messages in the + error_log.

+
+RLimitMEM +RLimitCPU +
+ + +Satisfy +Configures how host-level access control and user authentication +interact +Satisfy any|all +Satisfy all +directory.htaccess + + + +

Access policy if both Allow and Require used. The parameter can be + either 'all' or 'any'. This directive is only + useful if access to a particular area is being restricted by both + username/password and client host address. In this case + the default behavior ("all") is to require that the client passes + the address access restriction and enters a valid + username and password. With the "any" option the client will be + granted access if they either pass the host restriction or enter a + valid username and password. This can be used to password restrict + an area, but to let clients from particular addresses in without + prompting for a password.

+
+
+ + +ScriptInterpreterSource +Controls how the interpreter for CGI scripts is +located +ScriptInterpreterSource registry|script +ScriptInterpreterSource script +directory.htaccess + +Win32 only + + +

This directive is used to control how Apache finds the + interpreter used to run CGI scripts. The default technique is to + use the interpreter pointed to by the #! line in the + script. Setting ScriptInterpreterSource registry will + cause the Windows Registry to be searched using the script file + extension (e.g., .pl) as a search key.

+
+
+ + +ServerAdmin +Sets the email address that the server includes in error +messages sent to the client +ServerAdmin email-address +server configvirtual host + + + +

The ServerAdmin sets the e-mail address + that the server includes in any error messages it returns to the + client.

+ +

It may be worth setting up a dedicated address for this, + e.g.

+ServerAdmin www-admin@foo.bar.com +

as users do not always mention that they are talking about the + server!

+
+
+ + +ServerAlias +Sets alternate names for a host used when matching requests +to name-virtual hosts +ServerAlias hostname [hostname] ... +virtual host + + +

The ServerAlias directive sets the + alternate names for a host, for use with name-based virtual hosts.

+ + + <VirtualHost *>
+ ServerName server.domain.com
+ ServerAlias server server2.domain.com server2
+ ...
+ </VirtualHost> +
+
+Apache Virtual Host documentation +
+ + +ServerName +Sets the hostname and port that the server uses to identify +itself +ServerName fully-qualified-domain-name[:port] +server configvirtual host + +In version 2.0, this + directive supersedes the functionality of the Port + directive from version 1.3. + + +

The ServerName directive sets the hostname and + port that the server uses to identify itself. This is used when + creating redirection URLs. For example, if the name of the + machine hosting the webserver is simple.example.com, + but the machine also has the DNS alias www.example.com + and you wish the webserver to be so identified, the following + directive should be used:

+ +ServerName www.example.com:80 + +

If no ServerName is specified, then the + server attempts to deduce the hostname by performing a reverse + lookup on the IP address. If no port is specified in the + servername, then the server will use the port from the incoming + request. For optimal reliability and predictability, you should + specify an explicit hostname and port using the + ServerName directive.

+ +

If you are using name-based virtual hosts, + the ServerName inside a + VirtualHost + section specifies what hostname must appear in the request's + Host: header to match this virtual host.

+ +

See the description of the + UseCanonicalName directive for + settings which determine whether self-referential URL's (e.g., by the + mod_dir module) will refer to the + specified port, or to the port number given in the client's request. +

+
+ +DNS Issues +Apache virtual host + documentation +UseCanonicalName +NameVirtualHost +ServerAlias +
+ + +ServerPath +Sets the legacy URL pathname for a name-virtual host that +is accessed by an incompatible browser +ServerPath directory-path +virtual host + + +

The ServerPath directive sets the legacy + URL pathname for a host, for use with name-based virtual hosts.

+
+Apache Virtual Host documentation +
+ + +ServerRoot +Sets the base directory for the server installation +ServerRoot directory-path +ServerRoot /usr/local/apache +server config + + +

The ServerRoot directive sets the + directory in which the server lives. Typically it will contain the + subdirectories conf/ and logs/. Relative + paths for other configuration files are taken as relative to this + directory.

+
+the -d + option to httpd +the + security tips for information on how to properly set + permissions on the ServerRoot +
+ + +ServerSignature +Configures the footer on server-generated documents +ServerSignature On|Off|EMail +ServerSignature Off +server configvirtual host +directory.htaccess + + + +

The ServerSignature directive allows the + configuration of a trailing footer line under server-generated + documents (error messages, mod_proxy ftp directory listings, + mod_info output, ...). The reason why you would want to enable + such a footer line is that in a chain of proxies, the user often + has no possibility to tell which of the chained servers actually + produced a returned error message.
The Off + setting, which is the default, suppresses the error line (and is + therefore compatible with the behavior of Apache-1.2 and + below). The On setting simply adds a line with the + server version number and ServerName of the serving virtual host, + and the EMail setting additionally creates a + "mailto:" reference to the ServerAdmin of the referenced + document.

+
+
+ + +ServerTokens +Configures the Server HTTP response header +ServerTokens Minimal|ProductOnly|OS|Full +ServerTokens Full +server config + + +

This directive controls whether Server response + header field which is sent back to clients includes a + description of the generic OS-type of the server as well as + information about compiled-in modules.

+ +
+
ServerTokens Prod[uctOnly]
+ +
Server sends (e.g.): Server: + Apache
+ +
ServerTokens Min[imal]
+ +
Server sends (e.g.): Server: + Apache/1.3.0
+ +
ServerTokens OS
+ +
Server sends (e.g.): Server: Apache/1.3.0 + (Unix)
+ +
ServerTokens Full (or not specified)
+ +
Server sends (e.g.): Server: Apache/1.3.0 + (Unix) PHP/3.0 MyMod/1.2
+
+ +

This setting applies to the entire server, and cannot be + enabled or disabled on a virtualhost-by-virtualhost basis.

+
+
+ + +SetHandler +Forces all matching files to be processed by a +handler +SetHandler handler-name +server configvirtual host +directory.htaccess + +Moved into the core in Apache 2.0 + + +

When placed into an .htaccess file or a + Directory or + Location + section, this directive forces all matching files to be parsed + through the handler given by + handler-name. For example, if you had a directory you + wanted to be parsed entirely as imagemap rule files, regardless + of extension, you might put the following into an + .htaccess file in that directory:

+ + SetHandler imap-file + + +

Another example: if you wanted to have the server display a + status report whenever a URL of + http://servername/status was called, you might put + the following into httpd.conf:

+ + <Location /status>
+ SetHandler server-status
+ </Location> +
+
+
+ + +SetInputFilter +Sets the filters that will process client requests and POST +input +SetInputFilter filter[;filter...] +server configvirtual host +directory.htaccess + + + +

The SetInputFilter directive sets the + filter or filters which will process client requests and POST + input when they are received by the server. This is in addition to + any filters defined elsewhere, including the + AddInputFilter + directive.

+ +

If more than one filter is specified, they must be separated + by semicolons in the order in which they should process the + content.

+
+Filters documentation +
+ + +SetOutputFilter +Sets the filters that will process responses from the +server +SetOutputFilter filter [filter] ... +server configvirtual host +directory.htaccess + + + +

The SetOutputFilter directive sets the filters + which will process responses from the server before they are + sent to the client. This is in addition to any filters defined + elsewhere, including the + AddOutputFilter + directive.

+ +

For example, the following configuration will process all files + in the /www/data/ directory for server-side + includes.

+ +<Directory /www/data/>
+  SetOutputFilter INCLUDES
+</Directory> +
+ +

If more than one filter is specified, they must be separated + by semicolons in the order in which they should process the + content.

+
+Filters documentation +
+ + +TimeOut +Defines the amount of time the server will wait for +certain events before failing a request +TimeOut number +TimeOut 300 +server config + + +

The TimeOut directive currently defines + the amount of time Apache will wait for three things:

+ +
    +
  1. The total amount of time it takes to receive a GET + request.
  2. + +
  3. The amount of time between receipt of TCP packets on a + POST or PUT request.
  4. + +
  5. The amount of time between ACKs on transmissions of TCP + packets in responses.
  6. +
+ +

We plan on making these separately configurable at some point + down the road. The timer used to default to 1200 before 1.2, + but has been lowered to 300 which is still far more than + necessary in most situations. It is not set any lower by + default because there may still be odd places in the code where + the timer is not reset when a packet is sent.

+
+
+ + +UseCanonicalName +Configures how the server determines its own name and +port +UseCanonicalName on|off|dns +UseCanonicalName on +server configvirtual host +directory.htaccess +Options + + +

In many situations Apache has to construct a + self-referential URL. That is, a URL which refers back to + the same server. With UseCanonicalName on Apache will + use the hostname and port specified in the ServerName directive to construct a canonical + name for the server. This name is used in all self-referential + URLs, and for the values of SERVER_NAME and + SERVER_PORT in CGIs.

+ +

With UseCanonicalName off Apache will form + self-referential URLs using the hostname and port supplied by + the client if any are supplied (otherwise it will use the + canonical name). These values are the same that are used to + implement name based + virtual hosts, and are available with the same clients. The + CGI variables SERVER_NAME and + SERVER_PORT will be constructed from the client + supplied values as well.

+ +

An example where this may be useful is on an intranet server + where you have users connecting to the machine using short + names such as www. You'll notice that if the users + type a shortname, and a URL which is a directory, such as + http://www/splat, without the trailing + slash then Apache will redirect them to + http://www.domain.com/splat/. If you have + authentication enabled, this will cause the user to have to + reauthenticate twice (once for www and once again + for www.domain.com). But if + UseCanonicalName is set off, then Apache will + redirect to http://www/splat/.

+ +

There is a third option, UseCanonicalName DNS, + which is intended for use with mass IP-based virtual hosting to + support ancient clients that do not provide a + Host: header. With this option Apache does a + reverse DNS lookup on the server IP address that the client + connected to in order to work out self-referential URLs.

+ +

Warning: if CGIs make assumptions about the + values of SERVER_NAME they may be broken by this + option. The client is essentially free to give whatever value + they want as a hostname. But if the CGI is only using + SERVER_NAME to construct self-referential URLs + then it should be just fine.

+
+ServerName +Listen +
+ + +VirtualHost +Contains directives that apply only to a specific +hostname or IP address +<VirtualHost + addr[:port] [addr[:port]] + ...> ... </VirtualHost> +server config + + +

VirtualHost and + </VirtualHost> are used to enclose a group of + directives which will apply only to a particular virtual host. Any + directive which is allowed in a virtual host context may be + used. When the server receives a request for a document on a + particular virtual host, it uses the configuration directives + enclosed in the VirtualHost + section. Addr can be

+ +
    +
  • The IP address of the virtual host
  • + +
  • A fully qualified domain name for the IP address of the + virtual host.
  • +
+ Example: + +<VirtualHost 10.1.2.3>
+ ServerAdmin webmaster@host.foo.com
+ DocumentRoot /www/docs/host.foo.com
+ ServerName host.foo.com
+ ErrorLog logs/host.foo.com-error_log
+ TransferLog logs/host.foo.com-access_log
+ </VirtualHost> +
+ + +

IPv6 addresses must be specified in square brackets because + the optional port number could not be determined otherwise. An + IPv6 example is shown below:

+ + +<VirtualHost [fe80::a00:20ff:fea7:ccea]>
+ ServerAdmin webmaster@host.foo.com
+ DocumentRoot /www/docs/host.foo.com
+ ServerName host.foo.com
+ ErrorLog logs/host.foo.com-error_log
+ TransferLog logs/host.foo.com-access_log
+ </VirtualHost> +
+ +

Each Virtual Host must correspond to a different IP address, + different port number or a different host name for the server, + in the former case the server machine must be configured to + accept IP packets for multiple addresses. (If the machine does + not have multiple network interfaces, then this can be + accomplished with the ifconfig alias command (if + your OS supports it), or with kernel patches like VIF (for SunOS(TM) 4.1.x)).

+ +

The special name _default_ can be specified in + which case this virtual host will match any IP address that is + not explicitly listed in another virtual host. In the absence + of any _default_ virtual host the "main" server config, + consisting of all those definitions outside any VirtualHost + section, is used when no match occurs.

+ +

You can specify a :port to change the port that is + matched. If unspecified then it defaults to the same port as the + most recent Listen + statement of the main server. You may also specify :* + to match all ports on that address. (This is recommended when used + with _default_.)

+ +

SECURITY: See the security tips document + for details on why your security could be compromised if the + directory where logfiles are stored is writable by anyone other + than the user that starts the server.

+ +

NOTE: The use of VirtualHost does not + affect what addresses Apache listens on. You may need to ensure + that Apache is listening on the correct addresses using Listen.

+
+Apache Virtual Host documentation +Warnings about DNS and + Apache +Setting + which addresses and ports Apache uses +How + Directory, Location and Files sections work for an + explanation of how these different sections are combined when a + request is received +
+ +
\ No newline at end of file diff --git a/docs/manual/mod/directives.xml b/docs/manual/mod/directives.xml new file mode 100644 index 00000000000..6ef8220c07a --- /dev/null +++ b/docs/manual/mod/directives.xml @@ -0,0 +1,17 @@ + + +]> + + + +Directive Index + +

Each Apache directive available in the standard Apache + distribution is listed here. They are described using a + consistent format, and there is a dictionary of the terms used in their + descriptions available.

+
+&allmodules; +
\ No newline at end of file diff --git a/docs/manual/mod/index.xml b/docs/manual/mod/index.xml new file mode 100644 index 00000000000..a509c2eb0d3 --- /dev/null +++ b/docs/manual/mod/index.xml @@ -0,0 +1,18 @@ + + +]> + + + +Module Index + + +

Below is a list of all of the modules that come as part of + the Apache distribution. See also the complete + alphabetical list of all Apache + directives.

+ +
+&allmodules; +
\ No newline at end of file diff --git a/docs/manual/mod/mod_actions.xml b/docs/manual/mod/mod_actions.xml new file mode 100644 index 00000000000..e702dbe1349 --- /dev/null +++ b/docs/manual/mod/mod_actions.xml @@ -0,0 +1,115 @@ + + ]> + + + +mod_actions + +This module provides for executing CGI scripts based on +media type or request method. + +Base +mod_actions.c +actions_module + + +

This module has two directives. The Action directive lets you run CGI + scripts whenever a file of a certain type is requested. The + Script directive lets + you run CGI scripts whenever a particular method is used in a + request. This makes it much easier to execute scripts that process + files.

+
+ + + +Action + +Activates a CGI script for a particular handler or +content-type + +Action action-type cgi-script + +server configvirtual host +directory.htaccess + +FileInfo + + +

This directive adds an action, which will activate + cgi-script when action-type is triggered by + the request. The action-type can be either a handler or a MIME content type. It + sends the URL and file path of the requested document using the + standard CGI PATH_INFO and PATH_TRANSLATED environment + variables.

+ + +Examples + + # Requests for files of a particular type:
+ Action image/gif /cgi-bin/images.cgi
+
+ # Files of a particular file extension
+ AddHandler my-file-type .xyz
+ Action my-file-type /cgi-bin/program.cgi
+
+ +

In the first example, requests for files with a MIME content + type of image/gif will instead be handled by the + specified cgi script /cgi-bin/images.cgi.

+ +

In the second example, requests for files with a file extension of + .xyz are handled instead by the specified cgi script + /cgi-bin/program.cgi.

+
+ +AddHandler + +
+ + + +Script + +Activates a CGI script for a particular request +method. + Script method cgi-script + +server configvirtual host +directory + +

This directive adds an action, which will activate + cgi-script when a file is requested using the method of + method. It sends the URL and file path of the requested + document using the standard CGI PATH_INFO and PATH_TRANSLATED + environment variables.

+ + + Any arbitrary method name may be used. Method names are + case-sensitive, so Script PUT and + Script put have two entirely different + effects. + + +

Note that the Script command defines default actions only. + If a CGI script is called, or some other resource that is + capable of handling the requested method internally, it will do + so. Also note that Script with a method of GET + will only be called if there are query arguments present + (e.g., foo.html?hi). Otherwise, the request will + proceed normally.

+ + +Examples + # For <ISINDEX>-style searching
+ Script GET /cgi-bin/search
+ # A CGI PUT handler
+ Script PUT /~bob/put.cgi
+
+
+ +
+ +
\ No newline at end of file diff --git a/docs/manual/mod/mod_alias.xml b/docs/manual/mod/mod_alias.xml new file mode 100644 index 00000000000..84db11dc1c4 --- /dev/null +++ b/docs/manual/mod/mod_alias.xml @@ -0,0 +1,279 @@ + + + + +mod_alias +Provides for mapping different parts of the host + filesystem in the document tree and for URL redirection +Base +mod_alias.c +alias_module + + +

The directives contained in this module allow for manipulation + and control of URLs as requests arrive at the server. The + Alias and ScriptAlias directives are used to + map between URLs and filesystem paths. This allows for content + which is not directly under the DocumentRoot served as part of the web + document tree. The ScriptAlias directive has the + additional effect of marking the target directory as containing + only CGI scripts.

+ +

The Redirect + directives are used to instruct clients to make a new request with + a different URL. They are often used when a resource has moved to + a new location.

+ +

A more powerful and flexible set of directives for + manipulating URLs is contained in the mod_rewrite + module.

+
+ + +Alias +Maps URLs to filesystem locations + Alias URL-path + file-path|directory-path +server configvirtual host + + + + +

The Alias directive allows documents to + be stored in the local filesystem other than under the + DocumentRoot. URLs with a + (%-decoded) path beginning with url-path will be mapped + to local files beginning with directory-filename.

+ +

Example:

+ +Alias /image /ftp/pub/image + +

A request for http://myserver/image/foo.gif would cause the + server to return the file /ftp/pub/image/foo.gif.

+ +

Note that if you include a trailing / on the + url-path then the server will require a trailing / in + order to expand the alias. That is, if you use Alias + /icons/ /usr/local/apache/icons/ then the url + /icons will not be aliased.

+ +

Note that you may need to specify additional <Directory> sections which cover + the destination of aliases. Aliasing occurs before + <Directory> sections + are checked, so only the destination of aliases are affected. + (Note however <Location> + sections are run through once before aliases are performed, so + they will apply.)

+ +
+
+ + +AliasMatch +Maps URLs to filesystem locations using regular +expressions +AliasMatch regex + file-path|directory-path +server configvirtual host + + + +

This directive is equivalent to Alias, but makes use of standard + regular expressions, instead of simple prefix matching. The + supplied regular expression is matched against the URL-path, and + if it matches, the server will substitute any parenthesized + matches into the given string and use it as a filename. For + example, to activate the /icons directory, one might + use:

+ + AliasMatch ^/icons(.*) /usr/local/apache/icons$1 + +
+
+ + +Redirect +Sends an external redirect asking the client to fetch +a different URL +Redirect [status] URL-path URL +server configvirtual host +directory.htaccess +FileInfo + + +

The Redirect directive maps an old URL into a new one. The + new URL is returned to the client which attempts to fetch it + again with the new address. URL-path a (%-decoded) + path; any requests for documents beginning with this path will + be returned a redirect error to a new (%-encoded) URL beginning + with URL.

+ +

Example:

+ +Redirect /service http://foo2.bar.com/service + +

If the client requests http://myserver/service/foo.txt, it + will be told to access http://foo2.bar.com/service/foo.txt + instead.

+ +Note

Redirect directives take precedence over +Alias and ScriptAlias directives, irrespective of their ordering in +the configuration file. Also, URL-path must be an absolute +path, not a relative path, even when used with .htaccess files or +inside of <Directory> +sections.

+ +

If no status argument is given, the redirect will + be "temporary" (HTTP status 302). This indicates to the client + that the resource has moved temporarily. The status + argument can be used to return other HTTP status codes:

+ +
+
permanent
+ +
Returns a permanent redirect status (301) indicating that + the resource has moved permanently.
+ +
temp
+ +
Returns a temporary redirect status (302). This is the + default.
+ +
seeother
+ +
Returns a "See Other" status (303) indicating that the + resource has been replaced.
+ +
gone
+ +
Returns a "Gone" status (410) indicating that the + resource has been permanently removed. When this status is + used the url argument should be omitted.
+
+ +

Other status codes can be returned by giving the numeric + status code as the value of status. If the status is + between 300 and 399, the url argument must be present, + otherwise it must be omitted. Note that the status must be + known to the Apache code (see the function + send_error_response in http_protocol.c).

+
+
+ + +RedirectMatch +Sends an external redirect asking the client to fetch +a different URL based on a regular expression match of the +current URL +RedirectMatch [status] regex URL +server configvirtual host +directory.htaccess +FileInfo + + +

This directive is equivalent to Redirect, but makes use of standard + regular expressions, instead of simple prefix matching. The + supplied regular expression is matched against the URL-path, and + if it matches, the server will substitute any parenthesized + matches into the given string and use it as a filename. For + example, to redirect all GIF files to like-named JPEG files on + another server, one might use:

+ + RedirectMatch (.*)\.gif$ http://www.anotherserver.com$1.jpg + +
+
+ + +RedirectTemp +Sends an external temporary redirect asking the client to fetch +a different URL +RedirectTemp URL-path URL +server configvirtual host +directory.htaccess +FileInfo + + +

This directive makes the client know that the Redirect is + only temporary (status 302). Exactly equivalent to + Redirect temp.

+
+
+ + +RedirectPermanent +Sends an external permanent redirect asking the client to fetch +a different URL +RedirectPermanent URL-path URL +server configvirtual host +directory.htaccess +FileInfo + + +

This directive makes the client know that the Redirect is + permanent (status 301). Exactly equivalent to Redirect + permanent.

+
+
+ + +ScriptAlias +Maps a URL to a filesystem location and designates the +target as a CGI script +ScriptAlias +URL-path file-path|directory-path +server configvirtual host + + + +

The ScriptAlias directive has the same + behavior as the Alias + directive, except that in addition it marks the target directory + as containing CGI scripts that will be processed by mod_cgi's cgi-script handler. URLs with a + (%-decoded) path beginning with URL-path will be mapped + to scripts beginning with the second argument which is a full + pathname in the local filesystem.

+ +

Example:

+ +ScriptAlias /cgi-bin/ /web/cgi-bin/ + +

A request for http://myserver/cgi-bin/foo would cause the + server to run the script /web/cgi-bin/foo.

+
+
+ + +ScriptAliasMatch +Maps a URL to a filesystem location using a regular expression +and designates the target as a CGI script +ScriptAliasMatch +regex file-path|directory-path +server configvirtual host + + + +

This directive is equivalent to ScriptAlias, but makes use of standard + regular expressions, instead of simple prefix matching. The + supplied regular expression is matched against the URL-path, + and if it matches, the server will substitute any parenthesized + matches into the given string and use it as a filename. For + example, to activate the standard /cgi-bin, one + might use:

+ + ScriptAliasMatch ^/cgi-bin(.*) /usr/local/apache/cgi-bin$1 + +
+
+ +
+ diff --git a/docs/manual/mod/mod_asis.xml b/docs/manual/mod/mod_asis.xml new file mode 100644 index 00000000000..171e2b66814 --- /dev/null +++ b/docs/manual/mod/mod_asis.xml @@ -0,0 +1,69 @@ + + + + +mod_asis +Sends files that contain their own +HTTP headers +Base +mod_asis.c +asis_module + + +

This module provides the handler send-as-is + which causes Apache to send the document without adding most of + the usual HTTP headers.

+ +

This can be used to send any kind of data from the server, + including redirects and other special HTTP responses, without + requiring a cgi-script or an nph script.

+ +

For historical reasons, this module will also process any + file with the mime type httpd/send-as-is.

+
+ +
Usage + +

In the server configuration file, associate files with the + send-as-is handler e.g.

+ +AddHandler send-as-is asis + +

The contents of any file with a .asis extension + will then be sent by Apache to the client with almost no + changes. Clients will need HTTP headers to be attached, so do + not forget them. A Status: header is also required; the data + should be the 3-digit HTTP response code, followed by a textual + message.

+ +

Here's an example of a file whose contents are sent as + is so as to tell the client that a file has + redirected.

+ + +Status: 301 Now where did I leave that URL
+ Location: http://xyz.abc.com/foo/bar.html
+ Content-type: text/html
+
+ <HTML>
+ <HEAD>
+ <TITLE>Lame excuses'R'us</TITLE>
+ </HEAD>
+ <BODY>
+ <H1>Fred's exceptionally wonderful page has moved + to
+ <A + HREF="http://xyz.abc.com/foo/bar.html">Joe's</A> + site.
+ </H1>
+ </BODY>
+ </HTML> +
+ +

Notes: the server always adds a Date: and Server: header to + the data returned to the client, so these should not be + included in the file. The server does not add a + Last-Modified header; it probably should.

+
+ +
diff --git a/docs/manual/mod/mod_auth_digest.xml b/docs/manual/mod/mod_auth_digest.xml new file mode 100644 index 00000000000..3d3c5442781 --- /dev/null +++ b/docs/manual/mod/mod_auth_digest.xml @@ -0,0 +1,270 @@ + + + +mod_auth_digest +User authentication using MD5 + Digest Authentication. +Experimental +mod_auth_digest.c +auth_digest_module + + +

This module implements HTTP Digest Authentication. However, it + has not been extensively tested and is therefore marked + experimental.

+
+ +AuthName +AuthType +Require +Satisfy + +
Using Digest Authentication + +

Using MD5 Digest authentication is very simple. Simply set + up authentication normally, using "AuthType Digest" and + "AuthDigestFile" instead of the normal "AuthType Basic" and + "AuthUserFile"; also, replace any "AuthGroupFile" with + "AuthDigestGroupFile". Then add a "AuthDigestDomain" directive + containing at least the root URI(s) for this protection space. + Example:

+ + <Location /private/>
+ AuthType Digest
+ AuthName "private area"
+ AuthDigestDomain /private/ http://mirror.my.dom/private2/
+ AuthDigestFile /web/auth/.digest_pw
+ Require valid-user
+ </Location> +
+ +Note +

MD5 authentication provides a more + secure password system than Basic authentication, but only + works with supporting browsers. As of this writing (October 2001), + the only major browsers which support digest authentication are + Opera 4.0, + MS Internet + Explorer 5.0 and Amaya. + Therefore, we do not yet recommend using this feature on a large + Internet site. However, for personal and intra-net use, where + browser users can be controlled, it is ideal.

+
+
+ + +AuthDigestFile +Location of the text file containing the list +of users and encoded passwords for digest authentication +AuthDigestFile file-path +directory.htaccess + +AuthConfig + + +

The AuthDigestFile directive sets the + name of a textual file containing the list of users and encoded + passwords for digest authentication. File-path is the + absolute path to the user file.

+ +

The digest file uses a special format. Files in this format + can be created using the htdigest utility found in + the support/ subdirectory of the Apache distribution.

+
+
+ + +AuthDigestGroupFile +Name of the text file containing the list of groups +for digest authentication +AuthDigestGroupFile file-path +directory.htaccess + +AuthConfig + + +

The AuthDigestGroupFile directive sets + the name of a textual file containing the list of groups and their + members (user names). File-path is the absolute path to + the group file.

+ +

Each line of the group file contains a groupname followed by + a colon, followed by the member usernames separated by spaces. + Example:

+ +mygroup: bob joe anne + +

Note that searching large text files is very + inefficient.

+ +

Security: make sure that the AuthGroupFile is stored outside + the document tree of the web-server; do not put it in + the directory that it protects. Otherwise, clients will be able + to download the AuthGroupFile.

+
+
+ + +AuthDigestQop +Determines the quality-of-protection to use in digest +authentication +AuthDigestQop none|auth|auth-int [auth|auth-int] +AuthDigestQop auth +directory.htaccess + +AuthConfig + + +

The AuthDigestQop directive determines + the quality-of-protection to use. auth will only do + authentication (username/password); auth-int is + authentication plus integrity checking (an MD5 hash of the entity + is also computed and checked); none will cause the module + to use the old RFC-2069 digest algorithm (which does not include + integrity checking). Both auth and auth-int may + be specified, in which the case the browser will choose which of + these to use. none should only be used if the browser for + some reason does not like the challenge it receives otherwise.

+ +

auth-int is not implemented + yet.

+
+
+ + +AuthDigestNonceLifetime +How long the server nonce is valid +AuthDigestNonceLifetime seconds +AuthDigestNonceLifetime 300 +directory.htaccess + +AuthConfig + + +

The AuthDigestNonceLifetime directive + controls how long the server nonce is valid. When the client + contacts the server using an expired nonce the server will send + back a 401 with stale=true. If seconds is + greater than 0 then it specifies the amount of time for which the + nonce is valid; this should probably never be set to less than 10 + seconds. If seconds is less than 0 then the nonce never + expires. +

+
+
+ + +AuthDigestNonceFormat +Determines how the nonce is generated +??? +??? +directory.htaccess + +AuthConfig + + +

Not implemented yet. +

+
+
+ + +AuthDigestNcCheck +Enables or disables checking of the nonce-count sent by the +server +AuthDigestNcCheck On|Off +AuthDigestNcCheck Off +server config + + +

Not implemented yet. +

+
+
+ + +AuthDigestAlgorithm +Selects the algorithm used to calculate the challenge and +response hases in digest authentication +AuthDigestAlgorithm MD5|MD5-sess +AuthDigestAlgorithm MD5 +directory.htaccess + +AuthConfig + + +

The AuthDigestAlgorithm directive + selects the algorithm used to calculate the challenge and response + hashes.

+ +

MD5-sess is not correctly implemented + yet. +

+
+
+ + +AuthDigestDomain +URIs that are in the same protection space for digest +authentication +AuthDigestDomain URI [URI] ... +directory.htaccess + +AuthConfig + + +

The AuthDigestDomain directive allows + you to specify one or more URIs which are in the same protection + space (i.e. use the same realm and username/password info). The + specified URIs are prefixes, i.e. the client will assume that all + URIs "below" these are also protected by the same + username/password. The URIs may be either absolute URIs + (i.e. inluding a scheme, host, port, etc) or relative URIs.

+ +

This directive should always be specified and + contain at least the (set of) root URI(s) for this space. + Omitting to do so will cause the client to send the + Authorization header for every request sent to this + server. Apart from increasing the size of the request, it may + also have a detrimental effect on performance if + "AuthDigestNcCheck" is on.

+ +

The URIs specified can also point to different servers, in + which case clients (which understand this) will then share + username/password info across multiple servers without + prompting the user each time.

+
+
+ +
+ diff --git a/docs/manual/mod/mod_autoindex.xml b/docs/manual/mod/mod_autoindex.xml new file mode 100644 index 00000000000..73aeb7dcc6e --- /dev/null +++ b/docs/manual/mod/mod_autoindex.xml @@ -0,0 +1,842 @@ + + ]> + + +mod_autoindex + +Generates directory indexes, + automatically, similar to the Unix ls command or the + Win32 dir shell command +Base +mod_autoindex.c +autoindex_module + + +

The index of a directory can come from one of two + sources:

+ + +

The two functions are separated so that you can completely + remove (or replace) automatic index generation should you want + to.

+ +

Automatic index generation is enabled with using + Options +Indexes. See the + Options directive for + more details.

+ +

If the FancyIndexing + option is given with the IndexOptions directive, + the column headers are links that control the order of the + display. If you select a header link, the listing will be + regenerated, sorted by the values in that column. Selecting the + same header repeatedly toggles between ascending and descending + order. These column header links are suppressed with + IndexOptions directive's + SuppressColumnSorting option.

+ +

Note that when the display is sorted by "Size", it's the + actual size of the files that's used, not the + displayed value - so a 1010-byte file will always be displayed + before a 1011-byte file (if in ascending order) even though + they both are shown as "1K".

+
+ +
Autoindex Request Query Arguments + +

Apache 2.0.23 reorganized the Query Arguments for Column + Sorting, and introduced an entire group of new query options. + To effectively eliminate all client control over the output, + the IndexOptions + IgnoreClient option was introduced.

+ +

The column sorting headers themselves are self-referencing + hyperlinks that add the sort query options shown below. Any + option below may be added to any request for the directory + resource.

+ + + +

Note that the 'P'attern query argument is tested + after the usual IndexIgnore directives are processed, + and all file names are still subjected to the same criteria as + any other autoindex listing. The Query Arguments parser in + mod_autoindex will stop abruptly when an unrecognized option is + encountered. The Query Arguments must be well formed, according + to the table above.

+ +

The simple example below, which can be clipped and saved in + a header.html file, illustrates these query options. Note that + the unknown "X" argument, for the submit button, is listed last + to assure the arguments are all parsed before mod_autoindex + encounters the X=Go input.

+ + +<FORM METHOD="GET">
+  Show me a <SELECT NAME="F">
+    <OPTION VALUE="0"> Plain list
+    <OPTION VALUE="1" SELECTED> Fancy list
+    <OPTION VALUE="2"> Table list
+  </SELECT>
+  Sorted by <SELECT NAME="C">
+    <OPTION VALUE="N" SELECTED> Name
+    <OPTION VALUE="M"> Date Modified
+    <OPTION VALUE="S"> Size
+    <OPTION VALUE="D"> Description
+  </SELECT>
+  <SELECT NAME="O">
+    <OPTION VALUE="A" SELECTED> Ascending
+    <OPTION VALUE="D"> Descending
+  </SELECT>
+  <SELECT NAME="V">
+    <OPTION VALUE="0" SELECTED> in Normal order
+    <OPTION VALUE="1"> in Version order
+  </SELECT>
+  Matching <INPUT TYPE="text" NAME="P" VALUE="*">
+  <INPUT TYPE="submit" NAME="X" VALUE="Go">
+</FORM> +
+ +
+ + +AddAlt +Alternate text to display for a file, instead of an +icon selected by filename +AddAlt string file [file] ... +server configvirtual host +directory.htaccess + +Indexes + + +

AddAlt provides the alternate text to + display for a file, instead of an icon, for FancyIndexing. + File is a file extension, partial filename, wild-card + expression or full filename for files to describe. + String is enclosed in double quotes ("). + This alternate text is displayed if the client is image-incapable, + has image loading disabled, or fails to retrieve the icon.

+ +

Examples:

+ + AddAlt "PDF" *.pdf
+ AddAlt "Compressed" *.gz *.zip *.Z +
+
+
+ + +AddAltByEncoding +Alternate text to display for a file instead of an icon +selected by MIME-encoding +AddAltByEncoding string MIME-encoding +[MIME-encoding] ... +server configvirtual host +directory.htaccess + +Indexes + + +

AddAltByEncoding provides the alternate + text to display for a file, instead of an icon, for FancyIndexing. + MIME-encoding is a valid content-encoding, such as + x-compress. String is enclosed in double + quotes ("). This alternate text is displayed if the + client is image-incapable, has image loading disabled, or fails to + retrieve the icon.

+ +

Example:

+ + AddAltByEncoding "gzip" x-gzip + +
+
+ + +AddAltByType +Alternate text to display for a file, instead of an +icon selected by MIME content-type +AddAltByType string + MIME-type [MIME-type] ... +server configvirtual host +directory.htaccess + +Indexes + + +

AddAltByType sets the alternate text to + display for a file, instead of an icon, for FancyIndexing. + MIME-type is a valid content-type, such as + text/html. String is enclosed in double + quotes ("). This alternate text is displayed if the + client is image-incapable, has image loading disabled, or fails to + retrieve the icon.

+ +

Example:

+ + AddAltByType "TXT" text/plain + +
+
+ + +AddDescription +AddDescription + string file [file] ... +server configvirtual host +directory.htaccess + +Indexes + + +

This sets the description to display for a file, for + FancyIndexing. + File is a file extension, partial filename, wild-card + expression or full filename for files to describe. + String is enclosed in double quotes ("). + Example:

+ +AddDescription "The planet Mars" + /web/pics/mars.gif + +

The typical, default description field is 23 bytes wide. 6 + more bytes are added by the + IndexOptions SuppressIcon option, 7 bytes are + added by the IndexOptions SuppressSize + option, and 19 bytes are added by the + IndexOptions SuppressLastModified option. + Therefore, the widest default the description column is ever + assigned is 55 bytes.

+ +

See the DescriptionWidth + IndexOptions keyword + for details on overriding the size of this column, or allowing + descriptions of unlimited length.

+ +Caution

Descriptive text defined with + AddDescription may contain HTML markup, such as + tags and character entities. If the width of the description + column should happen to truncate a tagged element (such as + cutting off the end of a bolded phrase), the results may + affect the rest of the directory listing.

+
+
+
+ + +AddIcon +Icon to display for a file selected by name +AddIcon icon + name [name] ... +server configvirtual host +directory.htaccess + +Indexes + + +

This sets the icon to display next to a file ending in + name for FancyIndexing. + Icon is either a (%-escaped) relative URL to the icon, + or of the format (alttext,url) where + alttext is the text tag given for an icon for + non-graphical browsers.

+ +

Name is either ^^DIRECTORY^^ for directories, + ^^BLANKICON^^ for blank lines (to format the list correctly), a + file extension, a wildcard expression, a partial filename or a + complete filename. Examples:

+ + + AddIcon (IMG,/icons/image.xbm) .gif .jpg .xbm
+ AddIcon /icons/dir.xbm ^^DIRECTORY^^
+ AddIcon /icons/backup.xbm *~ +
+ +

AddIconByType + should be used in preference to AddIcon, + when possible.

+
+
+ + +AddIconByEncoding +Icon to display next to files selected by MIME +content-encoding +AddIconByEncoding + icon MIME-encoding [MIME-encoding] ... +server configvirtual host +directory.htaccess + +Indexes + + +

This sets the icon to display next to files with FancyIndexing. + Icon is either a (%-escaped) relative URL to the icon, + or of the format (alttext,url) where + alttext is the text tag given for an icon for + non-graphical browsers.

+ +

Mime-encoding is a wildcard expression matching + required the content-encoding. Examples:

+ +AddIconByEncoding /icons/compress.xbm x-compress +
+
+ + +AddIconByType +Icon to display next to files selected by MIME +content-type +AddIconByType + icon MIME-type [MIME-type] ... +server configvirtual host +directory.htaccess + +Indexes + + +

This sets the icon to display next to files of type + MIME-type for FancyIndexing. + Icon is either a (%-escaped) relative URL to the icon, + or of the format (alttext,url) where + alttext is the text tag given for an icon for + non-graphical browsers.

+ +

Mime-type is a wildcard expression matching + required the mime types. Examples:

+ +AddIconByType (IMG,/icons/image.xbm) image/* +
+
+ + +DefaultIcon +Icon to display for files when no specific icon is +configured +DefaultIcon url-path +server configvirtual host +directory.htaccess + +Indexes + + +

The DefaultIcon directive sets the icon + to display for files when no specific icon is known, for FancyIndexing. + Url is a (%-escaped) relative URL to the icon. + Examples:

+DefaultIcon /icon/unknown.xbm +
+
+ + +HeaderName +Name of the file that will be inserted at the top +of the index listing +HeaderName filename +server configvirtual host +directory.htaccess + +Indexes + + +

The HeaderName directive sets the name + of the file that will be inserted at the top of the index + listing. Filename is the name of the file to include.

+ + +

Both HeaderName and ReadmeName now treat + Filename as a URI path relative to the one used to + access the directory being indexed. Filename must + resolve to a document with a major content type of + "text/*" (e.g., text/html, + text/plain, etc.). This means that + filename may refer to a CGI script if the script's + actual file type (as opposed to its output) is marked as + text/html such as with a directive like:

+ + AddType text/html .cgi + +

Content negotiation + will be performed if the MultiViews Option is enabled. If + filename resolves to a static text/html + document (not a CGI script) and the Includes + option is enabled, the file + will be processed for server-side includes (see the + mod_include documentation).

+
+ +

If the file specified by HeaderName contains + the beginnings of an HTML document (<HTML>, <HEAD>, + etc) then you will probably want to set IndexOptions + +SuppressHTMLPreamble, so that these tags are not + repeated.

+
+
+ + +IndexIgnore +Adds to the list of files to hide when listing +a directory +IndexIgnore file [file] ... +server configvirtual host +directory.htaccess + +Indexes + + +

The IndexIgnore directive adds to the + list of files to hide when listing a directory. File is a + file extension, partial filename, wildcard expression or full + filename for files to ignore. Multiple IndexIgnore directives add + to the list, rather than the replacing the list of ignored + files. By default, the list contains + `.'. Example:

+ +IndexIgnore README .htaccess *~ +
+
+ + +IndexOptions +Various configuration settings for directory +indexing +IndexOptions [+|-]option [[+|-]option] ... +server configvirtual host +directory.htaccess + +Indexes + + +

The IndexOptions directive specifies the + behavior of the directory indexing. Option can be one + of

+ +
+
DescriptionWidth=[n + | *] (Apache 1.3.10 or 2.0.23 and later)
+ +
The DescriptionWidth keyword allows you to + specify the width of the description column in + characters.
+ +
-DescriptionWidth (or unset) allows + mod_autoindex to calculate the best width.
+ +
DescriptionWidth=n fixes the column width to + n bytes wide.
+ +
DescriptionWidth=* grows the column to the + width necessary to accommodate the longest description + string.
+ +
See the section on AddDescription for dangers + inherent in truncating descriptions.
+ +
FancyIndexing
+ +
+ This turns on fancy indexing of directories.
+ +
FoldersFirst (Apache + 1.3.10 or 2.0.23 and later)
+ +
If this option is enabled, subdirectory listings will + always appear first, followed by normal files in the + directory. The listing is basically broken into two + components, the files and the subdirectories, and each is + sorted separately and then displayed subdirectories-first. + For instance, if the sort order is descending by name, and + FoldersFirst is enabled, subdirectory + Zed will be listed before subdirectory + Beta, which will be listed before normal files + Gamma and Alpha. This option + only has an effect if FancyIndexing + is also enabled.
+ +
HTMLTable (Experimental, + Apache 2.0.23 and later)
+ +
+ This experimental option with FancyIndexing constructs a + simple table for the fancy directory listing. Note this will + confuse older browsers. It is particularly necessary if file + names or description text will alternate between + left-to-right and right-to-left reading order, as can happen + on WinNT or other utf-8 enabled platforms.
+ +
IconsAreLinks
+ +
+ This makes the icons part of the anchor for the filename, for + fancy indexing.
+ +
IconHeight[=pixels] + (Apache 1.3 and later)
+ +
+ Presence of this option, when used with IconWidth, will cause + the server to include HEIGHT and + WIDTH attributes in the IMG tag for + the file icon. This allows browser to precalculate the page + layout without having to wait until all the images have been + loaded. If no value is given for the option, it defaults to + the standard height of the icons supplied with the Apache + software.
+ +
IconWidth[=pixels] (Apache + 1.3 and later)
+ +
+ Presence of this option, when used with IconHeight, will + cause the server to include HEIGHT and + WIDTH attributes in the IMG tag for + the file icon. This allows browser to precalculate the page + layout without having to wait until all the images have been + loaded. If no value is given for the option, it defaults to + the standard width of the icons supplied with the Apache + software.
+ +
IgnoreClient
+ +
+ This option causes mod_autoindex to ignore all query + variables from the client, including sort order (implies + SuppressColumnSorting.)
+ +
NameWidth=[n | *] + (Apache 1.3.2 and later)
+ +
The NameWidth keyword allows you to specify the width of + the filename column in bytes.
+ +
-NameWidth (or unset) allows mod_autoindex + to calculate the best width.
+ +
NameWidth=n fixes the column width to n + bytes wide.
+ +
NameWidth=* grows the column to the + necessary width.
+ +
ScanHTMLTitles
+ +
+ This enables the extraction of the title from HTML documents + for fancy indexing. If the file does not have a description + given by AddDescription then + httpd will read the document for the value of the TITLE tag. + This is CPU and disk intensive.
+ +
SuppressColumnSorting + (Apache 1.3 and later)
+ +
+ If specified, Apache will not make the column headings in a + FancyIndexed directory listing into links for sorting. The + default behavior is for them to be links; selecting the + column heading will sort the directory listing by the values + in that column. Prior to Apache 2.0.23, this also + disabled parsing the Query Arguments for the sort + string. That behavior is now controlled by IndexOptions + IgnoreClient in Apache 2.0.23.
+ +
SuppressDescription
+ +
+ This will suppress the file description in fancy indexing + listings. By default, no file descriptions are defined, and + so the use of this option will regain 23 characters of screen + space to use for something else. See AddDescription for + information about setting the file description. See also the + DescriptionWidth + index option to limit the size of the description + column.
+ +
SuppressHTMLPreamble + (Apache 1.3 and later)
+ +
+ If the directory actually contains a file specified by the + HeaderName + directive, the module usually includes the contents of the file + after a standard HTML preamble (<HTML>, <HEAD>, + et cetera). The SuppressHTMLPreamble option disables + this behaviour, causing the module to start the display with the + header file contents. The header file must contain appropriate + HTML instructions in this case. If there is no header file, the + preamble is generated as usual.
+ +
SuppressIcon (Apache + 2.0.23 and later)
+ +
+ This will suppress the icon in fancy indexing listings. + Combining both SuppressIcon and + SuppressRules yields proper HTML 3.2 output, which + by the final specification prohibits IMG and HR tags from the + PRE block (used to format FancyIndexed listings.)
+ +
SuppressLastModified
+ +
+ This will suppress the display of the last modification date, + in fancy indexing listings.
+ +
SuppressRules + (Apache 2.0.23 and later)
+ +
+ This will suppress the horizontal rule lines (HR tags) in + directory listings. Combining both SuppressIcon and + SuppressRules yeilds proper HTML 3.2 output, which + by the final specification prohibits IMG and HR tags from the + PRE block (used to format FancyIndexed listings.)
+ +
SuppressSize
+ +
+ This will suppress the file size in fancy indexing + listings.
+ +
TrackModified (Apache + 1.3.15 or 2.0.23 and later)
+ +
+ This returns the Last-Modified and ETag values for the listed + directory in the HTTP header. It is only valid if the + operating system and file system return appropriate stat() + results. Some Unix systems do so, as do OS2's JFS and Win32's + NTFS volumes. OS2 and Win32 FAT volumes, for example, do not. + Once this feature is enabled, the client or proxy can track + changes to the list of files when they perform a HEAD + request. Note some operating systems correctly track new and + removed files, but do not track changes for sizes or dates of + the files within the directory. Changes to the size + or date stamp of an existing file will not update the + Last-Modified header on all Unix platforms. If this + is a concern, leave this option disabled.
+ +
VersionSort (Apache 2.0a3 + and later)
+ +
+ The VersionSort keyword causes files containing version + numbers to sort in a natural way. Strings are sorted as + usual, except that substrings of digits in the name and + description are compared according to their numeric value. + For example: + + +foo-1.7
+foo-1.7.2
+foo-1.7.12
+foo-1.8.2
+foo-1.8.2a
+foo-1.12
+
+ If the number starts with a zero, then it is considered to + be a fraction: + + +foo-1.001
+foo-1.002
+foo-1.030
+foo-1.04 +
+
+ +
+

Incremental IndexOptions

+
+ +
+ Apache 1.3.3 introduced some significant changes in the + handling of IndexOptions directives. In + particular,
+
+ + +
    +
  • Multiple IndexOptions directives for a + single directory are now merged together. The result of + the example above will now be the equivalent of + IndexOptions FancyIndexing ScanHTMLTitles.
  • + +
  • The addition of the incremental syntax + (i.e., prefixing keywords with '+' or '-').
  • +
+
+ Whenever a '+' or '-' prefixed keyword is encountered, it + is applied to the current IndexOptions + settings (which may have been inherited from an upper-level + directory). However, whenever an unprefixed keyword is + processed, it clears all inherited options and any + incremental settings encountered so far. Consider the + following example: + +IndexOptions +ScanHTMLTitles -IconsAreLinks + FancyIndexing
+ IndexOptions +SuppressSize
+
+ The net effect is equivalent to + IndexOptions FancyIndexing +SuppressSize, + because the unprefixed FancyIndexing discarded + the incremental keywords before it, but allowed them to + start accumulating again afterward.
+
+ To unconditionally set the IndexOptions for a + particular directory, clearing the inherited settings, + specify keywords without any '+' or '-' prefixes. +
+
+
+
+ + +IndexOrderDefault +Sets the default ordering of the directory index +IndexOrderDefault +Ascending|Descending Name|Date|Size|Description +server configvirtual host +directory.htaccess + +Indexes + + +

The IndexOrderDefault directive is used + in combination with the FancyIndexing + index option. By default, fancyindexed directory listings are + displayed in ascending order by filename; the + IndexOrderDefault allows you to change this initial + display order.

+ +

IndexOrderDefault takes two + arguments. The first must be either Ascending or + Descending, indicating the direction of the sort. + The second argument must be one of the keywords Name, + Date, Size, or Description, + and identifies the primary key. The secondary key is + always the ascending filename.

+ +

You can force a directory listing to only be displayed in a + particular order by combining this directive with the SuppressColumnSorting + index option; this will prevent the client from requesting the + directory listing in a different order.

+
+
+ + +ReadmeName +ReadmeName filename +server configvirtual host +directory.htaccess + +Indexes + + +

The ReadmeName directive sets the name + of the file that will be appended to the end of the index + listing. Filename is the name of the file to include, and + is taken to be relative to the location being indexed.

+ +

See also HeaderName, where this behavior + is described in greater detail.

+
+
+ +
\ No newline at end of file diff --git a/docs/manual/mod/mod_cern_meta.xml b/docs/manual/mod/mod_cern_meta.xml new file mode 100644 index 00000000000..de97c827f40 --- /dev/null +++ b/docs/manual/mod/mod_cern_meta.xml @@ -0,0 +1,76 @@ + + ]> + + + +mod_cern_meta +CERN httpd metafile semantics +Extension +mod_cern_meta.c +cern_meta_module + + + +

Emulate the CERN HTTPD Meta file semantics. Meta files are HTTP + headers that can be output in addition to the normal range of + headers for each file accessed. They appear rather like the + Apache .asis files, and are able to provide a crude way of + influencing the Expires: header, as well as providing other + curiosities. There are many ways to manage meta information, + this one was chosen because there is already a large number of + CERN users who can exploit this module.

+ +

More information on the + CERN metafile semantics is available.

+
+ + +MetaFiles +Activates CERN meta-file processing +MetaFiles on|off +MetaFiles off +directory + + +

Turns on/off Meta file processing on a per-directory basis.

+
+
+ + +MetaDir +Name of the directory to find CERN-style meta information +files +MetaDir directory +MetaDir .web +directory + + +

Specifies the name of the directory in which Apache can find + meta information files. The directory is usually a 'hidden' + subdirectory of the directory that contains the file being + accessed. Set to "." to look in the same directory + as the file.

+
+
+ + +MetaSuffix +File name suffix for the file containg CERN-style +meta information +MetaSuffix suffix +MetaSuffix .meta +directory + + +

Specifies the file name suffix for the file containing the + meta information. For example, the default values for the two + directives will cause a request to + DOCUMENT_ROOT/somedir/index.html to look in + DOCUMENT_ROOT/somedir/.web/index.html.meta and + will use its contents to generate additional MIME header + information.

+
+
+ +
diff --git a/docs/manual/mod/mod_cgi.xml b/docs/manual/mod/mod_cgi.xml new file mode 100644 index 00000000000..4c3ea9c1efa --- /dev/null +++ b/docs/manual/mod/mod_cgi.xml @@ -0,0 +1,202 @@ + + ]> + + + +mod_cgi +Execution of CGI scripts +Base +mod_cgi.c +cgi_module + + + + + + +

Any file that has the mime type + application/x-httpd-cgi or handler + cgi-script (Apache 1.1 or later) will be treated + as a CGI script, and run by the server, with its output being + returned to the client. Files acquire this type either by + having a name containing an extension defined by the + AddType directive, or by being + in a ScriptAlias + directory.

+ +

When the server invokes a CGI script, it will add a variable + called DOCUMENT_ROOT to the environment. This + variable will contain the value of the + DocumentRoot configuration + variable.

+ +

For an introduction to using CGI scripts with Apache, see + our tutorial on Dynamic Content + With CGI.

+ +

When using a multi-threaded MPM under unix, the module + mod_cgid should be used in place of + this module. At the user level, the two modules are essentially + identical.

+
+ +Options +ScriptAlias +AddHandler + +
CGI Environment variables +

The server will set the CGI environment variables as described + in the CGI + specification, with the following provisions:

+ +
+
PATH_INFO
+ +
This will not be available if the AcceptPathInfo directive is explicitly set to + off. The default behavior, if AcceptPathInfo is + not given, is that mod_cgi will accept path info (trailing + /more/path/info following the script filename in the URI), while + the core server will return a 404 NOT FOUND error for requests + with additional path info. Omitting the AcceptPathInfo + directive has the same effect as setting it on for + mod_cgi requests.
+ +
REMOTE_HOST
+ +
This will only be set if HostnameLookups is set to on (it + is off by default), and if a reverse DNS lookup of the accessing + host's address indeed finds a host name.
+ +
REMOTE_IDENT
+ +
This will only be set if IdentityCheck is set to + on and the accessing host supports the ident + protocol. Note that the contents of this variable cannot be + relied upon because it can easily be faked, and if there is a + proxy between the client and the server, it is usually + totally useless.
+ +
REMOTE_USER
+ +
This will only be set if the CGI script is subject to + authentication.
+
+
+ +
CGI Debugging +

Debugging CGI scripts has traditionally been difficult, mainly + because it has not been possible to study the output (standard + output and error) for scripts which are failing to run + properly. These directives, included in Apache 1.2 and later, + provide more detailed logging of errors when they occur.

+ +
CGI Logfile Format +

When configured, the CGI error log logs any CGI which does not + execute properly. Each CGI script which fails to operate causes + several lines of information to be logged. The first two lines + are always of the format:

+ + %% [time] request-line
+ %% HTTP-status CGI-script-filename +
+

If the error is that CGI script cannot be run, the log file + will contain an extra two lines:

+ + %%error
+ error-message +
+

Alternatively, if the error is the result of the script + returning incorrect header information (often due to a bug in + the script), the following information is logged:

+ + %request
+ All HTTP request headers received
+ POST or PUT entity (if any)
+ %response
+ All headers output by the CGI script
+ %stdout
+ CGI standard output
+ %stderr
+ CGI standard error
+
+

(The %stdout and %stderr parts may be missing if the script did + not output anything on standard output or standard error).

+
+
+ + +ScriptLog +Location of the CGI script error logfile +ScriptLog file-path +server config +mod_cgimod_cgid + + + +

The ScriptLog directive sets the CGI + script error logfile. If no ScriptLog is given, no error log is + created. If given, any CGI errors are logged into the filename + given as argument. If this is a relative file or path it is taken + relative to the server root.

+ +

This log will be opened as the user the child processes run + as, ie. the user specified in the main User directive. This means that + either the directory the script log is in needs to be writable + by that user or the file needs to be manually created and set + to be writable by that user. If you place the script log in + your main logs directory, do NOT change the + directory permissions to make it writable by the user the child + processes run as.

+ +

Note that script logging is meant to be a debugging feature + when writing CGI scripts, and is not meant to be activated + continuously on running servers. It is not optimized for speed + or efficiency, and may have security problems if used in a + manner other than that for which it was designed.

+
+
+ + +ScriptLogLength +Size limit of the CGI script logfile +ScriptLogLength bytes +ScriptLogLength 10385760 +server config +mod_cgimod_cgid + + + +

ScriptLogLength can be used to limit the + size of the CGI script logfile. Since the logfile logs a lot of + information per CGI error (all request headers, all script output) + it can grow to be a big file. To prevent problems due to unbounded + growth, this directive can be used to set an maximum file-size for + the CGI logfile. If the file exceeds this size, no more + information will be written to it.

+
+
+ + +ScriptLogBuffer +Maximum amount of PUT or POST requests that will be recorded +in the scriptlog +ScriptLogBuffer bytes +ScriptLogBuffer 1024 +server config +mod_cgimod_cgid + + + +

The size of any PUT or POST entity body that is logged to + the file is limited, to prevent the log file growing too big + too quickly if large bodies are being received. By default, up + to 1024 bytes are logged, but this can be changed with this + directive.

+
+
+ +
\ No newline at end of file diff --git a/docs/manual/mod/mod_cgid.xml b/docs/manual/mod/mod_cgid.xml new file mode 100644 index 00000000000..bebea4f7c3b --- /dev/null +++ b/docs/manual/mod/mod_cgid.xml @@ -0,0 +1,68 @@ + + ]> + + + +mod_cgid +Execution of CGI scripts using an + external CGI daemon +Base +mod_cgid.c +cgid_module +Unix threaded MPMs only + + +

Except for the optimizations and the additional ScriptSock directive noted below, + mod_cgid behaves similarly to mod_cgi. See the + mod_cgi Summary for additional details about + Apache and CGI.

+ +

On certain unix operating systems, forking a process from a + multi-threaded server is a very expensive operation because the + new process will replicate all the threads of the parent + process. In order to avoid incurring this expense on each CGI + invocation, mod_cgid creates an external daemon that is + responsible for forking child processes to run CGI scripts. The + main server communicates with this daemon using a unix domain + socket.

+ +

This module is used by default whenever a multi-threaded MPM + is selected during the compilation process. At the user level, + this module is identical in configuration and operation to + mod_cgi. The only exception is the + additional directive ScriptSock which gives the + name of the socket to use for communication with the cgi + daemon.

+
+ + +ScriptLog + + + +ScriptLogLength + + + +ScriptLogBuffer + + + +ScriptSock +ScriptSock file-path +ScriptSock logs/cgisock +server config + + +

This directive sets the name of the socket to use for + communication with the CGI daemon. The socket will be opened + using the permissions of the user who starts Apache (usually + root). To maintain the security of communications with CGI + scripts, it is important that no other user has permission to + write in the directory where the socket is located.

+
+
+ +
+ diff --git a/docs/manual/mod/mod_charset_lite.xml b/docs/manual/mod/mod_charset_lite.xml new file mode 100644 index 00000000000..dff19f649b4 --- /dev/null +++ b/docs/manual/mod/mod_charset_lite.xml @@ -0,0 +1,170 @@ + + + + +mod_charset_lite +specify character set translation or recoding +Experimental +mod_charset_lite.c +charset_lite_module + + +

This is an experimental module and should + be used with care. Experiment with your + mod_charset_lite configuration to ensure that it + performs the desired function.

+ +

mod_charset_lite allows the administrator to + specify the source character set of objects as well as the + character set they should be translated into before sending to the + client. mod_charset_lite does not translate the + data itself but instead tells Apache what translation to + perform. mod_charset_lite is applicable to EBCDIC + and ASCII host environments. In an EBCDIC environment, Apache + normally translates text content from the code page of the Apache + process locale to ISO-8859-1. mod_charset_lite + can be used to specify that a different translation is to be + performed. In an ASCII environment, Apache normally performs no + translation, so mod_charset_lite is needed in + order for any translation to take place.

+ +

This module provides a small subset of configuration + mechanisms implemented by Russian Apache and its associated + mod_charset.

+
+ +
Common Problems + +
Invalid character set names + +

The character set name parameters of CharsetSourceEnc and + CharsetDefault + must be acceptable to the translation mechanism used by APR on the + system where mod_charset_lite is deployed. These + character set names are not standardized and are usually not the + same as the corresponding values used in http headers. Currently, + APR can only use iconv(3), so you can easily test your character + set names using the iconv(1) program, as follows:

+ + iconv -f charsetsourceenc-value -t charsetdefault-value + +
+ +
Mismatch between character set of content and translation + rules + +

If the translation rules don't make sense for the content, + translation can fail in various ways, including:

+ +
    +
  • The translation mechanism may return a bad return code, + and the connection will be aborted.
  • + +
  • The translation mechanism may silently place special + characters (e.g., question marks) in the output buffer when + it cannot translate the input buffer.
  • +
+
+
+ + +CharsetSourceEnc +CharsetSourceEnc charset +server config +virtual hostdirectory +.htaccess + +FileInfo + + +

The CharsetSourceEnc directive specifies the + source charset of files in the associated container.

+ +

The value of the charset argument must be accepted + as a valid character set name by the character set support in + APR. Generally, this means that it must be supported by + iconv.

+ Example: + + <Directory "/export/home/trawick/apacheinst/htdocs/convert">
+ CharsetSourceEnc UTF-16BE
+ CharsetDefault ISO8859-1
+ </Directory> +
+

The character set names in this example work with the iconv + translation support in Solaris 8.

+
+
+ + +CharsetDefault +CharsetDefault charset +server config +virtual hostdirectory +.htaccess + +FileInfo + + +

The CharsetDefault directive specifies the + charset that content in the associated container should be + translated to.

+ +

The value of the charset argument must be accepted + as a valid character set name by the character set support in + APR. Generally, this means that it must be supported by + iconv.

+ Example: + + <Directory "/export/home/trawick/apacheinst/htdocs/convert">
+ CharsetSourceEnc UTF-16BE
+ CharsetDefault ISO8859-1
+ </Directory> +
+
+
+ + +CharsetOptions +CharsetOptions option [option] ... +CharsetOptions DebugLevel=0 +NoImplicitAdd +server config +virtual hostdirectory +.htaccess + +FileInfo + + +

The CharsetOptions directive configures certain + behaviors of mod_charset_lite. Option can + be one of

+ +
+
DebugLevel=n
+ +
The DebugLevel keyword allows you to specify + the level of debug messages generated by + mod_charset_lite. By default, no messages are + generated. This is equivalent to DebugLevel=0. + With higher numbers, more debug messages are generated, and + server performance will be degraded. The actual meanings of + the numeric values are described with the definitions of the + DBGLVL_ constants near the beginning of + mod_charset_lite.c.
+ +
ImplicitAdd | NoImplicitAdd
+ +
The ImplicitAdd keyword specifies that + mod_charset_lite should implicitly insert its + filter when the configuration specifies that the character + set of content should be translated. If the filter chain is + explicitly configured using the AddOutputFilter directive, + NoImplicitAdd should be specified so that + mod_charset_lite doesn't add its filter.
+
+
+
+ +
\ No newline at end of file diff --git a/docs/manual/mod/mod_dav.xml b/docs/manual/mod/mod_dav.xml new file mode 100644 index 00000000000..c7b8f3f5b5b --- /dev/null +++ b/docs/manual/mod/mod_dav.xml @@ -0,0 +1,136 @@ + + ]> + + + +mod_dav +Distributed Authoring and Versioning +(WebDAV) functionality. +Extension +mod_dav.c +dav_module + + +

This module provides class 1 and class 2 WebDAV ('Web-based Distributed + Authoring and Versioning') functionality for Apache. This + extension to the HTTP protocol allows creating, moving, + copying, and deleting resources and collections on a remote web + server.

+ +

To enable mod_dav, add the following to a container in your + httpd.conf file:

+ +Dav On + +

Also, specify a valid filename for the DAV lock database by + adding the following to the global section in your + httpd.conf file:

+ +DavLockDB /tmp/DavLock     + (Any web-server writable filename, without an + extension) + +
+ + +Dav +Enable WebDAV HTTP methods +Dav on|off +Dav off +directory + + +

Use the Dav directive to enable the + WebDAV HTTP methods for the given container. You may wish to add a + Limit clause + inside the location directive to limit access to + DAV-enabled locations.

+ +Example + DavLockDB /tmp/DavLock
+
+ <Location /foo>
+ Dav On
+
+ AuthType Basic
+ AuthName DAV
+ AuthUserFile user.passwd
+
+   <LimitExcept GET HEAD OPTIONS>
+   require user admin
+   </LimitExcept>
+ </Location>
+
+
+
+ + +Location of the DAV lock database +DavLockDB +DavLockDB file-path +server configvirtual host + + + +

Use the DavLockDB directive to specify + the full path to the lock database, excluding an extension. The + default (file system) implementation of mod_dav uses a SDBM + database to track user locks. The utility + modules/dav/util/lockview can be used from the server + to display all locks in a lock database.

+ +Example +DavLockDB /tmp/DavLock + +
+
+ + +DavMinTimeout +Minimum amount of time the server holds a lock on +a DAV resource +DavMinTimeout seconds +DavMinTimeout 0 +directory + + +

When a client requests a DAV resource lock, it can also + specify a time when the lock will be automatically removed by + the server. This value is only a request, and the server can + ignore it or inform the client of an arbitrary value.

+ +

Use the DavMinTimeout directive to specify, in + seconds, the minimum lock timeout to return to a client. + Microsoft Web Folders defaults to a timeout of 120 seconds; the + DavMinTimeout can override this to a higher value + (like 600 seconds) to reduce the chance of the client losing + the lock due to network latency.

+ +Example + <Location /MSWord>
+ DavMinTimeout 600
+ </Location>
+
+
+
+ + +DavDepthInfinity +Allow PROPFIND, Depth: Infinity requests +DavDepthInfinity on|off +DavDepthInfinity off +directory + + +

Use the DavDepthInfinity directive to + allow the processing of PROPFIND requests containing the header + 'Depth: Infinity'. Because this type of request could constitute a + denial-of-service attack, by default it is not allowed.

+
+
+ +
+ + diff --git a/docs/manual/mod/mod_deflate.html b/docs/manual/mod/mod_deflate.html new file mode 100755 index 00000000000..48c190fc2d1 --- /dev/null +++ b/docs/manual/mod/mod_deflate.html @@ -0,0 +1,129 @@ + + + + + + + Apache module mod_deflate + + + + + + +

Module mod_deflate

+ +

This module provides the ability to set environment + variables based upon attributes of the request.

+ +

Status: Experimental
+ Source File: + mod_deflate.c
+ Module Identifier: + deflate_module
+ Compatibility: Available in + Apache 2.0 and later.

+ +

Summary

+ +

The experimental mod_deflate module allows + output from your server to be compressed before being sent + to the client over the network.

+ +

Directives

+ + +
+ + +

DeflateFilterNote + directive

+ +

Syntax: DeflateFilterNote notename +
+ Default: none
+ Context: server config
+ Override: none
+ Status: Experimental
+ Module: mod_deflate
+ Compatibility: Apache 2.0 and + above

+ +

The DeflateFilterNote directive specifies that a note about + compression ratios should be attached to the request. The name + of the note is the value specified for the directive.

+ +
+ + +

DeflateWindowSize directive

+ +

Syntax: DeflateWindowSize + value
+ Default: none
+ Context: server config
+ Override: none
+ Status: Experimental
+ Module: mod_deflate
+ Compatibility: Apache 2.0 and + above

+ +

The DeflateWindowSize directive specifies the + zlib compression window size.

+ +
+ + +

DeflateMemLevel + directive

+ +

Syntax: DeflateMemLevel + value
+ Default: none
+ Context: server config
+ Override: none
+ Status: Experimental
+ Module: mod_deflate
+ Compatibility: Apache 2.0 and + above

+ +

The DeflateMemLevel directive specifies the amount of + memory available to zlib for compression.

+ + + + diff --git a/docs/manual/mod/mod_deflate.xml b/docs/manual/mod/mod_deflate.xml new file mode 100644 index 00000000000..44b5efda36f --- /dev/null +++ b/docs/manual/mod/mod_deflate.xml @@ -0,0 +1,88 @@ + + ]> + + + +mod_deflate +Compress content before + it is delivered to the client +experimental +mod_deflate.c +deflate_module + + +

The experimental mod_deflate module provides + the DEFLATE output filter that allows output from + your server to be compressed before being sent to the client over + the network.

+
+AddOutputFilter +SetOutputFilter + +
Enabling Compression + +

Compression is implemented by the DEFLATE + filter. The following directive + will enable compression for documents in the container where it + is placed:

+

Most popular browsers can not handle compression of all content + so you may want to enable the 'gzip-only-text/html' note (see below) +

+ +SetEnv gzip-only-text/html 1
+SetOutputFilter DEFLATE +
+ +

Here is an example of enabling compression for the Apache + documentation:

+ + +<Directory "/your-server-root/manual">
+ SetEnv gzip-only-text/html 1
+ SetOutputFilter DEFLATE
+</Directory> +
+
+ + +DeflateFilterNote +Places the compression ratio in a note for logging +DeflateFilterNote notename +server config + + +

The DeflateFilterNote directive + specifies that a note about compression ratios should be attached + to the request. The name of the note is the value specified for + the directive.

+
+
+ + +DeflateWindowSize +Zlib compression window size +DeflateWindowSize value +server config + + + +

The DeflateWindowSize directive specifies the + zlib compression window size.

+
+
+ + +DeflateMemLevel +Amount of memory available to zlib for compression +DeflateMemLevel value +server config + + + +

The DeflateMemLevel directive specifies + the amount of memory available to zlib for compression.

+
+
+ +
+ diff --git a/docs/manual/mod/mod_dir.xml b/docs/manual/mod/mod_dir.xml new file mode 100644 index 00000000000..850aa63872e --- /dev/null +++ b/docs/manual/mod/mod_dir.xml @@ -0,0 +1,81 @@ + + + + +mod_dir +Provides for "trailing slash" redirects and + serving directory index files. +Base +mod_dir.c +dir_module + + +

The index of a directory can come from one of two sources:

+ + +

The two functions are separated so that you can completely + remove (or replace) automatic index generation should you want + to.

+ +

A "trailing slash" redirect is issued when the server + receives a request for a URL + http://servername/foo/dirname where + dirname is a directory. Directories require a + trailing slash, so mod_dir issues a redirect to + http://servername/foo/dirname/.

+
+ + +List of resources to look for when the client requests +a directory +DirectoryIndex +DirectoryIndex + local-url [local-url] ... +DirectoryIndex index.html +server config +virtual host +directory +.htaccess + +Indexes + + +

The DirectoryIndex directive sets the + list of resources to look for, when the client requests an index + of the directory by specifying a / at the end of the a directory + name. Local-url is the (%-encoded) URL of a document on + the server relative to the requested directory; it is usually the + name of a file in the directory. Several URLs may be given, in + which case the server will return the first one that it finds. If + none of the resources exist and the Indexes option is + set, the server will generate its own listing of the + directory.

+ +Example +DirectoryIndex index.html + + +

then a request for http://myserver/docs/ would + return http://myserver/docs/index.html if it + exists, or would list the directory if it did not.

+ +

Note that the documents do not need to be relative to the + directory;

+ +DirectoryIndex index.html index.txt /cgi-bin/index.pl +

would cause the CGI script /cgi-bin/index.pl to be + executed if neither index.html or + index.txt existed in a directory.

+
+
+ +
\ No newline at end of file diff --git a/docs/manual/mod/mod_env.xml b/docs/manual/mod/mod_env.xml new file mode 100644 index 00000000000..a502fb5745c --- /dev/null +++ b/docs/manual/mod/mod_env.xml @@ -0,0 +1,80 @@ + + + + +mod_env + Modifies the environment which is + passed to CGI scripts and SSI pages + Base + mod_env.c + env_module + +

This module allows for control of the environment that will + be provided to CGI scripts and SSI pages. Environment variables + may be passed from the shell which invoked the httpd process. + Alternatively, environment variables may be set or unset within + the configuration process.

+
+ Environment Variables + + + PassEnv + Passes environment variables from the shell + PassEnv + env-variable [env-variable] ... + + server configvirtual host + directory.htaccess + + FileInfo + + +

Specifies one or more environment variables to pass to CGI + scripts and SSI pages from the environment of the shell which + invoked the httpd process. Example:

+ + PassEnv LD_LIBRARY_PATH + +
+
+ + +SetEnv +Sets environment variables +SetEnv env-variable value + +server configvirtual host +directory.htaccess + +FileInfo + + +

Sets an environment variable, which is then passed on to CGI + scripts and SSI pages. Example:

+ + SetEnv SPECIAL_PATH /foo/bin + +
+
+ + +UnsetEnv +Removes variables from the environment +UnsetEnv env-variable [env-variable] ... + +server configvirtual host +directory.htaccess + +FileInfo + + +

Removes one or more environment variables from those passed + on to CGI scripts and SSI pages. Example:

+ + UnsetEnv LD_LIBRARY_PATH + +
+
+ +
+ diff --git a/docs/manual/mod/mod_example.xml b/docs/manual/mod/mod_example.xml new file mode 100644 index 00000000000..97bd72f71a5 --- /dev/null +++ b/docs/manual/mod/mod_example.xml @@ -0,0 +1,120 @@ + + + + + +mod_example +Illustrates the Apache module API +Experimental +mod_example.c +example_module + + + + This document has not been updated + to take into account changes made in the 2.0 version of the + Apache HTTP Server. Some of the information may still be + relevant, but please use it with care. + + +

The files in the src/modules/example directory + under the Apache distribution directory tree are provided as an + example to those that wish to write modules that use the Apache + API.

+ +

The main file is mod_example.c, which + illustrates all the different callback mechanisms and call + syntaxes. By no means does an add-on module need to include + routines for all of the callbacks - quite the contrary!

+ +

The example module is an actual working module. If you link + it into your server, enable the "example-handler" handler for a + location, and then browse to that location, you will see a + display of some of the tracing the example module did as the + various callbacks were made.

+
+ +
Compiling the example module + +

To include the example module in your server, follow the + steps below:

+ +
    +
  1. + Uncomment the "AddModule modules/example/mod_example" line + near the bottom of the src/Configuration file. + If there isn't one, add it; it should look like this: + + AddModule modules/example/mod_example.o + +
  2. + +
  3. Run the src/Configure script + ("cd src; ./Configure"). This will + build the Makefile for the server itself, and update the + src/modules/Makefile for any additional modules + you have requested from beneath that subdirectory.
  4. + +
  5. Make the server (run "make" in the + src directory).
  6. +
+ +

To add another module of your own:

+ +
    +
  1. mkdir src/modules/mymodule
  2. + +
  3. cp src/modules/example/* + src/modules/mymodule
  4. + +
  5. Modify the files in the new directory.
  6. + +
  7. Follow steps [1] through [3] above, with appropriate + changes.
  8. +
+
+ +
Using the <code>mod_example</code> Module + +

To activate the example module, include a block similar to + the following in your srm.conf file:

+ + <Location /example-info>
+ SetHandler example-handler
+ </Location> +
+ +

As an alternative, you can put the following into a .htaccess file + and then request the file "test.example" from that location:

+ + AddHandler example-handler .example + + +

After reloading/restarting your server, you should be able + to browse to this location and see the brief display mentioned + earlier.

+
+ + +Example +Demonstration directive to illustrate the Apache module +API +Example +server config +virtual hostdirectory +.htaccess + + +

The Example directive just sets a demonstration + flag which the example module's content handler displays. It + takes no arguments. If you browse to an URL to which the + example content-handler applies, you will get a display of the + routines within the module and how and in what order they were + called to service the document request. The effect of this + directive one can observe under the point "Example + directive declared here: YES/NO".

+
+
+ +
diff --git a/docs/manual/mod/mod_expires.xml b/docs/manual/mod/mod_expires.xml new file mode 100644 index 00000000000..90ddbe3a7e1 --- /dev/null +++ b/docs/manual/mod/mod_expires.xml @@ -0,0 +1,208 @@ + + + + + +mod_expires +Generation of + Expires HTTP headers according to user-specified + criteria +Extension +mod_expires.c +expires_module + + +

This module controls the setting of the Expires + HTTP header in server responses. The expiration date can set to + be relative to either the time the source file was last + modified, or to the time of the client access.

+ +

The Expires HTTP header is an instruction to + the client about the document's validity and persistence. If + cached, the document may be fetched from the cache rather than + from the source until this time has passed. After that, the + cache copy is considered "expired" and invalid, and a new copy + must be obtained from the source.

+
+ +
Alternate Interval + Syntax + +

The ExpiresDefault and + ExpiresByType directives + can also be defined in a more readable syntax of the form:

+ + + ExpiresDefault "<base> [plus] {<num> + <type>}*"
+ ExpiresByType type/encoding "<base> [plus] + {<num> <type>}*" +
+ +

where <base> is one of:

+ + + +

The 'plus' keyword is optional. <num> + should be an integer value [acceptable to atoi()], + and <type> is one of:

+ + + +

For example, any of the following directives can be used to + make documents expire 1 month after being accessed, by + default:

+ + + ExpiresDefault "access plus 1 month"
+ ExpiresDefault "access plus 4 weeks"
+ ExpiresDefault "access plus 30 days" +
+ +

The expiry time can be fine-tuned by adding several + '<num> <type>' clauses:

+ + +ExpiresByType text/html "access plus 1 month 15 + days 2 hours"
+ ExpiresByType image/gif "modification plus 5 hours 3 + minutes" +
+ +

Note that if you use a modification date based setting, the + Expires header will not be added to content + that does not come from a file on disk. This is due to the fact + that there is no modification time for such content.

+
+ + +ExpiresActive +Enables generation of Expires headers +ExpiresActive On|Off +server config +virtual hostdirectory +.htaccess +Indexes + + +

This directive enables or disables the generation of the + Expires header for the document realm in question. + (That is, if found in an .htaccess file, for + instance, it applies only to documents generated from that + directory.) If set to Off, no + Expires header will be generated for any document + in the realm (unless overridden at a lower level, such as an + .htaccess file overriding a server config file). + If set to On, the header will be added to + served documents according to the criteria defined by the + ExpiresByType and + ExpiresDefault directives + (q.v.).

+ +

Note that this directive does not guarantee that an + Expires header will be generated. If the criteria + aren't met, no header will be sent, and the effect will be as + though this directive wasn't even specified.

+
+
+ + +ExpiresByType +Value of the Expires header configured +by MIME type +ExpiresByType + MIME-type <code>seconds +server config +virtual hostdirectory +.htaccess +Indexes + + +

This directive defines the value of the Expires + header generated for documents of the specified type + (e.g., text/html). The second argument + sets the number of seconds that will be added to a base time to + construct the expiration date.

+ +

The base time is either the last modification time of the + file, or the time of the client's access to the document. Which + should be used is specified by the + <code> field; M + means that the file's last modification time should be used as + the base time, and A means the client's access + time should be used.

+ +

The difference in effect is subtle. If M is used, + all current copies of the document in all caches will expire at + the same time, which can be good for something like a weekly + notice that's always found at the same URL. If A is + used, the date of expiration is different for each client; this + can be good for image files that don't change very often, + particularly for a set of related documents that all refer to + the same images (i.e., the images will be accessed + repeatedly within a relatively short timespan).

+ +

Example:

+ +# enable expirations
+ExpiresActive On
+# expire GIF images after a month in the client's cache
+ExpiresByType image/gif A2592000
+# HTML documents are good for a week from the time they were changed
+ExpiresByType text/html M604800 +
+ +

Note that this directive only has effect if + ExpiresActive On has been specified. It overrides, + for the specified MIME type only, any expiration date + set by the ExpiresDefault + directive.

+ +

You can also specify the expiration time calculation using + an alternate syntax, described earlier in + this document.

+
+
+ + +ExpiresDefault +Default algorithm for calculating expiration time +ExpiresDefault <code>seconds +server config +virtual hostdirectory +.htaccess +Indexes + + +

This directive sets the default algorithm for calculating the + expiration time for all documents in the affected realm. It can be + overridden on a type-by-type basis by the ExpiresByType directive. See the + description of that directive for details about the syntax of the + argument, and the alternate syntax + description as well.

+
+
+
+ diff --git a/docs/manual/mod/mod_ext_filter.xml b/docs/manual/mod/mod_ext_filter.xml new file mode 100644 index 00000000000..20dd458af03 --- /dev/null +++ b/docs/manual/mod/mod_ext_filter.xml @@ -0,0 +1,232 @@ + + + + + +mod_ext_filter +Pass the response body + through an external program before delivery to the + client +Experimental +mod_ext_filter.c +ext_filter_module + + +

This is an experimental module and should + be used with care. Test your mod_ext_filter + configuration carefully to ensure that it performs the desired + function. You may wish to review + this information for background on the Apache filtering + model.

+ +

mod_ext_filter presents a simple and familiar + programming model for filters. With this module, a program + which reads from stdin and writes to stdout (i.e., a Unix-style + filter command) can be a filter for Apache. This filtering + mechanism is much slower than using a filter which is specially + written for the Apache API and runs inside of the Apache server + process, but it does have the following benefits:

+ + + +

Even when the performance characteristics are not suitable + for production use, mod_ext_filter can be used as + a prototype environment for filters.

+
+ +
Examples + +
Generating HTML from some other type of response + +
+    # mod_ext_filter directive to define a filter to HTML-ize text/c files 
+    # using the external program /usr/bin/enscript, with the type of the 
+    # result set to text/html
+    ExtFilterDefine c-to-html mode=output intype=text/c outtype=text/html \
+                    cmd="/usr/bin/enscript --color -W html -Ec -o - -"
+
+    <Directory "/export/home/trawick/apacheinst/htdocs/c">
+
+    # core directive to cause the new filter to be run on output
+    SetOutputFilter c-to-html
+
+    # mod_mime directive to set the type of .c files to text/c
+    AddType text/c .c
+
+    # mod_ext_filter directive to set the debug level just high 
+    # enough to see a log message per request showing the configuration
+    # in force
+    ExtFilterOptions DebugLevel=1
+
+    </Directory>
+
+
+
+ +
Implementing a content encoding filter + +
+  # mod_ext_filter directive to define the external filter
+  ExtFilterDefine gzip mode=output cmd=/bin/gzip
+
+  <Location /gzipped>
+
+  # core directive to cause the gzip filter to be run on output
+  SetOutputFilter gzip
+
+  # mod_header directive to add "Content-Encoding: gzip" header field
+  Header set Content-Encoding gzip
+
+  </Location>
+
+
+ +

Note: this gzip example is just for the purposes of illustration. + Please refer to mod_deflate for a practical + implementation.

+
+ +
Slowing down the server + +
+  # mod_ext_filter directive to define a filter which runs everything 
+  # through cat; cat doesn't modify anything; it just introduces extra
+  # pathlength and consumes more resources
+  ExtFilterDefine slowdown mode=output cmd=/bin/cat preservescontentlength
+
+  <Location />
+
+  # core directive to cause the slowdown filter to be run several times on 
+  # output
+  SetOutputFilter slowdown slowdown slowdown
+
+  </Location>
+
+
+
+ +
+ + +ExtFilterDefine +ExtFilterDefine filtername parameters +server config + + +

The ExtFilterDefine directive defines the + characteristics of an external filter, including the program to + run and its arguments.

+ +

filtername specifies the name of the filter being + defined. This name can then be used in SetOutputFilter + directives. It must be unique among all registered filters. + At the present time, no error is reported by the + register-filter API, so a problem with duplicate names isn't + reported to the user.

+ +

Subsequent parameters can appear in any order and define the + external command to run and certain other characteristics. The + only required parameter is cmd=. These parameters + are:

+ +
+
cmd=cmdline
+ +
The cmd= keyword allows you to specify the + external command to run. If there are arguments after the + program name, the command line should be surrounded in + quotation marks.
+ +
mode=mode
+ +
mode should be output for now (the + default). In the future, mode=input will be used to + specify a filter for request bodies.
+ +
intype=imt
+ +
This parameter specifies the internet media type (i.e., + MIME type) of documents which should be filtered. By default, + all documents are filtered. If intype= is + specified, the filter will be disabled for documents of other + types.
+ +
outtype=imt
+ +
This parameter specifies the internet media type (i.e., + MIME type) of filtered documents. It is useful when the + filter changes the internet media type as part of the + filtering operation. By default, the internet media type is + unchanged.
+ +
PreservesContentLength
+ +
The PreservesContentLength keyword specifies + that the filter preserves the content length. This is not the + default, as most filters change the content length. In the + event that the filter doesn't modify the length, this keyword + should be specified.
+
+
+
+ + +ExtFilterOptions +ExtFilterOptions + option [option] ... +ExtFilterOptions DebugLevel=0 NoLogStderr +directory + + +

The ExtFilterOptions directive specifies + special processing options for mod_ext_filter. + Option can be one of

+ +
+
DebugLevel=n
+ +
+ The DebugLevel keyword allows you to specify + the level of debug messages generated by + mod_ext_filter. By default, no debug messages + are generated. This is equivalent to + DebugLevel=0. With higher numbers, more debug + messages are generated, and server performance will be + degraded. The actual meanings of the numeric values are + described with the definitions of the DBGLVL_ constants + near the beginning of mod_ext_filter.c. + +

Note: The core directive LogLevel should be used to + cause debug messages to be stored in the Apache error + log.

+
+ +
LogStderr | NoLogStderr
+ +
The LogStderr keyword specifies that + messages written to standard error by the external filter + program will be saved in the Apache error log. + NoLogStderr disables this feature.
+
+ +

Example:

+ + ExtFilterOptions LogStderr DebugLevel=0 + + +

Messages written to the filter's standard error will be stored + in the Apache error log. No debug messages will be generated by + mod_ext_filter.

+
+
+ +
\ No newline at end of file diff --git a/docs/manual/mod/mod_file_cache.xml b/docs/manual/mod/mod_file_cache.xml new file mode 100644 index 00000000000..3e6f4a4ef65 --- /dev/null +++ b/docs/manual/mod/mod_file_cache.xml @@ -0,0 +1,178 @@ + + + + + +mod_file_cache +Caches a static list of files in memory +Experimental +mod_file_cache.c +file_cache_module + + + + +This module should be used with care. You can easily + create a broken site using mod_file_cache, so read this + document carefully. + + +

Caching frequently requested files that change very + infrequently is a technique for reducing server load. + mod_file_cache provides two techniques for caching frequently + requested static files. Through configuration + directives, you can direct mod_file_cache to either open then + mmap()a file, or to pre-open a file and save the file's open + file handle. Both techniques reduce server load when + processing requests for these files by doing part of the work + (specifically, the file I/O) for serving the file when the + server is started rather than during each request.

+ +

Notice: You cannot use this for speeding up CGI programs or + other files which are served by special content handlers. It + can only be used for regular files which are usually served by + the Apache core content handler.

+ +

This module is an extension of and borrows heavily from the + mod_mmap_static module in Apache 1.3.

+
+ +
Using mod_file_cache + +

mod_file_cache caches a list of statically + configured files via MMapFile or CacheFile directives in the + main server configuration.

+ +

Not all platforms support both directives. For example, Apache + on Windows does not currently support the MMapStatic directive, while + other platforms, like AIX, support both. You will receive an error + message in the server error log if you attempt to use an + unsupported directive. If given an unsupported directive, the + server will start but the file will not be cached. On platforms + that support both directives, you should experiment with both to + see which works best for you.

+ +
MmapFile Directive + +

The MmapFile + directive of mod_file_cache maps a list of + statically configured files into memory through the system call + mmap(). This system call is available on most modern + Unix derivates, but not on all. There are sometimes + system-specific limits on the size and number of files that can be + mmap()d, experimentation is probably the easiest way to find + out.

+ +

This mmap()ing is done once at server start or restart, + only. So whenever one of the mapped files changes on the + filesystem you have to restart the server (see the Stopping and Restarting + documentation). To reiterate that point: if the files are + modified in place without restarting the server you + may end up serving requests that are completely bogus. You + should update files by unlinking the old copy and putting a new + copy in place. Most tools such as rdist and + mv do this. The reason why this modules doesn't + take care of changes to the files is that this check would need + an extra stat() every time which is a waste and + against the intent of I/O reduction.

+
+ +
CacheFile Directive + +

The CacheFile + directive of mod_file_cache opens an active + handle or file descriptor to the file (or files) + listed in the configuration directive and places these open file + handles in the cache. When the file is requested, the server + retrieves the handle from the cache and passes it to the + sendfile() (or TransmitFile() on Windows), socket API.

+ +

Insert more details about sendfile API...

+ +

This file handle caching is done once at server start or + restart, only. So whenever one of the cached files changes on + the filesystem you have to restart the server (see the + Stopping and Restarting + documentation). To reiterate that point: if the files are + modified in place without restarting the server you + may end up serving requests that are completely bogus. You + should update files by unlinking the old copy and putting a new + copy in place. Most tools such as rdist and + mv do this.

+
+ +Note Don't bother asking for a for a + directive which recursively caches all the files in a + directory. Try this instead... See the + Include directive, and consider + this command: + + find /www/htdocs -type f -print \
+ | sed -e 's/.*/mmapfile &/' > /www/conf/mmap.conf +
+
+ +
+ + +MMapFile +MMapFile file-path [file-path] ... +server config + + +

The MMapFile directive maps one or more files + (given as whitespace separated arguments) into memory at server + startup time. They are automatically unmapped on a server + shutdown. When the files have changed on the filesystem at + least a HUP or USR1 signal should be send to the server to + re-mmap them.

+ +

Be careful with the file-path arguments: They have + to literally match the filesystem path Apache's URL-to-filename + translation handlers create. We cannot compare inodes or other + stuff to match paths through symbolic links etc. + because that again would cost extra stat() system + calls which is not acceptable. This module may or may not work + with filenames rewritten by mod_alias or + mod_rewrite.

+ +Example + MMapFile /usr/local/apache/htdocs/index.html + +
+
+ + +CacheFile +CacheFile + file-path [file-path] ... +server config + + +

The CacheFile directive opens handles to + one or more files (given as whitespace separated arguments) and + places these handles into the cache at server startup + time. Handles to cached files are automatically closed on a server + shutdown. When the files have changed on the filesystem, the + server should be restarted to to re-cache them.

+ +

Be careful with the file-path arguments: They have + to literally match the filesystem path Apache's URL-to-filename + translation handlers create. We cannot compare inodes or other + stuff to match paths through symbolic links etc. + because that again would cost extra stat() system + calls which is not acceptable. This module may or may not work + with filenames rewritten by mod_alias or + mod_rewrite.

+ +Example + CacheFile /usr/local/apache/htdocs/index.html + +
+ +
+
\ No newline at end of file diff --git a/docs/manual/mod/mod_headers.xml b/docs/manual/mod/mod_headers.xml new file mode 100644 index 00000000000..b71885c2b93 --- /dev/null +++ b/docs/manual/mod/mod_headers.xml @@ -0,0 +1,261 @@ + + + + + +mod_headers +Customization of HTTP request + and response headers +Extension +mod_headers.c +headers_module +RequestHeader is available only in Apache 2.0 + + +

This module provides directives to control and modify HTTP + request and response headers. Headers can be merged, replaced + or removed.

+
+ +
Order of Processing + +

The directives provided by mod_header can occur almost + anywhere within the server configuration. They are valid in the + main server config and virtual host sections, inside + <Directory>, <Location> and <Files> sections, + and within .htaccess files.

+ +

The directives are processed in the following order:

+ +
    +
  1. main server
  2. + +
  3. virtual host
  4. + +
  5. <Directory> sections and .htaccess
  6. + +
  7. <Location>
  8. + +
  9. <Files>
  10. +
+ +

Order is important. These two headers have a different + effect if reversed:

+ + +RequestHeader append MirrorID "mirror 12"
+ RequestHeader unset MirrorID +
+ +

This way round, the MirrorID header is not set. If reversed, + the MirrorID header is set to "mirror 12".

+
+ +
Example + +
    +
  1. Copy all request headers that begin with "TS" to the + response headers: + + + Header echo ^TS* +
  2. + +
  3. Add a header, MyHeader, to the response including a + timestamp for when the request was received and how long it + took to begin serving the request. This header can be used by + the client to intuit load on the server or in isolating + bottlenecks between the client and the server. + + + Header add MyHeader "%D %t" + + results in this header being added to the response: + + MyHeader: D=3775428 t=991424704447256 + +
  4. + +
  5. Say hello to Joe + + + Header add MyHeader "Hello Joe. It took %D microseconds for Apache to serve this request." + + results in this header being added to the response: + + MyHeader: Hello Joe. It took D=3775428 microseconds for Apache to serve this request. + +
  6. + +
  7. Conditionally send MyHeader on the response if and only + if header "MyRequestHeader" is present on the request. This + is useful for constructing headers in response to some client + stimulus. Note that this example requires the services of the + mod_setenvif module. + + + SetEnvIf MyRequestHeader value HAVE_MyRequestHeader
    + Header add MyHeader "%D %t mytext" env=HAVE_MyRequestHeader +
    + If the header "MyRequestHeader: value" is present on the + HTTP request, the response will contain the following + header: + + MyHeader: D=3775428 t=991424704447256 mytext + +
  8. +
+
+ + +RequestHeader +Configure HTTP request headers +RequestHeader set|append|add|unset header +[value] +server config +virtual host +directory +.htaccess +FileInfo + + +

This directive can replace, merge or remove HTTP request + headers. The header is modified just before the content handler + is run, allowing incoming headers to be modified. The action it + performs is determined by the first argument. This can be one + of the following values:

+ +
    +
  • set
    + The request header is set, replacing any previous header + with this name
  • + +
  • append
    + The request header is appended to any existing header of the + same name. When a new value is merged onto an existing header + it is separated from the existing header with a comma. This + is the HTTP standard way of giving a header multiple + values.
  • + +
  • add
    + The request header is added to the existing set of headers, + even if this header already exists. This can result in two + (or more) headers having the same name. This can lead to + unforeseen consequences, and in general "append" should be + used instead.
  • + +
  • unset
    + The request header of this name is removed, if it exists. If + there are multiple headers of the same name, all will be + removed.
  • +
+ +

This argument is followed by a header name, which can + include the final colon, but it is not required. Case is + ignored. For add, append and + set a value is given as the third argument. If + this value contains spaces, it should be surrounded by double + quotes. For unset, no value should be given.

+ +

The RequestHeader directive is processed + just before the request is run by its handler in the fixup phase. + This should allow headers generated by the browser, or by Apache + input filters to be overridden or modified.

+
+
+ + +Header +Configure HTTP response headers +Header set|append|add|unset|echo header +[value] +server config +virtual host +directory +.htaccess +FileInfo + + +

This directive can replace, merge or remove HTTP response + headers. The header is modified just after the content handler + and output filters are run, allowing outgoing headers to be + modified. The action it performs is determined by the first + argument. This can be one of the following values:

+ +
    +
  • set
    + The response header is set, replacing any previous header + with this name. The value may be a format + string.
  • + +
  • append
    + The response header is appended to any existing header of + the same name. When a new value is merged onto an existing + header it is separated from the existing header with a comma. + This is the HTTP standard way of giving a header multiple + values.
  • + +
  • add
    + The response header is added to the existing set of headers, + even if this header already exists. This can result in two + (or more) headers having the same name. This can lead to + unforeseen consequences, and in general "append" should be + used instead.
  • + +
  • unset
    + The response header of this name is removed, if it exists. + If there are multiple headers of the same name, all will be + removed.
  • + +
  • echo
    + Request headers with this name are echoed back in the + response headers. header may be a regular + expression.
  • +
+ +

This argument is followed by a header name, which + can include the final colon, but it is not required. Case is + ignored for set, append, add and unset. The header + name for echo is case sensitive and may be a regular + expression.

+ +

For add, append and + set a value is specified as the third + argument. If value contains spaces, it should be + surrounded by doublequotes. value may be a character + string, a string containing format specifiers or a combination + of both. The following format specifiers are supported in + value:

+ + + + + + +
%t: The time the request was received in Universal +Coordinated Time since the epoch (Jan. 1, 1970) measured in +microseconds. The value is preceded by "t=".
%D: The time from when the request was received to +the time the headers are sent on the wire. This is a measure of the +duration of the request. The value is preceded by "D=".
%{FOOBAR}e: The contents of the environment +variable FOOBAR.
+ +

When the Header directive is used with the + add, append, or set + argument, a fourth argument may be used to specify conditions + under which the action will be taken. If the environment variable specified in the + env=... argument exists (or if the environment + variable does not exist and env=!... is specified) + then the action specified by the Header directive + will take effect. Otherwise, the directive will have no effect + on the request.

+ +

The Header directives are processed just before the response + is sent to the network. These means that it is possible to set + and/or override most headers, except for those headers added by + the header filter.

+
+
+ +
+ diff --git a/docs/manual/mod/mod_imap.xml b/docs/manual/mod/mod_imap.xml new file mode 100644 index 00000000000..489a2053b16 --- /dev/null +++ b/docs/manual/mod/mod_imap.xml @@ -0,0 +1,334 @@ + + + + + +mod_imap +Server-side imagemap processing +Base +mod_imap.c +imap_module + + +

This module processes .map files, thereby + replacing the functionality of the imagemap CGI + program. Any directory or document type configured to use the + handler imap-file (using either + AddHandler or + SetHandler) + will be processed by this module.

+ +

The following directive will activate files ending with + .map as imagemap files:

+ +AddHandler imap-file map + +

Note that the following is still supported:

+ +AddType application/x-httpd-imap map + +

However, we are trying to phase out "magic MIME types" so we + are deprecating this method.

+
+ +
New Features + +

The imagemap module adds some new features that were not + possible with previously distributed imagemap programs.

+ + +
+ +
Imagemap File + +

The lines in the imagemap files can have one of several + formats:

+ + + directive value [x,y ...]
+ directive value "Menu text" [x,y ...]
+ directive value x,y ... "Menu text" +
+

The directive is one of base, + default, poly, circle, + rect, or point. The value is an + absolute or relative URL, or one of the special values listed + below. The coordinates are x,y pairs separated by + whitespace. The quoted text is used as the text of the link if + a imagemap menu is generated. Lines beginning with '#' are + comments.

+ +
Imagemap File Directives +

There are six directives allowed in the imagemap file. The + directives can come in any order, but are processed in the + order they are found in the imagemap file.

+ +
+
base Directive
+ +
Has the effect of <BASE HREF="value">. + The non-absolute URLs of the map-file are taken relative to + this value. The base directive overrides + ImapBase as set in a .htaccess file or in the server + configuration files. In the absence of an ImapBase + configuration directive, base defaults to + http://server_name/.
+ base_uri is synonymous with base. + Note that a trailing slash on the URL is significant.
+ +
default Directive
+ +
The action taken if the coordinates given do not fit any + of the poly, circle or + rect directives, and there are no + point directives. Defaults to + nocontent in the absence of an ImapDefault + configuration setting, causing a status code of 204 No + Content to be returned. The client should keep the + same page displayed.
+ +
poly Directive
+ +
Takes three to one-hundred points, and is obeyed if the + user selected coordinates fall within the polygon defined by + these points.
+ +
circle
+ +
Takes the center coordinates of a circle and a point on + the circle. Is obeyed if the user selected point is with the + circle.
+ +
rect Directive
+ +
Takes the coordinates of two opposing corners of a + rectangle. Obeyed if the point selected is within this + rectangle.
+ +
point Directive
+ +
Takes a single point. The point directive closest to the + user selected point is obeyed if no other directives are + satisfied. Note that default will not be + followed if a point directive is present and + valid coordinates are given.
+
+
+ +
Values + +

The values for each of the directives can any of the following:

+ + +
+
a URL
+ +
The URL can be relative or absolute URL. Relative URLs + can contain '..' syntax and will be resolved relative to the + base value.
+ base itself will not resolved according to the + current value. A statement base mailto: will + work properly, though.
+ +
map
+ +
Equivalent to the URL of the imagemap file itself. No + coordinates are sent with this, so a menu will be generated + unless ImapMenu is set to 'none'.
+ +
menu
+ +
Synonymous with map.
+ +
referer
+ +
Equivalent to the URL of the referring document. Defaults + to http://servername/ if no Referer: header was + present.
+ +
nocontent
+ +
Sends a status code of 204 No Content, + telling the client to keep the same page displayed. Valid for + all but base.
+ +
error
+ +
Fails with a 500 Server Error. Valid for all + but base, but sort of silly for anything but + default.
+
+
+ +
Coordinates + +
+
0,0 200,200
+ +
A coordinate consists of an x and a y + value separated by a comma. The coordinates are separated + from each other by whitespace. To accommodate the way Lynx + handles imagemaps, should a user select the coordinate + 0,0, it is as if no coordinate had been + selected.
+
+ +
+ +
Quoted Text + +
+
"Menu Text"
+ +
After the value or after the coordinates, the line + optionally may contain text within double quotes. This string + is used as the text for the link if a menu is + generated:
+ <a HREF="http://foo.com/">Menu + text</a>
+ If no quoted text is present, the name of the link will be + used as the text:
+ <a + HREF="http://foo.com/">http://foo.com</a>
+ It is impossible to escape double quotes within this + text.
+
+
+
+ +
Example Mapfile + + + #Comments are printed in a 'formatted' or + 'semiformatted' menu.
+ #And can contain html tags. <hr>
+ base referer
+ poly map "Could I have a menu, please?" 0,0 0,10 10,10 + 10,0
+ rect .. 0,0 77,27 "the directory of the referer"
+ circle http://www.inetnebr.com/lincoln/feedback/ 195,0 + 305,27
+ rect another_file "in same directory as referer" 306,0 + 419,27
+ point http://www.zyzzyva.com/ 100,100
+ point http://www.tripod.com/ 200,200
+ rect mailto:nate@tripod.com 100,150 200,0 "Bugs?"
+
+ +
+ +
Referencing your mapfile + + + <A HREF="/maps/imagemap1.map">
+ <IMG ISMAP SRC="/images/imagemap1.gif">
+ </A> +
+
+ + +ImapMenu +Action if no coordinates are given when calling +an imagemap +ImapMenu + none|formatted|semiformatted|unformatted +server config +virtual host +directory +.htaccess +Indexes + + +

The ImapMenu directive determines the + action taken if an imagemap file is called without valid + coordinates.

+ +
+
none
+ +
If ImapMenu is none, no menu is generated, + and the default action is performed.
+ +
formatted
+ +
A formatted menu is the simplest menu. + Comments in the imagemap file are ignored. A level one header + is printed, then an hrule, then the links each on a separate + line. The menu has a consistent, plain look close to that of + a directory listing.
+ +
semiformatted
+ +
In the semiformatted menu, comments are + printed where they occur in the imagemap file. Blank lines + are turned into HTML breaks. No header or hrule is printed, + but otherwise the menu is the same as a + formatted menu.
+ +
unformatted
+ +
Comments are printed, blank lines are ignored. Nothing is + printed that does not appear in the imagemap file. All breaks + and headers must be included as comments in the imagemap + file. This gives you the most flexibility over the appearance + of your menus, but requires you to treat your map files as + HTML instead of plaintext.
+
+
+
+ + +ImapDefault +Default action when an imagemap is called with coordinates +that are not explicitly mapped +ImapDefault error|nocontent|map|referer|URL +ImapDefault nocontent +server config +virtual host +directory +.htaccess +Indexes + + +

The ImapDefault directive sets the default + default used in the imagemap files. Its value is + overridden by a default directive within the + imagemap file. If not present, the default action + is nocontent, which means that a 204 No + Content is sent to the client. In this case, the client + should continue to display the original page.

+
+
+ + +ImapBase +Default base for imagemap files +ImapBase map|referer|URL +ImapBase http://servername/ +server config +virtual host +directory +.htaccess +Indexes + + +

The ImapBase directive sets the default + base used in the imagemap files. Its value is + overridden by a base directive within the imagemap + file. If not present, the base defaults to + http://servername/.

+
+
+ +
\ No newline at end of file diff --git a/docs/manual/mod/mod_include.xml b/docs/manual/mod/mod_include.xml new file mode 100644 index 00000000000..c124daa1bff --- /dev/null +++ b/docs/manual/mod/mod_include.xml @@ -0,0 +1,695 @@ + + + + +mod_include +Base +include_module +mod_include.c + +This module provides for server-parsed html +documents. + + + +

This module provides a filter which will process files + before they are sent to the client. The processing is + controlled by specially formated SGML comments, referred to as + elements. These elements allow conditional text, the + inclusion other files or programs, as well as the setting and + printing of environment variables.

+ + See also: + Options, + SetOutputFilter + and AcceptPathInfo. + +
+ +
+ Enabling Server-Side Includes + +

Server Side Includes are implemented by the + INCLUDES filter. If + documents containing server-side include directives are given + the extension .shtml, the following directives will make Apache + parse them and assign the resulting document the mime type of + text/html:

+ + + AddType text/html .shtml
+ AddOutputFilter INCLUDES .shtml +
+ +

The following directive must be given for the directories + containing the shtml files (typically in a + <Directory> section, but this directive is + also valid .htaccess files if AllowOverride + Options is set):

+ + + Options +Includes + + +

For backwards compatibility, the server-parsed + handler also activates the + INCLUDES filter. As well, Apache will activate the INCLUDES + filter for any document with mime type + text/x-server-parsed-html or + text/x-server-parsed-html3 (and the resulting + output will have the mime type text/html).

+ +

For more information, see our Tutorial on Server Side + Includes.

+
+ +
+ Basic Elements +

The document is parsed as an HTML document, with special + commands embedded as SGML comments. A command has the syntax:

+ + + <!--#element attribute=value + attribute=value ... --> + + +

The value will often be enclosed in double quotes; many + commands only allow a single attribute-value pair. Note that + the comment terminator (-->) should be preceded + by whitespace to ensure that it isn't considered part of an SSI + token.

+ +

The allowed elements are:

+ +
+
config
+ +
+ This command controls various aspects of the parsing. The + valid attributes are: + +
+
errmsg
+ +
The value is a message that is sent back to the + client if an error occurs whilst parsing the + document.
+ +
sizefmt
+ +
The value sets the format to be used which displaying + the size of a file. Valid values are bytes + for a count in bytes, or abbrev for a count + in Kb or Mb as appropriate.
+ +
timefmt
+ +
The value is a string to be used by the + strftime(3) library routine when printing + dates.
+
+
+ +
echo
+ +
+ This command prints one of the include + variables, defined + below. If the variable is unset, it is printed as + (none). Any dates printed are subject to the + currently configured timefmt. Attributes: + +
+
var
+ +
The value is the name of the variable to print.
+ +
encoding
+ +
Specifies how Apache should encode special characters + contained in the variable before outputting them. If set + to "none", no encoding will be done. If set to "url", + then URL encoding (also known as %-encoding; this is + appropriate for use within URLs in links, etc.) will be + performed. At the start of an echo element, + the default is set to "entity", resulting in entity + encoding (which is appropriate in the context of a + block-level HTML element, eg. a paragraph of text). This + can be changed by adding an encoding + attribute, which will remain in effect until the next + encoding attribute is encountered or the + element ends, whichever comes first. Note that the + encoding attribute must precede the + corresponding var attribute to be effective, + and that only special characters as defined in the + ISO-8859-1 character encoding will be encoded. This + encoding process may not have the desired result if a + different character encoding is in use. Apache 1.3.12 and + above; previous versions do no encoding.
+
+
+ +
exec
+ +
+ The exec command executes a given shell command or CGI + script. The IncludesNOEXEC Option disables this command + completely. The valid attributes are: + +
+
cgi
+ +
+ The value specifies a (%-encoded) URL relative path to + the CGI script. If the path does not begin with a (/), + then it is taken to be relative to the current + document. The document referenced by this path is + invoked as a CGI script, even if the server would not + normally recognize it as such. However, the directory + containing the script must be enabled for CGI scripts + (with ScriptAlias or + the ExecCGI Option). + +

The CGI script is given the PATH_INFO and query + string (QUERY_STRING) of the original request from the + client; these cannot be specified in the URL path. The + include variables will be available to the script in + addition to the standard CGI + environment.

+ +

For example:

+ + <!--#exec cgi="/cgi-bin/example.cgi" --> + +

If the script returns a Location: header instead of + output, then this will be translated into an HTML + anchor.

+ +

The include + virtual element should be + used in preference to exec cgi. In particular, + if you need to pass additional arguments to a CGI program, + using the query string, this cannot be done with exec + cgi, but can be done with include + virtual, as shown here:

+ + <!--#include virtual="/cgi-bin/example.cgi?argument=value" --> +
+ +
cmd
+ +
+

The server will execute the given string using + /bin/sh. The include variables are available + to the command, in addition to the usual set of CGI + variables.

+ +

The use of #include + virtual is almost always + prefered to using either #exec cgi or #exec + cmd. The former (#include virtual) used the + standard Apache sub-request mechanism to include files or + scripts. It is much better tested and maintained.

+ +

In addition, on some platforms, like Win32, and on unix + when using suexec, you cannot pass arguments to a command in + an exec directive, or otherwise include spaces in + the command. Thus, while the following will work under a + non-suexec configuration on unix, it will not produce the + desired result under Win32, or when running suexec:

+ + <!--#exec cmd="perl /path/to/perlscript arg1 arg2" --> + +
+
+
+ +
fsize
+ +
+ This command prints the size of the specified file, subject + to the sizefmt format specification. + Attributes: + +
+
file
+ +
The value is a path relative to the directory + containing the current document being parsed.
+ +
virtual
+ +
The value is a (%-encoded) URL-path relative to the + current document being parsed. If it does not begin with + a slash (/) then it is taken to be relative to the + current document.
+
+
+ +
flastmod
+ +
This command prints the last modification date of the + specified file, subject to the timefmt format + specification. The attributes are the same as for the + fsize command.
+ +
include
+ +
+ This command inserts the text of another document or file + into the parsed file. Any included file is subject to the + usual access control. If the directory containing the + parsed file has the Option + IncludesNOEXEC set, and the including the document would + cause a program to be executed, then it will not be + included; this prevents the execution of CGI scripts. + Otherwise CGI scripts are invoked as normal using the + complete URL given in the command, including any query + string. + +

An attribute defines the location of the document; the + inclusion is done for each attribute given to the include + command. The valid attributes are:

+ +
+
file
+ +
The value is a path relative to the directory + containing the current document being parsed. It cannot + contain ../, nor can it be an absolute path. + Therefore, you cannot include files that are outside of the + document root, or above the current document in the directory + structure. + The virtual attribute should always be used + in preference to this one.
+ +
virtual
+ +
+

The value is a (%-encoded) URL relative to the + current document being parsed. The URL cannot contain a + scheme or hostname, only a path and an optional query + string. If it does not begin with a slash (/) then it is + taken to be relative to the current document.

+ +

A URL is constructed from the attribute, and the output the + server would return if the URL were accessed by the client + is included in the parsed output. Thus included files can + be nested.

+ +

If the specified URL is a CGI program, the program will + be executed and its output inserted in place of the directive + in the parsed file. You may include a query string in a CGI + url:

+ + <!--#include virtual="/cgi-bin/example.cgi?argument=value" --> + +

include virtual should be used in preference + to exec cgi to include the output of CGI + programs into an HTML document.

+
+
+
+ +
printenv
+ +
+

This prints out a listing of all existing variables and + their values. Starting with Apache 1.3.12, special characters + are entity encoded (see the echo element for details) + before being output. There are no attributes.

+ +

For example:

+ +

<!--#printenv -->

+ +

The printenv element is available only in + Apache 1.2 and above.

+
+
set
+ +
+ This sets the value of a variable. Attributes: + +
+
var
+ +
The name of the variable to set.
+ +
value
+ +
The value to give a variable.
+
+

+ For example: <!--#set var="category" value="help" + -->

+ +

The set element is available only in + Apache 1.2 and above.

+
+
+
+ +
+ Include Variables + + In addition to the variables in the standard CGI environment, + these are available for the echo command, for + if and elif, and to any program + invoked by the document. + +
+
DATE_GMT
+ +
The current date in Greenwich Mean Time.
+ +
DATE_LOCAL
+ +
The current date in the local time zone.
+ +
DOCUMENT_NAME
+ +
The filename (excluding directories) of the document + requested by the user.
+ +
DOCUMENT_URI
+ +
The (%-decoded) URL path of the document requested by the + user. Note that in the case of nested include files, this is + not then URL for the current document.
+ +
LAST_MODIFIED
+ +
The last modification date of the document requested by + the user.
+
+
+ +
+ Variable Substitution + +

Variable substitution is done within quoted strings in most + cases where they may reasonably occur as an argument to an SSI + directive. This includes the config, + exec, flastmod, fsize, + include, and set directives, as well + as the arguments to conditional operators. You can insert a + literal dollar sign into the string using backslash + quoting:

+
+    <!--#if expr="$a = \$test" -->
+
+ +

If a variable reference needs to be substituted in the + middle of a character sequence that might otherwise be + considered a valid identifier in its own right, it can be + disambiguated by enclosing the reference in braces, + a la shell substitution:

+
+    <!--#set var="Zed" value="${REMOTE_HOST}_${REQUEST_METHOD}" -->
+
+ +

This will result in the Zed variable being set + to "X_Y" if REMOTE_HOST is + "X" and REQUEST_METHOD is + "Y".

+ +

EXAMPLE: the below example will print "in foo" if the + DOCUMENT_URI is /foo/file.html, "in bar" if it is + /bar/file.html and "in neither" otherwise:

+
+    <!--#if expr="\"$DOCUMENT_URI\" = \"/foo/file.html\"" -->
+    in foo
+    <!--#elif expr="\"$DOCUMENT_URI\" = \"/bar/file.html\"" -->
+    in bar
+    <!--#else -->
+    in neither
+    <!--#endif -->
+
+
+ +
+ Flow Control Elements + + These are available in Apache 1.2 and above. The basic flow + control elements are: +
+    <!--#if expr="test_condition" -->
+    <!--#elif expr="test_condition" -->
+    <!--#else -->
+    <!--#endif -->
+
+ +

The if element works like an + if statement in a programming language. The test condition is + evaluated and if the result is true, then the text until the + next elif, + else. or + endif element is included in the + output stream.

+ +

The elif or + else statements are be used the + put text into the output stream if the original test_condition + was false. These elements are optional.

+ +

The endif element ends the + if element and is required.

+ +

test_condition is one of the following:

+ +
+
string
+ +
true if string is not empty
+ +
string1 = string2
+ string1 != string2
+ string1 < string2
+ string1 <= string2
+ string1 > string2
+ string1 >= string2
+ +
Compare string1 with string 2. If string2 has the form + /string/ then it is compared as a regular + expression. Regular expressions have the same syntax as those + found in the Unix egrep command.
+ +
( test_condition )
+ +
true if test_condition is true
+ +
! test_condition
+ +
true if test_condition is false
+ +
test_condition1 && + test_condition2
+ +
true if both test_condition1 and + test_condition2 are true
+ +
test_condition1 || test_condition2
+ +
true if either test_condition1 or + test_condition2 is true
+
+ +

"=" and "!=" bind more tightly than + "&&" and "||". "!" binds + most tightly. Thus, the following are equivalent:

+
+    <!--#if expr="$a = test1 && $b = test2" -->
+    <!--#if expr="($a = test1) && ($b = test2)" -->
+
+ +

Anything that's not recognized as a variable or an operator + is treated as a string. Strings can also be quoted: + 'string'. Unquoted strings can't contain whitespace + (blanks and tabs) because it is used to separate tokens such as + variables. If multiple strings are found in a row, they are + concatenated using blanks. So,

+
+     string1    string2  results in string1 string2
+    'string1    string2' results in string1    string2
+
+ +
+ +
+ Using Server Side Includes for ErrorDocuments + + There is a document + which describes how to use the features of mod_include to offer + internationalized customized server error documents. + +

PATH_INFO with Server Side Includes

+ +

Files processed for server-side includes no longer accept + requests with PATH_INFO (trailing pathname information) by + default. You can use the AcceptPathInfo directive to + configure the server to accept requests with PATH_INFO.

+ +
+ + + +SSIEndTag +Changes the string that mod_include looks for to end an +include command. +SSIEndTag tag +SSIEndTag "-->" +server config +virtual host +FileInfo +Apache 1.2 and Available in version 2.0.30 and later. + + + +

This directive changes the string that mod_include looks for + to mark the end of a include command.

+ + See also: SSIStartTag. +
+
+ + +SSIErrorMsg +Changes the error message displayed when there is an error +SSIErrorMsg message +SSIErrorMsg +"[an error occurred while processing this directive]" + +server config +virtual host +directory +.htaccess + + +Available in version 2.0.30 and later. + + +

The SSIErrorMsg directive changes the error message displayed + when mod_include encounters an error. For production servers you + may consider changing the default error message to + "<-- Error -->" so that the message + is not presented to the user. +

+

This directive has the same effect as the <--#config + errmsg=message --> element.

+ +
+
+ + +SSIStartTag + +Changes the string that mod_include looks for to start an +include element +SSIStartTag "<--!" + +server config +virtual host + + +Available in version 2.0.30 and later. + + + +

This directive changes the string that mod_include looks for + to mark an include element to process.

+ +

You may want to use this option if have 2 servers parsing the + output of a file each processing different commands (possibly at + different times).

+ + See also: SSIEndTag + +
+
+ + +SSITimeFormat +Configures the format in which date strings are +displayed +SSITimeFormat formatstring +SSITimeFormat "%A, %d-%b-%Y %H:%M:%S %Z" + +server config +virtual host +directory +.htaccess + + +Available in version 2.0.30 and later. + + +

This directive changes the format in which date strings are displayed + when echoing DATE environment variables. The formatstring + is as in strftime(3) from the C standard library.

+ +

This directive has the same effect as the <--#config + timefmt=formatstring --> element.

+
+
+ + +XBitHack +XBitHack on|off|full +XBitHack off + +server config +virtual host +directory +.htaccess + +Options + +Parse SSI directives in files with the execute +bit set + + +

The XBitHack directives controls the parsing of ordinary + html documents. This directive only affects files associated + with the MIME type text/html. XBitHack can take on + the following values:

+ +
+
off
+ +
No special treatment of executable files.
+ +
on
+ +
Any text/html file that has the user-execute bit set will + be treated as a server-parsed html document.
+ +
full
+ +
+ As for on but also test the group-execute bit. + If it is set, then set the Last-modified date of the + returned file to be the last modified time of the file. If + it is not set, then no last-modified date is sent. Setting + this bit allows clients and proxies to cache the result of + the request. + +

Note: you would not want to use the full + option, unless you assure the group-execute bit is unset for + every SSI script which might #include a CGI + or otherwise produces different output on each hit (or could + potentially change on subsequent requests).

+
+
+ +
+
+ +
+ diff --git a/docs/manual/mod/mod_info.xml b/docs/manual/mod/mod_info.xml new file mode 100644 index 00000000000..c086a891f0b --- /dev/null +++ b/docs/manual/mod/mod_info.xml @@ -0,0 +1,79 @@ + + + + +mod_info +Extension +This module provides a comprehensive overview of the server +configuration including all installed modules and directives in the +configuration files. +info_module +mod_info.c +Available in Apache 1.1 and later + + + + +

Using mod_info

+ +

To configure it, add the following to your + httpd.conf file.

+ + +<Location /server-info>
+SetHandler server-info
+</Location>
+
+ + You may wish to add a + <Limit> + clause inside the + <location> + directive to limit access to your server configuration + information. + +

Once configured, the server information is obtained by + accessing http://your.host.dom/server-info

+ + + Note that the configuration files are read by the + module at run-time, and therefore the display may + not reflect the running server's active + configuration if the files have been changed since the server + was last reloaded. Also, the configuration files must be + readable by the user as which the server is running (see the + User directive), or + else the directive settings will not be listed. + +

It should also be noted that if + mod_info is compiled into the server, its + handler capability is available in all configuration + files, including per-directory files (e.g., + .htaccess). This may have security-related + ramifications for your site.

+
+
+ + +AddModuleInfo +Allows additional information to be added to the module +information displayed by the server-info handler +AddModuleInfo module-name string +none +server config virtual +host +Apache 1.3 and above + + +

This allows the content of string to be shown as + HTML interpreted, Additional Information for + the module module-name. Example:

+ + +AddModuleInfo mod_auth.c 'See <A HREF="http://www.apache.org/docs/mod/mod_auth.html">http://www.apache.org/docs/mod/mod_auth.html</A>' + +
+ +
+
+ diff --git a/docs/manual/mod/mod_isapi.xml b/docs/manual/mod/mod_isapi.xml new file mode 100644 index 00000000000..c64cbd0b188 --- /dev/null +++ b/docs/manual/mod/mod_isapi.xml @@ -0,0 +1,271 @@ + + + + + +mod_isapi +ISAPI Extensions within Apache for Windows +Base +mod_isapi.c +isapi_module +Win32 only + + +

This module implements the Internet Server extension API. It + allows Internet Server extensions (e.g. ISAPI .dll + modules) to be served by Apache for Windows, subject to the + noted restrictions.

+ +

ISAPI extension modules (.dll files) are written by third + parties. The Apache Group does not author these modules, so we + provide no support for them. Please contact the ISAPI's author + directly if you are experiencing problems running their ISAPI + extention. Please do not post such problems to + Apache's lists or bug reporting pages.

+
+ +
Usage

In the server configuration file, use +the AddHandler directive to +associate ISAPI files with the isapi-isa handler, and map +it to the with their file extensions. To enable any .dll file to be +processed as an ISAPI extention, edit the httpd.conf file and add the +following line:

+ + AddHandler isapi-isa .dll + + +

There is no capability within the Apache server to leave a + requested module loaded. However, you may preload and keep a + specific module loaded by using the following syntax in your + httpd.conf:

+ + ISAPICacheFile c:/WebWork/Scripts/ISAPI/mytest.dll + + +

Whether or not you have preloaded an ISAPI extension, all + ISAPI extensions are governed by the same permissions and + restrictions as CGI scripts. That is, Options + ExecCGI must be set for the directory that contains the + ISAPI .dll file.

+ +

Review the Additional Notes and the Programmer's Journal for additional details + and clarification of the specific ISAPI support offered by + mod_isapi.

+
+ +
Additional Notes + +

Apache's ISAPI implementation conforms to all of the ISAPI + 2.0 specification, except for some "Microsoft-specific" + extensions dealing with asynchronous I/O. Apache's I/O model + does not allow asynchronous reading and writing in a manner + that the ISAPI could access. If an ISA tries to access + unsupported features, including async I/O, a message is placed + in the error log to help with debugging. Since these messages + can become a flood, the directive ISAPILogNotSupported + Off exists to quiet this noise.

+ +

Some servers, like Microsoft IIS, load the ISAPI extension + into the server and keep it loaded until memory usage is too + high, or unless configuration options are specified. Apache + currently loads and unloads the ISAPI extension each time it is + requested, unless the ISAPICacheFile directive is specified. + This is inefficient, but Apache's memory model makes this the + most effective method. Many ISAPI modules are subtly + incompatible with the Apache server, and unloading these + modules helps to ensure the stability of the server.

+ +

Also, remember that while Apache supports ISAPI Extensions, + it does not support ISAPI Filters. Support for + filters may be added at a later date, but no support is planned + at this time.

+
+ +
Programmer's Journal + +

If you are programming Apache 2.0 mod_isapi + modules, you must limit your calls to ServerSupportFunction to the + following directives:

+ +
+
HSE_REQ_SEND_URL_REDIRECT_RESP
+ +
Redirect the user to another location.
+ This must be a fully qualified URL (e.g. + http://server/location).
+ +
HSE_REQ_SEND_URL
+ +
Redirect the user to another location.
+ This cannot be a fully qualified URL, you are not allowed to + pass the protocol or a server name (e.g. simply + /location).
+ This redirection is handled by the server, not the + browser.
+ Warning: in their recent documentation, + Microsoft appears to have abandoned the distinction between + the two HSE_REQ_SEND_URL functions. Apache continues to treat + them as two distinct functions with different requirements + and behaviors.
+ +
HSE_REQ_SEND_RESPONSE_HEADER
+ +
Apache accepts a response body following the header if it + follows the blank line (two consecutive newlines) in the + headers string argument. This body cannot contain NULLs, + since the headers argument is NULL terminated.
+ +
HSE_REQ_DONE_WITH_SESSION
+ +
Apache considers this a no-op, since the session will be + finished when the ISAPI returns from processing.
+ +
HSE_REQ_MAP_URL_TO_PATH
+ +
Apache will translate a virtual name to a physical + name.
+ +
HSE_APPEND_LOG_PARAMETER
+ +
+ This logged message may be captured in any of the following + logs: + +
    +
  • in the \"%{isapi-parameter}n\" component in a + CustomLog directive
  • + +
  • in the %q log component with the + ISAPIAppendLogToQuery On directive
  • + +
  • in the error log with the ISAPIAppendLogToErrors On + directive
  • +
+ The first option, the %{isapi-parameter}n component, is + always available and prefered. +
+ +
HSE_REQ_IS_KEEP_CONN
+ +
Will return the negotiated Keep-Alive status.
+ +
HSE_REQ_SEND_RESPONSE_HEADER_EX
+ +
Will behave as documented, although the fKeepConn flag is + ignored.
+ +
HSE_REQ_IS_CONNECTED
+ +
Will report false if the request has been aborted.
+
+ +

Apache returns FALSE to any unsupported call to + ServerSupportFunction, and sets the GetLastError value to + ERROR_INVALID_PARAMETER.

+ +

ReadClient retrieves the request body exceeding the initial + buffer (defined by ISAPIReadAheadBuffer). Based on the + ISAPIReadAheadBuffer setting (number of bytes to buffer prior + to calling the ISAPI handler) shorter requests are sent + complete to the extension when it is invoked. If the request is + longer, the ISAPI extension must use ReadClient to retrieve the + remaining request body.

+ +

WriteClient is supported, but only with the HSE_IO_SYNC flag + or no option flag (value of 0). Any other WriteClient request + will be rejected with a return value of FALSE, and a + GetLastError value of ERROR_INVALID_PARAMETER.

+ +

GetServerVariable is supported, although extended server + variables do not exist (as defined by other servers.) All the + usual Apache CGI environment variables are available from + GetServerVariable, as well as the ALL_HTTP and ALL_RAW + values.

+ +

Apache 2.0 mod_isapi supports additional + features introduced in later versions of the ISAPI specification, + as well as limited emulation of async I/O and the TransmitFile + semantics. Apache also supports preloading ISAPI .dlls for + performance, neither of which were not available under Apache 1.3 + mod_isapi.

+
+ + +ISAPIFileChache +ISAPI .dll files to be loaded at startup +ISAPIFileCache file-path [file-path] ... +server config + + +

Specifies a space-separated list of file names to be loaded + when the Apache server is launched, and remain loaded until the + server is shut down. This directive may be repeated for every + ISAPI .dll file desired. The full path name of each file should + be specified.

+
+
+ + +ISAPIReadAheadBuffer +Size of the Read Ahead Buffer sent to ISAPI +extensions +ISAPIReadAheadBuffer size +ISAPIReadAheadBuffer 49152 +server config + + +

Defines the maximum size of the Read Ahead Buffer sent to + ISAPI extensions when they are initially invoked. All remaining + data must be retrieved using the ReadClient callback; some + ISAPI extensions may not support the ReadClient function. Refer + questions to the ISAPI extension's author.

+
+
+ + +ISAPILogNotSupported +Log unsupported feature requests from ISAPI +extensions +ISAPILogNotSupported on|off +ISAPILogNotSupported on +server config + + +

Logs all requests for unsupported features from ISAPI + extensions in the server error log. While this should be turned + off once all desired ISAPI modules are functioning, it defaults + to on to help administrators track down problems.

+
+
+ + +ISAPIAppendLogToErrors +Record HSE_APPEND_LOG_PARAMETER requests from ISAPI +extensions to the error log +ISAPIAppendLogToErrors on|off +ISAPIAppendLogToErrors off +server config + + +

Record HSE_APPEND_LOG_PARAMETER requests from ISAPI + extensions to the server error log.

+
+
+ + +ISAPIAppendLogToQuery +Record HSE_APPEND_LOG_PARAMETER requests from ISAPI +extensions to the query field +ISAPIAppendLogToQuery on|off +ISAPIAppendLogToQuery off +server config + + +

Record HSE_APPEND_LOG_PARAMETER requests from ISAPI + extensions to the query field (appended to the CustomLog %q + component).

+
+
+ +
\ No newline at end of file diff --git a/docs/manual/mod/mod_log_config.xml b/docs/manual/mod/mod_log_config.xml new file mode 100644 index 00000000000..b3c3809a1ad --- /dev/null +++ b/docs/manual/mod/mod_log_config.xml @@ -0,0 +1,389 @@ + + + + +mod_log_config +Base +log_config_module + + +This module provides for logging of the requests +made to the server, using the Common Log Format or a +user-specified format. + + + +

This module provides for flexible logging of client + requests. Logs are written in a customizable format, and may be + written directly to a file, or to an external program. + Conditional logging is provided so that individual requests may + be included or excluded from the logs based on characteristics + of the request.

+ +

Three directives are provided by this module: + TransferLog to create a log file, + LogFormat to set a custom format, and + CustomLog to define a log file and format in one + step. The TransferLog and CustomLog + directives can be used multiple times in each server to cause + each request to be logged to multiple files.

+ +See also: +Apache Log Files. + +
+Custom Log Formats + +

The format argument to the LogFormat and + CustomLog directives is a string. This string is + logged to the log file for each request. It can contain literal + characters copied into the log files and the c-type control + characters "\n" and "\t" to represent new-lines and tabs. + Literal quotes and back-slashes should be escaped with + back-slashes.

+ +

The characteristics of the request itself are logged by + placing "%" directives in the format string, which are replaced + in the log file by the values as follows:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
%...a:Remote IP-address
%...A:Local IP-address
%...B:Bytes sent, excluding HTTP headers.
%...b:Bytes sent, excluding HTTP headers. In CLF format +i.e. a '-' rather than a 0 when no bytes are sent.
%...{Foobar}C:The contents of cookie "Foobar" in the request sent to the server.
%...D:The time taken to serve the request, in microseconds.
%...{FOOBAR}e:The contents of the environment variable FOOBAR
%...f:Filename
%...h:Remote host
%...HThe request protocol
%...{Foobar}i:The contents of Foobar: header line(s) in the request +sent to the server.
%...l:Remote logname (from identd, if supplied)
%...m:The request method
%...{Foobar}n:The contents of note "Foobar" from another module.
%...{Foobar}o:The contents of Foobar: header line(s) in the reply.
%...p:The canonical Port of the server serving the request
%...P:The process ID of the child that serviced the request.
%...q:The query string (prepended with a ? if a query string exists, +otherwise an empty string)
%...r:First line of request
%...s:Status. For requests that got internally redirected, this is +the status of the *original* request --- %...>s for the last.
%...t:Time, in common log format time format (standard english format)
%...{format}t:The time, in the form given by format, which should +be in strftime(3) format. (potentially localized)
%...T:The time taken to serve the request, in seconds.
%...u:Remote user (from auth; may be bogus if return status (%s) is 401)
%...U:The URL path requested, not including any query string.
%...v:The canonical ServerName of the server serving the request.
%...V:The server name according to the UseCanonicalName setting.
%...X:Connection status when response is completed. + +'X' = connection aborted before the response completed.
+'+' = connection may be kept alive after the response is sent.
+'-' = connection will be closed after the response is sent. +
+(This directive was %...c in late versions of Apache 1.3, but +this conflicted with the historical ssl %...{var}c syntax.)
+ +

The "..." can be nothing at all (e.g., "%h %u + %r %s %b"), or it can indicate conditions for inclusion + of the item (which will cause it to be replaced with "-" if the + condition is not met). The forms of condition are a list of + HTTP status codes, which may or may not be preceded by "!". + Thus, "%400,501{User-agent}i" logs User-agent: on 400 errors + and 501 errors (Bad Request, Not Implemented) only; + "%!200,304,302{Referer}i" logs Referer: on all requests which + did not return some sort of normal status.

+ +

Note that there is no escaping performed on the strings from + %...r, %...i and %...o. This is mainly to comply with the + requirements of the Common Log Format. This implies that + clients can insert control characters into the log, so care + should be taken when dealing with raw log files.

+ +

Some commonly used log format strings are:

+ +
+
Common Log Format (CLF)
+ +
"%h %l %u %t \"%r\" %>s %b"
+ +
Common Log Format with Virtual Host
+ +
"%v %h %l %u %t \"%r\" %>s %b"
+ +
NCSA extended/combined log format
+ +
"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" + \"%{User-agent}i\""
+ +
Referer log format
+ +
"%{Referer}i -> %U"
+ +
Agent (Browser) log format
+ +
"%{User-agent}i"
+
+ +

Note that the canonical ServerName and Listen of the server serving the + request are used for %v and %p + respectively. This happens regardless of the UseCanonicalName setting + because otherwise log analysis programs would have to duplicate + the entire vhost matching algorithm in order to decide what + host really served the request.

+
+ +
+ + Security Considerations + +

See the security tips + document for details on why your security could be compromised + if the directory where logfiles are stored is writable by + anyone other than the user that starts the server.

+ +
+ +
+ + +CookieLog +Sets filename for the logging of cookies +CookieLog filename +none +server configvirtual +host +Only available in Apache 1.2 and above + + + +

The CookieLog directive sets the + filename for logging of cookies. The filename is relative to the + serverroot. This directive is + included only for compatibility with mod_cookies, + and is deprecated.

+
+ +
+ + +CustomLog +Sets filename and format of log file +CustomLog + file|pipe format|nickname + [env=[!]environment-variable] +none +server configvirtual +host +Nickname only available in Apache 1.3 or later. +Conditional logging available in 1.3.5 or later. + + + +

The CustomLog directive is used to + log requests to the server. A log format is specified, and the + logging can optionally be made conditional on request + characteristics using environment variables.

+ +

The first argument, which specifies the location to which + the logs will be written, can take on one of the following two + types of values:

+ +
+
file
+ +
A filename, relative to the ServerRoot.
+ +
pipe
+ +
The pipe character "|", followed by the path + to a program to receive the log information on its standard + input. Security: if a program is used, then + it will be run under the user who started httpd. This will be + root if the server was started by root; be sure that the + program is secure.
+
+ +

The second argument specifies what will be written to the + log file. It can specify either a nickname defined by + a previous LogFormat directive, or it + can be an explicit format string as described in the + log formats section.

+ +

For example, the following two sets of directives have + exactly the same effect:

+ + + # CustomLog with format nickname
+ LogFormat "%h %l %u %t \"%r\" %>s %b" common
+ CustomLog logs/access_log common
+
+ # CustomLog with explicit format string
+ CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b"
+
+ +

The third argument is optional and allows the decision on + whether or not to log a particular request to be based on the + presence or absence of a particular variable in the server + environment. If the specified environment + variable is set for the request (or is not set, in the case + of a 'env=!name' clause), then the + request will be logged.

+ +

Environment variables can be set on a per-request + basis using the mod_setenvif + and/or mod_rewrite modules. For + example, if you don't want to record requests for all GIF + images on your server in a separate logfile but not your main + log, you can use:

+ + + SetEnvIf Request_URI \.gif$ gif-image
+ CustomLog gif-requests.log common env=gif-image
+ CustomLog nongif-requests.log common env=!gif-image +
+
+ +
+ + +LogFormat +Describes a format for use in a log file +LogFormat + format|nickname [nickname] +none +server configvirtual +host +Nickname only available in Apache 1.3 or later. + + + +

This directive specifies the format of the access log + file.

+ +

The LogFormat directive can take one of two + forms. In the first form, where only one argument is specified, + this directive sets the log format which will be used by logs + specified in subsequent TransferLog + directives. The single argument can specify an explicit + format as discussed in custom log + formats section above. Alternatively, it can use a + nickname to refer to a log format defined in a + previous LogFormat directive as described + below.

+ +

The second form of the LogFormat + directive associates an explicit format with a + nickname. This nickname can then be used in + subsequent LogFormat or + CustomLog directives rather than + repeating the entire format string. A + LogFormat + directive which defines a nickname does nothing + else -- that is, it only defines the + nickname, it doesn't actually apply the format and make it the + default. Therefore, it will not affect subsequent + TransferLog directives.

+ +
+
+ + + +TransferLog +Specifly location of a log file +TransferLog file|pipe +none +server configvirtual +host + + + + +

This directive has exactly the same arguments and effect as + the CustomLog directive, with the + exception that it does not allow the log format to be specified + explicitly or for conditional logging of requests. Instead, the + log format is determined by the most recently specified + specified LogFormat directive (which + does not define a nickname). Common Log Format is used if no + other format has been specified.

+ +

Example:

+ + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
+ TransferLog logs/access_log +
+ +
+ +
+ +
diff --git a/docs/manual/mod/mod_mime.xml b/docs/manual/mod/mod_mime.xml new file mode 100644 index 00000000000..77bf64b267b --- /dev/null +++ b/docs/manual/mod/mod_mime.xml @@ -0,0 +1,922 @@ + + + + + +mod_mime +This module associates the request filename's extensions + (e.g. .html) with the file's behavior (handlers and filters) + and content (mime-type, language, character set and + encoding.) + +mod_mime.c +mime_module +Base + + +

This module is used to associate various bits of "meta + information" with files by their filename extensions. This + information relates the filename of the document to it's + mime-type, language, character set and encoding. This + information is sent to the browser, and participates in content + negotiation, so the user's preferences are respected when + choosing one of several possible files to serve. See + mod_negotiation for more information + about content negotiation.

+ +

The directives AddCharset, + AddEncoding, + AddLanguage and + AddType all used to map file extensions + onto the meta-information for that file. Respectively they set + the character set, content-encoding, content-language, and + MIME-type (content-type) of documents.

+ +

In addition, mod_mime may define the "handler" for a + document, which controls which module or script will serve the + document. With the introduction of "filters" in Apache 2.0, + mod_mime can also define the filters that the the content + should be processed through (e.g. the Includes output filter + for server side scripting) and what filters the client request + and POST content should be processed through (the input + filters.)

+ +

The directives AddHandler, + AddOutputFilter, and + AddInputFilter control the modules + or scripts that serve the document. The + MultiviewsMatch directive allows + mod_negotiation to consider these + file extensions to included when testing Multiviews matches.

+ +

The directive TypesConfig is used + to specify a file which also maps extensions onto MIME types. + Most administrators use the provided mime.types file which + associates common filename extensions with IANA registered + content types. The current list is maintained at + http://www.isi.edu/in-notes/iana/assignments/media-types/media-types + although it may be mirrored elsewhere). This simplifies the + httpd.conf file by providing the majority of media-type + definitions, and they may be overridden by + AddType directives as needed.

+ + Please do not send requests to the Apache httpd Project + to add any new entries in the distributed mime.types file + unless (1) they are already registered with IANA, and (2) they + use widely accepted, non-conflicting filename extensions across + platforms. category/x-subtype requests will be automatically + rejected, as will any new two-letter extensions as they will + likely conflict later with the already crowded language and + character set namespace. + +

The core directives ForceType and + SetHandler are used to + associate all the files in a given container (e.g., + <location>, <directory>, or <Files>) with a + particular MIME-type or handler. These settings override any + filename extension mappings defined in mod_mime.

+ +

Note that changing the type or encoding of a file does not + change the value of the Last-Modified header. + Thus, previously cached copies may still be used by a client or + proxy, with the previous headers. If you change the + meta-information (language, content type, character set or + encoding) you may need to 'touch' affected files (updating + their last modified date) to ensure that all visitors are + receive the corrected content headers.

+
+ + See also: MimeMagicFile + +
+Files with Multiple Extensions + +

Files can have more than one extension, and the order of the + extensions is normally irrelevant. For example, if the + file welcome.html.fr maps onto content type + text/html and language French then the file welcome.fr.html + will map onto exactly the same information. If more than one + extension is given which maps onto the same + type of meta-information, then the one to the right will be + used. For example, if ".gif" maps to the MIME-type image/gif + and ".html" maps to the MIME-type text/html, then the file + welcome.gif.html will be associated with the + MIME-type "text/html".

+ +

Care should be taken when a file with multiple extensions + gets associated with both a MIME-type and a handler. This will + usually result in the request being by the module associated + with the handler. For example, if the .imap + extension is mapped to the handler "imap-file" (from mod_imap) + and the .html extension is mapped to the MIME-type + "text/html", then the file world.imap.html will be + associated with both the "imap-file" handler and "text/html" + MIME-type. When it is processed, the "imap-file" handler will + be used, and so it will be treated as a mod_imap imagemap + file.

+
+ +
Content encoding + +

A file of a particular MIME type can additionally be encoded a + particular way to simplify transmission over the Internet. + While this usually will refer to compression, such as + gzip, it can also refer to encryption, such a + pgp or to an encoding such as UUencoding, which is + designed for transmitting a binary file in an ASCII (text) + format.

+ +

The MIME RFC puts it this way:

+ + + The Content-Encoding entity-header field is used as a + modifier to the media-type. When present, its value indicates + what additional content coding has been applied to the + resource, and thus what decoding mechanism must be applied in + order to obtain the media-type referenced by the Content-Type + header field. The Content-Encoding is primarily used to allow + a document to be compressed without losing the identity of + its underlying media type. + + +

By using more than one file extension (see section above about multiple file + extensions), you can indicate that a file is of a + particular type, and also has a particular + encoding.

+ +

For example, you may have a file which is a Microsoft Word + document, which is pkzipped to reduce its size. If the + .doc extension is associated with the Microsoft + Word file type, and the .zip extension is + associated with the pkzip file encoding, then the file + Resume.doc.zipwould be known to be a pkzip'ed Word + document.

+ +

Apache send a Content-encoding header with the + resource, in order to tell the client browser about the + encoding method.

+ + Content-encoding: pkzip + +
+ +
+ +Character sets and languages + +

In addition to file type and the file encoding, + another important piece of information is what language a + particular document is in, and in what character set the file + should be displayed. For example, the document might be written + in the Vietnamese alphabet, or in Cyrillic, and should be + displayed as such. This information, also, is transmitted in + HTTP headers.

+ +

The character set, language encoding and mime type are all + used in the process of content negotiation (See + mod_negotiation) to determine + which document to give to the client, when there are + alternative documents in more than one character set, language, + encoding or mime type. All filename extensions associations + created with AddCharset, AddEncoding, + AddLanguage and AddType directives + (and extensions listed in the MimeMagicFile) + participate in this select process. Filename extensions that + are only associated using the AddHandler, + AddInputFilter or AddOutputFilter + directives may be included or excluded from matching by using + the MultiviewsMatch directive.

+ +
+Charset + +

To convey this further information, Apache optionally sends + a Content-Language header, to specify the language + that the document is in, and can append additional information + onto the Content-Type header to indicate the + particular character set that should be used to correctly + render the information.

+ + +Content-Language: en, fr
+Content-Type: text/plain; charset=ISO-8859-2 +
+ +

The language specification is the two-letter abbreviation + for the language. The charset is the name of the + particular character set which should be used.

+
+
+ + + +AddCharset +AddCharset charset extension +[extension] ... +None + +server config +virtual host +directory +.htaccess + +FileInfo +AddCharset is only available in Apache +1.3.10 and later +Maps the given filename extensions + to the specified content charset + + + +

The AddCharset directive maps the given filename extensions + to the specified content charset. charset is the MIME + charset parameter of filenames containing extension. + This mapping is added to any already in force, overriding any + mappings that already exist for the same extension.

+ +

Example:

+ + AddLanguage ja .ja
+ AddCharset EUC-JP .euc
+ AddCharset ISO-2022-JP .jis
+ AddCharset SHIFT_JIS .sjis +
+ +

Then the document xxxx.ja.jis will be treated + as being a Japanese document whose charset is ISO-2022-JP (as + will the document xxxx.jis.ja). The AddCharset + directive is useful for both to inform the client about the + character encoding of the document so that the document can be + interpreted and displayed appropriately, and for content negotiation, + where the server returns one from several documents based on + the client's charset preference.

+ +

The extension argument is case-insensitive, and can + be specified with or without a leading dot.

+ + See also: + mod_negotiation + +
+ +
+ + +AddEncoding +AddEncoding + MIME-enc extension [extension] ... +None + +server config +virtual host +directory +.htaccess +FileInfo + +Maps the given filename extensions + to the specified encoding type + + + +

The AddEncoding directive maps the given filename extensions + to the specified encoding type. MIME-enc is the MIME + encoding to use for documents containing the + extension. This mapping is added to any already in + force, overriding any mappings that already exist for the same + extension. Example:

+ + + AddEncoding x-gzip .gz
+ AddEncoding x-compress .Z +
+ +

This will cause filenames containing the .gz extension to be + marked as encoded using the x-gzip encoding, and filenames + containing the .Z extension to be marked as encoded with + x-compress.

+ +

Old clients expect x-gzip and + x-compress, however the standard dictates that + they're equivalent to gzip and + compress respectively. Apache does content + encoding comparisons by ignoring any leading x-. + When responding with an encoding Apache will use whatever form + (i.e., x-foo or foo) the + client requested. If the client didn't specifically request a + particular form Apache will use the form given by the + AddEncoding directive. To make this long story + short, you should always use x-gzip and + x-compress for these two specific encodings. More + recent encodings, such as deflate should be + specified without the x-.

+ +

The extension argument is case-insensitive, and can + be specified with or without a leading dot.

+ + See also: Files with + multiple extensions +
+
+ + +AddHandler +AddHandler + handler-name extension [extension] ... +None + +server config +virtual host +directory +.htaccess + +FileInfo + +AddHandler maps the filename extensions extension +to the handler handler-name. + + + +

This mapping is added to any already in + force, overriding any mappings that already exist for the same + extension. For example, to activate CGI scripts with + the file extension ".cgi", you might use:

+ + + AddHandler cgi-script .cgi + + +

Once that has been put into your srm.conf or httpd.conf + file, any file containing the ".cgi" extension + will be treated as a CGI program.

+ +

The extension argument is case-insensitive, and can + be specified with or without a leading dot.

+ + See also: Files with + multiple extensions +
+
+ + +AddInputFilter +AddInputFilter + filter[;filter...] extension + [extension ...] +None + +server config +virtual host +directory +.htaccess + +AddInputFilter + is only available in Apache 2.0.26 and later. +Maps the filename extensions + extension to the filter or filters which will process + client requests and POST input when they are received by the + server. + + + +

AddInputFilter maps the filename extensions + extension to the filter or filters which will process + client requests and POST input when they are received by the + server. This is in addition to any filters defined elsewhere, + including the SetInputFilter directive. + This mapping is merged over any already in force, overriding + any mappings that already exist for the same + extension.

+ +

If more than one filter is specified, they must be separated + by semicolons in the order in which they should process the + content. Both the filter and extension arguments are + case-insensitive, and the extension may be specified with or + without a leading dot.

+ + See also the Filters + documentation. +
+ +
+ + + +AddLanguage +AddLanguage + MIME-lang extension [extension] ... +None + +server config +virtual host +directory +.htaccess + +FileInfo +maps the given filename extension +to the specified content language. + + + +

The AddLanguage directive maps the given filename extension + to the specified content language. MIME-lang is the + MIME language of filenames containing extension. This + mapping is added to any already in force, overriding any + mappings that already exist for the same + extension.

+ +

Example:

+ + + AddEncoding x-compress .Z
+ AddLanguage en .en
+ AddLanguage fr .fr +
+ +

Then the document xxxx.en.Z will be treated as + being a compressed English document (as will the document + xxxx.Z.en). Although the content language is + reported to the client, the browser is unlikely to use this + information. The AddLanguage directive is more useful for content negotiation, + where the server returns one from several documents based on + the client's language preference.

+ +

If multiple language assignments are made for the same + extension, the last one encountered is the one that is used. + That is, for the case of:

+ + + AddLanguage en .en
+ AddLanguage en-uk .en
+ AddLanguage en-us .en +
+ +

documents with the extension ".en" would be + treated as being "en-us".

+ +

The extension argument is case-insensitive, and can + be specified with or without a leading dot.

+ + See also: Files with + multiple extensions, mod_negotiation +
+
+ + +AddOutputFilter +AddOutputFilter + filter[;filter...] extension + [extension ...] +None + +server config +virtual host +directory +.htaccess + + +AddOutputFilter + is only available in Apache 2.0.26 and later. +maps the filename +extensions extension to the filters which will process +responses from the server before they are sent to the +client. + + + +

The AddOutputFilter directive maps the filename + extensions extension to the filters which will process + responses from the server before they are sent to the client. + This is in addition to any filters defined elsewhere, including + the SetOutputFilter + directive. This mapping is merged over any already in force, + overriding any mappings that already exist for the same + extension.

+ +

For example, the following configuration will process all + .shtml files for server-side includes.

+ + + +   AddOutputFilter INCLUDES shtml + + +

If more than one filter is specified, they must be separated + by semicolons in the order in which they should process the + content. Both the filter and extension arguments are + case-insensitive, and the extension may be specified with or + without a leading dot.

+ + See also the Filters + documentation. + +
+
+ + +AddType +AddType MIME-type + extension [extension] ... +None + +server config +virtual host +directory +.htaccess + +FileInfo +maps the given filename extensions +onto the specified content type. + + + +

The AddType directive maps the given filename extensions + onto the specified content type. MIME-type is the MIME + type to use for filenames containing extension. This + mapping is added to any already in force, overriding any + mappings that already exist for the same extension. + This directive can be used to add mappings not listed in the + MIME types file (see the TypesConfig + directive).

+ +

Example:

+ + + AddType image/gif .gif + + + It is recommended that new MIME types be added using the + AddType directive rather than changing the + TypesConfig file. + + Note that, unlike the NCSA httpd, this directive cannot be + used to set the type of particular files. + +

The extension argument is case-insensitive, and can + be specified with or without a leading dot.

+ + See also: Files with + multiple extensions +
+
+ + +MultiviewsMatch +MultiviewsMatch + [NegotiatedOnly] [Handlers] [Filters] [Any] +None + +server config +virtual host +directory +.htaccess + +FileInfo +only available + in Apache 2.0.26 and later. + + + +

MultiviewsMatch permits three different behaviors for + mod_negotiation's Multiviews + feature. Multiviews allows a request for a file, e.g. index.html, + to match any negotiated extensions following the base request, + e.g. index.html.en, index.html,fr, or index.html.gz.

+ +

The NegotiatedOnly option provides that every extension following + the base name must correlate to a recognized mod_mime extension for + content negotation, e.g. Charset, Content-Type, Language, or + Encoding. This is the strictest implementation with the fewest + unexpected side effects, and is the default behavior.

+ +

To include extensions associated with Handlers and/or Filters, + set the MultiviewsMatch directive to either Handlers, Filters, or + both option keywords. If all other factors are equal, the smallest + file will be served, e.g. in deciding between index.html.cgi of 500 + characters and index.html.pl of 1000 bytes, the .cgi file would win + in this example. Users of .asis files might prefer to use the + Handler option, if .asis files are associated with the asis-handler.

+ +

You may finally allow Any extensions to match, even if mod_mime + doesn't recognize the extension. This was the behavior in Apache 1.3, + and can cause unpredicatable results, such as serving .old or .bak + files the webmaster never expected to be served.

+
+
+ + +DefaultLanguage +DefaultLanguage + MIME-lang +None + +server config +virtual host +directory +.htaccess + +FileInfo +DefaultLanguage + is only available in Apache 1.3.4 and later. +Sets all files in the given scope to the +specified language + + + +

The DefaultLanguage directive tells Apache that all files in + the directive's scope (e.g., all files covered by the + current <Directory> container) that don't + have an explicit language extension (such as .fr + or .de as configured by AddLanguage) + should be considered to be in the specified MIME-lang + language. This allows entire directories to be marked as + containing Dutch content, for instance, without having to + rename each file. Note that unlike using extensions to specify + languages, DefaultLanguage can only specify a + single language.

+ +

If no DefaultLanguage directive is in force, + and a file does not have any language extensions as configured + by AddLanguage, then that file will be considered + to have no language attribute.

+ + See also: Files with + multiple extensions, mod_negotiation +
+
+ + + +RemoveCharset +RemoveCharset + extension [extension] ... +None + +directory +.htaccess + +RemoveCharset is + only available in Apache 2.0.24 and later. + + +

The RemoveCharset directive removes any + character set associations for files with the given extensions. + This allows .htaccess files in subdirectories to + undo any associations inherited from parent directories or the + server config files.

+ +

The extension argument is case-insensitive, and can + be specified with or without a leading dot.

+
+
+ + +RemoveEncoding +RemoveEncoding + extension [extension] ... +None + +directory +.htaccess + +RemoveEncoding + is only available in Apache 1.3.13 and later. + + + +

The RemoveEncoding directive removes any + encoding associations for files with the given extensions. This + allows .htaccess files in subdirectories to undo + any associations inherited from parent directories or the + server config files. An example of its use might be:

+ + + +
+
/foo/.htaccess:
+
AddEncoding x-gzip .gz
+ AddType text/plain .asc
+ <Files *.gz.asc>
+     RemoveEncoding + .gz
+ </Files>
+
+
+ +

This will cause foo.gz to be marked as being + encoded with the gzip method, but foo.gz.asc as an + unencoded plaintext file.

+ +

Note:RemoveEncoding directives are processed + after any AddEncoding directives, so it is possible they + may undo the effects of the latter if both occur within the + same directory configuration.

+ +

The extension argument is case-insensitive, and can + be specified with or without a leading dot.

+
+
+ + + +RemoveHandler +RemoveHandler + extension [extension] ... +None + +directory +.htaccess + +RemoveHandler is + only available in Apache 1.3.4 and later. + + + +

The RemoveHandler directive removes any handler + associations for files with the given extensions. This allows + .htaccess files in subdirectories to undo any + associations inherited from parent directories or the server + config files. An example of its use might be:

+ + +
+
/foo/.htaccess:
+ +
AddHandler server-parsed .html
+ +
/foo/bar/.htaccess:
+ +
RemoveHandler .html
+
+
+ +

This has the effect of returning .html files in + the /foo/bar directory to being treated as normal + files, rather than as candidates for parsing (see the mod_include + module).

+ +

The extension argument is case-insensitive, and can + be specified with or without a leading dot.

+
+
+ + + +RemoveInputFilter +RemoveInputFilter + extension [extension] ... +None + +directory +.htaccess + +RemoveInputFilter is only available in Apache +2.0.26 and later. + + + +

The RemoveInputFilter directive removes any + input filter associations for files with the given extensions. + This allows .htaccess files in subdirectories to + undo any associations inherited from parent directories or the + server config files.

+ +

The extension argument is case-insensitive, and can + be specified with or without a leading dot.

+
+
+ + +RemoveLanguage +RemoveLanguage + extension [extension] ... +None + +directory +.htaccess + +RemoveLanguage + is only available in Apache 2.0.24 and later. + + + + +

The RemoveLanguage directive removes any + language associations for files with the given extensions. This + allows .htaccess files in subdirectories to undo + any associations inherited from parent directories or the + server config files.

+ +

The extension argument is case-insensitive, and can + be specified with or without a leading dot.

+
+
+ + +RemoveOutputFilter +RemoveOutputFilter + extension [extension] ... + + +directory +.htaccess + + +RemoveOutputFilter is only available in Apache +2.0.26 and later. + + + +

The RemoveOutputFilter directive removes any + output filter associations for files with the given extensions. + This allows .htaccess files in subdirectories to + undo any associations inherited from parent directories or the + server config files.

+ +

The extension argument is case-insensitive, and can + be specified with or without a leading dot.

+
+
+ + + +RemoveType +RemoveType + extension [extension] ... + + +directory +.htaccess + + +RemoveType is + only available in Apache 1.3.13 and later. + + +

The RemoveType directive removes any MIME type + associations for files with the given extensions. This allows + .htaccess files in subdirectories to undo any + associations inherited from parent directories or the server + config files. An example of its use might be:

+ + +
+
/foo/.htaccess:
+ +
RemoveType .cgi
+
+
+ +

This will remove any special handling of .cgi + files in the /foo/ directory and any beneath it, + causing the files to be treated as being of the default type.

+ + Note:RemoveType directives are processed + after any AddType directives, so it is + possible they may undo the effects of the latter if both occur + within the same directory configuration. + +

The extension argument is case-insensitive, and can + be specified with or without a leading dot.

+
+
+ + + + +TypesConfig +TypesConfig file-path +TypesConfig conf/mime.types + +server config + + + + +

The TypesConfig directive sets the location of the MIME + types configuration file. Filename is relative to the + ServerRoot. This file sets + the default list of mappings from filename extensions to + content types; changing this file is not recommended. Use the + AddType directive instead. The file + contains lines in the format of the arguments to an AddType + command:

+ + + MIME-type extension extension ... + + +

+ The extensions are lower-cased. Blank lines, and lines + beginning with a hash character (`#') are ignored.

+
+
+
+ diff --git a/docs/manual/mod/mod_mime_magic.xml b/docs/manual/mod/mod_mime_magic.xml new file mode 100644 index 00000000000..18f22158d11 --- /dev/null +++ b/docs/manual/mod/mod_mime_magic.xml @@ -0,0 +1,304 @@ + + + + + +mod_mime_magic +Determines the MIME type of a file + by looking at a few bytes of its contents +Extension +mod_mime_magic.c +mime_magic_module + + +

This module determines the MIME type of files in the same + way the Unix file(1) command works: it looks at the first few + bytes of the file. It is intended as a "second line of defense" + for cases that mod_mime can't + resolve. To assure that mod_mime gets first try at determining + a file's MIME type, be sure to list mod_mime_magic + before mod_mime in the configuration.

+ +

This module is derived from a free version of the + file(1) command for Unix, which uses "magic + numbers" and other hints from a file's contents to figure out + what the contents are. This module is active only if the magic + file is specified by the MimeMagicFile directive.

+
+ +
Format of the Magic File + +

The contents of the file are plain ASCII text in 4-5 + columns. Blank lines are allowed but ignored. Commented lines + use a hash mark "#". The remaining lines are parsed for the + following columns:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ColumnDescription
1byte number to begin checking from
+ ">" indicates a dependency upon the previous non-">" + line
2 + type of data to match + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bytesingle character
shortmachine-order 16-bit integer
longmachine-order 32-bit integer
stringarbitrary-length string
datelong integer date (seconds since Unix + epoch/1970)
beshortbig-endian 16-bit integer
belongbig-endian 32-bit integer
bedatebig-endian 32-bit integer date
leshortlittle-endian 16-bit integer
lelonglittle-endian 32-bit integer
ledatelittle-endian 32-bit integer date
+
3contents of data to match
4MIME type if matched
5MIME encoding if matched (optional)
+ +

For example, the following magic file lines would recognize + some audio formats.

+ +
+# Sun/NeXT audio data
+0       string          .snd
+>12     belong          1               audio/basic
+>12     belong          2               audio/basic
+>12     belong          3               audio/basic
+>12     belong          4               audio/basic
+>12     belong          5               audio/basic
+>12     belong          6               audio/basic
+>12     belong          7               audio/basic
+>12     belong          23              audio/x-adpcm
+
+
+

Or these would recognize the difference between "*.doc" files + containing Microsoft Word or FrameMaker documents. (These are + incompatible file formats which use the same file suffix.)

+ +
+# Frame
+0       string          \<MakerFile     application/x-frame
+0       string          \<MIFFile       application/x-frame
+0       string          \<MakerDictionary       application/x-frame
+0       string          \<MakerScreenFon        application/x-frame
+0       string          \<MML           application/x-frame
+0       string          \<Book          application/x-frame
+0       string          \<Maker         application/x-frame
+
+# MS-Word
+0       string          \376\067\0\043                  application/msword
+0       string          \320\317\021\340\241\261        application/msword
+0       string          \333\245-\0\0\0                 application/msword
+
+
+

An optional MIME encoding can be included as a fifth column. + For example, this can recognize gzipped files and set the + encoding for them.

+ +
+# gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver)
+0       string          \037\213        application/octet-stream        x-gzip
+
+
+
+ +
Performance Issues +

This module is not for every system. If your system is barely + keeping up with its load or if you're performing a web server + benchmark, you may not want to enable this because the + processing is not free.

+ +

However, an effort was made to improve the performance of + the original file(1) code to make it fit in a busy web server. + It was designed for a server where there are thousands of users + who publish their own documents. This is probably very common + on intranets. Many times, it's helpful if the server can make + more intelligent decisions about a file's contents than the + file name allows ...even if just to reduce the "why doesn't my + page work" calls when users improperly name their own files. + You have to decide if the extra work suits your + environment.

+ +

When compiling an Apache server, this module should be at or + near the top of the list of modules in the Configuration file. + The modules are listed in increasing priority so that will mean + this one is used only as a last resort, just like it was + designed to.

+ +
+ +
Notes + +

The following notes apply to the mod_mime_magic module and are + included here for compliance with contributors' copyright + restrictions that require their acknowledgment.

+
+/*
+ * mod_mime_magic: MIME type lookup via file magic numbers
+ * Copyright (c) 1996-1997 Cisco Systems, Inc.
+ *
+ * This software was submitted by Cisco Systems to the Apache Group in July
+ * 1997.  Future revisions and derivatives of this source code must
+ * acknowledge Cisco Systems as the original contributor of this module.
+ * All other licensing and usage conditions are those of the Apache Group.
+ *
+ * Some of this code is derived from the free version of the file command
+ * originally posted to comp.sources.unix.  Copyright info for that program
+ * is included below as required.
+ * ---------------------------------------------------------------------------
+ * - Copyright (c) Ian F. Darwin, 1987. Written by Ian F. Darwin.
+ *
+ * This software is not subject to any license of the American Telephone and
+ * Telegraph Company or of the Regents of the University of California.
+ *
+ * Permission is granted to anyone to use this software for any purpose on any
+ * computer system, and to alter it and redistribute it freely, subject to
+ * the following restrictions:
+ *
+ * 1. The author is not responsible for the consequences of use of this
+ * software, no matter how awful, even if they arise from flaws in it.
+ *
+ * 2. The origin of this software must not be misrepresented, either by
+ * explicit claim or by omission.  Since few users ever read sources, credits
+ * must appear in the documentation.
+ *
+ * 3. Altered versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.  Since few users ever read
+ * sources, credits must appear in the documentation.
+ *
+ * 4. This notice may not be removed or altered.
+ * -------------------------------------------------------------------------
+ *
+ * For compliance with Mr Darwin's terms: this has been very significantly
+ * modified from the free "file" command.
+ * - all-in-one file for compilation convenience when moving from one
+ *   version of Apache to the next.
+ * - Memory allocation is done through the Apache API's pool structure.
+ * - All functions have had necessary Apache API request or server
+ *   structures passed to them where necessary to call other Apache API
+ *   routines.  (i.e., usually for logging, files, or memory allocation in
+ *   itself or a called function.)
+ * - struct magic has been converted from an array to a single-ended linked
+ *   list because it only grows one record at a time, it's only accessed
+ *   sequentially, and the Apache API has no equivalent of realloc().
+ * - Functions have been changed to get their parameters from the server
+ *   configuration instead of globals.  (It should be reentrant now but has
+ *   not been tested in a threaded environment.)
+ * - Places where it used to print results to stdout now saves them in a
+ *   list where they're used to set the MIME type in the Apache request
+ *   record.
+ * - Command-line flags have been removed since they will never be used here.
+ *
+ */
+
+
+ + +MimeMagicFile +Enable MIME-type determination based on file contents +using the specified magic file +MimeMagicFile file-path +server config +virtual host + + +

The MimeMagicFile directive can be used to + enable this module, the default file is distributed at + conf/magic. Non-rooted paths are relative to the + ServerRoot. Virtual hosts will use the same file as the main + server unless a more specific setting is used, in which case + the more specific setting overrides the main server's file.

+
+
+
+ diff --git a/docs/manual/mod/mod_negotiation.xml b/docs/manual/mod/mod_negotiation.xml new file mode 100644 index 00000000000..12904441a84 --- /dev/null +++ b/docs/manual/mod/mod_negotiation.xml @@ -0,0 +1,243 @@ + + + + + +mod_negotiation +Provides for content negotiation +Base +mod_negotiation.c +negotiation_module + + +

Content negotiation, or more accurately content selection, is + the selection of the document that best matches the clients + capabilities, from one of several available documents. There + are two implementations of this.

+ + +
+ +DefaultLangauge +AddEncoding +AddLanguage +AddType + +
Type maps +

A type map has the same format as RFC822 mail headers. It + contains document descriptions separated by blank lines, with + lines beginning with a hash character ('#') treated as + comments. A document description consists of several header + records; records may be continued on multiple lines if the + continuation lines start with spaces. The leading space will be + deleted and the lines concatenated. A header record consists of + a keyword name, which always ends in a colon, followed by a + value. Whitespace is allowed between the header name and value, + and between the tokens of value. The headers allowed are:

+ +
+
Content-Encoding:
+ +
The encoding of the file. Apache only recognizes + encodings that are defined by an AddEncoding directive. + This normally includes the encodings x-compress + for compress'd files, and x-gzip for gzip'd + files. The x- prefix is ignored for encoding + comparisons.
+ +
Content-Language:
+ +
The language of the variant, as an Internet standard + language tag (RFC 1766). An example is en, + meaning English.
+ +
Content-Length:
+ +
The length of the file, in bytes. If this header is not + present, then the actual length of the file is used.
+ +
Content-Type:
+ +
+ The MIME media type of the document, with optional + parameters. Parameters are separated from the media type + and from one another by a semi-colon, with a syntax of + name=value. Common parameters include: + +
+
level
+ +
an integer specifying the version of the media type. + For text/html this defaults to 2, otherwise + 0.
+ +
qs
+ +
a floating-point number with a value in the range 0.0 + to 1.0, indicating the relative 'quality' of this variant + compared to the other available variants, independent of + the client's capabilities. For example, a jpeg file is + usually of higher source quality than an ascii file if it + is attempting to represent a photograph. However, if the + resource being represented is ascii art, then an ascii + file would have a higher source quality than a jpeg file. + All qs values are therefore specific to a given + resource.
+
+ Example: + +
+ Content-Type: image/jpeg; qs=0.8 +
+
+ +
URI:
+ +
The path to the file containing this variant, relative to + the map file.
+
+
+ +
MultiViews + +

A MultiViews search is enabled by the MultiViews Options. If the server receives a + request for /some/dir/foo and + /some/dir/foo does not exist, then the + server reads the directory looking for all files named + foo.*, and effectively fakes up a type map which + names all those files, assigning them the same media types and + content-encodings it would have if the client had asked for one + of them by name. It then chooses the best match to the client's + requirements, and returns that document.

+
+ + +CacheNegotiatedDocs +Allows content-negotiated documents to be +cached by proxy servers +CacheNegotiatedDocs on|off +CacheNegotiatedDocs off +server config +The syntax changed in version 2.0. + + +

If set, this directive allows content-negotiated documents + to be cached by proxy servers. This could mean that clients + behind those proxys could retrieve versions of the documents + that are not the best match for their abilities, but it will + make caching more efficient.

+ +

This directive only applies to requests which come from + HTTP/1.0 browsers. HTTP/1.1 provides much better control over + the caching of negotiated documents, and this directive has no + effect in responses to HTTP/1.1 requests.

+ +

Prior to version 2.0, + CacheNegotiatedDocs did not take an + argument; it was turned on by the presence of the directive by + itself.

+
+
+ + +ForceLangaugePriority +Action to take if a single acceptable document is not +found +ForceLanguagePriority None|Prefer|Fallback [Prefer|Fallback] +ForceLangaugePriority None +server config +virtual host +directory +.htaccess + +FileInfo +Available in version 2.0.30 and later + + +

The ForceLanguagePriority directive uses + the given LanguagePriority to satisfy + negotation where the server could otherwise not return a single + matching document.

+ +

ForceLanguagePriority Prefer uses + LanguagePriority to serve a one valid result, rather + than returning an HTTP result 300 (MULTIPLE CHOICES) when there + are several equally valid choices. If the directives below were + given, and the user's Accept-Language header assigned en and de + each as quality .500 (equally acceptable) then then first matching + variant, en, will be served.

+ + + LanguagePriority en fr de
+ ForceLanguagePriority Prefer +
+ +

ForceLanguagePriority Fallback uses + LanguagePriority to serve a valid result, rather than + returning an HTTP result 406 (NOT ACCEPTABLE). If the directives + below were given, and the user's Accept-Language only permitted an + es langauge response, but such a variant isn't found, then the + first variant from the LanguagePriority list below will be + served.

+ + + LanguagePriority en fr de
+ ForceLanguagePriority Fallback +
+ +

Both options, Prefer and Fallback, may be specified, so either the + first matching variant from LanguagePriority will be served if more + that one variant is acceptable, or first available document will be + served if none of the variants matched the client's acceptable list of + languages.

+
+
+ + +LanguagePriority +The precendence of language variants for cases where +the client does not express a preference +LanguagePriority MIME-lang [MIME-lang] ... +server config +virtual host +directory +.htaccess + +FileInfo + + +

The LanguagePriority sets the precedence + of language variants for the case where the client does not + express a preference, when handling a MultiViews request. The list + of MIME-lang are in order of decreasing preference. + Example:

+ +LanguagePriority en fr de + +

For a request for foo.html, where + foo.html.fr and foo.html.de both + existed, but the browser did not express a language preference, + then foo.html.fr would be returned.

+ +

Note that this directive only has an effect if a 'best' + language cannot be determined by any other means or the ForceLanguagePriority directive + is not None. Correctly implemented HTTP/1.1 requests + will mean this directive has no effect.

+
+
+ +
\ No newline at end of file diff --git a/docs/manual/mod/mod_proxy.xml b/docs/manual/mod/mod_proxy.xml new file mode 100644 index 00000000000..d4d7551f2e7 --- /dev/null +++ b/docs/manual/mod/mod_proxy.xml @@ -0,0 +1,722 @@ + + + + + +mod_proxy +HTTP/1.1 proxy/gateway server +Extension +mod_proxy.c +proxy_module + + +Warning +This document has been updated to take into account changes +made in the 2.0 version of the Apache HTTP Server. Some of the +information may still be inaccurate, please use it +with care. + + +

This module implements a proxy/gateway for Apache. It implements +proxying capability for +FTP, +CONNECT (for SSL), +HTTP/0.9, +HTTP/1.0, and +HTTP/1.1. +The module can be configured to connect to other proxy modules for these +and other protocols.

+ +

This module was experimental in Apache 1.1.x. Improvements and bugfixes +were made in Apache v1.2.x and Apache v1.3.x, then the module underwent a major +overhaul for Apache v2.0. The protocol support was upgraded to HTTP/1.1, +and filter support was enabled.

+ +

Please note that the caching function present in +mod_proxy up to Apache v1.3.x has been removed from +mod_proxy and will be incorporated into a new module, mod_cache.

+
+ +
Common configuration topics + + + +
Forward and Reverse Proxies + +

Apache can be configured in both a forward and reverse +proxy configuration.

+ +

A forward proxy is an intermediate system that enables a browser to connect to a +remote network to which it normally does not have access. A forward proxy +can also be used to cache data, reducing load on the networks between the +forward proxy and the remote webserver.

+ +

Apache's mod_proxy can be figured to behave like a forward proxy +using the ProxyRemote +directive. In addition, caching of data can be achieved by configuring +Apache mod_cache. Other dedicated forward proxy +packages include Squid.

+ +

A reverse proxy is a webserver system that is capable of serving webpages +sourced from other webservers - in addition to webpages on disk or generated +dynamically by CGI - making these pages look like they originated at the +reverse proxy.

+ +

When configured with the mod_cache module the reverse +proxy can act as a cache for slower backend webservers. The reverse proxy +can also enable advanced URL strategies and management techniques, allowing +webpages served using different webserver systems or architectures to +coexist inside the same URL space. Reverse proxy systems are also ideal for +implementing centralised logging websites with many or diverse website +backends. Complex multi-tier webserver systems can be constructed using an +Apache mod_proxy frontend and any number of backend webservers.

+ +

The reverse proxy is configured using the +ProxyPass and ProxyPassReverse directives. Caching can be +enabled using mod_cache as with the forward proxy.

+ +
+ +
Controlling access to your proxy + +

You can control who can access your proxy via the normal Directory +control block using the following example:

+ + +<Directory proxy:*>
+Order Deny,Allow
+Deny from all
+Allow from 192.168.0
+</Directory> +
+ +

A Files block +will also work, and is the only method known to work for all possible +URLs in Apache versions earlier than 1.2b10.

+ +

When configuring a reverse proxy, access control takes on the +attributes of the normal server directory configuration.

+ + + + +
+ +
Why doesn't file type <em>xxx</em> +download via FTP? + +

You probably don't have that particular file type defined as +application/octet-stream in your proxy's mime.types configuration +file. A useful line can be

+ + +application/octet-stream bin dms lha lzh exe class tgz taz + +
+ +
How can I force an FTP ASCII download of +File <em>xxx</em>? + +

In the rare situation where you must download a specific file using the FTP +ASCII transfer method (while the default transfer is in +binary mode), you can override mod_proxy's default by +suffixing the request with ;type=a to force an ASCII transfer. +(FTP Directory listings are always executed in ASCII mode, however.)

+
+ +
How can I access FTP files outside +of my home directory? + +

+An FTP URI is interpreted relative to the home directory of the user +who is logging in. Alas, to reach higher directory levels you cannot +use /../, as the dots are interpreted by the browser and not actually +sent to the FTP server. To address this problem, the so called "Squid +%2f hack" was implemented in the Apache FTP proxy; it is is a solution +which is also used by other popular proxy servers like the Squid Proxy Cache. By +prepending /%2f to the path of your request, you can make such a proxy +change the FTP starting directory to / (instead of the home +directory).

+ +

Example: To retrieve the file +/etc/motd, you would use the URL

+ftp://user@host/%2f/etc/motd +
+ +
How can I hide the FTP cleartext password +in my browser's URL line? + +

+To log in to an FTP server by username and password, Apache +uses different strategies. +In absense of a user name and password in the URL altogether, +Apache sends an anomymous login to the FTP server, i.e.,

+ +user: anonymous
+password: apache_proxy@ +
+

This works for all popular FTP servers which are configured for +anonymous access.

+ +

For a personal login with a specific username, you can embed +the user name into the URL, like in: +ftp://username@host/myfile. If the FTP server +asks for a password when given this username (which it should), +then Apache will reply with a [401 Authorization required] response, +which causes the Browser to pop up the username/password dialog. +Upon entering the password, the connection attempt is retried, +and if successful, the requested resource is presented. +The advantage of this procedure is that your browser does not +display the password in cleartext (which it would if you had used +ftp://username:password@host/myfile in +the first place).

+ +Note +The password which is transmitted in such a way +is not encrypted on its way. It travels between your browser and +the Apache proxy server in a base64-encoded cleartext string, and +between the Apache proxy and the FTP server as plaintext. You should +therefore think twice before accessing your FTP server via HTTP +(or before accessing your personal files via FTP at all!) When +using unsecure channels, an eavesdropper might intercept your +password on its way. + +
+ +
Why does Apache start more slowly when +using the proxy module? + +

If you're using the ProxyBlock +directive, hostnames' IP addresses are looked up and cached during +startup for later match test. This may take a few seconds (or more) +depending on the speed with which the hostname lookups occur.

+
+ + + +
What other functions are useful for an +intranet proxy server? + +

An Apache proxy server situated in an intranet needs to forward +external requests through the company's firewall. However, when it has +to access resources within the intranet, it can bypass the firewall +when accessing hosts. The NoProxy directive is useful for +specifying which hosts belong to the intranet and should be accessed +directly.

+ +

Users within an intranet tend to omit the local domain name from their +WWW requests, thus requesting "http://somehost/" instead of +"http://somehost.my.dom.ain/". Some commercial proxy servers let them get +away with this and simply serve the request, implying a configured +local domain. When the ProxyDomain directive +is used and the server is configured for +proxy service, Apache can return a redirect response and send the client +to the correct, fully qualified, server address. This is the preferred method +since the user's bookmark files will then contain fully qualified hosts.

+
+ +
+ + +ProxyPreserveHost +ProxyPreserveHost on|off +ProxyPreserveHost Off +server config +virtual host + +Available in +Apache 2.0.31 and later. + + +

When enabled, this option will pass the Host: line from the +incoming request to the proxied host, instead of the hostname +specified in the proxypass line. +

+

This option should normally be turned 'off'.

+
+
+ + +ProxyRequests +ProxyRequests on|off +ProxyRequests Off +server config +virtual host + + + +

This allows or prevents Apache from functioning as a forward proxy +server. (Setting ProxyRequests to 'off' does not disable use of the +ProxyPass directive.)

+ +

In a typical reverse proxy configuration, this option should be set to +'off'.

+
+
+ + +ProxyRemote +ProxyRemote match remote-server +server config +virtual host + + + +

This defines remote proxies to this proxy. match is either the +name of a URL-scheme that the remote server supports, or a partial URL +for which the remote server should be used, or '*' to indicate the +server should be contacted for all requests. remote-server is a +partial URL for the remote server. Syntax:

+ +
+  remote-server = protocol://hostname[:port]
+
+ +

protocol is the protocol that should be used to communicate +with the remote server; only "http" is supported by this module.

+ +

+Example:

+ + ProxyRemote http://goodguys.com/ http://mirrorguys.com:8000
+ ProxyRemote * http://cleversite.com
+ ProxyRemote ftp http://ftpproxy.mydomain.com:8080 +
+ +

In the last example, the proxy will forward FTP requests, encapsulated +as yet another HTTP proxy request, to another proxy which can handle +them.

+ +

This option also supports reverse proxy configuration - a backend +webserver can be embedded within a virtualhost URL space even if that +server is hidden by another forward proxy.

+
+
+ + +ProxyPass +ProxyPass [path] !|url +server config +virtual host + + + + +

This directive allows remote servers to be mapped into the space of +the local server; the local server does not act as a proxy in the +conventional sense, but appears to be a mirror of the remote +server. path is the name of a local virtual path; +url is a partial URL for the remote server.

+ +

Suppose the local server has address http://wibble.org/; +then

+ + ProxyPass /mirror/foo/ http://foo.com/ + +

will cause a local request for the +<http://wibble.org/mirror/foo/bar> to be +internally converted into a proxy request to +<http://foo.com/bar>.

+

+The ! directive is useful in situations where you don't want to reverse-proxy +a subdirectory. eg.

+ + ProxyPass /mirror/foo/i !
+ ProxyPass /mirror/foo http://foo.com +
+

will proxy all requests to /mirror/foo to foo.com EXCEPT requests made to /mirror/foo/i

+ +NB: order is important. you need to put the exclusions BEFORE the general proxypass directive +
+
+ + +ProxyPassReverse +ProxyPassReverse [path] url +server config +virtual host + + + + +

This directive lets Apache adjust the URL in the Location, +Content-Location and URI headers on +HTTP redirect responses. This is essential when Apache is used as +a reverse proxy to avoid by-passing the reverse proxy because of HTTP +redirects on the backend servers which stay behind the reverse proxy.

+ +

path is the name of a local virtual path.
+url is a partial URL for the remote server - the same way they are +used for the ProxyPass directive.

+ +

+Example:
+Suppose the local server has address http://wibble.org/; then

+ + ProxyPass /mirror/foo/ http://foo.com/
+ ProxyPassReverse /mirror/foo/ http://foo.com/ +
+

will not only cause a local request for the +<http://wibble.org/mirror/foo/bar> to be internally +converted into a proxy request to <http://foo.com/bar> (the +functionality ProxyPass provides here). It also takes care of +redirects the server foo.com sends: when http://foo.com/bar is +redirected by him to http://foo.com/quux Apache adjusts this to +http://wibble.org/mirror/foo/quux before forwarding the HTTP +redirect response to the client.

+

+Note that this ProxyPassReverse directive can +also be used in conjunction with the proxy pass-through feature +("RewriteRule ... [P]") from +mod_rewrite because its doesn't depend on a +corresponding ProxyPass +directive.

+
+
+ + +AllowCONNECT +AllowCONNECT port [port] ... +AllowCONNECT 443 563 +server config +virtual host + + + +

The AllowCONNECT directive specifies a list +of port numbers to which the proxy CONNECT method may +connect. Today's browsers use this method when a https +connection is requested and proxy tunneling over http is in +effect.
By default, only the default https port (443) and the +default snews port (563) are enabled. Use the +AllowCONNECT directive to overrride this default and +allow connections to the listed ports only.

+
+
+ + +ProxyBlock +ProxyBlock *|word|host|domain +[word|host|domain] ... +server config +virtual host + + + +

The ProxyBlock directive specifies a list of +words, hosts and/or domains, separated by spaces. HTTP, HTTPS, and +FTP document requests to sites whose names contain matched words, +hosts or domains are blocked by the proxy server. The proxy +module will also attempt to determine IP addresses of list items which +may be hostnames during startup, and cache them for match test as +well. Example:

+ + + ProxyBlock joes-garage.com some-host.co.uk rocky.wotsamattau.edu + + +

'rocky.wotsamattau.edu' would also be matched if referenced by IP +address.

+ +

Note that 'wotsamattau' would also be sufficient to match +'wotsamattau.edu'.

+ +

Note also that

+ + +ProxyBlock * + + +

blocks connections to all sites.

+ +
+
+ + +ProxyReceiveBufferSize +ProxyReceiveBufferSize bytes +server config +virtual host + + + +

The ProxyReceiveBufferSize directive +specifies an explicit network buffer size for outgoing HTTP and FTP +connections, for increased throughput. It has to be greater than 512 +or set to 0 to indicate that the system's default buffer size should +be used.

+Example + ProxyReceiveBufferSize 2048 + +
+
+ + +ProxyMaxForwards +ProxyMaxForwards number +ProxyMaxForwards 10 +server config +virtual host + +Available in Apache 2.0 and later + + +

The ProxyMaxForwards directive specifies the +maximum number of proxies through which a request may pass. This is +set to prevent infinite proxy loops, or a DoS attack.

+ +Example + ProxyMaxForwards 10 + +
+
+ + +NoProxy +NoProxy + Domain| + SubNet| + IpAddr| + Hostname +[Domain| + SubNet| + IpAddr| + Hostname] ... +server config +virtual host + + + +

This directive is only useful for Apache proxy servers within +intranets. The NoProxy directive specifies a +list of subnets, IP addresses, hosts and/or domains, separated by +spaces. A request to a host which matches one or more of these is +always served directly, without forwarding to the configured +ProxyRemote proxy server(s).

+ +Example + ProxyRemote * http://firewall.mycompany.com:81
+ NoProxy .mycompany.com 192.168.112.0/21 +
+ +

The arguments to the NoProxy directive are one of the following type list:

+
+ +
+ Domain
+
A Domain is a partially qualified DNS domain name, preceded + by a period. + It represents a list of hosts which logically belong to the same DNS + domain or zone (i.e., the suffixes of the hostnames are all ending in + Domain).
+ Examples: .com .apache.org.
+ To distinguish Domains from Hostnames (both + syntactically and semantically; a DNS domain can have a DNS A record, + too!), Domains are always written + with a leading period.
+ Note: Domain name comparisons are done without regard to the case, + and Domains are always assumed to be anchored in the root + of the DNS tree, therefore two domains .MyDomain.com and + .mydomain.com. (note the trailing period) are + considered equal. Since a domain comparison does not involve a DNS + lookup, it is much more efficient than subnet comparison.
+ + +
+ SubNet
+
A SubNet is a partially qualified internet address in + numeric (dotted quad) form, optionally followed by a slash and the + netmask, specified as the number of significant bits in the + SubNet. It is used to represent a subnet of hosts which can + be reached over a common network interface. In the absence of the + explicit net mask it is assumed that omitted (or zero valued) + trailing digits specify the mask. (In this case, the netmask can + only be multiples of 8 bits wide.)
+ Examples: +
+
192.168 or 192.168.0.0
+
the subnet 192.168.0.0 with an implied netmask of 16 valid bits + (sometimes used in the netmask form 255.255.0.0)
+
192.168.112.0/21
+
the subnet 192.168.112.0/21 with a netmask of 21 + valid bits (also used in the form 255.255.248.0)
+
+ As a degenerate case, a SubNet with 32 valid bits is the + equivalent to an IPAddr, while a SubNet with zero + valid bits (e.g., 0.0.0.0/0) is the same as the constant + _Default_, matching any IP address.
+ + +
+ IPAddr
+
A IPAddr represents a fully qualified internet address in + numeric (dotted quad) form. Usually, this address represents a + host, but there need not necessarily be a DNS domain name + connected with the address.
+ Example: 192.168.123.7
+ Note: An IPAddr does not need to be resolved by the DNS + system, so it can result in more effective apache performance.
+ + +
+ Hostname
+
A Hostname is a fully qualified DNS domain name which can + be resolved to one or more IPAddrs via the DNS domain name service. + It represents a logical host (in contrast to + Domains, see + above) and must be resolvable to at least one IPAddr (or often to a list of hosts + with different IPAddr's).
+ Examples: prep.ai.mit.edu + www.apache.org.
+ Note: In many situations, it is more effective to specify an + IPAddr in place of a + Hostname since a DNS lookup + can be avoided. Name resolution in Apache can take a remarkable deal + of time when the connection to the name server uses a slow PPP + link.
+ Note: Hostname comparisons are done without regard to the case, + and Hostnames are always assumed to be anchored in the root + of the DNS tree, therefore two hosts WWW.MyDomain.com + and www.mydomain.com. (note the trailing period) are + considered equal.
+
+
+DNS Issues +
+ + +ProxyTimeout +ProxyTimeout seconds +ProxyTimeout 300 +server config +virtual host + +Available in +Apache 2.0.31 and later + + +

This directive allows a user to specifiy a timeout on proxy requests. +This is usefull when you have a slow/buggy appserver which hangs, +and you would rather just return a timeout and fail gracefully instead +of waiting however long it takes the server to return +

+
+
+ + +ProxyDomain +ProxyDomain Domain +server config +virtual host + + + +

This directive is only useful for Apache proxy servers within +intranets. The ProxyDomain directive specifies +the default domain which the apache proxy server will belong to. If a +request to a host without a domain name is encountered, a redirection +response to the same host with the configured Domain appended +will be generated.

+ +Example + ProxyRemote * http://firewall.mycompany.com:81
+ NoProxy .mycompany.com 192.168.112.0/21
+ ProxyDomain .mycompany.com +
+
+
+ + +ProxyVia +ProxyVia on|off|full|block +ProxyVia off +server config +virtual host + + + +

This directive controls the use of the Via: HTTP +header by the proxy. Its intended use is to control the flow of of +proxy requests along a chain of proxy servers. See RFC2068 (HTTP/1.1) +for an explanation of Via: header lines.

+ +
  • If set +to off, which is the default, no special processing is +performed. If a request or reply contains a Via: header, +it is passed through unchanged.
  • + +
  • If set to on, each +request and reply will get a Via: header line added for +the current host.
  • + +
  • If set to full, each generated Via: header +line will additionally have the Apache server version shown as a +Via: comment field.
  • + +
  • If set to block, every +proxy request will have all its Via: header lines +removed. No new Via: header will be generated.
  • +
+
+
+ + +ProxyErrorOverride +ProxyErrorOverride On|Off +ProxyErrorOverride Off +server config +virtual host + +Available in version 2.0 and later + + +

This directive is useful for reverse-proxy setups, where you want to +have a common look and feel on the error pages seen by the end user. +This also allows for included files (via mod_include's SSI) to get +the error code and act accordingly (default behavior would display +the error page of the proxied server, turning this on shows the SSI +Error message).

+
+
+
diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml new file mode 100644 index 00000000000..ff31e179bce --- /dev/null +++ b/docs/manual/mod/mod_rewrite.xml @@ -0,0 +1,1798 @@ + + ]> + + + +mod_rewrite + +Provides a rule-based rewriting engine to rewrite requested +URLs on the fly + +Extension +mod_rewrite.c +rewrite_module +Available in Apache 1.3 and later + + +
+ ``The great thing about mod_rewrite is it gives you + all the configurability and flexibility of Sendmail. + The downside to mod_rewrite is that it gives you all + the configurability and flexibility of Sendmail.'' + + +
+ -- Brian Behlendorf
+ Apache Group +
+
+ +
+ `` Despite the tons of examples and docs, + mod_rewrite is voodoo. Damned cool voodoo, but still + voodoo. '' + +
+ -- Brian Moore
+ bem@news.cmc.net +
+
+ + +

Welcome to mod_rewrite, the Swiss Army Knife of URL + manipulation!

+ +

This module uses a rule-based rewriting engine (based on a + regular-expression parser) to rewrite requested URLs on the + fly. It supports an unlimited number of rules and an + unlimited number of attached rule conditions for each rule to + provide a really flexible and powerful URL manipulation + mechanism. The URL manipulations can depend on various tests, + for instance server variables, environment variables, HTTP + headers, time stamps and even external database lookups in + various formats can be used to achieve a really granular URL + matching.

+ +

This module operates on the full URLs (including the + path-info part) both in per-server context + (httpd.conf) and per-directory context + (.htaccess) and can even generate query-string + parts on result. The rewritten result can lead to internal + sub-processing, external request redirection or even to an + internal proxy throughput.

+ +

But all this functionality and flexibility has its + drawback: complexity. So don't expect to understand this + entire module in just one day.

+ +

This module was invented and originally written in April + 1996 and gifted exclusively to the The Apache Group in July 1997 + by

+ +
+ Ralf S. + Engelschall
+ rse@engelschall.com
+ www.engelschall.com +
+
+ +
Interal Processing + +

The internal processing of this module is very complex but + needs to be explained once even to the average user to avoid + common mistakes and to let you exploit its full + functionality.

+ +
API Phases + +

First you have to understand that when Apache processes a + HTTP request it does this in phases. A hook for each of these + phases is provided by the Apache API. Mod_rewrite uses two of + these hooks: the URL-to-filename translation hook which is + used after the HTTP request has been read but before any + authorization starts and the Fixup hook which is triggered + after the authorization phases and after the per-directory + config files (.htaccess) have been read, but + before the content handler is activated.

+ +

So, after a request comes in and Apache has determined the + corresponding server (or virtual server) the rewriting engine + starts processing of all mod_rewrite directives from the + per-server configuration in the URL-to-filename phase. A few + steps later when the final data directories are found, the + per-directory configuration directives of mod_rewrite are + triggered in the Fixup phase. In both situations mod_rewrite + rewrites URLs either to new URLs or to filenames, although + there is no obvious distinction between them. This is a usage + of the API which was not intended to be this way when the API + was designed, but as of Apache 1.x this is the only way + mod_rewrite can operate. To make this point more clear + remember the following two points:

+ +
    +
  1. Although mod_rewrite rewrites URLs to URLs, URLs to + filenames and even filenames to filenames, the API + currently provides only a URL-to-filename hook. In Apache + 2.0 the two missing hooks will be added to make the + processing more clear. But this point has no drawbacks for + the user, it is just a fact which should be remembered: + Apache does more in the URL-to-filename hook than the API + intends for it.
  2. + +
  3. + Unbelievably mod_rewrite provides URL manipulations in + per-directory context, i.e., within + .htaccess files, although these are reached + a very long time after the URLs have been translated to + filenames. It has to be this way because + .htaccess files live in the filesystem, so + processing has already reached this stage. In other + words: According to the API phases at this time it is too + late for any URL manipulations. To overcome this chicken + and egg problem mod_rewrite uses a trick: When you + manipulate a URL/filename in per-directory context + mod_rewrite first rewrites the filename back to its + corresponding URL (which is usually impossible, but see + the RewriteBase directive below for the + trick to achieve this) and then initiates a new internal + sub-request with the new URL. This restarts processing of + the API phases. + +

    Again mod_rewrite tries hard to make this complicated + step totally transparent to the user, but you should + remember here: While URL manipulations in per-server + context are really fast and efficient, per-directory + rewrites are slow and inefficient due to this chicken and + egg problem. But on the other hand this is the only way + mod_rewrite can provide (locally restricted) URL + manipulations to the average user.

    +
  4. +
+ +

Don't forget these two points!

+
+ +
Ruleset Processing + +

Now when mod_rewrite is triggered in these two API phases, it + reads the configured rulesets from its configuration + structure (which itself was either created on startup for + per-server context or during the directory walk of the Apache + kernel for per-directory context). Then the URL rewriting + engine is started with the contained ruleset (one or more + rules together with their conditions). The operation of the + URL rewriting engine itself is exactly the same for both + configuration contexts. Only the final result processing is + different.

+ +

The order of rules in the ruleset is important because the + rewriting engine processes them in a special (and not very + obvious) order. The rule is this: The rewriting engine loops + through the ruleset rule by rule (RewriteRule directives) and + when a particular rule matches it optionally loops through + existing corresponding conditions (RewriteCond + directives). For historical reasons the conditions are given + first, and so the control flow is a little bit long-winded. See + Figure 1 for more details.

+ +
+ + + + + + + + +
[Needs graphics capability to display]
Figure 1: The + control flow through the rewriting ruleset
+
+ +

As you can see, first the URL is matched against the + Pattern of each rule. When it fails mod_rewrite + immediately stops processing this rule and continues with the + next rule. If the Pattern matches, mod_rewrite looks + for corresponding rule conditions. If none are present, it + just substitutes the URL with a new value which is + constructed from the string Substitution and goes on + with its rule-looping. But if conditions exist, it starts an + inner loop for processing them in the order that they are + listed. For conditions the logic is different: we don't match + a pattern against the current URL. Instead we first create a + string TestString by expanding variables, + back-references, map lookups, etc. and then we try + to match CondPattern against it. If the pattern + doesn't match, the complete set of conditions and the + corresponding rule fails. If the pattern matches, then the + next condition is processed until no more conditions are + available. If all conditions match, processing is continued + with the substitution of the URL with + Substitution.

+ +
+ +
Quoting Special Characters + +

As of Apache 1.3.20, special characters in + TestString and Substitution strings can be + escaped (that is, treated as normal characters without their + usual special meaning) by prefixing them with a slosh ('\') + character. In other words, you can include an actual + dollar-sign character in a Substitution string by + using '\$'; this keeps mod_rewrite from trying + to treat it as a backreference.

+
+ +
Regex Back-Reference Availability + +

One important thing here has to be remembered: Whenever you + use parentheses in Pattern or in one of the + CondPattern, back-references are internally created + which can be used with the strings $N and + %N (see below). These are available for creating + the strings Substitution and TestString. + Figure 2 shows to which locations the back-references are + transfered for expansion.

+ +
+ + + + + + + + +
[Needs graphics capability to display]
Figure 2: The + back-reference flow through a rule
+
+ +

We know this was a crash course on mod_rewrite's internal + processing. But you will benefit from this knowledge when + reading the following documentation of the available + directives.

+ +
+
+ +
Environment Variables + +

This module keeps track of two additional (non-standard) + CGI/SSI environment variables named SCRIPT_URL + and SCRIPT_URI. These contain the + logical Web-view to the current resource, while the + standard CGI/SSI variables SCRIPT_NAME and + SCRIPT_FILENAME contain the physical + System-view.

+ +

Notice: These variables hold the URI/URL as they were + initially requested, i.e., before any + rewriting. This is important because the rewriting process is + primarily used to rewrite logical URLs to physical + pathnames.

+ +

Example:

+ + +
+SCRIPT_NAME=/sw/lib/w3s/tree/global/u/rse/.www/index.html
+SCRIPT_FILENAME=/u/rse/.www/index.html
+SCRIPT_URL=/u/rse/
+SCRIPT_URI=http://en1.engelschall.com/u/rse/
+
+
+ +
+ +
Practical Solutions + +

We also have an URL + Rewriting Guide available, which provides a collection of + practical solutions for URL-based problems. There you can + find real-life rulesets and additional information about + mod_rewrite.

+
+ + + + +RewriteEngine + +Enables or disables runtime rewriting engine + +RewriteEngine on|off +RewriteEngine off +server configvirtual host +directory.htaccess +FileInfo + + + +

The RewriteEngine directive enables or + disables the runtime rewriting engine. If it is set to + off this module does no runtime processing at + all. It does not even update the SCRIPT_URx + environment variables.

+ +

Use this directive to disable the module instead of + commenting out all the RewriteRule directives!

+ +

Note that, by default, rewrite configurations are not + inherited. This means that you need to have a + RewriteEngine on directive for each virtual host + in which you wish to use it.

+
+ +
+ + +RewriteOptions +Sets some special options for the rewrite engine +RewriteOptions Options +None +server configvirtual host +directory.htaccess + + + +

The RewriteOptions directive sets some + special options for the current per-server or per-directory + configuration. The Option strings can be one of the + following:

+ +
    +
  • 'inherit'
    + This forces the current configuration to inherit the + configuration of the parent. In per-virtual-server context + this means that the maps, conditions and rules of the main + server are inherited. In per-directory context this means + that conditions and rules of the parent directory's + .htaccess configuration are inherited.
  • +
+
+ +
+ + +RewriteLog +Sets the name of the file used for logging rewrite engine +processing +RewriteLog file-path +server configvirtual host + + + +

The RewriteLog directive sets the name + of the file to which the server logs any rewriting actions it + performs. If the name does not begin with a slash + ('/') then it is assumed to be relative to the + Server Root. The directive should occur only once per + server config.

+ + To disable the logging of + rewriting actions it is not recommended to set + Filename to /dev/null, because + although the rewriting engine does not then output to a + logfile it still creates the logfile output internally. + This will slow down the server with no advantage + to the administrator! To disable logging either + remove or comment out the RewriteLog + directive or use RewriteLogLevel 0! + + +Security + +See the Apache Security Tips +document for details on why your security could be compromised if the +directory where logfiles are stored is writable by anyone other than +the user that starts the server. + + +Example +RewriteLog "/usr/local/var/apache/logs/rewrite.log" + + +
+ +
+ + +RewriteLogLevel +Sets the verbosity of the log file used by the rewrite +engine +RewriteLogLevel Level +RerwiteLogLevel 0 +server configvirtual host + + + +

The RewriteLogLevel directive sets the + verbosity level of the rewriting logfile. The default level 0 + means no logging, while 9 or more means that practically all + actions are logged.

+ +

To disable the logging of rewriting actions simply set + Level to 0. This disables all rewrite action + logs.

+ + Using a high value for + Level will slow down your Apache server + dramatically! Use the rewriting logfile at a + Level greater than 2 only for debugging! + + +Example +RewriteLogLevel 3 + + +
+ +
+ + +RewriteLock +Sets the name of the lock file used for RewriteMap +synchronization +RewriteLock file-path +None +server config + + +

This directive sets the filename for a synchronization + lockfile which mod_rewrite needs to communicate with RewriteMap + programs. Set this lockfile to a local path (not on a + NFS-mounted device) when you want to use a rewriting + map-program. It is not required for other types of rewriting + maps.

+
+ +
+ + +RewriteMap +Defines a mapping function for key-lookup +RewriteMap MapName MapType:MapSource + +None +server configvirtual host + + + +

The RewriteMap directive defines a + Rewriting Map which can be used inside rule + substitution strings by the mapping-functions to + insert/substitute fields through a key lookup. The source of + this lookup can be of various types.

+ +

The MapName is + the name of the map and will be used to specify a + mapping-function for the substitution strings of a rewriting + rule via one of the following constructs:

+ +
+ ${ MapName : + LookupKey }
+ ${ MapName : + LookupKey | DefaultValue + }
+
+ +

When such a construct occurs the map MapName is + consulted and the key LookupKey is looked-up. If the + key is found, the map-function construct is substituted by + SubstValue. If the key is not found then it is + substituted by DefaultValue or by the empty string + if no DefaultValue was specified.

+ +

The following combinations for MapType and + MapSource can be used:

+ +
    +
  • + Standard Plain Text
    + MapType: txt, MapSource: Unix filesystem + path to valid regular file + +

    This is the standard rewriting map feature where the + MapSource is a plain ASCII file containing + either blank lines, comment lines (starting with a '#' + character) or pairs like the following - one per + line.

    + +
    + MatchingKey + SubstValue +
    + +Example +
    +##
    +##  map.txt -- rewriting map
    +##
    +
    +Ralf.S.Engelschall    rse   # Bastard Operator From Hell
    +Mr.Joe.Average        joe   # Mr. Average
    +
    +
    + + +RewriteMap real-to-user txt:/path/to/file/map.txt + +
  • + +
  • + Randomized Plain Text
    + MapType: rnd, MapSource: Unix filesystem + path to valid regular file + +

    This is identical to the Standard Plain Text variant + above but with a special post-processing feature: After + looking up a value it is parsed according to contained + ``|'' characters which have the meaning of + ``or''. In other words they indicate a set of + alternatives from which the actual returned value is + chosen randomly. Although this sounds crazy and useless, + it was actually designed for load balancing in a reverse + proxy situation where the looked up values are server + names. Example:

    + + +
    +##
    +##  map.txt -- rewriting map
    +##
    +
    +static   www1|www2|www3|www4
    +dynamic  www5|www6
    +
    +
    + + +RewriteMap servers rnd:/path/to/file/map.txt + +
  • + +
  • + Hash File
    + MapType: dbm, MapSource: Unix filesystem + path to valid regular file + +

    Here the source is a binary NDBM format file + containing the same contents as a Plain Text + format file, but in a special representation which is + optimized for really fast lookups. You can create such a + file with any NDBM tool or with the following Perl + script:

    + + +
    +#!/path/to/bin/perl
    +##
    +##  txt2dbm -- convert txt map to dbm format
    +##
    +
    +use NDBM_File;
    +use Fcntl;
    +
    +($txtmap, $dbmmap) = @ARGV;
    +
    +open(TXT, "<$txtmap") or die "Couldn't open $txtmap!\n";
    +tie (%DB, 'NDBM_File', $dbmmap,O_RDWR|O_TRUNC|O_CREAT, 0644) or die "Couldn't create $dbmmap!\n";
    +
    +while (<TXT>) {
    +  next if (/^\s*#/ or /^\s*$/);
    +  $DB{$1} = $2 if (/^\s*(\S+)\s+(\S+)/);
    +}
    +
    +untie %DB;
    +close(TXT);
    +
    +
    + + +$ txt2dbm map.txt map.db + +
  • + +
  • + Internal Function
    + MapType: int, MapSource: Internal Apache + function + +

    Here the source is an internal Apache function. + Currently you cannot create your own, but the following + functions already exists:

    + +
      +
    • toupper:
      + Converts the looked up key to all upper case.
    • + +
    • tolower:
      + Converts the looked up key to all lower case.
    • + +
    • escape:
      + Translates special characters in the looked up key to + hex-encodings.
    • + +
    • unescape:
      + Translates hex-encodings in the looked up key back to + special characters.
    • +
    +
  • + +
  • + External Rewriting Program
    + MapType: prg, MapSource: Unix filesystem + path to valid regular file + +

    Here the source is a program, not a map file. To + create it you can use the language of your choice, but + the result has to be a executable (i.e., either + object-code or a script with the magic cookie trick + '#!/path/to/interpreter' as the first + line).

    + +

    This program is started once at startup of the Apache + servers and then communicates with the rewriting engine + over its stdin and stdout + file-handles. For each map-function lookup it will + receive the key to lookup as a newline-terminated string + on stdin. It then has to give back the + looked-up value as a newline-terminated string on + stdout or the four-character string + ``NULL'' if it fails (i.e., there + is no corresponding value for the given key). A trivial + program which will implement a 1:1 map (i.e., + key == value) could be:

    + + +
    +#!/usr/bin/perl
    +$| = 1;
    +while (<STDIN>) {
    +    # ...put here any transformations or lookups...
    +    print $_;
    +}
    +
    +
    + +

    But be very careful:

    + +
      +
    1. ``Keep it simple, stupid'' (KISS), because + if this program hangs it will hang the Apache server + when the rule occurs.
    2. + +
    3. Avoid one common mistake: never do buffered I/O on + stdout! This will cause a deadloop! Hence + the ``$|=1'' in the above example...
    4. + +
    5. Use the RewriteLock directive to + define a lockfile mod_rewrite can use to synchronize the + communication to the program. By default no such + synchronization takes place.
    6. +
    +
  • +
+ The RewriteMap directive can occur more than + once. For each mapping-function use one + RewriteMap directive to declare its rewriting + mapfile. While you cannot declare a map in + per-directory context it is of course possible to + use this map in per-directory context. + +Note For plain text and DBM format files the +looked-up keys are cached in-core until the mtime of the +mapfile changes or the server does a restart. This way you can have +map-functions in rules which are used for every +request. This is no problem, because the external lookup only happens +once! + + +
+
+ + +RewriteBase +Sets the base URL for per-directory rewrites +RewriteBase URL-path +RewriteBase physical-directory-path +directory.htaccess + +FileInfo + + +

The RewriteBase directive explicitly + sets the base URL for per-directory rewrites. As you will see + below, RewriteRule + can be used in per-directory config files + (.htaccess). There it will act locally, + i.e., the local directory prefix is stripped at this + stage of processing and your rewriting rules act only on the + remainder. At the end it is automatically added back to the + path.

+ +

When a substitution occurs for a new URL, this module has + to re-inject the URL into the server processing. To be able + to do this it needs to know what the corresponding URL-prefix + or URL-base is. By default this prefix is the corresponding + filepath itself. But at most websites URLs are NOT + directly related to physical filename paths, so this + assumption will usually be wrong! There you have to + use the RewriteBase directive to specify the + correct URL-prefix.

+ + If your webserver's URLs are not directly +related to physical file paths, you have to use +RewriteBase in every .htaccess +files where you want to use RewriteRule directives. + + +

For example, assume the following per-directory config file:

+ + +
+#
+#  /abc/def/.htaccess -- per-dir config file for directory /abc/def
+#  Remember: /abc/def is the physical path of /xyz, i.e., the server
+#            has a 'Alias /xyz /abc/def' directive e.g.
+#
+
+RewriteEngine On
+
+#  let the server know that we were reached via /xyz and not
+#  via the physical path prefix /abc/def
+RewriteBase   /xyz
+
+#  now the rewriting rules
+RewriteRule   ^oldstuff\.html$  newstuff.html
+
+
+ +

In the above example, a request to + /xyz/oldstuff.html gets correctly rewritten to + the physical file /abc/def/newstuff.html.

+ +For Apache Hackers +

The following list gives detailed information about + the internal processing steps:

+
+Request:
+  /xyz/oldstuff.html
+
+Internal Processing:
+  /xyz/oldstuff.html     -> /abc/def/oldstuff.html  (per-server Alias)
+  /abc/def/oldstuff.html -> /abc/def/newstuff.html  (per-dir    RewriteRule)
+  /abc/def/newstuff.html -> /xyz/newstuff.html      (per-dir    RewriteBase)
+  /xyz/newstuff.html     -> /abc/def/newstuff.html  (per-server Alias)
+
+Result:
+  /abc/def/newstuff.html
+
+
+

This seems very complicated but is + the correct Apache internal processing, because the + per-directory rewriting comes too late in the + process. So, when it occurs the (rewritten) request + has to be re-injected into the Apache kernel! BUT: + While this seems like a serious overhead, it really + isn't, because this re-injection happens fully + internally to the Apache server and the same + procedure is used by many other operations inside + Apache. So, you can be sure the design and + implementation is correct.

+
+ +
+ +
+ + +RewriteCond +Defines a condition under which rewriting will take place + + RewriteCond + TestString CondPattern +None +server configvirtual host +directory.htaccess +FileInfo + + +

The RewriteCond directive defines a + rule condition. Precede a RewriteRule directive with one + or more RewriteCond directives. The following + rewriting rule is only used if its pattern matches the current + state of the URI and if these additional + conditions apply too.

+ +

TestString is a string which can contains the + following expanded constructs in addition to plain text:

+ +
    +
  • + RewriteRule backreferences: These are + backreferences of the form + +
    + $N +
    + (0 <= N <= 9) which provide access to the grouped + parts (parenthesis!) of the pattern from the + corresponding RewriteRule directive (the one + following the current bunch of RewriteCond + directives). +
  • + +
  • + RewriteCond backreferences: These are + backreferences of the form + +
    + %N +
    + (1 <= N <= 9) which provide access to the grouped + parts (parentheses!) of the pattern from the last matched + RewriteCond directive in the current bunch + of conditions. +
  • + +
  • + RewriteMap expansions: These are + expansions of the form + +
    + ${mapname:key|default} +
    + See the documentation for + RewriteMap for more details. +
  • + +
  • + Server-Variables: These are variables of + the form + +
    + %{ NAME_OF_VARIABLE + } +
    + where NAME_OF_VARIABLE can be a string taken + from the following list: + + + + + + + + + + + + + + + +
    + HTTP headers: + +

    HTTP_USER_AGENT
    + HTTP_REFERER
    + HTTP_COOKIE
    + HTTP_FORWARDED
    + HTTP_HOST
    + HTTP_PROXY_CONNECTION
    + HTTP_ACCEPT
    +

    +
    + connection & request: + +

    REMOTE_ADDR
    + REMOTE_HOST
    + REMOTE_USER
    + REMOTE_IDENT
    + REQUEST_METHOD
    + SCRIPT_FILENAME
    + PATH_INFO
    + QUERY_STRING
    + AUTH_TYPE
    +

    +
    + server internals: + +

    DOCUMENT_ROOT
    + SERVER_ADMIN
    + SERVER_NAME
    + SERVER_ADDR
    + SERVER_PORT
    + SERVER_PROTOCOL
    + SERVER_SOFTWARE
    +

    +
    + system stuff: + +

    TIME_YEAR
    + TIME_MON
    + TIME_DAY
    + TIME_HOUR
    + TIME_MIN
    + TIME_SEC
    + TIME_WDAY
    + TIME
    +

    +
    + specials: + +

    API_VERSION
    + THE_REQUEST
    + REQUEST_URI
    + REQUEST_FILENAME
    + IS_SUBREQ
    +

    +
    + + +

    These variables all + correspond to the similarly named HTTP + MIME-headers, C variables of the Apache server or + struct tm fields of the Unix system. + Most are documented elsewhere in the Manual or in + the CGI specification. Those that are special to + mod_rewrite include:

    + +
    +
    IS_SUBREQ
    + +
    Will contain the text "true" if the request + currently being processed is a sub-request, + "false" otherwise. Sub-requests may be generated + by modules that need to resolve additional files + or URIs in order to complete their tasks.
    + +
    API_VERSION
    + +
    This is the version of the Apache module API + (the internal interface between server and + module) in the current httpd build, as defined in + include/ap_mmn.h. The module API version + corresponds to the version of Apache in use (in + the release version of Apache 1.3.14, for + instance, it is 19990320:10), but is mainly of + interest to module authors.
    + +
    THE_REQUEST
    + +
    The full HTTP request line sent by the + browser to the server (e.g., "GET + /index.html HTTP/1.1"). This does not + include any additional headers sent by the + browser.
    + +
    REQUEST_URI
    + +
    The resource requested in the HTTP request + line. (In the example above, this would be + "/index.html".)
    + +
    REQUEST_FILENAME
    + +
    The full local filesystem path to the file or + script matching the request.
    +
    +
    +
  • +
+ +

Special Notes:

+ +
    +
  1. The variables SCRIPT_FILENAME and REQUEST_FILENAME + contain the same value, i.e., the value of the + filename field of the internal + request_rec structure of the Apache server. + The first name is just the commonly known CGI variable name + while the second is the consistent counterpart to + REQUEST_URI (which contains the value of the + uri field of request_rec).
  2. + +
  3. There is the special format: + %{ENV:variable} where variable can be + any environment variable. This is looked-up via internal + Apache structures and (if not found there) via + getenv() from the Apache server process.
  4. + +
  5. There is the special format: + %{HTTP:header} where header can be + any HTTP MIME-header name. This is looked-up from the HTTP + request. Example: %{HTTP:Proxy-Connection} is + the value of the HTTP header + ``Proxy-Connection:''.
  6. + +
  7. There is the special format + %{LA-U:variable} for look-aheads which perform + an internal (URL-based) sub-request to determine the final + value of variable. Use this when you want to use a + variable for rewriting which is actually set later in an + API phase and thus is not available at the current stage. + For instance when you want to rewrite according to the + REMOTE_USER variable from within the + per-server context (httpd.conf file) you have + to use %{LA-U:REMOTE_USER} because this + variable is set by the authorization phases which come + after the URL translation phase where mod_rewrite + operates. On the other hand, because mod_rewrite implements + its per-directory context (.htaccess file) via + the Fixup phase of the API and because the authorization + phases come before this phase, you just can use + %{REMOTE_USER} there.
  8. + +
  9. There is the special format: + %{LA-F:variable} which performs an internal + (filename-based) sub-request to determine the final value + of variable. Most of the time this is the same as + LA-U above.
  10. +
+ +

CondPattern is the condition pattern, + i.e., a regular expression which is applied to the + current instance of the TestString, i.e., + TestString is evaluated and then matched against + CondPattern.

+ +

Remember: CondPattern is a + standard Extended Regular Expression with some + additions:

+ +
    +
  1. You can prefix the pattern string with a + '!' character (exclamation mark) to specify a + non-matching pattern.
  2. + +
  3. + There are some special variants of CondPatterns. + Instead of real regular expression strings you can also + use one of the following: + +
      +
    • '<CondPattern' (is lexically + lower)
      + Treats the CondPattern as a plain string and + compares it lexically to TestString. True if + TestString is lexically lower than + CondPattern.
    • + +
    • '>CondPattern' (is lexically + greater)
      + Treats the CondPattern as a plain string and + compares it lexically to TestString. True if + TestString is lexically greater than + CondPattern.
    • + +
    • '=CondPattern' (is lexically + equal)
      + Treats the CondPattern as a plain string and + compares it lexically to TestString. True if + TestString is lexically equal to + CondPattern, i.e the two strings are exactly + equal (character by character). If CondPattern + is just "" (two quotation marks) this + compares TestString to the empty string.
    • + +
    • '-d' (is + directory)
      + Treats the TestString as a pathname and tests + if it exists and is a directory.
    • + +
    • '-f' (is regular + file)
      + Treats the TestString as a pathname and tests + if it exists and is a regular file.
    • + +
    • '-s' (is regular file with + size)
      + Treats the TestString as a pathname and tests + if it exists and is a regular file with size greater + than zero.
    • + +
    • '-l' (is symbolic + link)
      + Treats the TestString as a pathname and tests + if it exists and is a symbolic link.
    • + +
    • '-F' (is existing file via + subrequest)
      + Checks if TestString is a valid file and + accessible via all the server's currently-configured + access controls for that path. This uses an internal + subrequest to determine the check, so use it with care + because it decreases your servers performance!
    • + +
    • '-U' (is existing URL via + subrequest)
      + Checks if TestString is a valid URL and + accessible via all the server's currently-configured + access controls for that path. This uses an internal + subrequest to determine the check, so use it with care + because it decreases your server's performance!
    • +
    + +Notice + All of these tests can + also be prefixed by an exclamation mark ('!') to + negate their meaning. + +
  4. +
+ +

Additionally you can set special flags for + CondPattern by appending

+ +
+ [flags] +
+ as the third argument to the RewriteCond + directive. Flags is a comma-separated list of the + following flags: + +
    +
  • 'nocase|NC' + (no case)
    + This makes the test case-insensitive, i.e., there + is no difference between 'A-Z' and 'a-z' both in the + expanded TestString and the CondPattern. + This flag is effective only for comparisons between + TestString and CondPattern. It has no + effect on filesystem and subrequest checks.
  • + +
  • + 'ornext|OR' + (or next condition)
    + Use this to combine rule conditions with a local OR + instead of the implicit AND. Typical example: + + +
    +RewriteCond %{REMOTE_HOST}  ^host1.*  [OR]
    +RewriteCond %{REMOTE_HOST}  ^host2.*  [OR]
    +RewriteCond %{REMOTE_HOST}  ^host3.*
    +RewriteRule ...some special stuff for any of these hosts...
    +
    +
    + + Without this flag you would have to write the cond/rule + three times. +
  • +
+ +

Example:

+ +

To rewrite the Homepage of a site according to the + ``User-Agent:'' header of the request, you can + use the following:

+ + +
+RewriteCond  %{HTTP_USER_AGENT}  ^Mozilla.*
+RewriteRule  ^/$                 /homepage.max.html  [L]
+
+RewriteCond  %{HTTP_USER_AGENT}  ^Lynx.*
+RewriteRule  ^/$                 /homepage.min.html  [L]
+
+RewriteRule  ^/$                 /homepage.std.html  [L]
+
+
+ +

Interpretation: If you use Netscape Navigator as your + browser (which identifies itself as 'Mozilla'), then you + get the max homepage, which includes Frames, etc. + If you use the Lynx browser (which is Terminal-based), then + you get the min homepage, which contains no images, no + tables, etc. If you use any other browser you get + the standard homepage.

+ +
+ +
+ + +RewriteRule +Defines rules for the rewriting engine +RewriteRule + Pattern Substitution +None +server configvirtual host +directory.htaccess +FileInfo + + +

The RewriteRule directive is the real + rewriting workhorse. The directive can occur more than once. + Each directive then defines one single rewriting rule. The + definition order of these rules is + important, because this order is used when + applying the rules at run-time.

+ +

Pattern can + be (for Apache 1.1.x a System V8 and for Apache 1.2.x and + later a POSIX) regular + expression which gets applied to the current URL. Here + ``current'' means the value of the URL when this rule gets + applied. This may not be the originally requested URL, + because any number of rules may already have matched and made + alterations to it.

+ +

Some hints about the syntax of regular expressions:

+ + + + + +
+
+Text:
+  .           Any single character
+  [chars]     Character class: One  of chars
+  [^chars]    Character class: None of chars
+  text1|text2 Alternative: text1 or text2
+
+Quantifiers:
+  ?           0 or 1 of the preceding text
+  *           0 or N of the preceding text (N > 0)
+  +           1 or N of the preceding text (N > 1)
+
+Grouping:
+  (text)      Grouping of text
+              (either to set the borders of an alternative or
+              for making backreferences where the Nth group can 
+              be used on the RHS of a RewriteRule with $N)
+
+Anchors:
+  ^           Start of line anchor
+  $           End   of line anchor
+
+Escaping:
+  \char       escape that particular char
+              (for instance to specify the chars ".[]()" etc.)
+
+
+ +

For more information about regular expressions either have + a look at your local regex(3) manpage or its + src/regex/regex.3 copy in the Apache 1.3 + distribution. If you are interested in more detailed + information about regular expressions and their variants + (POSIX regex, Perl regex, etc.) have a look at the + following dedicated book on this topic:

+ +
+ Mastering Regular Expressions
+ Jeffrey E.F. Friedl
+ Nutshell Handbook Series
+ O'Reilly & Associates, Inc. 1997
+ ISBN 1-56592-257-3
+
+ +

Additionally in mod_rewrite the NOT character + ('!') is a possible pattern prefix. This gives + you the ability to negate a pattern; to say, for instance: + ``if the current URL does NOT match this + pattern''. This can be used for exceptional cases, where + it is easier to match the negative pattern, or as a last + default rule.

+ +Notice +When using the NOT character + to negate a pattern you cannot have grouped wildcard + parts in the pattern. This is impossible because when the + pattern does NOT match, there are no contents for the + groups. In consequence, if negated patterns are used, you + cannot use $N in the substitution + string! + + +

Substitution of a + rewriting rule is the string which is substituted for (or + replaces) the original URL for which Pattern + matched. Beside plain text you can use

+ +
    +
  1. back-references $N to the RewriteRule + pattern
  2. + +
  3. back-references %N to the last matched + RewriteCond pattern
  4. + +
  5. server-variables as in rule condition test-strings + (%{VARNAME})
  6. + +
  7. mapping-function calls + (${mapname:key|default})
  8. +
+ Back-references are $N + (N=0..9) identifiers which will be replaced + by the contents of the Nth group of the + matched Pattern. The server-variables are the same + as for the TestString of a RewriteCond + directive. The mapping-functions come from the + RewriteMap directive and are explained there. + These three types of variables are expanded in the order of + the above list. + +

As already mentioned above, all the rewriting rules are + applied to the Substitution (in the order of + definition in the config file). The URL is completely + replaced by the Substitution and the + rewriting process goes on until there are no more rules + unless explicitly terminated by a + L flag - see below.

+ +

There is a special substitution string named + '-' which means: NO + substitution! Sounds silly? No, it is useful to + provide rewriting rules which only match + some URLs but do no substitution, e.g., in + conjunction with the C (chain) flag to be + able to have more than one pattern to be applied before a + substitution occurs.

+ +

One more note: You can even create URLs in the + substitution string containing a query string part. Just use + a question mark inside the substitution string to indicate + that the following stuff should be re-injected into the + QUERY_STRING. When you want to erase an existing query + string, end the substitution string with just the question + mark.

+ +Note +There is a special feature: + When you prefix a substitution field with + http://thishost[:thisport] + then mod_rewrite automatically strips it + out. This auto-reduction on implicit external redirect + URLs is a useful and important feature when used in + combination with a mapping-function which generates the + hostname part. Have a look at the first example in the + example section below to understand this. + + +Remember + An unconditional external + redirect to your own server will not work with the prefix + http://thishost because of this feature. To + achieve such a self-redirect, you have to use the + R-flag (see below). + + +

Additionally you can set special flags for + Substitution by appending

+ +
+ [flags] +
+ as the third argument to the RewriteRule + directive. Flags is a comma-separated list of the + following flags: + +
    +
  • + 'redirect|R + [=code]' (force redirect)
    + Prefix Substitution with + http://thishost[:thisport]/ (which makes the + new URL a URI) to force a external redirection. If no + code is given a HTTP response of 302 (MOVED + TEMPORARILY) is used. If you want to use other response + codes in the range 300-400 just specify them as a number + or use one of the following symbolic names: + temp (default), permanent, + seeother. Use it for rules which should + canonicalize the URL and give it back to the client, + e.g., translate ``/~'' into + ``/u/'' or always append a slash to + /u/user, etc.
    + + +

    Note: When you use this flag, make + sure that the substitution field is a valid URL! If not, + you are redirecting to an invalid location! And remember + that this flag itself only prefixes the URL with + http://thishost[:thisport]/, rewriting + continues. Usually you also want to stop and do the + redirection immediately. To stop the rewriting you also + have to provide the 'L' flag.

    +
  • + +
  • 'forbidden|F' (force URL + to be forbidden)
    + This forces the current URL to be forbidden, + i.e., it immediately sends back a HTTP response of + 403 (FORBIDDEN). Use this flag in conjunction with + appropriate RewriteConds to conditionally block some + URLs.
  • + +
  • 'gone|G' (force URL to be + gone)
    + This forces the current URL to be gone, i.e., it + immediately sends back a HTTP response of 410 (GONE). Use + this flag to mark pages which no longer exist as gone.
  • + +
  • + 'proxy|P' (force + proxy)
    + This flag forces the substitution part to be internally + forced as a proxy request and immediately (i.e., + rewriting rule processing stops here) put through the proxy module. You have to make + sure that the substitution string is a valid URI + (e.g., typically starting with + http://hostname) which can be + handled by the Apache proxy module. If not you get an + error from the proxy module. Use this flag to achieve a + more powerful implementation of the ProxyPass directive, + to map some remote stuff into the namespace of the local + server. + +

    Notice: To use this functionality make sure you have + the proxy module compiled into your Apache server + program. If you don't know please check whether + mod_proxy.c is part of the ``httpd + -l'' output. If yes, this functionality is + available to mod_rewrite. If not, then you first have to + rebuild the ``httpd'' program with mod_proxy + enabled.

    +
  • + +
  • 'last|L' + (last rule)
    + Stop the rewriting process here and don't apply any more + rewriting rules. This corresponds to the Perl + last command or the break command + from the C language. Use this flag to prevent the currently + rewritten URL from being rewritten further by following + rules. For example, use it to rewrite the root-path URL + ('/') to a real one, e.g., + '/e/www/'.
  • + +
  • 'next|N' + (next round)
    + Re-run the rewriting process (starting again with the + first rewriting rule). Here the URL to match is again not + the original URL but the URL from the last rewriting rule. + This corresponds to the Perl next command or + the continue command from the C language. Use + this flag to restart the rewriting process, i.e., + to immediately go to the top of the loop.
    + But be careful not to create an infinite + loop!
  • + +
  • 'chain|C' + (chained with next rule)
    + This flag chains the current rule with the next rule + (which itself can be chained with the following rule, + etc.). This has the following effect: if a rule + matches, then processing continues as usual, i.e., + the flag has no effect. If the rule does + not match, then all following chained + rules are skipped. For instance, use it to remove the + ``.www'' part inside a per-directory rule set + when you let an external redirect happen (where the + ``.www'' part should not to occur!).
  • + +
  • + 'type|T=MIME-type' + (force MIME type)
    + Force the MIME-type of the target file to be + MIME-type. For instance, this can be used to + simulate the mod_alias directive + ScriptAlias which internally forces all files + inside the mapped directory to have a MIME type of + ``application/x-httpd-cgi''.
  • + +
  • + 'nosubreq|NS' (used only if + no internal + sub-request)
    + This flag forces the rewriting engine to skip a + rewriting rule if the current request is an internal + sub-request. For instance, sub-requests occur internally + in Apache when mod_include tries to find out + information about possible directory default files + (index.xxx). On sub-requests it is not + always useful and even sometimes causes a failure to if + the complete set of rules are applied. Use this flag to + exclude some rules.
    + + +

    Use the following rule for your decision: whenever you + prefix some URLs with CGI-scripts to force them to be + processed by the CGI-script, the chance is high that you + will run into problems (or even overhead) on + sub-requests. In these cases, use this flag.

    +
  • + +
  • 'nocase|NC' + (no case)
    + This makes the Pattern case-insensitive, + i.e., there is no difference between 'A-Z' and + 'a-z' when Pattern is matched against the current + URL.
  • + +
  • 'qsappend|QSA' + (query string + append)
    + This flag forces the rewriting engine to append a query + string part in the substitution string to the existing one + instead of replacing it. Use this when you want to add more + data to the query string via a rewrite rule.
  • + +
  • + 'noescape|NE' + (no URI escaping of + output)
    + This flag keeps mod_rewrite from applying the usual URI + escaping rules to the result of a rewrite. Ordinarily, + special characters (such as '%', '$', ';', and so on) + will be escaped into their hexcode equivalents ('%25', + '%24', and '%3B', respectively); this flag prevents this + from being done. This allows percent symbols to appear in + the output, as in + + RewriteRule /foo/(.*) /bar?arg=P1\%3d$1 [R,NE] + + + which would turn '/foo/zed' into a safe + request for '/bar?arg=P1=zed'. +
  • + +
  • + 'passthrough|PT' + (pass through to next + handler)
    + This flag forces the rewriting engine to set the + uri field of the internal + request_rec structure to the value of the + filename field. This flag is just a hack to + be able to post-process the output of + RewriteRule directives by + Alias, ScriptAlias, + Redirect, etc. directives from + other URI-to-filename translators. A trivial example to + show the semantics: If you want to rewrite + /abc to /def via the rewriting + engine of mod_rewrite and then + /def to /ghi with + mod_alias: + + RewriteRule ^/abc(.*) /def$1 [PT]
    + Alias /def /ghi +
    + If you omit the PT flag then + mod_rewrite will do its job fine, + i.e., it rewrites uri=/abc/... to + filename=/def/... as a full API-compliant + URI-to-filename translator should do. Then + mod_alias comes and tries to do a + URI-to-filename transition which will not work. + +

    Note: You have to use this flag if you want to + intermix directives of different modules which contain + URL-to-filename translators. The typical example + is the use of mod_alias and + mod_rewrite..

    + +For Apache hackers + If the current Apache API had a filename-to-filename + hook additionally to the URI-to-filename hook then we + wouldn't need this flag! But without such a hook this + flag is the only solution. The Apache Group has + discussed this problem and will add such a hook in + Apache version 2.0. + +
  • + +
  • 'skip|S=num' + (skip next rule(s))
    + This flag forces the rewriting engine to skip the next + num rules in sequence when the current rule + matches. Use this to make pseudo if-then-else constructs: + The last rule of the then-clause becomes + skip=N where N is the number of rules in the + else-clause. (This is not the same as the + 'chain|C' flag!)
  • + +
  • + 'env|E=VAR:VAL' + (set environment variable)
    + This forces an environment variable named VAR to + be set to the value VAL, where VAL can + contain regexp backreferences $N and + %N which will be expanded. You can use this + flag more than once to set more than one variable. The + variables can be later dereferenced in many situations, but + usually from within XSSI (via <!--#echo + var="VAR"-->) or CGI (e.g. + $ENV{'VAR'}). Additionally you can dereference + it in a following RewriteCond pattern via + %{ENV:VAR}. Use this to strip but remember + information from URLs.
  • +
+ +Note Never forget that Pattern is +applied to a complete URL in per-server configuration +files. But in per-directory configuration files, the +per-directory prefix (which always is the same for a specific +directory!) is automatically removed for the pattern matching +and automatically added after the substitution has been +done. This feature is essential for many sorts of rewriting, +because without this prefix stripping you have to match the parent +directory which is not always possible. + +

There is one exception: If a substitution string + starts with ``http://'' then the directory + prefix will not be added and an + external redirect or proxy throughput (if flag + P is used!) is forced!

+
+ +Note + To enable the rewriting engine + for per-directory configuration files you need to set + ``RewriteEngine On'' in these files + and ``Options + FollowSymLinks'' must be enabled. If your + administrator has disabled override of + FollowSymLinks for a user's directory, then + you cannot use the rewriting engine. This restriction is + needed for security reasons. + + +

Here are all possible substitution combinations and their + meanings:

+ +

Inside per-server configuration + (httpd.conf)
+ for request ``GET + /somepath/pathinfo'':

+

+ + + + + +
+
+Given Rule                                      Resulting Substitution
+----------------------------------------------  ----------------------------------
+^/somepath(.*) otherpath$1                      not supported, because invalid!
+
+^/somepath(.*) otherpath$1  [R]                 not supported, because invalid!
+
+^/somepath(.*) otherpath$1  [P]                 not supported, because invalid!
+----------------------------------------------  ----------------------------------
+^/somepath(.*) /otherpath$1                     /otherpath/pathinfo
+
+^/somepath(.*) /otherpath$1 [R]                 http://thishost/otherpath/pathinfo
+                                                via external redirection
+
+^/somepath(.*) /otherpath$1 [P]                 not supported, because silly!
+----------------------------------------------  ----------------------------------
+^/somepath(.*) http://thishost/otherpath$1      /otherpath/pathinfo
+
+^/somepath(.*) http://thishost/otherpath$1 [R]  http://thishost/otherpath/pathinfo
+                                                via external redirection
+
+^/somepath(.*) http://thishost/otherpath$1 [P]  not supported, because silly!
+----------------------------------------------  ----------------------------------
+^/somepath(.*) http://otherhost/otherpath$1     http://otherhost/otherpath/pathinfo
+                                                via external redirection
+
+^/somepath(.*) http://otherhost/otherpath$1 [R] http://otherhost/otherpath/pathinfo
+                                                via external redirection
+                                                (the [R] flag is redundant)
+
+^/somepath(.*) http://otherhost/otherpath$1 [P] http://otherhost/otherpath/pathinfo
+                                                via internal proxy
+
+
+ +

Inside per-directory configuration for + /somepath
+ (i.e., file .htaccess in dir + /physical/path/to/somepath containing + RewriteBase /somepath)
+ for request ``GET + /somepath/localpath/pathinfo'':

+

+ + + + + +
+
+Given Rule                                      Resulting Substitution
+----------------------------------------------  ----------------------------------
+^localpath(.*) otherpath$1                      /somepath/otherpath/pathinfo
+
+^localpath(.*) otherpath$1  [R]                 http://thishost/somepath/otherpath/pathinfo
+                                                via external redirection
+
+^localpath(.*) otherpath$1  [P]                 not supported, because silly!
+----------------------------------------------  ----------------------------------
+^localpath(.*) /otherpath$1                     /otherpath/pathinfo
+
+^localpath(.*) /otherpath$1 [R]                 http://thishost/otherpath/pathinfo
+                                                via external redirection
+
+^localpath(.*) /otherpath$1 [P]                 not supported, because silly!
+----------------------------------------------  ----------------------------------
+^localpath(.*) http://thishost/otherpath$1      /otherpath/pathinfo
+
+^localpath(.*) http://thishost/otherpath$1 [R]  http://thishost/otherpath/pathinfo
+                                                via external redirection
+
+^localpath(.*) http://thishost/otherpath$1 [P]  not supported, because silly!
+----------------------------------------------  ----------------------------------
+^localpath(.*) http://otherhost/otherpath$1     http://otherhost/otherpath/pathinfo
+                                                via external redirection
+
+^localpath(.*) http://otherhost/otherpath$1 [R] http://otherhost/otherpath/pathinfo
+                                                via external redirection
+                                                (the [R] flag is redundant)
+
+^localpath(.*) http://otherhost/otherpath$1 [P] http://otherhost/otherpath/pathinfo
+                                                via internal proxy
+
+
+ +

Example:

+ +

We want to rewrite URLs of the form

+ +
+ / Language /~ + Realname /.../ File +
+ into + +
+ /u/ Username /.../ + File . Language +
+ +

We take the rewrite mapfile from above and save it under + /path/to/file/map.txt. Then we only have to + add the following lines to the Apache server configuration + file:

+ + +
+RewriteLog   /path/to/file/rewrite.log
+RewriteMap   real-to-user               txt:/path/to/file/map.txt
+RewriteRule  ^/([^/]+)/~([^/]+)/(.*)$   /u/${real-to-user:$2|nobody}/$3.$1
+
+
+ +
+
+ +
+ diff --git a/docs/manual/mod/mod_setenvif.xml b/docs/manual/mod/mod_setenvif.xml new file mode 100644 index 00000000000..41bc4ddb04d --- /dev/null +++ b/docs/manual/mod/mod_setenvif.xml @@ -0,0 +1,258 @@ + + + + +mod_setenvif +Base +setenvif_module +mod_setenvif.c +Available in Apache 1.3 and later + +Allows the setting of environment variables based +on characteristics of the request + + + +

The mod_setenvif module allows you to set + environment variables according to whether different aspects of + the request match regular expressions you specify. These + environment variables can be used by other parts of the server + to make decisions about actions to be taken.

+ +

The directives are considered in the order they appear in + the configuration files. So more complex sequences can be used, + such as this example, which sets netscape if the + browser is mozilla but not MSIE.

+ + + BrowserMatch ^Mozilla netscape
+ BrowserMatch MSIE !netscape
+
+
+ +Environment Variables in Apache + + +BrowserMatch +Sets environment variables conditional on HTTP User-Agent + +BrowserMatch regex env-variable[=value] +[env-variable[=value]] ... +none +server config, virtual host, directory, .htaccess +FileInfo +Apache 1.2 and + above (in Apache 1.2 this directive was found in the + now-obsolete mod_browser module) + + +

The BrowserMatch directive defines + environment variables based on the User-Agent HTTP + request header field. The first argument should be a POSIX.2 + extended regular expression (similar to an + egrep-style regex). The rest of the arguments give + the names of variables to set, and optionally values to which they + should be set. These take the form of

+ +
    +
  1. varname, or
  2. + +
  3. !varname, or
  4. + +
  5. varname=value
  6. +
+ +

In the first form, the value will be set to "1". The second + will remove the given variable if already defined, and the + third will set the variable to the value given by + value. If a User-Agent + string matches more than one entry, they will be merged. + Entries are processed in the order in which they appear, and + later entries can override earlier ones.

+ +

For example:

+ + BrowserMatch ^Mozilla forms jpeg=yes browser=netscape
+ BrowserMatch "^Mozilla/[2-3]" tables agif frames javascript
+ BrowserMatch MSIE !javascript
+
+ +

Note that the regular expression string is + case-sensitive. For case-INsensitive matching, + see the BrowserMatchNoCase + directive.

+ +

The BrowserMatch and + BrowserMatchNoCase directives are special cases of + the SetEnvIf and SetEnvIfNoCase + directives. The following two lines have the same effect:

+ + BrowserMatchNoCase Robot is_a_robot
+ SetEnvIfNoCase User-Agent Robot is_a_robot
+
+
+
+ + +BrowserMatchNoCase +Sets environment variables conditional on User-Agent without +respect to case +BrowserMatchNoCase regex env-variable[=value] + [env-variable[=value]] ... +none +server config, virtual host, directory, .htaccess +FileInfo +Apache 1.2 and + above (in Apache 1.2 this directive was found in the + now-obsolete mod_browser module) + + + +

The BrowserMatchNoCase directive is + semantically identical to the BrowserMatch directive. + However, it provides for case-insensitive matching. For + example:

+ + BrowserMatchNoCase mac platform=macintosh
+ BrowserMatchNoCase win platform=windows
+
+ +

The BrowserMatch and + BrowserMatchNoCase directives are special cases of + the SetEnvIf and SetEnvIfNoCase + directives. The following two lines have the same effect:

+ + BrowserMatchNoCase Robot is_a_robot
+ SetEnvIfNoCase User-Agent Robot is_a_robot
+
+
+
+ + +SetEnvIf +Sets environment variables based on attributes of the request + +SetEnvIf attribute + regex env-variable[=value] + [env-variable[=value]] ... +none + server config, virtual host, directory, .htaccess +FileInfo +Apache 1.3 and + above; the Request_Protocol keyword and environment-variable + matching are only available with 1.3.7 and later + + +

The SetEnvIf directive defines environment + variables based on attributes of the request. These attributes + can be the values of various HTTP request header fields (see RFC2616 + for more information about these), or of other aspects of the + request, including the following:

+ +
    +
  • Remote_Host - the hostname (if available) of + the client making the request
  • + +
  • Remote_Addr - the IP address of the client + making the request
  • + +
  • Remote_User - the authenticated username (if + available)
  • + +
  • Request_Method - the name of the method + being used (GET, POST, et + cetera)
  • + +
  • Request_Protocol - the name and version of + the protocol with which the request was made (e.g., + "HTTP/0.9", "HTTP/1.1", etc.)
  • + +
  • Request_URI - the portion of the URL + following the scheme and host portion
  • +
+ +

Some of the more commonly used request header field names + include Host, User-Agent, and + Referer.

+ +

If the attribute name doesn't match any of the + special keywords, nor any of the request's header field names, + it is tested as the name of an environment variable in the list + of those associated with the request. This allows + SetEnvIf directives to test against the result of + prior matches.

+ + + Only those environment variables defined by earlier + SetEnvIf[NoCase] directives are available for + testing in this manner. 'Earlier' means that they were + defined at a broader scope (such as server-wide) or + previously in the current directive's scope. + + +

attribute may be a regular expression when used to + match a request header. If attribute is a regular + expression and it doesn't match any of the request's header + names, then attribute is not tested against the + request's environment variable list.

+ + +Example: + SetEnvIf Request_URI "\.gif$" object_is_image=gif
+ SetEnvIf Request_URI "\.jpg$" object_is_image=jpg
+ SetEnvIf Request_URI "\.xbm$" object_is_image=xbm
+ :
+ SetEnvIf Referer www\.mydomain\.com intra_site_referral
+ :
+ SetEnvIf object_is_image xbm XBIT_PROCESSING=1
+ :
+ SetEnvIf ^TS* ^[a-z].* HAVE_TS
+
+ +

The first three will set the environment variable + object_is_image if the request was for an image + file, and the fourth sets intra_site_referral if + the referring page was somewhere on the + www.mydomain.com Web site.

+ +

The last example will set environment variable + HAVE_TS if the request contains any headers that + begin with "TS" whose values begins with any character in the + set [a-z].

+
+
+ + +SetEnvIfNoCase +Sets environment variables based on attributes of the request +without respect to case +SetEnvIfNoCase attribute regex env-variable[=value] + [env-variable[=value]] ... +none +server config, virtual host, directory, .htaccess +FileInfo +Apache 1.3 and above + + + +

The SetEnvIfNoCase is semantically identical to + the SetEnvIf directive, + and differs only in that the regular expression matching is + performed in a case-insensitive manner. For example:

+ + SetEnvIfNoCase Host Apache\.Org site=apache + + +

This will cause the site environment variable + to be set to "apache" if the HTTP request header + field Host: was included and contained + Apache.Org, apache.org, or any other + combination.

+
+
+
\ No newline at end of file diff --git a/docs/manual/mod/mod_so.xml b/docs/manual/mod/mod_so.xml new file mode 100755 index 00000000000..2c510b92494 --- /dev/null +++ b/docs/manual/mod/mod_so.xml @@ -0,0 +1,157 @@ + + + + +mod_so +Base (Windows>; Optional (Unix) +so_module +mod_so.c +Available in Apache 1.3 and later. + + +This module provides for loading of executable code and +modules into the server at start-up or restart time. + + + +

On selected operating systems this module can be used to + load modules into Apache at runtime via the Dynamic Shared Object (DSO) mechanism, + rather than requiring a recompilation.

+ +

On Unix, the loaded code typically comes from shared object + files (usually with .so extension), on Windows + this may either the .so or .dll + extension. This module is only available in Apache 1.3 and + up.

+ +

In previous releases, the functionality of this module was + provided for Unix by mod_dld, and for Windows by mod_dll. On + Windows, mod_dll was used in beta release 1.3b1 through 1.3b5. + mod_so combines these two modules into a single module for all + operating systems.

+ +

Warning: Apache 1.3 modules cannot be directly used + with Apache 2.0 - the module must be modified to dynamically + load or compile into Apache 2.0.

+
+ +
Creating Loadable Modules +for Windows + +

Note: the module name format changed for Windows + with Apache 1.3.15 and 2.0 - the modules are now named as + mod_foo.so. While mod_so still loads modules with + ApacheModuleFoo.dll names, the new naming convention is + preferred; if you are converting your loadable module for 2.0, + please fix the name to this 2.0 convention.

+ +

The Apache module API is unchanged between the Unix and + Windows versions. Many modules will run on Windows with no or + little change from Unix, although others rely on aspects of the + Unix architecture which are not present in Windows, and will + not work.

+ +

When a module does work, it can be added to the server in + one of two ways. As with Unix, it can be compiled into the + server. Because Apache for Windows does not have the + Configure program of Apache for Unix, the module's + source file must be added to the ApacheCore project file, and + its symbols must be added to the + os\win32\modules.c file.

+ +

The second way is to compile the module as a DLL, a shared + library that can be loaded into the server at runtime, using + the LoadModule + directive. These module DLLs can be distributed and run on any + Apache for Windows installation, without recompilation of the + server.

+ +

To create a module DLL, a small change is necessary to the + module's source file: The module record must be exported from + the DLL (which will be created later; see below). To do this, + add the AP_MODULE_DECLARE_DATA (defined in the + Apache header files) to your module's module record definition. + For example, if your module has:

+ + + module foo_module; + + +

Replace the above with:

+ + module AP_MODULE_DECLARE_DATA foo_module; + + +

Note that this will only be activated on Windows, so the + module can continue to be used, unchanged, with Unix if needed. + Also, if you are familiar with .DEF files, you can + export the module record with that method instead.

+ +

Now, create a DLL containing your module. You will need to + link this against the libhttpd.lib export library that is + created when the libhttpd.dll shared library is compiled. You + may also have to change the compiler settings to ensure that + the Apache header files are correctly located. You can find + this library in your server root's modules directory. It is + best to grab an existing module .dsp file from the tree to + assure the build environment is configured correctly, or + alternately compare the compiler and link options to your + .dsp.

+ +

This should create a DLL version of your module. Now simply + place it in the modules directory of your server + root, and use the LoadModule + directive to load it.

+ +
+ + +LoadFile +LoadFile filename [filename] ... +none + +server config + +Link in the named object file or library + + + +

The LoadFile directive links in the named object files or + libraries when the server is started or restarted; this is used + to load additional code which may be required for some module + to work. Filename is either an absolute path or + relative to ServerRoot.

+
+
+ + +LoadModule +LoadModule module filename +none + +server config + +Links in the object file or library, and adds to the list +of active modules + + +

The LoadModule directive links in the object file or library + filename and adds the module structure named + module to the list of active modules. Module + is the name of the external variable of type + module in the file, and is listed as the Module Identifier + in the module documentation. Example:

+ + + LoadModule status_module modules/mod_status.so + + +

loads the named module from the modules subdirectory of the + ServerRoot.

+
+ +
+
+ diff --git a/docs/manual/mod/mod_speling.xml b/docs/manual/mod/mod_speling.xml new file mode 100755 index 00000000000..dd6df25b746 --- /dev/null +++ b/docs/manual/mod/mod_speling.xml @@ -0,0 +1,96 @@ + + + + +mod_speling +Extension +speling_module +mod_speling.c +Available in Apache 1.3 and later. Available as +an External module in Apache 1.1 and later. + +This module attempts to correct misspellings of URLs that +users might have entered, by ignoring capitalization and by +allowing up to one misspelling. + + + +

Requests to documents sometimes cannot be served by the core + apache server because the request was misspelled or + miscapitalized. This module addresses this problem by trying to + find a matching document, even after all other modules gave up. + It does its work by comparing each document name in the + requested directory against the requested document name + without regard to case, and allowing + up to one misspelling (character insertion / + omission / transposition or wrong character). A list is built + with all document names which were matched using this + strategy.

+ +

If, after scanning the directory,

+ + + +
+ + + +CheckSpelling +CheckSpelling on|off +CheckSpelling Off + +server config +virtual host +directory +.htaccess + +Options +CheckSpelling was available as a separately available +module for Apache 1.1, but was limited to miscapitalizations. As +of Apache 1.3, it is part of the Apache distribution. Prior to Apache +1.3.2, the CheckSpelling directive was only available in the +"server" and "virtual host" contexts. +This directive enables or disables the spelling +module. + + + +

This directive enables or disables the spelling module. When + enabled, keep in mind that

+ +
    +
  • the directory scan which is necessary for the spelling + correction will have an impact on the server's performance + when many spelling corrections have to be performed at the + same time.
  • + +
  • the document trees should not contain sensitive files + which could be matched inadvertently by a spelling + "correction".
  • + +
  • the module is unable to correct misspelled user names (as + in http://my.host/~apahce/), just file names or + directory names.
  • + +
  • spelling corrections apply strictly to existing files, so + a request for the <Location /status> may + get incorrectly treated as the negotiated file + "/stats.html".
  • +
+
+ +
+ +
+ diff --git a/docs/manual/mod/mod_ssl.html b/docs/manual/mod/mod_ssl.html new file mode 100644 index 00000000000..f7ecb633ffe --- /dev/null +++ b/docs/manual/mod/mod_ssl.html @@ -0,0 +1,2539 @@ + + +mod_ssl: Reference + + + + + + + + + + +
+ + + + +
+
+ + + + + + + + + + + + + +
+ + + + + +
+ mod_ssl + + Chapter 3 +
+
+ + + + + +
+previous page
Introduction +
+next page
Compatibility +
+
+
+ Reference +
+
+ + + + + + + +
+ +``Try to understand everything, +but believe nothing!'' + +
+ +Unknown + +
+
+

+ + + + + + +
+T +his chapter provides a reference to all configuration directives and +additional user visible features mod_ssl provides. It's intended as the +official resource when you want to know how a particilar mod_ssl functionality +is actually configured or activated. Each directive is documented similar to +the way standard Apache directives are documented in the official Apache +documentation set, i.e. for each directive especially the syntax, default and +context where applicable is given. +

+Notice that there are three major classes of directives which are used by +mod_ssl: First Global Directives (i.e. directives with context +``server config''), which can occur inside the server config files but only +outside of any sectioning commands like <VirtualHost>. Second +Per-Server Directives (i.e. those with context ``server config, +virtual host''), which can occur inside the server config files both outside +(for the main/default server) and inside <VirtualHost> sections. +

+   + +
+ + + + + + + +
+ +Table Of Contents + +
+ +Configuration Directives
+        SSLPassPhraseDialog
+        SSLMutex
+        SSLRandomSeed
+        SSLSessionCache
+        SSLSessionCacheTimeout
+        SSLEngine
+        SSLProtocol
+        SSLCipherSuite
+        SSLCertificateFile
+        SSLCertificateKeyFile
+        SSLCertificateChainFile
+        SSLCACertificatePath
+        SSLCACertificateFile
+        SSLCARevocationPath
+        SSLCARevocationFile
+        SSLVerifyClient
+        SSLVerifyDepth
+        SSLLog
+        SSLLogLevel
+        SSLOptions
+        SSLRequireSSL
+        SSLRequire
+Additional Features
+        Environment Variables
+        Custom Log Formats
+
+
+
+
+

+And third Per-Directory Directives (i.e. those with context ``server +config, virtual host, directory, .htaccess''), which can pretty much occur +everywhere. Especially both inside the server config files and the +per-directory .htaccess files. The three classes are subsets of +each other, i.e. directives from the per-directory class can also be used in +the per-server and global context, and directives from the per-server class +can also be used the in the global context. +

+Additional directives and environment variables provided by mod_ssl (via +on-the-fly mapping) for backward compatiblity to other Apache SSL solutions +are documented in the Compatibility chapter. +

Configuration Directives

+The most visible and error-prone things of mod_ssl are its configuration +directives. So we document them in great detail here to assist you in setting +up the best possible configuration of your SSL-aware webserver. + +

+
+ +

SSLPassPhraseDialog

+

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLPassPhraseDialog
+Description: Type of pass phrase dialog for encrypted private keys
Syntax: SSLPassPhraseDialog type
Default: SSLPassPhraseDialog builtin
Context: server config
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.1
+
+
+

+When Apache starts up it has to read the various Certificate (see SSLCertificateFile) and Private Key (see SSLCertificateKeyFile) files of the +SSL-enabled virtual servers. Because for security reasons the Private Key +files are usually encrypted, mod_ssl needs to query the administrator for a +Pass Phrase in order to decrypt those files. This query can be done in two ways +which can be configured by type: +

    +
  • builtin +

    + This is the default where an interactive terminal dialog occurs at startup + time just before Apache detaches from the terminal. Here the administrator + has to manually enter the Pass Phrase for each encrypted Private Key file. + Because a lot of SSL-enabled virtual hosts can be configured, the + following reuse-scheme is used to minimize the dialog: When a Private Key + file is encrypted, all known Pass Phrases (at the beginning there are + none, of course) are tried. If one of those known Pass Phrases succeeds no + dialog pops up for this particular Private Key file. If none succeeded, + another Pass Phrase is queried on the terminal and remembered for the next + round (where it perhaps can be reused). +

    + This scheme allows mod_ssl to be maximally flexible (because for N encrypted + Private Key files you can use N different Pass Phrases - but then + you have to enter all of them, of course) while minimizing the terminal + dialog (i.e. when you use a single Pass Phrase for all N Private Key files + this Pass Phrase is queried only once). +

    +

  • exec:/path/to/program +

    + Here an external program is configured which is called at startup for each + encrypted Private Key file. It is called with two arguments (the first is + of the form ``servername:portnumber'', the second is either + ``RSA'' or ``DSA''), which indicate for which + server and algorithm it has to print the corresponding Pass Phrase to + stdout. The intent is that this external program first runs + security checks to make sure that the system is not compromised by an + attacker, and only when these checks were passed successfully it provides + the Pass Phrase. +

    + Both these security checks, and the way the Pass Phrase is determined, can + be as complex as you like. Mod_ssl just defines the interface: an + executable program which provides the Pass Phrase on stdout. + Nothing more or less! So, if you're really paranoid about security, here + is your interface. Anything else has to be left as an exercise to the + administrator, because local security requirements are so different. +

    + The reuse-algorithm above is used here, too. In other words: The external + program is called only once per unique Pass Phrase. +

+

+Example: +

+
+SSLPassPhraseDialog exec:/usr/local/apache/sbin/pp-filter
+
+
+ +

+
+ +

SSLMutex

+

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLMutex
+Description: Semaphore for internal mutual exclusion of operations
Syntax: SSLMutex type
Default: SSLMutex none
Context: server config
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.1
+
+
+

+This configures the SSL engine's semaphore (aka. lock) which is used for mutual +exclusion of operations which have to be done in a synchronized way between the +pre-forked Apache server processes. This directive can only be used in the +global server context because it's only useful to have one global mutex. +

+The following Mutex types are available: +

    +
  • none +

    + This is the default where no Mutex is used at all. Use it at your own + risk. But because currently the Mutex is mainly used for synchronizing + write access to the SSL Session Cache you can live without it as long + as you accept a sometimes garbled Session Cache. So it's not recommended + to leave this the default. Instead configure a real Mutex. +

    +

  • file:/path/to/mutex +

    + This is the portable and (under Unix) always provided Mutex variant where + a physical (lock-)file is used as the Mutex. Always use a local disk + filesystem for /path/to/mutex and never a file residing on a + NFS- or AFS-filesystem. Note: Internally, the Process ID (PID) of the + Apache parent process is automatically appended to + /path/to/mutex to make it unique, so you don't have to worry + about conflicts yourself. Notice that this type of mutex is not available + under the Win32 environment. There you have to use the semaphore + mutex. +

    +

  • sem +

    + This is the most elegant but also most non-portable Mutex variant where a + SysV IPC Semaphore (under Unix) and a Windows Mutex (under Win32) is used + when possible. It is only available when the underlying platform + supports it. +

+

+Example: +

+
+SSLMutex file:/usr/local/apache/logs/ssl_mutex
+
+
+ +

+
+ +

SSLRandomSeed

+

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLRandomSeed
+Description: Pseudo Random Number Generator (PRNG) seeding source
Syntax: SSLRandomSeed context source [bytes]
Default: none
Context: server config
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.2
+
+
+

+This configures one or more sources for seeding the Pseudo Random Number +Generator (PRNG) in OpenSSL at startup time (context is +startup) and/or just before a new SSL connection is established +(context is connect). This directive can only be used +in the global server context because the PRNG is a global facility. +

+The following source variants are available: +

    +
  • builtin +

    This is the always available builtin seeding source. It's usage + consumes minimum CPU cycles under runtime and hence can be always used + without drawbacks. The source used for seeding the PRNG contains of the + current time, the current process id and (when applicable) a randomly + choosen 1KB extract of the inter-process scoreboard structure of Apache. + The drawback is that this is not really a strong source and at startup + time (where the scoreboard is still not available) this source just + produces a few bytes of entropy. So you should always, at least for the + startup, use an additional seeding source. +

    +

  • file:/path/to/source +

    + This variant uses an external file /path/to/source as the + source for seeding the PRNG. When bytes is specified, only the + first bytes number of bytes of the file form the entropy (and + bytes is given to /path/to/source as the first + argument). When bytes is not specified the whole file forms the + entropy (and 0 is given to /path/to/source as + the first argument). Use this especially at startup time, for instance + with an available /dev/random and/or + /dev/urandom devices (which usually exist on modern Unix + derivates like FreeBSD and Linux). +

    + But be careful: Usually /dev/random provides only as + much entropy data as it actually has, i.e. when you request 512 bytes of + entropy, but the device currently has only 100 bytes available two things + can happen: On some platforms you receive only the 100 bytes while on + other platforms the read blocks until enough bytes are available (which + can take a long time). Here using an existing /dev/urandom is + better, because it never blocks and actually gives the amount of requested + data. The drawback is just that the quality of the received data may not + be the best. +

    + On some platforms like FreeBSD one can even control how the entropy is + actually generated, i.e. by which system interrupts. More details one can + find under rndcontrol(8) on those platforms. Alternatively, when + your system lacks such a random device, you can use tool + like EGD + (Entropy Gathering Daemon) and run it's client program with the + exec:/path/to/program/ variant (see below) or use + egd:/path/to/egd-socket (see below). +

    +

  • exec:/path/to/program +

    + This variant uses an external executable /path/to/program as + the source for seeding the PRNG. When bytes is specified, only the + first bytes number of bytes of its stdout contents + form the entropy. When bytes is not specified, the entirety of + the data produced on stdout form the entropy. Use this only + at startup time when you need a very strong seeding with the help of an + external program (for instance as in the example above with the + truerand utility you can find in the mod_ssl distribution + which is based on the AT&T truerand library). Using this in + the connection context slows down the server too dramatically, of course. + So usually you should avoid using external programs in that context. +

    +

  • egd:/path/to/egd-socket (Unix only) +

    + This variant uses the Unix domain socket of the + external Entropy Gathering Daemon (EGD) (see http://www.lothar.com/tech + /crypto/) to seed the PRNG. Use this if no random device exists + on your platform. +

+

+Example: +

+
+SSLRandomSeed startup builtin
+SSLRandomSeed startup file:/dev/random
+SSLRandomSeed startup file:/dev/urandom 1024
+SSLRandomSeed startup exec:/usr/local/bin/truerand 16
+SSLRandomSeed connect builtin
+SSLRandomSeed connect file:/dev/random
+SSLRandomSeed connect file:/dev/urandom 1024
+
+
+ +

+
+ +

SSLSessionCache

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLSessionCache
+Description: Type of the global/inter-process SSL Session Cache
Syntax: SSLSessionCache type
Default: SSLSessionCache none
Context: server config
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.1
+
+
+

+This configures the storage type of the global/inter-process SSL Session +Cache. This cache is an optional facility which speeds up parallel request +processing. For requests to the same server process (via HTTP keep-alive), +OpenSSL already caches the SSL session information locally. But because modern +clients request inlined images and other data via parallel requests (usually +up to four parallel requests are common) those requests are served by +different pre-forked server processes. Here an inter-process cache +helps to avoid unneccessary session handshakes. +

+The following two storage types are currently supported: +

    +
  • none +

    + This is the default and just disables the global/inter-process Session + Cache. There is no drawback in functionality, but a noticeable speed + penalty can be observed. +

    +

  • dbm:/path/to/datafile +

    + This makes use of a DBM hashfile on the local disk to synchronize the + local OpenSSL memory caches of the server processes. The slight increase + in I/O on the server results in a visible request speedup for your + clients, so this type of storage is generally recommended. +

    +

  • shm:/path/to/datafile[(size)] +

    + This makes use of a high-performance hash table (approx. size bytes + in size) inside a shared memory segment in RAM (established via + /path/to/datafile) to synchronize the local OpenSSL memory + caches of the server processes. This storage type is not available on all + platforms. See the mod_ssl INSTALL document for details on + how to build Apache+EAPI with shared memory support. +

+

+Examples: +

+
+SSLSessionCache dbm:/usr/local/apache/logs/ssl_gcache_data
+SSLSessionCache shm:/usr/local/apache/logs/ssl_gcache_data(512000)
+
+
+ +

+
+ +

SSLSessionCacheTimeout

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLSessionCacheTimeout
+Description: Number of seconds before an SSL session expires in the Session Cache
Syntax: SSLSessionCacheTimeout seconds
Default: SSLSessionCacheTimeout 300
Context: server config, virtual host
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.0
+
+
+

+This directive sets the timeout in seconds for the information stored in the +global/inter-process SSL Session Cache and the OpenSSL internal memory cache. +It can be set as low as 15 for testing, but should be set to higher +values like 300 in real life. +

+Example: +

+
+SSLSessionCacheTimeout 600
+
+
+ +

+
+ +

SSLEngine

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLEngine
+Description: SSL Engine Operation Switch
Syntax: SSLEngine on|off
Default: SSLEngine off
Context: server config, virtual host
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.1
+
+
+

+This directive toggles the usage of the SSL/TLS Protocol Engine. This is +usually used inside a <VirtualHost> section to enable SSL/TLS for a +particular virtual host. By default the SSL/TLS Protocol Engine is disabled +for both the main server and all configured virtual hosts. +

+Example: +

+
+<VirtualHost _default_:443>
+SSLEngine on
+...
+</VirtualHost>
+
+
+ +

+
+ +

SSLProtocol

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLProtocol
+Description: Configure usable SSL protocol flavors
Syntax: SSLProtocol [+-]protocol ...
Default: SSLProtocol all
Context: server config, virtual host
Override: Options
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.2
+
+
+

+This directive can be used to control the SSL protocol flavors mod_ssl should +use when establishing its server environment. Clients then can only connect +with one of the provided protocols. +

+The available (case-insensitive) protocols are: +

    +
  • SSLv2 +

    + This is the Secure Sockets Layer (SSL) protocol, version 2.0. It is the + original SSL protocol as designed by Netscape Corporation. +

    +

  • SSLv3 +

    + This is the Secure Sockets Layer (SSL) protocol, version 3.0. It is the + successor to SSLv2 and the currently (as of February 1999) de-facto + standardized SSL protocol from Netscape Corporation. It's supported by + almost all popular browsers. +

    +

  • TLSv1 +

    + This is the Transport Layer Security (TLS) protocol, version 1.0. It is the + successor to SSLv3 and currently (as of February 1999) still under + construction by the Internet Engineering Task Force (IETF). It's still + not supported by any popular browsers. +

    +

  • All +

    + This is a shortcut for ``+SSLv2 +SSLv3 +TLSv1'' and a + convinient way for enabling all protocols except one when used in + combination with the minus sign on a protocol as the example above shows. +

+

+Example: +

+
+#   enable SSLv3 and TLSv1, but not SSLv2
+SSLProtocol all -SSLv2
+
+
+ +

+
+ +

SSLCipherSuite

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLCipherSuite
+Description: Cipher Suite available for negotiation in SSL handshake
Syntax: SSLCipherSuite cipher-spec
Default: SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
Context: server config, virtual host, directory, .htaccess
Override: AuthConfig
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.1
+
+
+

+This complex directive uses a colon-separated cipher-spec string +consisting of OpenSSL cipher specifications to configure the Cipher Suite the +client is permitted to negotiate in the SSL handshake phase. Notice that this +directive can be used both in per-server and per-directory context. In +per-server context it applies to the standard SSL handshake when a connection +is established. In per-directory context it forces a SSL renegotation with the +reconfigured Cipher Suite after the HTTP request was read but before the HTTP +response is sent. +

+An SSL cipher specification in cipher-spec is composed of 4 major +attributes plus a few extra minor ones: +

    +
  • Key Exchange Algorithm:
    + RSA or Diffie-Hellman variants. +

    +

  • Authentication Algorithm:
    + RSA, Diffie-Hellman, DSS or none. +

    +

  • Cipher/Encryption Algorithm:
    + DES, Triple-DES, RC4, RC2, IDEA or none. +

    +

  • MAC Digest Algorithm:
    + MD5, SHA or SHA1. +
+An SSL cipher can also be an export cipher and is either a SSLv2 or SSLv3/TLSv1 +cipher (here TLSv1 is equivalent to SSLv3). To specify which ciphers to use, +one can either specify all the Ciphers, one at a time, or use aliases to +specify the preference and order for the ciphers (see Table +1). +

+

+ + + +
Table 1: OpenSSL Cipher Specification Tags
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Tag Description
Key Exchange Algorithm:
kRSA RSA key exchange
kDHr Diffie-Hellman key exchange with RSA key
kDHd Diffie-Hellman key exchange with DSA key
kEDH Ephemeral (temp.key) Diffie-Hellman key exchange (no cert)
Authentication Algorithm:
aNULL No authentication
aRSA RSA authentication
aDSS DSS authentication
aDH Diffie-Hellman authentication
Cipher Encoding Algorithm:
eNULL No encoding
DES DES encoding
3DES Triple-DES encoding
RC4 RC4 encoding
RC2 RC2 encoding
IDEA IDEA encoding
MAC Digest Algorithm:
MD5 MD5 hash function
SHA1 SHA1 hash function
SHA SHA hash function
Aliases:
SSLv2 all SSL version 2.0 ciphers
SSLv3 all SSL version 3.0 ciphers
TLSv1 all TLS version 1.0 ciphers
EXP all export ciphers
EXPORT40 all 40-bit export ciphers only
EXPORT56 all 56-bit export ciphers only
LOW all low strength ciphers (no export, single DES)
MEDIUM all ciphers with 128 bit encryption
HIGH all ciphers using Triple-DES
RSA all ciphers using RSA key exchange
DH all ciphers using Diffie-Hellman key exchange
EDH all ciphers using Ephemeral Diffie-Hellman key exchange
ADH all ciphers using Anonymous Diffie-Hellman key exchange
DSS all ciphers using DSS authentication
NULL all ciphers using no encryption
+
+
+
+

+Now where this becomes interesting is that these can be put together +to specify the order and ciphers you wish to use. To speed this up +there are also aliases (SSLv2, SSLv3, TLSv1, EXP, LOW, MEDIUM, +HIGH) for certain groups of ciphers. These tags can be joined +together with prefixes to form the cipher-spec. Available +prefixes are: +

    +
  • none: add cipher to list +
  • +: add ciphers to list and pull them to current location in list +
  • -: remove cipher from list (can be added later again) +
  • !: kill cipher from list completely (can not be added later again) +
+A simpler way to look at all of this is to use the ``openssl ciphers +-v'' command which provides a nice way to successively create the +correct cipher-spec string. The default cipher-spec string +is ``ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP'' which +means the following: first, remove from consideration any ciphers that do not +authenticate, i.e. for SSL only the Anonymous Diffie-Hellman ciphers. Next, +use ciphers using RC4 and RSA. Next include the high, medium and then the low +security ciphers. Finally pull all SSLv2 and export ciphers to the +end of the list. +
+
+$ openssl ciphers -v 'ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP'
+NULL-SHA                SSLv3 Kx=RSA      Au=RSA  Enc=None      Mac=SHA1
+NULL-MD5                SSLv3 Kx=RSA      Au=RSA  Enc=None      Mac=MD5
+EDH-RSA-DES-CBC3-SHA    SSLv3 Kx=DH       Au=RSA  Enc=3DES(168) Mac=SHA1
+...                     ...               ...     ...           ...
+EXP-RC4-MD5             SSLv3 Kx=RSA(512) Au=RSA  Enc=RC4(40)   Mac=MD5  export
+EXP-RC2-CBC-MD5         SSLv2 Kx=RSA(512) Au=RSA  Enc=RC2(40)   Mac=MD5  export
+EXP-RC4-MD5             SSLv2 Kx=RSA(512) Au=RSA  Enc=RC4(40)   Mac=MD5  export
+
+
+The complete list of particular RSA & DH ciphers for SSL is given in Table 2. +

+Example: +

+
+SSLCipherSuite RSA:!EXP:!NULL:+HIGH:+MEDIUM:-LOW
+
+
+

+

+ + + +
Table 2: Particular SSL Ciphers
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Cipher-Tag Protocol Key Ex. Auth. Enc. MAC Type
RSA Ciphers:
DES-CBC3-SHA SSLv3 RSA RSA 3DES(168) SHA1  
DES-CBC3-MD5 SSLv2 RSA RSA 3DES(168) MD5  
IDEA-CBC-SHA SSLv3 RSA RSA IDEA(128) SHA1  
RC4-SHA SSLv3 RSA RSA RC4(128) SHA1  
RC4-MD5 SSLv3 RSA RSA RC4(128) MD5  
IDEA-CBC-MD5 SSLv2 RSA RSA IDEA(128) MD5  
RC2-CBC-MD5 SSLv2 RSA RSA RC2(128) MD5  
RC4-MD5 SSLv2 RSA RSA RC4(128) MD5  
DES-CBC-SHA SSLv3 RSA RSA DES(56) SHA1  
RC4-64-MD5 SSLv2 RSA RSA RC4(64) MD5  
DES-CBC-MD5 SSLv2 RSA RSA DES(56) MD5  
EXP-DES-CBC-SHA SSLv3 RSA(512) RSA DES(40) SHA1 export
EXP-RC2-CBC-MD5 SSLv3 RSA(512) RSA RC2(40) MD5 export
EXP-RC4-MD5 SSLv3 RSA(512) RSA RC4(40) MD5 export
EXP-RC2-CBC-MD5 SSLv2 RSA(512) RSA RC2(40) MD5 export
EXP-RC4-MD5 SSLv2 RSA(512) RSA RC4(40) MD5 export
NULL-SHA SSLv3 RSA RSA None SHA1  
NULL-MD5 SSLv3 RSA RSA None MD5  
Diffie-Hellman Ciphers:
ADH-DES-CBC3-SHA SSLv3 DH None 3DES(168) SHA1  
ADH-DES-CBC-SHA SSLv3 DH None DES(56) SHA1  
ADH-RC4-MD5 SSLv3 DH None RC4(128) MD5  
EDH-RSA-DES-CBC3-SHA SSLv3 DH RSA 3DES(168) SHA1  
EDH-DSS-DES-CBC3-SHA SSLv3 DH DSS 3DES(168) SHA1  
EDH-RSA-DES-CBC-SHA SSLv3 DH RSA DES(56) SHA1  
EDH-DSS-DES-CBC-SHA SSLv3 DH DSS DES(56) SHA1  
EXP-EDH-RSA-DES-CBC-SHA SSLv3 DH(512) RSA DES(40) SHA1 export
EXP-EDH-DSS-DES-CBC-SHA SSLv3 DH(512) DSS DES(40) SHA1 export
EXP-ADH-DES-CBC-SHA SSLv3 DH(512) None DES(40) SHA1 export
EXP-ADH-RC4-MD5 SSLv3 DH(512) None RC4(40) MD5 export
+
+
+
+ +

+
+ +

SSLCertificateFile

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLCertificateFile
+Description: Server PEM-encoded X.509 Certificate file
Syntax: SSLCertificateFile filename
Default: None
Context: server config, virtual host
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.0
+
+
+

+This directive points to the PEM-encoded Certificate file for the server and +optionally also to the corresponding RSA or DSA Private Key file for it +(contained in the same file). If the contained Private Key is encrypted the +Pass Phrase dialog is forced at startup time. This directive can be used up to +two times (referencing different filenames) when both a RSA and a DSA based +server certificate is used in parallel. +

+Example: +

+
+SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt
+
+
+ +

+
+ +

SSLCertificateKeyFile

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLCertificateKeyFile
+Description: Server PEM-encoded Private Key file
Syntax: SSLCertificateKeyFile filename
Default: None
Context: server config, virtual host
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.0
+
+
+

+This directive points to the PEM-encoded Private Key file for the server. If +the Private Key is not combined with the Certificate in the +SSLCertificateFile, use this additional directive to point to the +file with the stand-alone Private Key. When SSLCertificateFile +is used and the file contains both the Certificate and the Private Key this +directive need not be used. But we strongly discourage this practice. +Instead we recommend you to separate the Certificate and the Private Key. If +the contained Private Key is encrypted, the Pass Phrase dialog is forced at +startup time. This directive can be used up to two times (referencing +different filenames) when both a RSA and a DSA based private key is used in +parallel. +

+Example: +

+
+SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key
+
+
+ +

+
+ +

SSLCertificateChainFile

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLCertificateChainFile
+Description: File of PEM-encoded Server CA Certificates
Syntax: SSLCertificateChainFile filename
Default: None
Context: server config, virtual host
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.3.6
+
+
+

+This directive sets the optional all-in-one file where you can +assemble the certificates of Certification Authorities (CA) which form the +certificate chain of the server certificate. This starts with the issuing CA +certificate of of the server certificate and can range up to the root CA +certificate. Such a file is simply the concatenation of the various +PEM-encoded CA Certificate files, usually in certificate chain order. +

+This should be used alternatively and/or additionally to SSLCACertificatePath for explicitly +constructing the server certificate chain which is sent to the browser in +addition to the server certificate. It is especially useful to avoid conflicts +with CA certificates when using client authentication. Because although +placing a CA certificate of the server certificate chain into SSLCACertificatePath has the same effect for +the certificate chain construction, it has the side-effect that client +certificates issued by this same CA certificate are also accepted on client +authentication. That's usually not one expect. +

+But be careful: Providing the certificate chain works only if you are using a +single (either RSA or DSA) based server certificate. If you are +using a coupled RSA+DSA certificate pair, this will work only if actually both +certificates use the same certificate chain. Else the browsers will be +confused in this situation. +

+Example: +

+
+SSLCertificateChainFile /usr/local/apache/conf/ssl.crt/ca.crt
+
+
+ +

+
+ +

SSLCACertificatePath

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLCACertificatePath
+Description: Directory of PEM-encoded CA Certificates for Client Auth.
Syntax: SSLCACertificatePath directory
Default: None
Context: server config, virtual host
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.0
+
+
+

+This directive sets the directory where you keep the Certificates of +Certification Authorities (CAs) whose clients you deal with. These are used to +verify the client certificate on Client Authentication. +

+The files in this directory have to be PEM-encoded and are accessed through +hash filenames. So usually you can't just place the Certificate files +there: you also have to create symbolic links named +hash-value.N. And you should always make sure this directory +contains the appropriate symbolic links. Use the Makefile which +comes with mod_ssl to accomplish this task. +

+Example: +

+
+SSLCACertificatePath /usr/local/apache/conf/ssl.crt/
+
+
+ +

+
+ +

SSLCACertificateFile

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLCACertificateFile
+Description: File of concatenated PEM-encoded CA Certificates for Client Auth.
Syntax: SSLCACertificateFile filename
Default: None
Context: server config, virtual host
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.0
+
+
+

+This directive sets the all-in-one file where you can assemble the +Certificates of Certification Authorities (CA) whose clients you deal +with. These are used for Client Authentication. Such a file is simply the +concatenation of the various PEM-encoded Certificate files, in order of +preference. This can be used alternatively and/or additionally to SSLCACertificatePath. +

+Example: +

+
+SSLCACertificateFile /usr/local/apache/conf/ssl.crt/ca-bundle-client.crt
+
+
+ +

+
+ +

SSLCARevocationPath

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLCARevocationPath
+Description: Directory of PEM-encoded CA CRLs for Client Auth.
Syntax: SSLCARevocationPath directory
Default: None
Context: server config, virtual host
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.3
+
+
+

+This directive sets the directory where you keep the Certificate Revocation +Lists (CRL) of Certification Authorities (CAs) whose clients you deal with. +These are used to revoke the client certificate on Client Authentication. +

+The files in this directory have to be PEM-encoded and are accessed through +hash filenames. So usually you have not only to place the CRL files there. +Additionally you have to create symbolic links named +hash-value.rN. And you should always make sure this directory +contains the appropriate symbolic links. Use the Makefile which +comes with mod_ssl to accomplish this task. +

+Example: +

+
+SSLCARevocationPath /usr/local/apache/conf/ssl.crl/
+
+
+ +

+
+ +

SSLCARevocationFile

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLCARevocationFile
+Description: File of concatenated PEM-encoded CA CRLs for Client Auth.
Syntax: SSLCARevocationFile filename
Default: None
Context: server config, virtual host
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.3
+
+
+

+This directive sets the all-in-one file where you can assemble the +Certificate Revocation Lists (CRL) of Certification Authorities (CA) whose +clients you deal with. These are used for Client Authentication. +Such a file is simply the concatenation of the various PEM-encoded CRL +files, in order of preference. This can be used alternatively and/or +additionally to SSLCARevocationPath. +

+Example: +

+
+SSLCARevocationFile /usr/local/apache/conf/ssl.crl/ca-bundle-client.crl
+
+
+ +

+
+ +

SSLVerifyClient

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLVerifyClient
+Description: Type of Client Certificate verification
Syntax: SSLVerifyClient level
Default: SSLVerifyClient none
Context: server config, virtual host, directory, .htaccess
Override: AuthConfig
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.0
+
+
+

+This directive sets the Certificate verification level for the Client +Authentication. Notice that this directive can be used both in per-server and +per-directory context. In per-server context it applies to the client +authentication process used in the standard SSL handshake when a connection is +established. In per-directory context it forces a SSL renegotation with the +reconfigured client verification level after the HTTP request was read but +before the HTTP response is sent. +

+The following levels are available for level: +

    +
  • none: + no client Certificate is required at all +
  • optional: + the client may present a valid Certificate +
  • require: + the client has to present a valid Certificate +
  • optional_no_ca: + the client may present a valid Certificate
    + but it need not to be (successfully) verifiable. +
+In practice only levels none and require are +really interesting, because level optional doesn't work with +all browsers and level optional_no_ca is actually against the +idea of authentication (but can be used to establish SSL test pages, etc.) +

+Example: +

+
+SSLVerifyClient require
+
+
+ +

+
+ +

SSLVerifyDepth

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLVerifyDepth
+Description: Maximum depth of CA Certificates in Client Certificate verification
Syntax: SSLVerifyDepth number
Default: SSLVerifyDepth 1
Context: server config, virtual host, directory, .htaccess
Override: AuthConfig
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.0
+
+
+

+This directive sets how deeply mod_ssl should verify before deciding that the +clients don't have a valid certificate. Notice that this directive can be +used both in per-server and per-directory context. In per-server context it +applies to the client authentication process used in the standard SSL +handshake when a connection is established. In per-directory context it forces +a SSL renegotation with the reconfigured client verification depth after the +HTTP request was read but before the HTTP response is sent. +

+The depth actually is the maximum number of intermediate certificate issuers, +i.e. the number of CA certificates which are max allowed to be followed while +verifying the client certificate. A depth of 0 means that self-signed client +certificates are accepted only, the default depth of 1 means the client +certificate can be self-signed or has to be signed by a CA which is directly +known to the server (i.e. the CA's certificate is under +SSLCACertificatePath), etc. +

+Example: +

+
+SSLVerifyDepth 10
+
+
+ +

+
+ +

SSLLog

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLLog
+Description: Where to write the dedicated SSL engine logfile
Syntax: SSLLog filename
Default: None
Context: server config, virtual host
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.1
+
+
+

+This directive sets the name of the dedicated SSL protocol engine logfile. +Error type messages are additionally duplicated to the general Apache error +log file (directive ErrorLog). Put this somewhere where it cannot +be used for symlink attacks on a real server (i.e. somewhere where only root +can write). If the filename does not begin with a slash +('/') then it is assumed to be relative to the Server +Root. If filename begins with a bar ('|') then the +following string is assumed to be a path to an executable program to which a +reliable pipe can be established. The directive should occur only once per +virtual server config. +

+Example: +

+
+SSLLog /usr/local/apache/logs/ssl_engine_log
+
+
+ +

+
+ +

SSLLogLevel

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLLogLevel
+Description: Logging level for the dedicated SSL engine logfile
Syntax: SSLLogLevel level
Default: SSLLogLevel none
Context: server config, virtual host
Override: Not applicable
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.1
+
+
+

+This directive sets the verbosity degree of the dedicated SSL protocol engine +logfile. The level is one of the following (in ascending order where +higher levels include lower levels): +

    +
  • none
    + no dedicated SSL logging is done, but messages of level + ``error'' are still written to the general Apache error + logfile. +

    +

  • error
    + log messages of error type only, i.e. messages which show fatal situations + (processing is stopped). Those messages are also duplicated to the + general Apache error logfile. +

    +

  • warn
    + log also warning messages, i.e. messages which show non-fatal problems + (processing is continued). +

    +

  • info
    + log also informational messages, i.e. messages which show major + processing steps. +

    +

  • trace
    + log also trace messages, i.e. messages which show minor processing steps. +

    +

  • debug
    + log also debugging messages, i.e. messages which show development and + low-level I/O information. +
+

+Example: +

+
+SSLLogLevel warn
+
+
+ +

+
+ +

SSLOptions

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLOptions
+Description: Configure various SSL engine run-time options
Syntax: SSLOptions [+-]option ...
Default: None
Context: server config, virtual host, directory, .htaccess
Override: Options
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.1
+
+
+

+This directive can be used to control various run-time options on a +per-directory basis. Normally, if multiple SSLOptions could +apply to a directory, then the most specific one is taken completely; the +options are not merged. However if all the options on the +SSLOptions directive are preceded by a plus (+) or +minus (-) symbol, the options are merged. Any options preceded by +a + are added to the options currently in force, and any options +preceded by a - are removed from the options currently in force. +

+The available options are: +

    +
  • StdEnvVars +

    + When this option is enabled, the standard set of SSL related CGI/SSI + environment variables are created. This per default is disabled for + performance reasons, because the information extraction step is a + rather expensive operation. So one usually enables this option for + CGI and SSI requests only. +

    +

  • CompatEnvVars +

    + When this option is enabled, additional CGI/SSI environment variables are + created for backward compatibility to other Apache SSL solutions. Look in + the Compatibility chapter for details + on the particular variables generated. +

    +

  • ExportCertData +

    + When this option is enabled, additional CGI/SSI environment variables are + created: SSL_SERVER_CERT, SSL_CLIENT_CERT and + SSL_CLIENT_CERT_CHAINn (with n = 0,1,2,..). + These contain the PEM-encoded X.509 Certificates of server and client for + the current HTTPS connection and can be used by CGI scripts for deeper + Certificate checking. Additionally all other certificates of the client + certificate chain are provided, too. This bloats up the environment a + little bit which is why you have to use this option to enable it on + demand. +

    +

  • FakeBasicAuth +

    + When this option is enabled, the Subject Distinguished Name (DN) of the + Client X509 Certificate is translated into a HTTP Basic Authorization + username. This means that the standard Apache authentication methods can + be used for access control. The user name is just the Subject of the + Client's X509 Certificate (can be determined by running OpenSSL's + openssl x509 command: openssl x509 -noout -subject -in + certificate.crt). Note that no password is + obtained from the user. Every entry in the user file needs this password: + ``xxj31ZMTZzkVA'', which is the DES-encrypted version of the + word `password''. Those who live under MD5-based encryption + (for instance under FreeBSD or BSD/OS, etc.) should use the following MD5 + hash of the same word: ``$1$OXLyS...$Owx8s2/m9/gfkcRVXzgoE/''. +

    +

  • StrictRequire +

    + This forces forbidden access when SSLRequireSSL or + SSLRequire successfully decided that access should be + forbidden. Usually the default is that in the case where a ``Satisfy + any'' directive is used, and other access restrictions are passed, + denial of access due to SSLRequireSSL or + SSLRequire is overridden (because that's how the Apache + Satisfy mechanism should work.) But for strict access restriction + you can use SSLRequireSSL and/or SSLRequire in + combination with an ``SSLOptions +StrictRequire''. Then an + additional ``Satisfy Any'' has no chance once mod_ssl has + decided to deny access. +

    +

  • OptRenegotiate +

    + This enables optimized SSL connection renegotiation handling when SSL + directives are used in per-directory context. By default a strict + scheme is enabled where every per-directory reconfiguration of + SSL parameters causes a full SSL renegotiation handshake. When this + option is used mod_ssl tries to avoid unnecessary handshakes by doing more + granular (but still safe) parameter checks. Nevertheless these granular + checks sometimes maybe not what the user expects, so enable this on a + per-directory basis only, please. +

+

+Example: +

+
+SSLOptions +FakeBasicAuth -StrictRequire
+<Files ~ "\.(cgi|shtml)$">
+    SSLOptions +StdEnvVars +CompatEnvVars -ExportCertData
+<Files>
+
+
+ +

+
+ +

SSLRequireSSL

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLRequireSSL
+Description: Deny access when SSL is not used for the HTTP request
Syntax: SSLRequireSSL
Default: None
Context: directory, .htaccess
Override: AuthConfig
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.0
+
+
+

+This directive forbids access unless HTTP over SSL (i.e. HTTPS) is enabled for +the current connection. This is very handy inside the SSL-enabled virtual +host or directories for defending against configuration errors that expose +stuff that should be protected. When this directive is present all requests +are denied which are not using SSL. +

+Example: +

+
+SSLRequireSSL
+
+
+ +

+
+ +

SSLRequire

+ + + + +
+ + + + +
+ + + + + + + + + + +
+Name: SSLRequire
+Description: Allow access only when an arbitrarily complex boolean expression is true
Syntax: SSLRequire expression
Default: None
Context: directory, .htaccess
Override: AuthConfig
Status: Extension
Module: mod_ssl
Compatibility: mod_ssl 2.1
+
+
+

+This directive specifies a general access requirement which has to be +fulfilled in order to allow access. It's a very powerful directive because the +requirement specification is an arbitrarily complex boolean expression +containing any number of access checks. +

+The expression must match the following syntax (given as a BNF +grammar notation): +

+
+expr     ::= "true" | "false"
+           | "!" expr
+           | expr "&&" expr
+           | expr "||" expr
+           | "(" expr ")"
+           | comp
+
+comp     ::= word "==" word | word "eq" word
+           | word "!=" word | word "ne" word
+           | word "<"  word | word "lt" word
+           | word "<=" word | word "le" word
+           | word ">"  word | word "gt" word
+           | word ">=" word | word "ge" word
+           | word "in" "{" wordlist "}"
+           | word "=~" regex
+           | word "!~" regex
+
+wordlist ::= word
+           | wordlist "," word
+
+word     ::= digit
+           | cstring
+           | variable
+           | function
+
+digit    ::= [0-9]+
+cstring  ::= "..."
+variable ::= "%{" varname "}"
+function ::= funcname "(" funcargs ")"
+
+
+while for varname any variable from Table 3 +can be used. Finally for funcname the following functions +are available: +
    +
  • file(filename) +

    + This function takes one string argument and expands to the contents of the + file. This is especially useful for matching this contents against a + regular expression, etc. +

+Notice that expression is first parsed into an internal machine +representation and then evaluated in a second step. Actually, in Global and +Per-Server Class context expression is parsed at startup time and +at runtime only the machine representation is executed. For Per-Directory +context this is different: here expression has to be parsed and +immediately executed for every request. +

+Example: +

+
+SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)-/ \
+            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
+            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
+            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
+            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \
+           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
+
+
+
+ + + +
Table 3: Available Variables for SSLRequire
+ + +
+
+Standard CGI/1.0 and Apache variables: +
+HTTP_USER_AGENT        PATH_INFO             AUTH_TYPE
+HTTP_REFERER           QUERY_STRING          SERVER_SOFTWARE
+HTTP_COOKIE            REMOTE_HOST           API_VERSION
+HTTP_FORWARDED         REMOTE_IDENT          TIME_YEAR
+HTTP_HOST              IS_SUBREQ             TIME_MON
+HTTP_PROXY_CONNECTION  DOCUMENT_ROOT         TIME_DAY
+HTTP_ACCEPT            SERVER_ADMIN          TIME_HOUR
+HTTP:headername        SERVER_NAME           TIME_MIN
+THE_REQUEST            SERVER_PORT           TIME_SEC
+REQUEST_METHOD         SERVER_PROTOCOL       TIME_WDAY
+REQUEST_SCHEME         REMOTE_ADDR           TIME
+REQUEST_URI            REMOTE_USER           ENV:variablename
+REQUEST_FILENAME
+
+SSL-related variables: +
+HTTPS                  SSL_CLIENT_M_VERSION   SSL_SERVER_M_VERSION
+                       SSL_CLIENT_M_SERIAL    SSL_SERVER_M_SERIAL
+SSL_PROTOCOL           SSL_CLIENT_V_START     SSL_SERVER_V_START
+SSL_SESSION_ID         SSL_CLIENT_V_END       SSL_SERVER_V_END
+SSL_CIPHER             SSL_CLIENT_S_DN        SSL_SERVER_S_DN
+SSL_CIPHER_EXPORT      SSL_CLIENT_S_DN_C      SSL_SERVER_S_DN_C
+SSL_CIPHER_ALGKEYSIZE  SSL_CLIENT_S_DN_ST     SSL_SERVER_S_DN_ST
+SSL_CIPHER_USEKEYSIZE  SSL_CLIENT_S_DN_L      SSL_SERVER_S_DN_L
+SSL_VERSION_LIBRARY    SSL_CLIENT_S_DN_O      SSL_SERVER_S_DN_O
+SSL_VERSION_INTERFACE  SSL_CLIENT_S_DN_OU     SSL_SERVER_S_DN_OU
+                       SSL_CLIENT_S_DN_CN     SSL_SERVER_S_DN_CN
+                       SSL_CLIENT_S_DN_T      SSL_SERVER_S_DN_T
+                       SSL_CLIENT_S_DN_I      SSL_SERVER_S_DN_I
+                       SSL_CLIENT_S_DN_G      SSL_SERVER_S_DN_G
+                       SSL_CLIENT_S_DN_S      SSL_SERVER_S_DN_S
+                       SSL_CLIENT_S_DN_D      SSL_SERVER_S_DN_D
+                       SSL_CLIENT_S_DN_UID    SSL_SERVER_S_DN_UID
+                       SSL_CLIENT_S_DN_Email  SSL_SERVER_S_DN_Email
+                       SSL_CLIENT_I_DN        SSL_SERVER_I_DN
+                       SSL_CLIENT_I_DN_C      SSL_SERVER_I_DN_C
+                       SSL_CLIENT_I_DN_ST     SSL_SERVER_I_DN_ST
+                       SSL_CLIENT_I_DN_L      SSL_SERVER_I_DN_L
+                       SSL_CLIENT_I_DN_O      SSL_SERVER_I_DN_O
+                       SSL_CLIENT_I_DN_OU     SSL_SERVER_I_DN_OU
+                       SSL_CLIENT_I_DN_CN     SSL_SERVER_I_DN_CN
+                       SSL_CLIENT_I_DN_T      SSL_SERVER_I_DN_T
+                       SSL_CLIENT_I_DN_I      SSL_SERVER_I_DN_I
+                       SSL_CLIENT_I_DN_G      SSL_SERVER_I_DN_G
+                       SSL_CLIENT_I_DN_S      SSL_SERVER_I_DN_S
+                       SSL_CLIENT_I_DN_D      SSL_SERVER_I_DN_D
+                       SSL_CLIENT_I_DN_UID    SSL_SERVER_I_DN_UID
+                       SSL_CLIENT_I_DN_Email  SSL_SERVER_I_DN_Email
+                       SSL_CLIENT_A_SIG       SSL_SERVER_A_SIG
+                       SSL_CLIENT_A_KEY       SSL_SERVER_A_KEY
+                       SSL_CLIENT_CERT        SSL_SERVER_CERT
+                       SSL_CLIENT_CERT_CHAINn
+                       SSL_CLIENT_VERIFY
+
+
+
+
+
+
+
+

+

Additional Features

+

Environment Variables

+This module provides a lot of SSL information as additional environment +variables to the SSI and CGI namespace. The generated variables are listed in +Table 4. For backward compatibility the information can +be made available under different names, too. Look in the Compatibility chapter for details on the +compatibility variables. +

+

+ + + +
Table 4: SSI/CGI Environment Variables
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variable Name:Value Type:Description:
HTTPS flag HTTPS is being used.
SSL_PROTOCOL string The SSL protocol version (SSLv2, SSLv3, TLSv1)
SSL_SESSION_ID string The hex-encoded SSL session id
SSL_CIPHER string The cipher specification name
SSL_CIPHER_EXPORT string true if cipher is an export cipher
SSL_CIPHER_USEKEYSIZE number Number of cipher bits (actually used)
SSL_CIPHER_ALGKEYSIZE number Number of cipher bits (possible)
SSL_VERSION_INTERFACE string The mod_ssl program version
SSL_VERSION_LIBRARY string The OpenSSL program version
SSL_CLIENT_M_VERSION string The version of the client certificate
SSL_CLIENT_M_SERIAL string The serial of the client certificate
SSL_CLIENT_S_DN string Subject DN in client's certificate
SSL_CLIENT_S_DN_x509 string Component of client's Subject DN
SSL_CLIENT_I_DN string Issuer DN of client's certificate
SSL_CLIENT_I_DN_x509 string Component of client's Issuer DN
SSL_CLIENT_V_START string Validity of client's certificate (start time)
SSL_CLIENT_V_END string Validity of client's certificate (end time)
SSL_CLIENT_A_SIG string Algorithm used for the signature of client's certificate
SSL_CLIENT_A_KEY string Algorithm used for the public key of client's certificate
SSL_CLIENT_CERT string PEM-encoded client certificate
SSL_CLIENT_CERT_CHAINn string PEM-encoded certificates in client certificate chain
SSL_CLIENT_VERIFY string NONE, SUCCESS, GENEROUS or FAILED:reason
SSL_SERVER_M_VERSION string The version of the server certificate
SSL_SERVER_M_SERIAL string The serial of the server certificate
SSL_SERVER_S_DN string Subject DN in server's certificate
SSL_SERVER_S_DN_x509 string Component of server's Subject DN
SSL_SERVER_I_DN string Issuer DN of server's certificate
SSL_SERVER_I_DN_x509 string Component of server's Issuer DN
SSL_SERVER_V_START string Validity of server's certificate (start time)
SSL_SERVER_V_END string Validity of server's certificate (end time)
SSL_SERVER_A_SIG string Algorithm used for the signature of server's certificate
SSL_SERVER_A_KEY string Algorithm used for the public key of server's certificate
SSL_SERVER_CERT string PEM-encoded server certificate
+[ where x509 is a component of a X.509 DN: + C,ST,L,O,OU,CN,T,I,G,S,D,UID,Email ] +
+
+
+

+
+

Custom Log Formats

+When mod_ssl is built into Apache or at least loaded (under DSO situation) +additional functions exist for the Custom Log Format of mod_log_config. First there is an additional +``%{varname}x'' eXtension format function +which can be used to expand any variables provided by any module, especially +those provided by mod_ssl which can you find in Table 4. +

+For backward compatibility there is additionally a special +``%{name}c'' cryptography format function +provided. Information about this function is provided in the Compatibility chapter. +

+Example: +

+
+CustomLog logs/ssl_request_log \
+          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
+
+
+

+
+ + + + + + + + + + +
+ + + + + +
+previous page
Introduction +
+next page
Compatibility +
+
+ + + + +
+ mod_ssl 2.8, User Manual
+ The Apache Interface to OpenSSL +
+
+ Copyright © 1998-2001 + Ralf S. Engelschall
+ All Rights Reserved
+
+
+
+

+
+ + diff --git a/docs/manual/mod/mod_ssl.xml b/docs/manual/mod/mod_ssl.xml new file mode 100644 index 00000000000..71f41d7665c --- /dev/null +++ b/docs/manual/mod/mod_ssl.xml @@ -0,0 +1,1256 @@ + + + + + +mod_ssl +Strong cryptography using the Secure Sockets +Layer (SSL) and Transport Layer Security (TLS) protocols +Extension +mod_ssl.c +ssl_module + + +

This module provides SSL v2/v3 and TLS v1 support for the Apache +HTTP Server. It was contributed by Ralf S. Engeschall based on his +mod_ssl project and originally derived from work by Ben Laurie.

+ +

This module relies on OpenSSL +to provide the cryptography engine.

+ +

Further details, discussion, and examples are provided in the +SSL documentation.

+
+ +
Environment Variables + +

This module provides a lot of SSL information as additional environment +variables to the SSI and CGI namespace. The generated variables are listed in +the table below. For backward compatibility the information can +be made available under different names, too. Look in the Compatibility chapter for details on the +compatibility variables.

+ +
+ + + +
SSI/CGI Environment Variables
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variable Name:Value Type:Description:
HTTPS flag HTTPS is being used.
SSL_PROTOCOL string The SSL protocol version (SSLv2, SSLv3, TLSv1)
SSL_SESSION_ID string The hex-encoded SSL session id
SSL_CIPHER string The cipher specification name
SSL_CIPHER_EXPORT string true if cipher is an export cipher
SSL_CIPHER_USEKEYSIZE number Number of cipher bits (actually used)
SSL_CIPHER_ALGKEYSIZE number Number of cipher bits (possible)
SSL_VERSION_INTERFACE string The mod_ssl program version
SSL_VERSION_LIBRARY string The OpenSSL program version
SSL_CLIENT_M_VERSION string The version of the client certificate
SSL_CLIENT_M_SERIAL string The serial of the client certificate
SSL_CLIENT_S_DN string Subject DN in client's certificate
SSL_CLIENT_S_DN_x509 string Component of client's Subject DN
SSL_CLIENT_I_DN string Issuer DN of client's certificate
SSL_CLIENT_I_DN_x509 string Component of client's Issuer DN
SSL_CLIENT_V_START string Validity of client's certificate (start time)
SSL_CLIENT_V_END string Validity of client's certificate (end time)
SSL_CLIENT_A_SIG string Algorithm used for the signature of client's certificate
SSL_CLIENT_A_KEY string Algorithm used for the public key of client's certificate
SSL_CLIENT_CERT string PEM-encoded client certificate
SSL_CLIENT_CERT_CHAINn string PEM-encoded certificates in client certificate chain
SSL_CLIENT_VERIFY string NONE, SUCCESS, GENEROUS or FAILED:reason
SSL_SERVER_M_VERSION string The version of the server certificate
SSL_SERVER_M_SERIAL string The serial of the server certificate
SSL_SERVER_S_DN string Subject DN in server's certificate
SSL_SERVER_S_DN_x509 string Component of server's Subject DN
SSL_SERVER_I_DN string Issuer DN of server's certificate
SSL_SERVER_I_DN_x509 string Component of server's Issuer DN
SSL_SERVER_V_START string Validity of server's certificate (start time)
SSL_SERVER_V_END string Validity of server's certificate (end time)
SSL_SERVER_A_SIG string Algorithm used for the signature of server's certificate
SSL_SERVER_A_KEY string Algorithm used for the public key of server's certificate
SSL_SERVER_CERT string PEM-encoded server certificate
+[ where x509 is a component of a X.509 DN: + C,ST,L,O,OU,CN,T,I,G,S,D,UID,Email ] +
+
+
+
+ +
Custom Log Formats + +

When mod_ssl is built into Apache or at least +loaded (under DSO situation) additional functions exist for the Custom Log Format of +mod_log_config. First there is an +additional ``%{varname}x'' +eXtension format function which can be used to expand any variables +provided by any module, especially those provided by mod_ssl which can +you find in the above table.

+

+For backward compatibility there is additionally a special +``%{name}c'' cryptography format function +provided. Information about this function is provided in the Compatibility chapter.

+

+Example:

+ +CustomLog logs/ssl_request_log \ + "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" + +
+ + +SSLPassPhraseDialog +Type of pass phrase dialog for encrypted private +keys +SSLPassPhraseDialog type +SSLPassPhraseDialog builtin +server config + + +

+When Apache starts up it has to read the various Certificate (see +SSLCertificateFile) and +Private Key (see SSLCertificateKeyFile) files of the +SSL-enabled virtual servers. Because for security reasons the Private +Key files are usually encrypted, mod_ssl needs to query the +administrator for a Pass Phrase in order to decrypt those files. This +query can be done in two ways which can be configured by +type:

+
    +
  • builtin +

    + This is the default where an interactive terminal dialog occurs at startup + time just before Apache detaches from the terminal. Here the administrator + has to manually enter the Pass Phrase for each encrypted Private Key file. + Because a lot of SSL-enabled virtual hosts can be configured, the + following reuse-scheme is used to minimize the dialog: When a Private Key + file is encrypted, all known Pass Phrases (at the beginning there are + none, of course) are tried. If one of those known Pass Phrases succeeds no + dialog pops up for this particular Private Key file. If none succeeded, + another Pass Phrase is queried on the terminal and remembered for the next + round (where it perhaps can be reused).

    +

    + This scheme allows mod_ssl to be maximally flexible (because for N encrypted + Private Key files you can use N different Pass Phrases - but then + you have to enter all of them, of course) while minimizing the terminal + dialog (i.e. when you use a single Pass Phrase for all N Private Key files + this Pass Phrase is queried only once).

  • + +
  • exec:/path/to/program +

    + Here an external program is configured which is called at startup for each + encrypted Private Key file. It is called with two arguments (the first is + of the form ``servername:portnumber'', the second is either + ``RSA'' or ``DSA''), which indicate for which + server and algorithm it has to print the corresponding Pass Phrase to + stdout. The intent is that this external program first runs + security checks to make sure that the system is not compromised by an + attacker, and only when these checks were passed successfully it provides + the Pass Phrase.

    +

    + Both these security checks, and the way the Pass Phrase is determined, can + be as complex as you like. Mod_ssl just defines the interface: an + executable program which provides the Pass Phrase on stdout. + Nothing more or less! So, if you're really paranoid about security, here + is your interface. Anything else has to be left as an exercise to the + administrator, because local security requirements are so different.

    +

    + The reuse-algorithm above is used here, too. In other words: The external + program is called only once per unique Pass Phrase.

  • +
+

+Example:

+ +SSLPassPhraseDialog exec:/usr/local/apache/sbin/pp-filter + +
+
+ + +SSLMutex +Semaphore for internal mutual exclusion of +operations +SSLMutex type +SSLMutex none +server config + + +

+This configures the SSL engine's semaphore (aka. lock) which is used for mutual +exclusion of operations which have to be done in a synchronized way between the +pre-forked Apache server processes. This directive can only be used in the +global server context because it's only useful to have one global mutex.

+

+The following Mutex types are available:

+
    +
  • none +

    + This is the default where no Mutex is used at all. Use it at your own + risk. But because currently the Mutex is mainly used for synchronizing + write access to the SSL Session Cache you can live without it as long + as you accept a sometimes garbled Session Cache. So it's not recommended + to leave this the default. Instead configure a real Mutex.

  • +
  • file:/path/to/mutex +

    + This is the portable and (under Unix) always provided Mutex variant where + a physical (lock-)file is used as the Mutex. Always use a local disk + filesystem for /path/to/mutex and never a file residing on a + NFS- or AFS-filesystem. Note: Internally, the Process ID (PID) of the + Apache parent process is automatically appended to + /path/to/mutex to make it unique, so you don't have to worry + about conflicts yourself. Notice that this type of mutex is not available + under the Win32 environment. There you have to use the semaphore + mutex.

  • +
  • sem +

    + This is the most elegant but also most non-portable Mutex variant where a + SysV IPC Semaphore (under Unix) and a Windows Mutex (under Win32) is used + when possible. It is only available when the underlying platform + supports it.

  • +
+Example +SSLMutex file:/usr/local/apache/logs/ssl_mutex + +
+
+ + +SSLRandomSeed +Pseudo Random Number Generator (PRNG) seeding +source +SSLRandomSeed context source +[bytes] +server config + + +

+This configures one or more sources for seeding the Pseudo Random Number +Generator (PRNG) in OpenSSL at startup time (context is +startup) and/or just before a new SSL connection is established +(context is connect). This directive can only be used +in the global server context because the PRNG is a global facility.

+

+The following source variants are available:

+
    +
  • builtin +

    This is the always available builtin seeding source. It's usage + consumes minimum CPU cycles under runtime and hence can be always used + without drawbacks. The source used for seeding the PRNG contains of the + current time, the current process id and (when applicable) a randomly + choosen 1KB extract of the inter-process scoreboard structure of Apache. + The drawback is that this is not really a strong source and at startup + time (where the scoreboard is still not available) this source just + produces a few bytes of entropy. So you should always, at least for the + startup, use an additional seeding source.

  • +
  • file:/path/to/source +

    + This variant uses an external file /path/to/source as the + source for seeding the PRNG. When bytes is specified, only the + first bytes number of bytes of the file form the entropy (and + bytes is given to /path/to/source as the first + argument). When bytes is not specified the whole file forms the + entropy (and 0 is given to /path/to/source as + the first argument). Use this especially at startup time, for instance + with an available /dev/random and/or + /dev/urandom devices (which usually exist on modern Unix + derivates like FreeBSD and Linux).

    +

    + But be careful: Usually /dev/random provides only as + much entropy data as it actually has, i.e. when you request 512 bytes of + entropy, but the device currently has only 100 bytes available two things + can happen: On some platforms you receive only the 100 bytes while on + other platforms the read blocks until enough bytes are available (which + can take a long time). Here using an existing /dev/urandom is + better, because it never blocks and actually gives the amount of requested + data. The drawback is just that the quality of the received data may not + be the best.

    +

    + On some platforms like FreeBSD one can even control how the entropy is + actually generated, i.e. by which system interrupts. More details one can + find under rndcontrol(8) on those platforms. Alternatively, when + your system lacks such a random device, you can use tool + like EGD + (Entropy Gathering Daemon) and run it's client program with the + exec:/path/to/program/ variant (see below) or use + egd:/path/to/egd-socket (see below).

  • + +
  • exec:/path/to/program +

    + This variant uses an external executable + /path/to/program as the source for seeding the + PRNG. When bytes is specified, only the first + bytes number of bytes of its stdout contents + form the entropy. When bytes is not specified, the + entirety of the data produced on stdout form the + entropy. Use this only at startup time when you need a very strong + seeding with the help of an external program (for instance as in + the example above with the truerand utility you can + find in the mod_ssl distribution which is based on the AT&T + truerand library). Using this in the connection context + slows down the server too dramatically, of course. So usually you + should avoid using external programs in that context.

  • +
  • egd:/path/to/egd-socket (Unix only) +

    + This variant uses the Unix domain socket of the + external Entropy Gathering Daemon (EGD) (see http://www.lothar.com/tech + /crypto/) to seed the PRNG. Use this if no random device exists + on your platform.

  • +
+Example +SSLRandomSeed startup builtin
+SSLRandomSeed startup file:/dev/random
+SSLRandomSeed startup file:/dev/urandom 1024
+SSLRandomSeed startup exec:/usr/local/bin/truerand 16
+SSLRandomSeed connect builtin
+SSLRandomSeed connect file:/dev/random
+SSLRandomSeed connect file:/dev/urandom 1024
+
+
+
+ + +SSLSessionCache +Type of the global/inter-process SSL Session +Cache +SSLSessionCache type +SSLSessionCache none +server config + + +

+This configures the storage type of the global/inter-process SSL Session +Cache. This cache is an optional facility which speeds up parallel request +processing. For requests to the same server process (via HTTP keep-alive), +OpenSSL already caches the SSL session information locally. But because modern +clients request inlined images and other data via parallel requests (usually +up to four parallel requests are common) those requests are served by +different pre-forked server processes. Here an inter-process cache +helps to avoid unneccessary session handshakes.

+

+The following two storage types are currently supported:

+
    +
  • none +

    + This is the default and just disables the global/inter-process Session + Cache. There is no drawback in functionality, but a noticeable speed + penalty can be observed.

  • +
  • dbm:/path/to/datafile +

    + This makes use of a DBM hashfile on the local disk to synchronize the + local OpenSSL memory caches of the server processes. The slight increase + in I/O on the server results in a visible request speedup for your + clients, so this type of storage is generally recommended.

  • +
  • shm:/path/to/datafile[(size)] +

    + This makes use of a high-performance hash table (approx. size bytes + in size) inside a shared memory segment in RAM (established via + /path/to/datafile) to synchronize the local OpenSSL memory + caches of the server processes. This storage type is not available on all + platforms. See the mod_ssl INSTALL document for details on + how to build Apache+EAPI with shared memory support.

  • +
+Examples +SSLSessionCache dbm:/usr/local/apache/logs/ssl_gcache_data
+SSLSessionCache shm:/usr/local/apache/logs/ssl_gcache_data(512000) +
+
+
+ + +SSLSessionCacheTimeout +Number of seconds before an SSL session expires +in the Session Cache +SSLSessionCacheTimeout seconds +SSLSessionCacheTimeout 300 +server config +virtual host + + +

+This directive sets the timeout in seconds for the information stored in the +global/inter-process SSL Session Cache and the OpenSSL internal memory cache. +It can be set as low as 15 for testing, but should be set to higher +values like 300 in real life.

+Example +SSLSessionCacheTimeout 600 + +
+
+ + +SSLEngine +SSL Engine Operation Switch +SSLEngine on|off +SSLEngine off +server config +virtual host + + +

+This directive toggles the usage of the SSL/TLS Protocol Engine. This +is usually used inside a VirtualHost section to enable SSL/TLS for a +particular virtual host. By default the SSL/TLS Protocol Engine is +disabled for both the main server and all configured virtual hosts.

+Example +<VirtualHost _default_:443>
+SSLEngine on
+...
+</VirtualHost> +
+
+
+ + +SSLProtocol +Configure usable SSL protocol flavors +SSLProtocol [+|-]protocol ... +SSLProtocol all +server config +virtual host +Options + + +

+This directive can be used to control the SSL protocol flavors mod_ssl should +use when establishing its server environment. Clients then can only connect +with one of the provided protocols.

+

+The available (case-insensitive) protocols are:

+
    +
  • SSLv2 +

    + This is the Secure Sockets Layer (SSL) protocol, version 2.0. It is the + original SSL protocol as designed by Netscape Corporation.

  • + +
  • SSLv3 +

    + This is the Secure Sockets Layer (SSL) protocol, version 3.0. It is the + successor to SSLv2 and the currently (as of February 1999) de-facto + standardized SSL protocol from Netscape Corporation. It's supported by + almost all popular browsers.

  • + +
  • TLSv1 +

    + This is the Transport Layer Security (TLS) protocol, version 1.0. It is the + successor to SSLv3 and currently (as of February 1999) still under + construction by the Internet Engineering Task Force (IETF). It's still + not supported by any popular browsers.

  • + +
  • All +

    + This is a shortcut for ``+SSLv2 +SSLv3 +TLSv1'' and a + convinient way for enabling all protocols except one when used in + combination with the minus sign on a protocol as the example above + shows.

  • +
+Example +# enable SSLv3 and TLSv1, but not SSLv2
+SSLProtocol all -SSLv2 +
+
+
+ + +SSLCipherSuite +Cipher Suite available for negotiation in SSL +handshake +SSLCipherSuite cipher-spec +SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP +server config +virtual host +directory +.htaccess +AuthConfig + + +

+This complex directive uses a colon-separated cipher-spec string +consisting of OpenSSL cipher specifications to configure the Cipher Suite the +client is permitted to negotiate in the SSL handshake phase. Notice that this +directive can be used both in per-server and per-directory context. In +per-server context it applies to the standard SSL handshake when a connection +is established. In per-directory context it forces a SSL renegotation with the +reconfigured Cipher Suite after the HTTP request was read but before the HTTP +response is sent.

+

+An SSL cipher specification in cipher-spec is composed of 4 major +attributes plus a few extra minor ones:

+
    +
  • Key Exchange Algorithm:
    + RSA or Diffie-Hellman variants. +
  • +
  • Authentication Algorithm:
    + RSA, Diffie-Hellman, DSS or none. +
  • +
  • Cipher/Encryption Algorithm:
    + DES, Triple-DES, RC4, RC2, IDEA or none. +
  • +
  • MAC Digest Algorithm:
    + MD5, SHA or SHA1. +
  • +
+

An SSL cipher can also be an export cipher and is either a SSLv2 or SSLv3/TLSv1 +cipher (here TLSv1 is equivalent to SSLv3). To specify which ciphers to use, +one can either specify all the Ciphers, one at a time, or use aliases to +specify the preference and order for the ciphers (see Table +1).

+ +
+ + + +
Table 1: OpenSSL Cipher Specification Tags
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Tag Description
Key Exchange Algorithm:
kRSA RSA key exchange
kDHr Diffie-Hellman key exchange with RSA key
kDHd Diffie-Hellman key exchange with DSA key
kEDH Ephemeral (temp.key) Diffie-Hellman key exchange (no cert)
Authentication Algorithm:
aNULL No authentication
aRSA RSA authentication
aDSS DSS authentication
aDH Diffie-Hellman authentication
Cipher Encoding Algorithm:
eNULL No encoding
DES DES encoding
3DES Triple-DES encoding
RC4 RC4 encoding
RC2 RC2 encoding
IDEA IDEA encoding
MAC Digest Algorithm:
MD5 MD5 hash function
SHA1 SHA1 hash function
SHA SHA hash function
Aliases:
SSLv2 all SSL version 2.0 ciphers
SSLv3 all SSL version 3.0 ciphers
TLSv1 all TLS version 1.0 ciphers
EXP all export ciphers
EXPORT40 all 40-bit export ciphers only
EXPORT56 all 56-bit export ciphers only
LOW all low strength ciphers (no export, single DES)
MEDIUM all ciphers with 128 bit encryption
HIGH all ciphers using Triple-DES
RSA all ciphers using RSA key exchange
DH all ciphers using Diffie-Hellman key exchange
EDH all ciphers using Ephemeral Diffie-Hellman key exchange
ADH all ciphers using Anonymous Diffie-Hellman key exchange
DSS all ciphers using DSS authentication
NULL all ciphers using no encryption
+
+
+
+

+Now where this becomes interesting is that these can be put together +to specify the order and ciphers you wish to use. To speed this up +there are also aliases (SSLv2, SSLv3, TLSv1, EXP, LOW, MEDIUM, +HIGH) for certain groups of ciphers. These tags can be joined +together with prefixes to form the cipher-spec. Available +prefixes are:

+
    +
  • none: add cipher to list
  • +
  • +: add ciphers to list and pull them to current location in list
  • +
  • -: remove cipher from list (can be added later again)
  • +
  • !: kill cipher from list completely (can not be added later again)
  • +
+

A simpler way to look at all of this is to use the ``openssl ciphers +-v'' command which provides a nice way to successively create the +correct cipher-spec string. The default cipher-spec string +is ``ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP'' which +means the following: first, remove from consideration any ciphers that do not +authenticate, i.e. for SSL only the Anonymous Diffie-Hellman ciphers. Next, +use ciphers using RC4 and RSA. Next include the high, medium and then the low +security ciphers. Finally pull all SSLv2 and export ciphers to the +end of the list.

+ +
+$ openssl ciphers -v 'ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP'
+NULL-SHA                SSLv3 Kx=RSA      Au=RSA  Enc=None      Mac=SHA1
+NULL-MD5                SSLv3 Kx=RSA      Au=RSA  Enc=None      Mac=MD5
+EDH-RSA-DES-CBC3-SHA    SSLv3 Kx=DH       Au=RSA  Enc=3DES(168) Mac=SHA1
+...                     ...               ...     ...           ...
+EXP-RC4-MD5             SSLv3 Kx=RSA(512) Au=RSA  Enc=RC4(40)   Mac=MD5  export
+EXP-RC2-CBC-MD5         SSLv2 Kx=RSA(512) Au=RSA  Enc=RC2(40)   Mac=MD5  export
+EXP-RC4-MD5             SSLv2 Kx=RSA(512) Au=RSA  Enc=RC4(40)   Mac=MD5  export
+
+
+

The complete list of particular RSA & DH ciphers for SSL is given in Table 2.

+Example +SSLCipherSuite RSA:!EXP:!NULL:+HIGH:+MEDIUM:-LOW + +
+ + + +
Table 2: Particular SSL Ciphers
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Cipher-Tag Protocol Key Ex. Auth. Enc. MAC Type
RSA Ciphers:
DES-CBC3-SHA SSLv3 RSA RSA 3DES(168) SHA1  
DES-CBC3-MD5 SSLv2 RSA RSA 3DES(168) MD5  
IDEA-CBC-SHA SSLv3 RSA RSA IDEA(128) SHA1  
RC4-SHA SSLv3 RSA RSA RC4(128) SHA1  
RC4-MD5 SSLv3 RSA RSA RC4(128) MD5  
IDEA-CBC-MD5 SSLv2 RSA RSA IDEA(128) MD5  
RC2-CBC-MD5 SSLv2 RSA RSA RC2(128) MD5  
RC4-MD5 SSLv2 RSA RSA RC4(128) MD5  
DES-CBC-SHA SSLv3 RSA RSA DES(56) SHA1  
RC4-64-MD5 SSLv2 RSA RSA RC4(64) MD5  
DES-CBC-MD5 SSLv2 RSA RSA DES(56) MD5  
EXP-DES-CBC-SHA SSLv3 RSA(512) RSA DES(40) SHA1 export
EXP-RC2-CBC-MD5 SSLv3 RSA(512) RSA RC2(40) MD5 export
EXP-RC4-MD5 SSLv3 RSA(512) RSA RC4(40) MD5 export
EXP-RC2-CBC-MD5 SSLv2 RSA(512) RSA RC2(40) MD5 export
EXP-RC4-MD5 SSLv2 RSA(512) RSA RC4(40) MD5 export
NULL-SHA SSLv3 RSA RSA None SHA1  
NULL-MD5 SSLv3 RSA RSA None MD5  
Diffie-Hellman Ciphers:
ADH-DES-CBC3-SHA SSLv3 DH None 3DES(168) SHA1  
ADH-DES-CBC-SHA SSLv3 DH None DES(56) SHA1  
ADH-RC4-MD5 SSLv3 DH None RC4(128) MD5  
EDH-RSA-DES-CBC3-SHA SSLv3 DH RSA 3DES(168) SHA1  
EDH-DSS-DES-CBC3-SHA SSLv3 DH DSS 3DES(168) SHA1  
EDH-RSA-DES-CBC-SHA SSLv3 DH RSA DES(56) SHA1  
EDH-DSS-DES-CBC-SHA SSLv3 DH DSS DES(56) SHA1  
EXP-EDH-RSA-DES-CBC-SHA SSLv3 DH(512) RSA DES(40) SHA1 export
EXP-EDH-DSS-DES-CBC-SHA SSLv3 DH(512) DSS DES(40) SHA1 export
EXP-ADH-DES-CBC-SHA SSLv3 DH(512) None DES(40) SHA1 export
EXP-ADH-RC4-MD5 SSLv3 DH(512) None RC4(40) MD5 export
+
+
+
+
+
+ + +SSLCertificateFile +Server PEM-encoded X.509 Certificate file +SSLCertificateFile file-path +server config +virtual host + + +

+This directive points to the PEM-encoded Certificate file for the server and +optionally also to the corresponding RSA or DSA Private Key file for it +(contained in the same file). If the contained Private Key is encrypted the +Pass Phrase dialog is forced at startup time. This directive can be used up to +two times (referencing different filenames) when both a RSA and a DSA based +server certificate is used in parallel.

+Example +SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt + +
+
+ + +SSLCertificateKeyFile +Server PEM-encoded Private Key file +SSLCertificateKeyFile file-path +server config +virtual host + + +

+This directive points to the PEM-encoded Private Key file for the +server. If the Private Key is not combined with the Certificate in the +SSLCertificateFile, use this additional directive to +point to the file with the stand-alone Private Key. When +SSLCertificateFile is used and the file +contains both the Certificate and the Private Key this directive need +not be used. But we strongly discourage this practice. Instead we +recommend you to separate the Certificate and the Private Key. If the +contained Private Key is encrypted, the Pass Phrase dialog is forced +at startup time. This directive can be used up to two times +(referencing different filenames) when both a RSA and a DSA based +private key is used in parallel.

+Example +SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key + +
+
+ + +SSLCertificateChainFile +File of PEM-encoded Server CA Certificates +SSLCertificateChainFile file-path +server config +virtual host + + +

+This directive sets the optional all-in-one file where you can +assemble the certificates of Certification Authorities (CA) which form the +certificate chain of the server certificate. This starts with the issuing CA +certificate of of the server certificate and can range up to the root CA +certificate. Such a file is simply the concatenation of the various +PEM-encoded CA Certificate files, usually in certificate chain order.

+

+This should be used alternatively and/or additionally to SSLCACertificatePath for explicitly +constructing the server certificate chain which is sent to the browser +in addition to the server certificate. It is especially useful to +avoid conflicts with CA certificates when using client +authentication. Because although placing a CA certificate of the +server certificate chain into SSLCACertificatePath has the same effect +for the certificate chain construction, it has the side-effect that +client certificates issued by this same CA certificate are also +accepted on client authentication. That's usually not one expect.

+

+But be careful: Providing the certificate chain works only if you are using a +single (either RSA or DSA) based server certificate. If you are +using a coupled RSA+DSA certificate pair, this will work only if actually both +certificates use the same certificate chain. Else the browsers will be +confused in this situation.

+Example +SSLCertificateChainFile /usr/local/apache/conf/ssl.crt/ca.crt + +
+
+ + +SSLCACertificatePath +Directory of PEM-encoded CA Certificates for +Client Auth +SSLCACertificatePath directory-path +server config +virtual host + + +

+This directive sets the directory where you keep the Certificates of +Certification Authorities (CAs) whose clients you deal with. These are used to +verify the client certificate on Client Authentication.

+

+The files in this directory have to be PEM-encoded and are accessed through +hash filenames. So usually you can't just place the Certificate files +there: you also have to create symbolic links named +hash-value.N. And you should always make sure this directory +contains the appropriate symbolic links. Use the Makefile which +comes with mod_ssl to accomplish this task.

+Example +SSLCACertificatePath /usr/local/apache/conf/ssl.crt/ + +
+
+ + +SSLCACertificateFile +File of concatenated PEM-encoded CA Certificates +for Client Auth +SSLCACertificateFile file-path +server config +virtual host + + +

+This directive sets the all-in-one file where you can assemble the +Certificates of Certification Authorities (CA) whose clients you deal +with. These are used for Client Authentication. Such a file is simply the +concatenation of the various PEM-encoded Certificate files, in order of +preference. This can be used alternatively and/or additionally to +SSLCACertificatePath.

+Example +SSLCACertificateFile /usr/local/apache/conf/ssl.crt/ca-bundle-client.crt + +
+
+ + +SSLCARevocationPath +Directory of PEM-encoded CA CRLs for +Client Auth +SSLCARevocationPath directory-path +server config +virtual host + + +

+This directive sets the directory where you keep the Certificate Revocation +Lists (CRL) of Certification Authorities (CAs) whose clients you deal with. +These are used to revoke the client certificate on Client Authentication.

+

+The files in this directory have to be PEM-encoded and are accessed through +hash filenames. So usually you have not only to place the CRL files there. +Additionally you have to create symbolic links named +hash-value.rN. And you should always make sure this directory +contains the appropriate symbolic links. Use the Makefile which +comes with mod_ssl to accomplish this task.

+Example +SSLCARevocationPath /usr/local/apache/conf/ssl.crl/ + +
+
+ + +SSLCARevocationFile +File of concatenated PEM-encoded CA CRLs for +Client Auth +SSLCARevocationFile file-path +server config +virtual host + + +

+This directive sets the all-in-one file where you can +assemble the Certificate Revocation Lists (CRL) of Certification +Authorities (CA) whose clients you deal with. These are used +for Client Authentication. Such a file is simply the concatenation of +the various PEM-encoded CRL files, in order of preference. This can be +used alternatively and/or additionally to SSLCARevocationPath.

+Example +SSLCARevocationFile /usr/local/apache/conf/ssl.crl/ca-bundle-client.crl + +
+
+ + +SSLVerifyClient +Type of Client Certificate verification +SSLVerifyClient level +SSLVerifyClient none +server config +virtual host +directory +.htaccess +AuthConfig + + +

+This directive sets the Certificate verification level for the Client +Authentication. Notice that this directive can be used both in per-server and +per-directory context. In per-server context it applies to the client +authentication process used in the standard SSL handshake when a connection is +established. In per-directory context it forces a SSL renegotation with the +reconfigured client verification level after the HTTP request was read but +before the HTTP response is sent.

+

+The following levels are available for level:

+
    +
  • none: + no client Certificate is required at all
  • +
  • optional: + the client may present a valid Certificate
  • +
  • require: + the client has to present a valid Certificate
  • +
  • optional_no_ca: + the client may present a valid Certificate
    + but it need not to be (successfully) verifiable.
  • +
+

In practice only levels none and +require are really interesting, because level +optional doesn't work with all browsers and level +optional_no_ca is actually against the idea of +authentication (but can be used to establish SSL test pages, etc.)

+Example +SSLVerifyClient require + +
+
+ + +SSLVerifyDepth +Maximum depth of CA Certificates in Client +Certificate verification +SSLVerifyDepth number +SSLVerifyDepth 1 +server config +virtual host +directory +.htaccess +AuthConfig + + +

+This directive sets how deeply mod_ssl should verify before deciding that the +clients don't have a valid certificate. Notice that this directive can be +used both in per-server and per-directory context. In per-server context it +applies to the client authentication process used in the standard SSL +handshake when a connection is established. In per-directory context it forces +a SSL renegotation with the reconfigured client verification depth after the +HTTP request was read but before the HTTP response is sent.

+

+The depth actually is the maximum number of intermediate certificate issuers, +i.e. the number of CA certificates which are max allowed to be followed while +verifying the client certificate. A depth of 0 means that self-signed client +certificates are accepted only, the default depth of 1 means the client +certificate can be self-signed or has to be signed by a CA which is directly +known to the server (i.e. the CA's certificate is under +SSLCACertificatePath), etc.

+Example +SSLVerifyDepth 10 + +
+
+ + +SSLLog +Where to write the dedicated SSL engine logfile +SSLLog file-path +server config +virtual host + + +

+This directive sets the name of the dedicated SSL protocol engine logfile. +Error type messages are additionally duplicated to the general Apache error +log file (directive ErrorLog). Put this somewhere where it cannot +be used for symlink attacks on a real server (i.e. somewhere where only root +can write). If the file-path does not begin with a slash +('/') then it is assumed to be relative to the Server +Root. If file-path begins with a bar ('|') then the +following string is assumed to be a path to an executable program to which a +reliable pipe can be established. The directive should occur only once per +virtual server config.

+Example +SSLLog /usr/local/apache/logs/ssl_engine_log + +
+
+ + +SSLLogLevel +Logging level for the dedicated SSL engine +logfile +SSLLogLevel level +SSLLogLevel none +server config +virtual host + + +

+This directive sets the verbosity degree of the dedicated SSL protocol engine +logfile. The level is one of the following (in ascending order where +higher levels include lower levels):

+
    +
  • none
    + no dedicated SSL logging is done, but messages of level + ``error'' are still written to the general Apache error + logfile. +
  • +
  • error
    + log messages of error type only, i.e. messages which show fatal situations + (processing is stopped). Those messages are also duplicated to the + general Apache error logfile. +
  • +
  • warn
    + log also warning messages, i.e. messages which show non-fatal problems + (processing is continued). +
  • +
  • info
    + log also informational messages, i.e. messages which show major + processing steps. +
  • +
  • trace
    + log also trace messages, i.e. messages which show minor processing steps. +
  • +
  • debug
    + log also debugging messages, i.e. messages which show development and + low-level I/O information. +
  • +
+Example +SSLLogLevel warn + +
+
+ + +SSLOptions +Configure various SSL engine run-time options +SSLOptions [+|-]option ... +server config +virtual host +directory +.htaccess +Options + + +

+This directive can be used to control various run-time options on a +per-directory basis. Normally, if multiple SSLOptions +could apply to a directory, then the most specific one is taken +completely; the options are not merged. However if all the +options on the SSLOptions directive are preceded by a +plus (+) or minus (-) symbol, the options +are merged. Any options preceded by a + are added to the +options currently in force, and any options preceded by a +- are removed from the options currently in force.

+

+The available options are:

+
    +
  • StdEnvVars +

    + When this option is enabled, the standard set of SSL related CGI/SSI + environment variables are created. This per default is disabled for + performance reasons, because the information extraction step is a + rather expensive operation. So one usually enables this option for + CGI and SSI requests only.

    +
  • +
  • CompatEnvVars +

    + When this option is enabled, additional CGI/SSI environment variables are + created for backward compatibility to other Apache SSL solutions. Look in + the Compatibility chapter for details + on the particular variables generated.

    +
  • +
  • ExportCertData +

    + When this option is enabled, additional CGI/SSI environment variables are + created: SSL_SERVER_CERT, SSL_CLIENT_CERT and + SSL_CLIENT_CERT_CHAINn (with n = 0,1,2,..). + These contain the PEM-encoded X.509 Certificates of server and client for + the current HTTPS connection and can be used by CGI scripts for deeper + Certificate checking. Additionally all other certificates of the client + certificate chain are provided, too. This bloats up the environment a + little bit which is why you have to use this option to enable it on + demand.

    +
  • +
  • FakeBasicAuth +

    + When this option is enabled, the Subject Distinguished Name (DN) of the + Client X509 Certificate is translated into a HTTP Basic Authorization + username. This means that the standard Apache authentication methods can + be used for access control. The user name is just the Subject of the + Client's X509 Certificate (can be determined by running OpenSSL's + openssl x509 command: openssl x509 -noout -subject -in + certificate.crt). Note that no password is + obtained from the user. Every entry in the user file needs this password: + ``xxj31ZMTZzkVA'', which is the DES-encrypted version of the + word `password''. Those who live under MD5-based encryption + (for instance under FreeBSD or BSD/OS, etc.) should use the following MD5 + hash of the same word: ``$1$OXLyS...$Owx8s2/m9/gfkcRVXzgoE/''.

    +
  • +
  • StrictRequire +

    + This forces forbidden access when SSLRequireSSL or + SSLRequire successfully decided that access should be + forbidden. Usually the default is that in the case where a ``Satisfy + any'' directive is used, and other access restrictions are passed, + denial of access due to SSLRequireSSL or + SSLRequire is overridden (because that's how the Apache + Satisfy mechanism should work.) But for strict access restriction + you can use SSLRequireSSL and/or SSLRequire in + combination with an ``SSLOptions +StrictRequire''. Then an + additional ``Satisfy Any'' has no chance once mod_ssl has + decided to deny access.

    +
  • +
  • OptRenegotiate +

    + This enables optimized SSL connection renegotiation handling when SSL + directives are used in per-directory context. By default a strict + scheme is enabled where every per-directory reconfiguration of + SSL parameters causes a full SSL renegotiation handshake. When this + option is used mod_ssl tries to avoid unnecessary handshakes by doing more + granular (but still safe) parameter checks. Nevertheless these granular + checks sometimes maybe not what the user expects, so enable this on a + per-directory basis only, please.

    +
  • +
+Example +SSLOptions +FakeBasicAuth -StrictRequire
+<Files ~ "\.(cgi|shtml)$">
+ SSLOptions +StdEnvVars +CompatEnvVars -ExportCertData
+<Files> +
+
+
+ + +SSLRequireSSL +Deny access when SSL is not used for the +HTTP request +SSLRequireSSL +directory +.htaccess +AuthConfig + + +

+This directive forbids access unless HTTP over SSL (i.e. HTTPS) is enabled for +the current connection. This is very handy inside the SSL-enabled virtual +host or directories for defending against configuration errors that expose +stuff that should be protected. When this directive is present all requests +are denied which are not using SSL.

+Example +SSLRequireSSL + +
+
+ + +SSLRequire +Allow access only when an arbitrarily complex +boolean expression is true +SSLRequire expression +directory +.htaccess +AuthConfig + + +

+This directive specifies a general access requirement which has to be +fulfilled in order to allow access. It's a very powerful directive because the +requirement specification is an arbitrarily complex boolean expression +containing any number of access checks.

+

+The expression must match the following syntax (given as a BNF +grammar notation):

+
+
+expr     ::= "true" | "false"
+           | "!" expr
+           | expr "&&" expr
+           | expr "||" expr
+           | "(" expr ")"
+           | comp
+
+comp     ::= word "==" word | word "eq" word
+           | word "!=" word | word "ne" word
+           | word "<"  word | word "lt" word
+           | word "<=" word | word "le" word
+           | word ">"  word | word "gt" word
+           | word ">=" word | word "ge" word
+           | word "in" "{" wordlist "}"
+           | word "=~" regex
+           | word "!~" regex
+
+wordlist ::= word
+           | wordlist "," word
+
+word     ::= digit
+           | cstring
+           | variable
+           | function
+
+digit    ::= [0-9]+
+cstring  ::= "..."
+variable ::= "%{" varname "}"
+function ::= funcname "(" funcargs ")"
+
+
+

while for varname any variable from Table 3 can be used. Finally for +funcname the following functions are available:

+
    +
  • file(filename) +

    + This function takes one string argument and expands to the contents of the + file. This is especially useful for matching this contents against a + regular expression, etc.

    +
  • +
+

Notice that expression is first parsed into an internal machine +representation and then evaluated in a second step. Actually, in Global and +Per-Server Class context expression is parsed at startup time and +at runtime only the machine representation is executed. For Per-Directory +context this is different: here expression has to be parsed and +immediately executed for every request.

+Example +SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)-/ \
+ and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
+ and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
+ and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
+ and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
+ or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/ +
+
+ + + +
Table 3: Available Variables for SSLRequire
+ + +
+
+Standard CGI/1.0 and Apache variables: +
+HTTP_USER_AGENT        PATH_INFO             AUTH_TYPE
+HTTP_REFERER           QUERY_STRING          SERVER_SOFTWARE
+HTTP_COOKIE            REMOTE_HOST           API_VERSION
+HTTP_FORWARDED         REMOTE_IDENT          TIME_YEAR
+HTTP_HOST              IS_SUBREQ             TIME_MON
+HTTP_PROXY_CONNECTION  DOCUMENT_ROOT         TIME_DAY
+HTTP_ACCEPT            SERVER_ADMIN          TIME_HOUR
+HTTP:headername        SERVER_NAME           TIME_MIN
+THE_REQUEST            SERVER_PORT           TIME_SEC
+REQUEST_METHOD         SERVER_PROTOCOL       TIME_WDAY
+REQUEST_SCHEME         REMOTE_ADDR           TIME
+REQUEST_URI            REMOTE_USER           ENV:variablename
+REQUEST_FILENAME
+
+SSL-related variables: +
+HTTPS                  SSL_CLIENT_M_VERSION   SSL_SERVER_M_VERSION
+                       SSL_CLIENT_M_SERIAL    SSL_SERVER_M_SERIAL
+SSL_PROTOCOL           SSL_CLIENT_V_START     SSL_SERVER_V_START
+SSL_SESSION_ID         SSL_CLIENT_V_END       SSL_SERVER_V_END
+SSL_CIPHER             SSL_CLIENT_S_DN        SSL_SERVER_S_DN
+SSL_CIPHER_EXPORT      SSL_CLIENT_S_DN_C      SSL_SERVER_S_DN_C
+SSL_CIPHER_ALGKEYSIZE  SSL_CLIENT_S_DN_ST     SSL_SERVER_S_DN_ST
+SSL_CIPHER_USEKEYSIZE  SSL_CLIENT_S_DN_L      SSL_SERVER_S_DN_L
+SSL_VERSION_LIBRARY    SSL_CLIENT_S_DN_O      SSL_SERVER_S_DN_O
+SSL_VERSION_INTERFACE  SSL_CLIENT_S_DN_OU     SSL_SERVER_S_DN_OU
+                       SSL_CLIENT_S_DN_CN     SSL_SERVER_S_DN_CN
+                       SSL_CLIENT_S_DN_T      SSL_SERVER_S_DN_T
+                       SSL_CLIENT_S_DN_I      SSL_SERVER_S_DN_I
+                       SSL_CLIENT_S_DN_G      SSL_SERVER_S_DN_G
+                       SSL_CLIENT_S_DN_S      SSL_SERVER_S_DN_S
+                       SSL_CLIENT_S_DN_D      SSL_SERVER_S_DN_D
+                       SSL_CLIENT_S_DN_UID    SSL_SERVER_S_DN_UID
+                       SSL_CLIENT_S_DN_Email  SSL_SERVER_S_DN_Email
+                       SSL_CLIENT_I_DN        SSL_SERVER_I_DN
+                       SSL_CLIENT_I_DN_C      SSL_SERVER_I_DN_C
+                       SSL_CLIENT_I_DN_ST     SSL_SERVER_I_DN_ST
+                       SSL_CLIENT_I_DN_L      SSL_SERVER_I_DN_L
+                       SSL_CLIENT_I_DN_O      SSL_SERVER_I_DN_O
+                       SSL_CLIENT_I_DN_OU     SSL_SERVER_I_DN_OU
+                       SSL_CLIENT_I_DN_CN     SSL_SERVER_I_DN_CN
+                       SSL_CLIENT_I_DN_T      SSL_SERVER_I_DN_T
+                       SSL_CLIENT_I_DN_I      SSL_SERVER_I_DN_I
+                       SSL_CLIENT_I_DN_G      SSL_SERVER_I_DN_G
+                       SSL_CLIENT_I_DN_S      SSL_SERVER_I_DN_S
+                       SSL_CLIENT_I_DN_D      SSL_SERVER_I_DN_D
+                       SSL_CLIENT_I_DN_UID    SSL_SERVER_I_DN_UID
+                       SSL_CLIENT_I_DN_Email  SSL_SERVER_I_DN_Email
+                       SSL_CLIENT_A_SIG       SSL_SERVER_A_SIG
+                       SSL_CLIENT_A_KEY       SSL_SERVER_A_KEY
+                       SSL_CLIENT_CERT        SSL_SERVER_CERT
+                       SSL_CLIENT_CERT_CHAINn
+                       SSL_CLIENT_VERIFY
+
+
+
+
+
+
+
+ +
diff --git a/docs/manual/mod/mod_status.xml b/docs/manual/mod/mod_status.xml new file mode 100644 index 00000000000..d3a351f12ff --- /dev/null +++ b/docs/manual/mod/mod_status.xml @@ -0,0 +1,137 @@ + + + + +mod_status +Base +status_module +mod_status.c +Available in Apache 1.1 and later + +This module provides information on server activity and +performance. + + + + + Warning: This document has not been updated + to take into account changes made in the 2.0 version of the + Apache HTTP Server. Some of the information may still be + relevant, but please use it with care. + + +

The Status module allows a server administrator to find out + how well their server is performing. A HTML page is presented + that gives the current server statistics in an easily readable + form. If required this page can be made to automatically + refresh (given a compatible browser). Another page gives a + simple machine-readable list of the current server state.

+ +

The details given are:

+ + + + A compile-time option must be used to display the details + marked "(*)" as the instrumentation required for obtaining + these statistics does not exist within standard Apache. +
+ +
+ Enabling Status Support + + To enable status reports only for browsers from the foo.com + domain add this code to your httpd.conf + configuration file + + <Location /server-status>
+ SetHandler server-status
+
+ Order Deny,Allow
+ Deny from all
+ Allow from .foo.com
+ </Location> +
+ +

You can now access server statistics by using a Web browser + to access the page + http://your.server.name/server-status

+ +

Note that mod_status will only work + when you are running Apache in standalone mode and not + inetd mode.

+
+ +
+ + Automatic Updates + You can get the status page to update itself automatically if + you have a browser that supports "refresh". Access the page + http://your.server.name/server-status?refresh=N to + refresh the page every N seconds. + +
+ +
+ + Machine Readable Status File + A machine-readable version of the status file is available by + accessing the page + http://your.server.name/server-status?auto. This + is useful when automatically run, see the Perl program in the + /support directory of Apache, + log_server_status. + + + It should be noted that if mod_status is + compiled into the server, its handler capability is available + in all configuration files, including + per-directory files (e.g., + .htaccess). This may have security-related + ramifications for your site. + + +
+ + + +ExtendedStatus +This directive controls whether the server keeps track of +extended status information for each request. This is only +useful if the status module is enabled on the server. +ExtendedStatus On|Off +ExtendedStatus Off +server config +ExtendedStatus is only available in Apache 1.3.2 and +later. + + +

This setting applies to the entire server, and cannot be + enabled or disabled on a virtualhost-by-virtualhost basis.

+
+ +
+
+ diff --git a/docs/manual/mod/mod_suexec.xml b/docs/manual/mod/mod_suexec.xml new file mode 100644 index 00000000000..0d575e4913d --- /dev/null +++ b/docs/manual/mod/mod_suexec.xml @@ -0,0 +1,40 @@ + + + + +mod_suexec +Extension +suexec_module +mod_suexec.c +Available in Apache 2.0 and later + +This module allows CGI scripts to run as a specified user +and Group. + + +

This module allows CGI scripts to run as a specified user + and Group.

+
+ + + + +SuexecUserGroup +SuexecUserGroup User Group +None +server config +virtual host +SuexecUserGroup is only available in 2.0 and +later. + + +

The SuexecUserGroup directive allows you to + specify a user and group for CGI programs to run as. Non-CGI + requests are still processes with the user specified in the + User directive. This directive replaces using the User and + Group directives inside of VirtualHosts.

+
+ +
+
+ diff --git a/docs/manual/mod/mod_unique_id.xml b/docs/manual/mod/mod_unique_id.xml new file mode 100755 index 00000000000..6c4166c1d82 --- /dev/null +++ b/docs/manual/mod/mod_unique_id.xml @@ -0,0 +1,182 @@ + + + + +mod_unique_id +Extension +unique_id_module +mod_unique_id.c +Available in Apache 1.3 and later. + +This module provides an environment variable with a unique +identifier for each request. + + + +

This module provides a magic token for each request which is + guaranteed to be unique across "all" requests under very + specific conditions. The unique identifier is even unique + across multiple machines in a properly configured cluster of + machines. The environment variable UNIQUE_ID is + set to the identifier for each request. Unique identifiers are + useful for various reasons which are beyond the scope of this + document.

+
+ +
+ Theory + +

First a brief recap of how the Apache server works on Unix + machines. This feature currently isn't supported on Windows NT. + On Unix machines, Apache creates several children, the children + process requests one at a time. Each child can serve multiple + requests in its lifetime. For the purpose of this discussion, + the children don't share any data with each other. We'll refer + to the children as httpd processes.

+ +

Your website has one or more machines under your + administrative control, together we'll call them a cluster of + machines. Each machine can possibly run multiple instances of + Apache. All of these collectively are considered "the + universe", and with certain assumptions we'll show that in this + universe we can generate unique identifiers for each request, + without extensive communication between machines in the + cluster.

+ +

The machines in your cluster should satisfy these + requirements. (Even if you have only one machine you should + synchronize its clock with NTP.)

+ + + +

As far as operating system assumptions go, we assume that + pids (process ids) fit in 32-bits. If the operating system uses + more than 32-bits for a pid, the fix is trivial but must be + performed in the code.

+ +

Given those assumptions, at a single point in time we can + identify any httpd process on any machine in the cluster from + all other httpd processes. The machine's IP address and the pid + of the httpd process are sufficient to do this. So in order to + generate unique identifiers for requests we need only + distinguish between different points in time.

+ +

To distinguish time we will use a Unix timestamp (seconds + since January 1, 1970 UTC), and a 16-bit counter. The timestamp + has only one second granularity, so the counter is used to + represent up to 65536 values during a single second. The + quadruple ( ip_addr, pid, time_stamp, counter ) is + sufficient to enumerate 65536 requests per second per httpd + process. There are issues however with pid reuse over time, and + the counter is used to alleviate this issue.

+ +

When an httpd child is created, the counter is initialized + with ( current microseconds divided by 10 ) modulo 65536 (this + formula was chosen to eliminate some variance problems with the + low order bits of the microsecond timers on some systems). When + a unique identifier is generated, the time stamp used is the + time the request arrived at the web server. The counter is + incremented every time an identifier is generated (and allowed + to roll over).

+ +

The kernel generates a pid for each process as it forks the + process, and pids are allowed to roll over (they're 16-bits on + many Unixes, but newer systems have expanded to 32-bits). So + over time the same pid will be reused. However unless it is + reused within the same second, it does not destroy the + uniqueness of our quadruple. That is, we assume the system does + not spawn 65536 processes in a one second interval (it may even + be 32768 processes on some Unixes, but even this isn't likely + to happen).

+ +

Suppose that time repeats itself for some reason. That is, + suppose that the system's clock is screwed up and it revisits a + past time (or it is too far forward, is reset correctly, and + then revisits the future time). In this case we can easily show + that we can get pid and time stamp reuse. The choice of + initializer for the counter is intended to help defeat this. + Note that we really want a random number to initialize the + counter, but there aren't any readily available numbers on most + systems (i.e., you can't use rand() because you need + to seed the generator, and can't seed it with the time because + time, at least at one second resolution, has repeated itself). + This is not a perfect defense.

+ +

How good a defense is it? Suppose that one of your machines + serves at most 500 requests per second (which is a very + reasonable upper bound at this writing, because systems + generally do more than just shovel out static files). To do + that it will require a number of children which depends on how + many concurrent clients you have. But we'll be pessimistic and + suppose that a single child is able to serve 500 requests per + second. There are 1000 possible starting counter values such + that two sequences of 500 requests overlap. So there is a 1.5% + chance that if time (at one second resolution) repeats itself + this child will repeat a counter value, and uniqueness will be + broken. This was a very pessimistic example, and with real + world values it's even less likely to occur. If your system is + such that it's still likely to occur, then perhaps you should + make the counter 32 bits (by editing the code).

+ +

You may be concerned about the clock being "set back" during + summer daylight savings. However this isn't an issue because + the times used here are UTC, which "always" go forward. Note + that x86 based Unixes may need proper configuration for this to + be true -- they should be configured to assume that the + motherboard clock is on UTC and compensate appropriately. But + even still, if you're running NTP then your UTC time will be + correct very shortly after reboot.

+ +

The UNIQUE_ID environment variable is + constructed by encoding the 112-bit (32-bit IP address, 32 bit + pid, 32 bit time stamp, 16 bit counter) quadruple using the + alphabet [A-Za-z0-9@-] in a manner similar to MIME + base64 encoding, producing 19 characters. The MIME base64 + alphabet is actually [A-Za-z0-9+/] however + + and / need to be specially encoded + in URLs, which makes them less desirable. All values are + encoded in network byte ordering so that the encoding is + comparable across architectures of different byte ordering. The + actual ordering of the encoding is: time stamp, IP address, + pid, counter. This ordering has a purpose, but it should be + emphasized that applications should not dissect the encoding. + Applications should treat the entire encoded + UNIQUE_ID as an opaque token, which can be + compared against other UNIQUE_IDs for equality + only.

+ +

The ordering was chosen such that it's possible to change + the encoding in the future without worrying about collision + with an existing database of UNIQUE_IDs. The new + encodings should also keep the time stamp as the first element, + and can otherwise use the same alphabet and bit length. Since + the time stamps are essentially an increasing sequence, it's + sufficient to have a flag second in which all machines + in the cluster stop serving and request, and stop using the old + encoding format. Afterwards they can resume requests and begin + issuing the new encodings.

+ +

This we believe is a relatively portable solution to this + problem. It can be extended to multithreaded systems like + Windows NT, and can grow with future needs. The identifiers + generated have essentially an infinite life-time because future + identifiers can be made longer as required. Essentially no + communication is required between machines in the cluster (only + NTP synchronization is required, which is low overhead), and no + communication between httpd processes is required (the + communication is implicit in the pid value assigned by the + kernel). In very specific situations the identifier can be + shortened, but more information needs to be assumed (for + example the 32-bit IP address is overkill for any site, but + there is no portable shorter replacement for it).

+
+ + +
diff --git a/docs/manual/mod/mod_userdir.xml b/docs/manual/mod/mod_userdir.xml new file mode 100755 index 00000000000..65777a7e45b --- /dev/null +++ b/docs/manual/mod/mod_userdir.xml @@ -0,0 +1,107 @@ + + + + +mod_userdir +Base +This module provides for user-specific +directories. +userdir_module +mod_userdir.c + + + + + + + +UserDir +Sets the directory from which to serve files when requests +for a particular user are received, denoted by requests containing +~username, such as +http://server.example.com/~bob/ +UserDir directory-filename +UserDir public_html +server config virtual +host +All forms except the UserDir public_html +form are only available in Apache 1.1 or above. Use of the +enabled keyword, or disabled with a +list of usernames, is only available in Apache 1.3 and +above. + + + +

The UserDir directive sets the real directory in a user's + home directory to use when a request for a document for a user + is received. Directory-filename is one of the + following:

+ +
    +
  • The name of a directory or a pattern such as those shown + below.
  • + +
  • The keyword disabled. This turns off + all username-to-directory translations except those + explicitly named with the enabled keyword (see + below).
  • + +
  • The keyword disabled followed by a + space-delimited list of usernames. Usernames that appear in + such a list will never have directory translation + performed, even if they appear in an enabled + clause.
  • + +
  • The keyword enabled followed by a + space-delimited list of usernames. These usernames will have + directory translation performed even if a global disable is + in effect, but not if they also appear in a + disabled clause.
  • +
+ +

If neither the enabled nor the + disabled keywords appear in the + Userdir directive, the argument is treated as a + filename pattern, and is used to turn the name into a directory + specification. A request for + http://www.foo.com/~bob/one/two.html will be + translated to:

+ + + + + + + +
UserDir directive usedTranslated path
UserDir public_html~bob/public_html/one/two.html
UserDir /usr/web/usr/web/bob/one/two.html
UserDir /home/*/www/home/bob/www/one/two.html
+ +

The following directives will send redirects to the client:

+ + + + + + + +
UserDir directive usedTranslated path
UserDir http://www.foo.com/usershttp://www.foo.com/users/bob/one/two.html
UserDir +http://www.foo.com/*/usrhttp://www.foo.com/bob/usr/one/two.html
UserDir +http://www.foo.com/~*/http://www.foo.com/~bob/one/two.html
+ +
+ Be careful when using this directive; for instance, + "UserDir ./" would map + "/~root" to "/" - which is probably + undesirable. If you are running Apache 1.3 or above, it is + strongly recommended that your configuration include a + "UserDir disabled root" declaration. + See also the Directory + directive and the Security + Tips page for more information. +
+ +
+ +
+
+ + diff --git a/docs/manual/mod/mod_usertrack.xml b/docs/manual/mod/mod_usertrack.xml new file mode 100755 index 00000000000..ab6c0e901a9 --- /dev/null +++ b/docs/manual/mod/mod_usertrack.xml @@ -0,0 +1,228 @@ + + + + + +mod_usertrack + + This module uses cookies to provide for a + clickstream log of user activity on a site. + +Extension +mod_usertrack.c +usertrack_module +Known as mod_cookies prior to Apache 1.3. + + + +

Summary

+ +

Previous releases of Apache have included a module which + generates a 'clickstream' log of user activity on a site using + cookies. This was called the "cookies" module, mod_cookies. In + Apache 1.2 and later this module has been renamed the "user + tracking" module, mod_usertrack. This module has been + simplified and new directives added.

+
+ + +
+Logging + +

Previously, the cookies module (now the user tracking + module) did its own logging, using the CookieLog + directive. In this release, this module does no logging at all. + Instead, a configurable log format file should be used to log + user click-streams. This is possible because the logging module + now allows multiple log files. The cookie itself is logged by + using the text %{cookie}n in the log file format. For + example:

+ +CustomLog logs/clickstream "%{cookie}n %r %t" + + +

For backward compatibility the configurable log module + implements the old CookieLog directive, but this + should be upgraded to the above CustomLog directive.

+
+ +
+2-digit or 4-digit dates for cookies? + +

(the following is from message + <022701bda43d$9d32bbb0$1201a8c0@christian.office.sane.com> + in the new-httpd archives) +

+From: "Christian Allen" <christian@sane.com>
+Subject: Re: Apache Y2K bug in mod_usertrack.c
+Date: Tue, 30 Jun 1998 11:41:56 -0400
+
+Did some work with cookies and dug up some info that might be useful.
+
+True, Netscape claims that the correct format NOW is four digit dates, and
+four digit dates do in fact work... for Netscape 4.x (Communicator), that
+is.  However, 3.x and below do NOT accept them.  It seems that Netscape
+originally had a 2-digit standard, and then with all of the Y2K hype and
+probably a few complaints, changed to a four digit date for Communicator.
+Fortunately, 4.x also understands the 2-digit format, and so the best way to
+ensure that your expiration date is legible to the client's browser is to
+use 2-digit dates.
+
+However, this does not limit expiration dates to the year 2000; if you use
+an expiration year of "13", for example, it is interpreted as 2013, NOT
+1913!  In fact, you can use an expiration year of up to "37", and it will be
+understood as "2037" by both MSIE and Netscape versions 3.x and up (not sure
+about versions previous to those).  Not sure why Netscape used that
+particular year as its cut-off point, but my guess is that it was in respect
+to UNIX's 2038 problem.  Netscape/MSIE 4.x seem to be able to understand
+2-digit years beyond that, at least until "50" for sure (I think they
+understand up until about "70", but not for sure).
+
+Summary:  Mozilla 3.x and up understands two digit dates up until "37"
+(2037).  Mozilla 4.x understands up until at least "50" (2050) in 2-digit
+form, but also understands 4-digit years, which can probably reach up until
+9999.  Your best bet for sending a long-life cookie is to send it for some
+time late in the year "37".
+
+

+
+ + +CookieDomain +CookieDomain domain +None + +server config +virtual host +directory +.htaccess + +controls the setting of the domain to which + the tracking cookie applies. + + + +

This directive controls the setting of the domain to which + the tracking cookie applies. If not present, no domain is + included in the cookie header field.

+ +

The domain string must begin with a dot, and + must include at least one embedded dot. That is, + ".foo.com" is legal, but "foo.bar.com" and ".com" are not.

+
+
+ + + +CookieExpires +CookieExpires expiry-period + + +server config +virtual host +directory +.htaccess + + +In 1.3.20 and earlier, not usable in directory and +.htaccess + + +

When used, this directive sets an expiry time on the cookie + generated by the usertrack module. The expiry-period + can be given either as a number of seconds, or in the format + such as "2 weeks 3 days 7 hours". Valid denominations are: + years, months, weeks, hours, minutes and seconds. If the expiry + time is in any format other than one number indicating the + number of seconds, it must be enclosed by double quotes.

+ +

If this directive is not used, cookies last only for the + current browser session.

+
+
+ + +CookieName +CookieName token +Apache + +server config +virtual host +directory +.htaccess + + + +

This directive allows you to change the name of the cookie + this module uses for its tracking purposes. By default the + cookie is named "Apache".

+ +

You must specify a valid cookie name; results are + unpredictable if you use a name containing unusual characters. + Valid characters include A-Z, a-z, 0-9, "_", and "-".

+
+
+ + +CookieStyle +CookieStyle + Netscape|Cookie|Cookie2|RFC2109|RFC2965 + + +server config +virtual host +directory +.htaccess + +Controls the format of the cookie header + field + + +

This directive controls the format of the cookie header + field. The three formats allowed are:

+ +
    +
  • Netscape, which is the original but now deprecated + syntax. This is the default, and the syntax Apache has + historically used.
  • + +
  • Cookie or RFC2109, which is the syntax that + superseded the Netscape syntax.
  • + +
  • Cookie2 or RFC2965, which is the most + current cookie syntax.
  • +
+ +

Not all clients can understand all of these formats. but you + should use the newest one that is generally acceptable to your + users' browsers.

+
+
+ + + + +CookieTracking +CookieTracking on|off + + +server config +virtual host +directory +.htaccess + +FileInfo + + +

When the user track module is compiled in, and + "CookieTracking on" is set, Apache will start sending a + user-tracking cookie for all new requests. This directive can + be used to turn this behavior on or off on a per-server or + per-directory basis. By default, compiling mod_usertrack will + not activate cookies.

+ +
+
+ +
+ diff --git a/docs/manual/mod/mod_vhost_alias.xml b/docs/manual/mod/mod_vhost_alias.xml new file mode 100644 index 00000000000..d10d21cb396 --- /dev/null +++ b/docs/manual/mod/mod_vhost_alias.xml @@ -0,0 +1,287 @@ + + + + +mod_vhost_alias +Extension +vhost_alias_module +mod_vhost_alias.c +Available in Apache 1.3.7 and later. + +This module provides support for dynamically configured mass virtual +hosting. + + + +

This module creates dynamically configured virtual hosts, by + allowing the IP address and/or the Host: header of + the HTTP request to be used as part of the pathname to + determine what files to serve. This allows for easy use of a + huge number of virtual hosts with similar configurations.

+ + See also: UseCanonicalName. + +
+ +
+ Directory Name Interpolation + +

All the directives in this module interpolate a string into + a pathname. The interpolated string (henceforth called the + "name") may be either the server name (see the UseCanonicalName + directive for details on how this is determined) or the IP + address of the virtual host on the server in dotted-quad + format. The interpolation is controlled by specifiers inspired + by printf which have a number of formats:

+ + + + + + + + + + + + +
%%insert a %
%pinsert the port number of the virtual host
%N.Minsert (part of) the name
+ +

N and M are used to specify + substrings of the name. N selects from the + dot-separated components of the name, and M + selects characters within whatever N has selected. + M is optional and defaults to zero if it isn't + present; the dot must be present if and only if M + is present. The interpretation is as follows:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
0the whole name
1the first part
2the second part
-1the last part
-2the penultimate part
2+the second and all subsequent parts
-2+the penultimate and all preceding parts
1+ and -1+the same as 0
+ +

If N or M is greater than the number + of parts available a single underscore is interpolated.

+ +
+ +
+ Examples + +

For simple name-based virtual hosts you might use the + following directives in your server configuration file:

+ + + UseCanonicalName Off
+ VirtualDocumentRoot /usr/local/apache/vhosts/%0 +
+ +

A request for + http://www.example.com/directory/file.html will be + satisfied by the file + /usr/local/apache/vhosts/www.example.com/directory/file.html. +

+ +

For a very large number of virtual hosts it is a good idea + to arrange the files to reduce the size of the + vhosts directory. To do this you might use the + following in your configuration file:

+ + + UseCanonicalName Off
+ VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2 +
+ +

A request for + http://www.example.isp.com/directory/file.html + will be satisfied by the file + /usr/local/apache/vhosts/isp.com/e/x/a/example/directory/file.html.

+ +

A more even spread of files can be achieved by hashing from the + end of the name, for example:

+ + + VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.-1/%2.-2/%2.-3/%2 + + +

The example request would come from + /usr/local/apache/vhosts/isp.com/e/l/p/example/directory/file.html.

+ +

Alternatively you might use:

+ + + VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2.4+ + + +

The example request would come from + /usr/local/apache/vhosts/isp.com/e/x/a/mple/directory/file.html.

+ +

For IP-based virtual hosting you might use the following in + your configuration file:

+ + + UseCanonicalName DNS
+ VirtualDocumentRootIP /usr/local/apache/vhosts/%1/%2/%3/%4/docs
+ VirtualScriptAliasIP /usr/local/apache/vhosts/%1/%2/%3/%4/cgi-bin +
+ +

A request for + http://www.example.isp.com/directory/file.html + would be satisfied by the file + /usr/local/apache/vhosts/10/20/30/40/docs/directory/file.html + if the IP address of www.example.com were + 10.20.30.40. A request for + http://www.example.isp.com/cgi-bin/script.pl would + be satisfied by executing the program + /usr/local/apache/vhosts/10/20/30/40/cgi-bin/script.pl.

+ +

If you want to include the . character in a + VirtualDocumentRoot directive, but it clashes with + a % directive, you can work around the problem in + the following way:

+ + + VirtualDocumentRoot /usr/local/apache/vhosts/%2.0.%3.0 + + +

A request for + http://www.example.isp.com/directory/file.html + will be satisfied by the file + /usr/local/apache/vhosts/example.isp/directory/file.html.

+ +

The LogFormat + directives %V and %A are useful + in conjunction with this module.

+
+ + +VirtualDocumentRoot +VirtualDocumentRoot interpolated-directory +none + +server config +virtual host + + +VirtualDocumentRoot is only available in 1.3.7 and +later. +Dynamically configure the location of the document root +for a given virtual host. + + + +

The VirtualDocumentRoot directive allows you to + determine where Apache will find your documents based on the + value of the server name. The result of expanding + interpolated-directory is used as the root of the + document tree in a similar manner to the DocumentRoot directive's argument. + If interpolated-directory is none then + VirtaulDocumentRoot is turned off. This directive + cannot be used in the same context as + VirtualDocumentRootIP.

+ +
+
+ + +VirtualDocumentRootIP +VirtualDocumentRootIP interpolated-directory +none + +server config +virtual host + + +VirtualDocumentRootIP is only available in 1.3.7 +and later. +Dynamically configure the location of the document root +for a given virtual host + + + +

The VirtualDocumentRootIP directive is like the + VirtualDocumentRoot + directive, except that it uses the IP address of the server end + of the connection instead of the server name.

+
+
+ + +VirtualScriptAlias +VirtualScriptAlias interpolated-directory +none + +server config +virtual host + + +VirtualScriptAlias is only available in 1.3.7 +and later. +Dynamically configure the location of the CGI directory for +a given virtual host. + + + +

The VirtualScriptAlias directive allows you to + determine where Apache will find CGI scripts in a similar + manner to VirtualDocumentRoot + does for other documents. It matches requests for URIs starting + /cgi-bin/, much like ScriptAlias + /cgi-bin/ would.

+ +
+
+ + +VirtualScriptAliasIP +VirtualScriptAliasIP interpolated-directory +none + +server config +virtual host + + +VirtualScriptAliasIP is only available in 1.3.7 +and later. +Dynamically configure the location of the cgi directory for +a given virtual host. + + + +

The VirtualScriptAliasIP directive is like the + VirtualScriptAlias + directive, except that it uses the IP address of the server end + of the connection instead of the server name.

+ +
+ +
+
+ diff --git a/docs/manual/mod/mpm_common.xml b/docs/manual/mod/mpm_common.xml new file mode 100644 index 00000000000..3e3e4b7a5f7 --- /dev/null +++ b/docs/manual/mod/mpm_common.xml @@ -0,0 +1,613 @@ + + + + +mpm_common +A collection of directives that are implemented by +more than one multi-processing module (MPM) +MPM + + +CoreDumpDirectory +Sets the directory where Apache attempts to +switch before dumping core +CoreDumpDirectory directory +CoreDumpDirectory ServerRoot +server config +workerperchild +preforkmpm_winnt + + + + +

This controls the directory to which Apache attempts to + switch before dumping core. The default is in the + ServerRoot directory, however + since this should not be writable by the user the server runs + as, core dumps won't normally get written. If you want a core + dump for debugging, you can use this directive to place it in a + different location.

+
+
+ + +Group +Sets the group under which the server will answer +requests +Group unix-group +Group #-1 +server configvirtual host + +workerperchild +prefork + + +

The Group directive sets the group under + which the server will answer requests. In order to use this + directive, the stand-alone server must be run initially as root. + Unix-group is one of:

+ +
+
A group name
+ +
Refers to the given group by name.
+ +
# followed by a group number.
+ +
Refers to a group by its number.
+
+

It is recommended that you set up a new group specifically for + running the server. Some admins use user nobody, + but this is not always possible or desirable.

+ +

Note: if you start the server as a non-root user, it will + fail to change to the specified group, and will instead + continue to run as the group of the original user.

+ +

Special note: Use of this directive in <VirtualHost< is + no longer supported. To implement the suEXEC wrapper with Apache 2.0, use the + SuexecUserGroup + directive. SECURITY: See User for a discussion of the + security considerations.

+
+
+ + +PidFile +Sets the file where the server records the process ID +of the daemon +PidFile filename +PidFile logs/httpd.pid +server config +workerperchilde +preforkmpm_winnt + + + +

The PidFile directive sets the file to + which the server records the process id of the daemon. If the + filename does not begin with a slash (/) then it is assumed to be + relative to the ServerRoot.

+ +

It is often useful to be able to send the server a signal, + so that it closes and then reopens its ErrorLog and TransferLog, and + re-reads its configuration files. This is done by sending a + SIGHUP (kill -1) signal to the process id listed in the + PidFile.

+ +

The PidFile is subject to the same warnings about log file + placement and security.

+
+
+ + +Listen +Sets the IP addresses and ports that the server +listens to +Listen [IP-address:]portnumber +server config +workerperchild +preforkmpm_winnt + + + +

The Listen directive instructs Apache to + listen to only specific IP addresses or ports; by default it + responds to requests on all IP interfaces. The Listen directive is + now a required directive. If it is not in the config file, the + server will fail to start. This is a change from previous versions + of Apache.

+ +

The Listen directive tells the server to accept incoming + requests on the specified port or address-and-port combination. + If only a port number is specified, the server listens to the + given port on all interfaces. If an IP address is given as well + as a port, the server will listen on the given port and + interface.

+ +

Multiple Listen directives may be used to specify a number + of addresses and ports to listen to. The server will respond to + requests from any of the listed addresses and ports.

+ +

For example, to make the server accept connections on both + port 80 and port 8000, use:

+ + Listen 80
+ Listen 8000 +
+ To make the server accept connections on two specified + interfaces and port numbers, use + + Listen 192.170.2.1:80
+ Listen 192.170.2.5:8000 +
+ IPv6 addresses must be surrounded in square brackets, as in the + following example: + + Listen [fe80::a00:20ff:fea7:ccea]:80 + +
+ +DNS Issues +Setting + which addresses and ports Apache uses +
+ + +ListenBackLog +Maximum length of the queue of pending connections +ListenBacklog backlog +ListenBacklog 511 +server config +workerperchild +preforkmpm_winnt + + + +

The maximum length of the queue of pending connections. + Generally no tuning is needed or desired, however on some + systems it is desirable to increase this when under a TCP SYN + flood attack. See the backlog parameter to the + listen(2) system call.

+ +

This will often be limited to a smaller number by the + operating system. This varies from OS to OS. Also note that + many OSes do not use exactly what is specified as the backlog, + but use a number based on (but normally larger than) what is + set.

+
+
+ + +LockFile +Location of the accept serialization lock file +LockFile filename +LockFile logs/accept.lock +server config +workerperchild +prefork + + +

The LockFile directive sets the path to + the lockfile used when Apache is compiled with either + USE_FCNTL_SERIALIZED_ACCEPT or USE_FLOCK_SERIALIZED_ACCEPT. This + directive should normally be left at its default value. The main + reason for changing it is if the logs directory is + NFS mounted, since the lockfile must be stored on a local + disk. The PID of the main server process is + automatically appended to the filename.

+ +

SECURITY: It is best to avoid putting this + file in a world writable directory such as + /var/tmp because someone could create a denial of + service attack and prevent the server from starting by creating + a lockfile with the same name as the one the server will try to + create.

+
+
+ + +MaxClients +Maximum number of child processes that will be created +to serve requests +MaxClients number +>MaxClients + 8 (with threads) MaxClients 256 +server config +workerprefork + + + +

The MaxClients directive sets the limit + on the number of child processes that will be created to serve + requests. When the server is built without threading, no more than + this number of clients can be served simultaneously. To configure + more than 256 clients with the prefork MPM, you must use the + ServerLimit directive. + To configure more than 1024 clients with the worker MPM, you must + use the ServerLimit and + ThreadLimit directives.

+ +

Any connection attempts over the + MaxClients limit will normally be queued, + up to a number based on the ListenBacklog directive. Once a child + process is freed at the end of a different request, the connection + will then be serviced.

+ +

When the server is compiled with threading, then the maximum + number of simultaneous requests that can be served is obtained + from the value of this directive multiplied by + ThreadsPerChild.

+
+
+ + +MaxRequestPerChild +Limit on the number of requests that an individual child server +will handle during its life +MaxRequestsPerChild number +MaxRequestsPerChild 10000 +server config +workerperchild +preforkmpm_winnt + + + +

The MaxRequestsPerChild directive sets + the limit on the number of requests that an individual child + server process will handle. After + MaxRequestsPerChild requests, the child + process will die. If MaxRequestsPerChild is + 0, then the process will never expire.

+ +

Setting MaxRequestsPerChild to a + non-zero limit has two beneficial effects:

+ +
    +
  • it limits the amount of memory that process can consume + by (accidental) memory leakage;
  • + +
  • by giving processes a finite lifetime, it helps reduce + the number of processes when the server load reduces.
  • +
+ +

NOTE: For KeepAlive requests, only + the first request is counted towards this limit. In effect, it + changes the behavior to limit the number of + connections per child.

+
+
+ + +MaxSpareThreads +Maximum number of idle threads +MaxSpareThreads number +MaxSpareThreads 10 (Perchild) or 500 (worker) +server config +workerperchild + + + +

Maximum number of idle threads. Different MPMs deal with this + directive differently. perchild monitors the + number of idle threads on a per-child basis. If there are too many + idle threads in that child, the server will begin to kill threads + within that child.

+ +

worker deals with idle threads on a + server-wide basis. If there are too many idle threads in the + server then child processes are killed until the number of idle + threads is less than this number.

+ +
+MinSpareThreads +StartServers +
+ + +MaxThreadsPerChild +Maximum number of threads per child process +MaxThreadsPerChild number +MaxThreadsPerChild 64 +server config +workerperchild + + + +

Maximum number of threads per child. For MPMs with a + variable number of threads per child, this directive sets the + maximum number of threads that will be created in each child + process. To increase this value beyond its default, it is + necessary to change the value of the compile-time define + HARD_THREAD_LIMIT and recompile the server.

+
+
+ + +MinSpareThreads +Minimum number of idle threads available to handle request +spikes +MinSpareServers number +MinSpareThreads 5 (Perchild) or 250 (worker) +server config +workerperchild + + + +

Minimum number of idle threads to handle request spikes. + Different MPMs deal with this directive + differently. perchild monitors the number of idle + threads on a per-child basis. If there aren't enough idle threads + in that child, the server will begin to create new threads within + that child.

+ +

worker deals with idle threads on a + server-wide basis. If there aren't enough idle threads in the + server then child processes are created until the number of idle + threads is greater than number.

+
+MaxSpareThreads +StartServers +
+ + +NumServers +Total number of children alive at the same time +NumServers number +NumServers 2 +server config +perchild + + +

Number of children alive at the same time. MPMs that use + this directive do not dynamically create new child processes so + this number should be large enough to handle the requests for + the entire site.

+
+
+ + +ScoreBoardFile +Location of the file used to store coordination data for +the child processes +ScoreBoardFile file-path +ScoreBoardFile logs/apache_status +server config +workerperchild +prefork + + +

The ScoreBoardFile directive is required + on some architectures to place a file that the server will use to + communicate between its children and the parent. The easiest way + to find out if your architecture requires a scoreboard file is to + run Apache and see if it creates the file named by the + directive. If your architecture requires it then you must ensure + that this file is not used at the same time by more than one + invocation of Apache.

+ +

If you have to use a ScoreBoardFile then + you may see improved speed by placing it on a RAM disk. But be + careful that you heed the same warnings about log file placement + and security.

+
+Stopping and Restarting Apache +
+ + +SendBufferSize +TCP buffer size +SendBufferSize bytes +server config +workerperchild +preforkmpm_winnt + + + +

The server will set the TCP buffer size to the number of bytes + specified. Very useful to increase past standard OS defaults on + high speed high latency (i.e., 100ms or so, such as + transcontinental fast pipes).

+
+
+ + +ServerLimit +Upper limit on configurable number of processes +ServerLimit number +ServerLimit 256 (prefork), ServerLimit 16 (worker) +server config +workerprefork + + + +

For the prefork MPM, this directive sets the + maximum configured value for MaxClients for the lifetime of the + Apache process. For the worker MPM, this directive in combination + with ThreadLimit sets + the maximum configured value for MaxClients for the lifetime of the + Apache process. Any attempts to change this directive during a + restart will be ignored, but MaxClients can be modified during + a restart.

+ +

Special care must be taken when using this directive. If + ServerLimit is set to a value much higher + than necessary, extra, unused shared memory will be allocated. If + both ServerLimit and MaxClients are set to values + higher than the system can handle, Apache may not start or the + system may become unstable.

+ +

With the prefork MPM, use this directive only + if you need to set MaxClients higher higher than 256. + Do not set the value of this directive any higher than what you + might want to set MaxClients to.

+ +

With the worker MPM, use this directive only + if your MaxClients and + ThreadsPerChild + settings require more than 16 server processes. Do not set the + value of this directive any higher than the number of server + processes required by what you may want for MaxClients and ThreadsPerChild.

+
+
+ + +StartServers +Number of child server processes created at startup +StartServers number +StartServers 5 +server config +worker + + +

The StartServers directive sets the + number of child server processes created on startup. As the number + of processes is dynamically controlled depending on the load, + there is usually little reason to adjust this parameter.

+
+MinSpareThreads +MaxSpareThreads +
+ + +StartThreads +Nubmer of threads each child creates on startup +StartThreads number +StartThreads 5 +server config +perchild + + +

Number of threads each child creates on startup. As the + number of threads is dynamically controlled depending on the + load, there is usually little reason to adjust this + parameter.

+
+
+ + +ThreadLimit +Sets the upper limit on the configurable number of threads +per child process +ThreadLimit number +ThreadLimit 64 +server config +worker + + +

This directive sets the maximum configured value for ThreadsPerChild for the lifetime + of the Apache process. Any attempts to change this directive + during a restart will be ignored, but ThreadsPerChild can be modified + during a restart up to the value of this directive.

+ +

Special care must be taken when using this directive. If + ThreadLimit is set to a value much higher + than ThreadsPerChild, + extra unused shared memory will be allocated. If both + ThreadLimit and ThreadsPerChild are set to values + higher than the system can handle, Apache may not start or the + system may become unstable.

+ +

Use this directive only if you need to set ThreadsPerChild higher than 64. Do + not set the value of this directive any higher than what you might + want to set ThreadsPerChild to.

+
+
+ + +ThreadsPerChild +Number of threads created by each child process +ThreadsPerChild number +ThreadsPerChild 50 +server config +workermpm_winnt + + + +

This directive sets the number of threads created by each + child process. The child creates these threads at startup and + never creates more. if using an MPM like mpmt_winnt, where + there is only one child process, this number should be high + enough to handle the entire load of the server. If using an MPM + like worker, where there are multiple child processes, the + total number of threads should be high enough to handle the + common load on the server.

+
+
+ + +User +The userid under which the server will answer +requests +User unix-userid +User #-1 +server configvirtual host + +workerperchild +prefork + + +

The User directive sets the userid as + which the server will answer requests. In order to use this + directive, the standalone server must be run initially as + root. Unix-userid is one of:

+ +
+
A username
+ +
Refers to the given user by name.
+ +
# followed by a user number.
+ +
Refers to a user by their number.
+
+ +

The user should have no privileges which result in it being + able to access files which are not intended to be visible to the + outside world, and similarly, the user should not be able to + execute code which is not meant for httpd requests. It is + recommended that you set up a new user and group specifically for + running the server. Some admins use user nobody, but + this is not always possible or desirable. For example + mod_proxy's cache, when enabled, must be + accessible to this user (see CacheRoot).

+ +

Notes: If you start the server as a non-root user, it will + fail to change to the lesser privileged user, and will instead + continue to run as that original user. If you do start the + server as root, then it is normal for the parent process to + remain running as root.

+ +

Special note: Use of this directive in VirtualHost is no longer supported. To + configure your server for suexec use + SuexecUserGroup.

+ +Security

Don't set User +(or Group) to +root unless you know exactly what you are doing, and what +the dangers are.

+
+
+ +
\ No newline at end of file diff --git a/docs/manual/mod/mpm_netware.html b/docs/manual/mod/mpm_netware.html new file mode 100644 index 00000000000..38aef834855 --- /dev/null +++ b/docs/manual/mod/mpm_netware.html @@ -0,0 +1,199 @@ + + + + + + + Apache MPM prefork + + + + + + +

Multi-Processing Module NetWare

+ +

This Multi-Processing Module implements an exclusively threaded web + server optimized for Novell NetWare.

+ +

Status: MPM
+ Source File: mpm_netware.c
+ Module Identifier: + mpm_netware_module

+ +

Summary

+ +

This Multi-Processing Module (MPM) implements an exclusively threaded web server + that has been optimized for Novell NetWare.

+ +

The main thread is responsible for launching child + worker threads which listen for connections and serve them when they + arrive. Apache always tries to maintain several spare + or idle worker threads, which stand ready to serve incoming + requests. In this way, clients do not need to wait for a new + child threads to be spawned before their requests can be + served.

+ +

The StartThreads, MinSpareThreads, + MaxSpareThreads, and MaxThreads + regulate how the main thread creates worker threads to serve + requests. In general, Apache is very self-regulating, so most + sites do not need to adjust these directives from their default + values. Sites which need to serve more than 250 simultaneous + requests may need to increase MaxThreads, while + sites with limited memory may need to decrease + MaxThreads to keep the server from thrashing (spawning and + terminating idle threads). More information about + tuning process creation is provided in the performance hints + documentation.

+ +

MaxRequestsPerChild controls how frequently the + server recycles processes by killing old ones and launching new + ones.  On the NetWare OS it is highly recommended that this directive + remain set to 0.  This allows worker threads to continue servicing + requests indefinitely.

+ +

See also: Setting which addresses and + ports Apache uses.

+ +

Directives

+ + +
+ +

MaxThreads directive

+ + Syntax: MaxThreads + number
+ Default: MaxThreads 250
+ Context: server config
+ Status: core

The MaxThreads directive sets the desired maximum + number worker threads allowable.

+ +

See also MinSpareThreads, MaxSpareThreads and + StartThreads.

+
+ +

MaxSpareThreads directive

+ + Syntax: MaxSpareThreads + number
+ Default: MaxSpareThreads 100
+ Context: server config
+ Status: core + +

The MaxSpareThreads directive sets the desired maximum + number of idle worker threads. An idle worker thread + is one which is not handling a request. If there are more than + MaxSpareThreads idle, then the main thread will kill off the + excess worker threads.

+ +

Tuning of this parameter should only be necessary on very + busy sites. Setting this parameter to a large number is almost + always a bad idea.

+ +

See also MinSpareThreads, MaxThreads and + StartThreads.

+
+ +

MinSpareThreads directive

+ + Syntax: MinSpareThreads + number
+ Default: MinSpareThreads 10
+ Context: server config
+ Status: core

The MinSpareThreads directive sets the desired minimum + number of idle worker threads. An idle worker thread + is one which is not handling a request. If there are fewer than MinSpareThreads idle, then the + main thread spawns new worker.

+ +

Tuning of this parameter should only be necessary on very + busy sites. Setting this parameter to a large number is almost + always a bad idea.

+ +

See also MaxSpareThreads, MaxThreads and + StartThreads. +


+ +

StartThreads directive

+ + Syntax: StartThreads + number
+ Default: StartThreads + 50
+ Context: server config
+ Status: core

The StartThreads directive sets the desired + number of worker threads to spawn and startup. 

+ +

See also MaxSpareThreadsMinSpareThreads + and MaxThreads. +


+ +

ThreadStackSize

+ Syntax: ThreadStackSize + number
+ Default: ThreadStackSize + 65536
+ Context: server config
+ Status: core +

This directive tells the server what stack size to use for + each of the running threads. If you ever get a stack overflow + you will need to bump this number to a higher setting.

+ +
+ + + + + diff --git a/docs/manual/mod/mpm_netware.xml b/docs/manual/mod/mpm_netware.xml new file mode 100644 index 00000000000..e10f2594097 --- /dev/null +++ b/docs/manual/mod/mpm_netware.xml @@ -0,0 +1,131 @@ + + + + +mpm_netware +Multi-Processing Module implementing an exclusively threaded web + server optimized for Novell NetWare +MPM +mpm_netware.c +mpm_netware_module + + +

This Multi-Processing Module (MPM) implements an exclusively threaded web server + that has been optimized for Novell NetWare.

+ +

The main thread is responsible for launching child + worker threads which listen for connections and serve them when they + arrive. Apache always tries to maintain several spare + or idle worker threads, which stand ready to serve incoming + requests. In this way, clients do not need to wait for a new + child threads to be spawned before their requests can be + served.

+ +

The StartThreads, MinSpareThreads, + MaxSpareThreads, and MaxThreads + regulate how the main thread creates worker threads to serve + requests. In general, Apache is very self-regulating, so most + sites do not need to adjust these directives from their default + values. Sites which need to serve more than 250 simultaneous + requests may need to increase MaxThreads, while + sites with limited memory may need to decrease + MaxThreads to keep the server from thrashing (spawning and + terminating idle threads). More information about + tuning process creation is provided in the performance hints + documentation.

+ +

MaxRequestsPerChild controls how frequently the + server recycles processes by killing old ones and launching new + ones.  On the NetWare OS it is highly recommended that this directive + remain set to 0.  This allows worker threads to continue servicing + requests indefinitely.

+ +

See also: Setting which addresses and + ports Apache uses.

+
+ +Listen + +ListenBacklog + +MaxRequestsPerChild + +SendBufferSize + + + +MaxThreads +MaxThreads number +MaxThreads 250 +server config + + +

The MaxThreads directive sets the desired maximum + number worker threads allowable.

+
+
+ + +MaxSpareThreads +MaxSpareThreads number +MaxSpareThreads 100 +server config + + +

The MaxSpareThreads directive sets the + desired maximum number of idle worker threads. An idle + worker thread is one which is not handling a request. If there are + more than MaxSpareThreads idle, then the main thread will kill off + the excess worker threads.

+ +

Tuning of this parameter should only be necessary on very + busy sites. Setting this parameter to a large number is almost + always a bad idea.

+
+
+ + +MinSpareThreads +MinSpareThreads number +MinSpareThreads 10 +server config + + +

The MinSpareThreads directive sets the +desired minimum number of idle worker threads. An idle worker +thread is one which is not handling a request. If there are fewer than +MinSpareThreads idle, then the main thread spawns new worker.

+ +

Tuning of this parameter should only be necessary on very + busy sites. Setting this parameter to a large number is almost + always a bad idea.

+
+
+ + +StartThreads +StartThreads number +StartThreads 50 +server config + + +

The StartThreads directive sets the desired + number of worker threads to spawn and startup

+
+
+ + +ThreadStackSize +ThreadStackSize number +ThreadStackSize 65536 +server config + + +

This directive tells the server what stack size to use for + each of the running threads. If you ever get a stack overflow + you will need to bump this number to a higher setting.

+
+
+ +
\ No newline at end of file diff --git a/docs/manual/mod/mpm_winnt.xml b/docs/manual/mod/mpm_winnt.xml new file mode 100644 index 00000000000..ca51b38063e --- /dev/null +++ b/docs/manual/mod/mpm_winnt.xml @@ -0,0 +1,34 @@ + + + + +mpm_winnt +This Multi-Processing Module is optimized for Windows + NT. +MPM +mpm_winnt.c +mpm_winnt_module + + +

This Multi-Processing Module (MPM) is the default for the + Windows NT operating systems. It uses a single control process + which launches a single child process which in turn creates + threads to handle requests

+
+ +CoreDumpDirectory + +PidFile + +Listen + +ListenBacklog + +MaxRequestsPerChild + +SendBufferSize + +ThreadsPerChild + + +
\ No newline at end of file diff --git a/docs/manual/mod/perchild.xml b/docs/manual/mod/perchild.xml new file mode 100644 index 00000000000..62a9245f9af --- /dev/null +++ b/docs/manual/mod/perchild.xml @@ -0,0 +1,150 @@ + + + + + +perchild +Multi-Processing Module allowing for daemon processes + serving requests to be assigned a variety of different + userids +MPM +perchild.c +mpm_perchild_module + + + +This MPM does not currently work on most platforms. Work is ongoing to +make it functional. + + +

This Multi-Processing Module (MPM) implements a hybrid + multi-process, multi-threaded web server. A fixed number of + processes create threads to handle requests. Fluctuations in + load are handled by increasing or decreasing the number of + threads in each process.

+ +

A single control process launches the number of child processes + indicated by the NumServers directive at server + startup. Each child process creates threads as specified in the + StartThreads directive. The individual threads then + listen for connections and serve them when they arrive.

+ +

Apache always tries to maintain a pool of spare or + idle server threads, which stand ready to serve incoming + requests. In this way, clients do not need to wait for new + threads to be created. For each child process, Apache assesses + the number of idle threads and creates or destroys threads to + keep this number within the boundaries specified by + MinSpareThreads and MaxSpareThreads. + Since this process is very self-regulating, it is rarely + necessary to modify these directives from their default values. + The maximum number of clients that may be served simultaneously + is determined by multiplying the number of server processes + that will be created (NumServers) by the maximum + number of threads created in each process + (MaxThreadsPerChild).

+ +

While the parent process is usually started as root under + Unix in order to bind to port 80, the child processes and + threads are launched by Apache as a less-privileged user. The + User and Group directives are used to + set the privileges of the Apache child processes. The child + processes must be able to read all the content that will be + served, but should have as few privileges beyond that as + possible. In addition, unless suexec is used, these directives also + set the privileges which will be inherited by CGI scripts.

+ +

MaxRequestsPerChild controls how frequently the + server recycles processes by killing old ones and launching new + ones.

+ +

See also: Setting which addresses and + ports Apache uses.

+ +

In addition it adds the extra ability to specify that + specific processes should serve requests under different + userids. These processes can then be associated with specific + virtual hosts.

+ +
+ + +CoreDumpDirectory + + +Group + + +PidFile + + +Listen + + +ListenBacklog + + +LockFile + + +MaxRequestsPerChild + + +MaxSpareThreads + + +MaxThreadsPerChild + + +MinSpareThreads + + +NumServers + + +ScoreBoardFile + + +SendBufferSize + + +StartThreads + + +User + + + +AssignUserId +AssignUserID user_id group_id +virtual host + + +

Tie a virtual host to a specific child process. Requests addressed to +the virtual host where this directive appears will be served by the process +running with the specified user and group id.

+
+
+ + +ChildPerUserId +ChildPerUserID user_id +group_id child_id +server config + + +

Specify a user id and group id for a specific child process. The number of +children if set by the NumServers +directive. For example, the default value for NumServers is 5 and that means +children ids 1,2,3,4 and 5 are available for assigment. If a child does not +have an associated ChildPerUserID, it inherits the User and Group settings from the main server

+
+
+ +
+ diff --git a/docs/manual/mod/prefork.xml b/docs/manual/mod/prefork.xml new file mode 100644 index 00000000000..1dd788813bd --- /dev/null +++ b/docs/manual/mod/prefork.xml @@ -0,0 +1,207 @@ + + + +prefork +Implements a non-threaded, pre-forking web server +MPM +prefork.c +mpm_prefork_module + + +

This Multi-Processing Module (MPM) implements a + non-threaded, pre-forking web server which handles request in a + manner very similar to the default behavior of Apache 1.3 on + Unix.

+ +

A single control process is responsible for launching child + processes which listen for connections and serve them when they + arrive. Apache always tries to maintain several spare + or idle server processes, which stand ready to serve incoming + requests. In this way, clients do not need to wait for a new + child processes to be forked before their requests can be + served.

+ +

The StartServers, + MinSpareServers, + MaxSpareServers, and + MaxClients regulate how + the parent process creates children to serve requests. In general, + Apache is very self-regulating, so most sites do not need to + adjust these directives from their default values. Sites which + need to serve more than 256 simultaneous requests may need to + increase MaxClients, + while sites with limited memory may need to decrease MaxClients to keep the server from + thrashing (swapping memory to disk and back). More information + about tuning process creation is provided in the performance hints + documentation.

+ +

While the parent process is usually started as root under Unix + in order to bind to port 80, the child processes are launched by + Apache as a less-privileged user. The User and Group directives are used to set + the privileges of the Apache child processes. The child processes + must be able to read all the content that will be served, but + should have as few privileges beyond that as possible. In + addition, unless suexec is used, + these directives also set the privileges which will be inherited + by CGI scripts.

+ +

MaxRequestsPerChild + controls how frequently the server recycles processes by killing + old ones and launching new ones.

+
+Setting which addresses and + ports Apache uses + + +CoreDumpDirectory + + + +PidFile + + + +Listen + + + +ListenBacklog + + + +LockFile + + + +MaxRequestsPerChild + + + +MaxSpareServers + + + +MinSpareServers + + + +ScoreBoardFile + + + +SendBufferSize + + + +ServerLimit + + + +StartServers + + + +User + + + +AcceptMutex +Method that Apache uses to serialize multiple children +accepting requests on network sockets +AcceptMutex default|method +AcceptMutex default +server config + + +

The AcceptMutex directives sets the + method that Apache uses to serialize multiple children accepting + requests on network sockets. Prior to Apache 2.0, the method was + selectable only at compile time. The optimal method to use is + highly architecture and platform dependent. For further details, + see the performance tuning + documentation.

+ +

If this directive is set to default, then the + compile-time selected default will be used. Other possible + methods are listed below. Note that not all methods are + available on all platforms. If a method is specified which is + not available, a message will be written to the error log + listing the available methods.

+ +
+
flock
+ +
uses the flock(2) system call to lock the + file defined by the LockFile directive.
+ +
fcntl
+ +
uses the fnctl(2) system call to lock the + file defined by the LockFile directive.
+ +
sysvsem
+ +
uses SySV-style semaphores to implement the mutex.
+ +
pthread
+ +
uses POSIX mutexes as implemented by the POSIX Threads + (PThreads) specification.
+
+
+
+ + +MaxSpareServers +Maximum number of idle child server processes +MaxSpareServers number
+MaxSpareServers 10 +server config + + +

The MaxSpareServers directive sets the + desired maximum number of idle child server processes. An + idle process is one which is not handling a request. If there are + more than MaxSpareServers idle, then the parent process will kill + off the excess processes.

+ +

Tuning of this parameter should only be necessary on very + busy sites. Setting this parameter to a large number is almost + always a bad idea.

+
+MinSpareServers +StartServers +
+ + +MinSpareServers +Minimum number of idle child server processes +MinSpareServers number +MinSpareServers 5 +server config + + +

The MinSpareServers directive sets the + desired minimum number of idle child server processes. An + idle process is one which is not handling a request. If there are + fewer than MinSpareServers idle, then the parent process creates + new children at a maximum rate of 1 per second.

+ +

Tuning of this parameter should only be necessary on very + busy sites. Setting this parameter to a large number is almost + always a bad idea.

+ +

This directive has no effect on Microsoft Windows.

+
+MaxSpareServers +StartServers +
+ +
+ diff --git a/docs/manual/mod/worker.html b/docs/manual/mod/worker.html new file mode 100644 index 00000000000..48e4d6642c5 --- /dev/null +++ b/docs/manual/mod/worker.html @@ -0,0 +1,121 @@ + + + + + + + Apache MPM worker + + + + + + +

Multi-Processing Module worker

+ +

This Multi-Processing Module implements a hybrid + multi-threaded multi-process web server.

+ +

Status: MPM
+ Source File: worker.c
+ Module Identifier: + mpm_worker_module

+ +

Summary

+ +

This Multi-Processing Module (MPM) is the default for most + unix-like operating systems. It implements a hybrid + multi-process multi-threaded server. Each process has a fixed + number of threads. The server adjusts to handle load by + increasing or decreasing the number of processes.

+ +

A single control process is responsible for launching child + processes. Each child process creates a fixed number of threads + as specified in the ThreadsPerChild directive. The + individual threads then listen for connections and serve them + when they arrive.

+ +

Apache always tries to maintain a pool of spare or + idle server threads, which stand ready to serve incoming + requests. In this way, clients do not need to wait for a new + threads or processes to be created before their requests can be + served. Apache assesses the total number of idle threads in all + processes, and forks or kills processes to keep this number + within the boundaries specified by MinSpareThreads + and MaxSpareThreads. Since this process is very + self-regulating, it is rarely necessary to modify these + directives from their default values. The maximum number of + clients that may be served simultaneously is determined by + multiplying the maximum number of server processes that will be + created (MaxClients) by the number of threads + created in each process (ThreadsPerChild).

+ +

While the parent process is usually started as root under + Unix in order to bind to port 80, the child processes and + threads are launched by Apache as a less-privileged user. The + User and Group directives are used to + set the privileges of the Apache child processes. The child + processes must be able to read all the content that will be + served, but should have as few privileges beyond that as + possible. In addition, unless suexec is used, these directives also + set the privileges which will be inherited by CGI scripts.

+ +

MaxRequestsPerChild controls how frequently the + server recycles processes by killing old ones and launching new + ones.

+ +

See also: Setting which addresses and + ports Apache uses.

+ +

Directives

+ + + + + + diff --git a/docs/manual/mod/worker.xml b/docs/manual/mod/worker.xml new file mode 100644 index 00000000000..c0d38ce9822 --- /dev/null +++ b/docs/manual/mod/worker.xml @@ -0,0 +1,94 @@ + + + + +worker +Multi-Processing Module implementing a hybrid + multi-threaded multi-process web server +MPM +worker.c +mpm_worker_module + + +

This Multi-Processing Module (MPM) is the default for most + unix-like operating systems. It implements a hybrid + multi-process multi-threaded server. Each process has a fixed + number of threads. The server adjusts to handle load by + increasing or decreasing the number of processes.

+ +

A single control process is responsible for launching child + processes. Each child process creates a fixed number of threads + as specified in the ThreadsPerChild directive. The + individual threads then listen for connections and serve them + when they arrive.

+ +

Apache always tries to maintain a pool of spare or + idle server threads, which stand ready to serve incoming + requests. In this way, clients do not need to wait for a new + threads or processes to be created before their requests can be + served. Apache assesses the total number of idle threads in all + processes, and forks or kills processes to keep this number + within the boundaries specified by MinSpareThreads + and MaxSpareThreads. Since this process is very + self-regulating, it is rarely necessary to modify these + directives from their default values. The maximum number of + clients that may be served simultaneously is determined by + multiplying the maximum number of server processes that will be + created (MaxClients) by the number of threads + created in each process (ThreadsPerChild).

+ +

While the parent process is usually started as root under + Unix in order to bind to port 80, the child processes and + threads are launched by Apache as a less-privileged user. The + User and Group directives are used to + set the privileges of the Apache child processes. The child + processes must be able to read all the content that will be + served, but should have as few privileges beyond that as + possible. In addition, unless suexec is used, these directives also + set the privileges which will be inherited by CGI scripts.

+ +

MaxRequestsPerChild controls how frequently the + server recycles processes by killing old ones and launching new + ones.

+ +

See also: Setting which addresses and + ports Apache uses.

+
+ +CoreDumpDirectory + +Group + +PidFile + +Listen + +ListenBacklog + +LockFile + +MaxClients + +MaxRequestsPerChild + +MaxSpareThreads + +MinSpareThreads + +ScoreBoardFile + +SendBufferSize + +ServerLimit + +StartServers + +ThreadLimit + +ThreadsPerChild + +User + + +
\ No newline at end of file diff --git a/docs/manual/new_features_2_0.html.de b/docs/manual/new_features_2_0.html.de new file mode 100644 index 00000000000..b32085498ed --- /dev/null +++ b/docs/manual/new_features_2_0.html.de @@ -0,0 +1,180 @@ + + + + + + + New features with Apache 2.0 + + + + + + +

Übersicht der neuen Funktionen in Apache 2.0

+

übersetzt von simon.putz@t-online.de

+

Erweiterungen: Core | Module

+ +
+ +

Core Erweiterungen:

+ +
+
Unix Threading
+ +
Auf Unix Systemen mit POSIX threads Unterstützung, kann Apache jetzt + in einem hybrid multiprocess im multithreaded mode gestartet werden. Dies + verbessiert die Skalierfähigkeit für viele, aber nicht alle Konfigurationen.
+ +
Neues Build System
+ +
Das build system wurde komplett auf der Basis von autoconf und libtool neugeschrieben. + Dadurch wird Apaches Konfigurationssystem dem vieler anderer Packages ähnlicher.
+ +
Multiprotocol Unterstützung
+ +
Apache hat jetzt einiges der Infrastruktur bereit um mehrere Protokolle zu unterstützen. + mod_echo wurde zum Beispiel neugeschrieben.
+ +
Bessere Unterstützung von nicht-Unix Plattformen
+ +
Apache 2.0 ist schneller und stabiler auf nicht-Unix + Plattformen wie BeOS, OS/2, und Windows. Mit der Einführung von Plattform-spezifischen + multi-processing Modulen (MPMs) und der + Apache Portable Runtime (APR), sind diese Plattformen jetzt in ihrer + eigenen API implementiert, was die häufigen Fehler der schlecht funktionierenden + POSIX-emulation layer vermeidet.
+ +
Neue Apache API
+ +
Die API für Module hat sich in 2.0 stark verändert. + Viele der module-ordering Probleme von 1.3 sollten verschwunden sein. + 2.0 macht einiges hiervon automatisch, und das module ordering wird + jetzt per-hook vorgenommen, um mehr Flexibilität zu bieten. Außerdem wurden neue calls + hinzugefügt, die zusätzliche Modul-Fähigkeiten bieten, ohne den core zu patchen.
+ +
IPv6 Unterstützung
+ +
Auf Systemen, bei denen IPv6 durch die zugrunde liegende + Apache Portable Runtime library unterstützt ist, bekommt Apache standarmäßig IPv6 listening + sockets. Zusätzlich unterstützen die Listen, + NameVirtualHost, and <VirtualHost> Directiven + numerische IPv6 address strings (z.B., "Listen + [fe80::1]:8080").
+ +
Filtering
+ +
Apache Module können jetzt als Filter die auf den Inhalts-Stream wirken, wie er + von oder zum Server kommt. + Dadurch können z. B. die Ausgabe von CGI scripts von den Server Side Include Direktiven + durch den INCLUDE filter in mod_include bearbeitet werden.
+ +
Mehrsprachige Fehlermeldungen
+ +
Fehlermeldungen zum Browser werden jetzt, durch SSI Dokumente, in verschiedenen Sprachen zur Verfügung gestellt. + Sie können durch den Administrator angepasst werden, um ein einheitliches Design zu erreichen.
+ +
Vereinfachte Konfiguration
+ +
Viele komplizierte Direktiven wurden vereinfacht. Die oft verwirrenden + Port und BindAddress Direktiven wurden entfernt; nur die + Listen Direktive wird zum IP address binding benutzt; die + ServerName Direktive bestimmt den Server-Namen und Port-Nummer + nur zur Weiterleitung und vhost Erkennung.
+ +
Eingebaute Windows NT Unicode Unterstützung
+ +
Apache 2.0 auf Windows NT benutzt jetzt utf-8 für alle Dateinamen + Encodierungen. Diese werden direkt zum zugrunde liegenden unicode Dateisystem übersetzt, + somit wird die Mehrsprach-Unterstützung, fü alle Windows NT-basiernde Installationen, + inclusive Windows 2000 und Windows XP gewährt. + Diese Unterstützung geht nicht auf Windows 95, 98 oder ME über, diese + benutzen noch immer die lokale codepage des Rechners zum Dateisystem-Zugriff.
+ +
+
+ +

Modul Erweiterungen:

+ +
+
mod_ssl
+ +
Neues Modul in Apache 2.0. Dieses Modul ist ein Interface + zu den SSL/TLS Verschlüsselungs-Protokollen, die von OpenSSL bereitgestellt werden.
+ +
mod_dav
+ +
Neues Modul in Apache 2.0. Dieses Modul bietet die HTTP + Distributed Authoring and Versioning (DAV) Spezifikation, um + Web-Inhalte zu Posten und zu Warten.
+ +
mod_auth_digest
+ +
Zusätzliche Unterstützung für prozessübergreifendes session caching mittels shared memory. +
+ +
mod_charset_lite
+ +
Neues Modul in Apache 2.0. Dieses experimentelle Modul erlaubt Zeichensatz-Übersetung oder Wiederkodierung.
+ +
mod_file_cache
+ +
Neues Modul in Apache 2.0. Dieses Modul beinhaltet die Funktionen von mod_mmap_static aus Apache 1.3 und + weitere Zwischenspeicherungs-Möglichkeiten.
+ +
mod_headers
+ +
Dieses Modul ist in Apache 2.0 viel flexibler geworden. Es kann jetzt request-header die von mod_proxy benutzt werden, verändern + und es kann Response-Header nach Fallunterscheidung setzen.
+ +
mod_proxy
+ +
Das Proxy Modul wurde komplett neugeschrieben um die Funktionen der neuen Filter Infrastruktur auszuschöpfen und + um einen zuverlässigen, mit HTTP/1.1 übereinstimmenden Proxy zu erstellen.
+ +
mod_negotiation
+ +
Eine neue ForceLanguagePriority + Direktive kann benutzt werden, um zu sichern, dass der Client auf jeden Fall ein einzelnes Dokument anstatt + NOT ACCEPTABLE oder MULTIPLE CHOICES Antworten bekommt. Zusätzlich wurden die Verhandlungs und Multiview + Algorithmen gesäubert um einheitlichere Ergebnisse zu liefern. Außerdem wird eine neue Form der Type Map + die Dokumente einschließen kann, bereitgestellt.
+ +
mod_autoindex
+ +
Automatisch indizierte Verzeichnis Auflistungen können für bessere Übersichtlichkeit + durch eine HTML Tabelle dargestellt werden. Genauerere Sortierungen, wie Versions-Sorting und Platzhalter-Filtering + des Verzeichnislistings werden unterstützt.
+ +
mod_include
+ +
Neue Direktiven erlauben es, die Standard Start- und Endtags von SSI Elementen + zu ändern und die Fehler and Zeitformat Konfiguration in der Haupkonfigurationsdatei + anstatt im SSI Dokument stattzufinden. + Ergebnisse von regular expression parsing und grouping können duch die mod_include Variablen $0 bis $9 eingeholt werden.
+ +
mod_auth_dbm
+ +
DBM-ähnliche Datenbanken werden jetzt durch die AuthDBMType + Direktive unterstützt. + +
mod_auth_db
+ +
Berkeley DB 3.0 wird jetzt unterstützt
+ +
mod_proxy
+ +
Neue Konfigurations Sections bringen eine lesbarere + (und intern schnellere) Kontrolle der zwischengespeicherten Seiten; die überladene + Konfiguration wird nicht unterstützt. Das + Modul is jetzt in eigene Protokoll-Unterstützungs Module wie proxy_connect, proxy_ftp and proxy_http gegliedert.
+ +
+ + + + + diff --git a/docs/manual/sitemap.html b/docs/manual/sitemap.html new file mode 100644 index 00000000000..34e21dad8af --- /dev/null +++ b/docs/manual/sitemap.html @@ -0,0 +1,201 @@ + + + + + Site Map - Apache HTTP Server 2.0 + + + + + + +

Site Map

+ +
+ + + + \ No newline at end of file diff --git a/docs/manual/sitemap.html.en b/docs/manual/sitemap.html.en new file mode 100644 index 00000000000..34e21dad8af --- /dev/null +++ b/docs/manual/sitemap.html.en @@ -0,0 +1,201 @@ + + + + + Site Map - Apache HTTP Server 2.0 + + + + + + +

Site Map

+ + + + + + \ No newline at end of file diff --git a/docs/manual/ssl/index.html b/docs/manual/ssl/index.html new file mode 100644 index 00000000000..fb39a4440b0 --- /dev/null +++ b/docs/manual/ssl/index.html @@ -0,0 +1,223 @@ + + +mod_ssl: Title Page + + + + + + + +
+ + + + +
+
+ + + + + + + + + + +
+ + + + + + + +
+ User Manual +
+ mod_ssl version 2.8    +
+
+
+ mod_ssl - The Apache Interface to OpenSSL +
+ + + + + + + +
+ Ralf S. Engelschall
+ rse@engelschall.com
+ www.engelschall.com
+
+      + +next page
Overview +
+ +
+
+
+
+ + diff --git a/docs/manual/ssl/index.html.en b/docs/manual/ssl/index.html.en new file mode 100644 index 00000000000..fb39a4440b0 --- /dev/null +++ b/docs/manual/ssl/index.html.en @@ -0,0 +1,223 @@ + + +mod_ssl: Title Page + + + + + + + +
+ + + + +
+
+ + + + + + + + + + +
+ + + + + + + +
+ User Manual +
+ mod_ssl version 2.8    +
+
+
+ mod_ssl - The Apache Interface to OpenSSL +
+ + + + + + + +
+ Ralf S. Engelschall
+ rse@engelschall.com
+ www.engelschall.com
+
+      + +next page
Overview +
+ +
+
+
+
+ + diff --git a/docs/manual/ssl/ssl_compat.html b/docs/manual/ssl/ssl_compat.html new file mode 100644 index 00000000000..391c0668c60 --- /dev/null +++ b/docs/manual/ssl/ssl_compat.html @@ -0,0 +1,551 @@ + + +mod_ssl: Compatibility + + + + + + + + + + +
+ + + + +
+
+ + + + + + + + + + + + + +
+ + + + + +
+ mod_ssl + + Chapter 4 +
+
+ + + + + +
+previous page
Reference +
+next page
HowTo +
+
+
+ Compatibility +
+
+ + + + + + + +
+ +All PCs are compatible. But some of +them are more compatible than others. + +
+ +Unknown + +
+
+

+ + + + + + +
+H +ere we talk about backward compatibility to other SSL solutions. As you +perhaps know, mod_ssl is not the only existing SSL solution for Apache. +Actually there are four additional major products available on the market: Ben +Laurie's freely available Apache-SSL +(from where mod_ssl were originally derived in 1998), RedHat's commercial Secure Web +Server (which is based on mod_ssl), Covalent's commercial Raven SSL Module (also based on mod_ssl) +and finally C2Net's commercial product Stronghold (based on a +different evolution branch named Sioux up to Stronghold 2.x and based on +mod_ssl since Stronghold 3.x). + +   + +
+ + + + + + + +
+ +Table Of Contents + +
+ +        Configuration Directives
+        Environment Variables
+        Custom Log Functions
+
+
+
+
+

+The idea in mod_ssl is mainly the following: because mod_ssl provides mostly a +superset of the functionality of all other solutions we can easily provide +backward compatibility for most of the cases. Actually there are three +compatibility areas we currently address: configuration directives, +environment variables and custom log functions. +

Configuration Directives

+For backward compatibility to the configuration directives of other SSL +solutions we do an on-the-fly mapping: directives which have a direct +counterpart in mod_ssl are mapped silently while other directives lead to a +warning message in the logfiles. The currently implemented directive mapping +is listed in Table 1. Currently full backward +compatibilty is provided only for Apache-SSL 1.x and mod_ssl 2.0.x. +Compatibility to Sioux 1.x and Stronghold 2.x is only partial because of +special functionality in these interfaces which mod_ssl (still) doesn't +provide. +

+

+ + + +
Table 1: Configuration Directive Mapping
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Old Directivemod_ssl DirectiveComment
Apache-SSL 1.x & mod_ssl 2.0.x compatibility:
SSLEnableSSLEngine oncompactified
SSLDisableSSLEngine offcompactified
SSLLogFile fileSSLLog filecompactified
SSLRequiredCiphers specSSLCipherSuite specrenamed
SSLRequireCipher c1 ...SSLRequire %{SSL_CIPHER} in {"c1", ...}generalized
SSLBanCipher c1 ...SSLRequire not (%{SSL_CIPHER} in {"c1", ...})generalized
SSLFakeBasicAuthSSLOptions +FakeBasicAuthmerged
SSLCacheServerPath dir-functionality removed
SSLCacheServerPort integer-functionality removed
Apache-SSL 1.x compatibility:
SSLExportClientCertificatesSSLOptions +ExportCertDatamerged
SSLCacheServerRunDir dir-functionality not supported
Sioux 1.x compatibility:
SSL_CertFile fileSSLCertificateFile filerenamed
SSL_KeyFile fileSSLCertificateKeyFile filerenamed
SSL_CipherSuite argSSLCipherSuite argrenamed
SSL_X509VerifyDir argSSLCACertificatePath argrenamed
SSL_Log fileSSLLogFile filerenamed
SSL_Connect flagSSLEngine flagrenamed
SSL_ClientAuth argSSLVerifyClient argrenamed
SSL_X509VerifyDepth argSSLVerifyDepth argrenamed
SSL_FetchKeyPhraseFrom arg-not directly mappable; use SSLPassPhraseDialog
SSL_SessionDir dir-not directly mappable; use SSLSessionCache
SSL_Require expr-not directly mappable; use SSLRequire
SSL_CertFileType arg-functionality not supported
SSL_KeyFileType arg-functionality not supported
SSL_X509VerifyPolicy arg-functionality not supported
SSL_LogX509Attributes arg-functionality not supported
Stronghold 2.x compatibility:
StrongholdAccelerator dir-functionality not supported
StrongholdKey dir-functionality not supported
StrongholdLicenseFile dir-functionality not supported
SSLFlag flagSSLEngine flagrenamed
SSLSessionLockFile fileSSLMutex filerenamed
SSLCipherList specSSLCipherSuite specrenamed
RequireSSLSSLRequireSSLrenamed
SSLErrorFile file-functionality not supported
SSLRoot dir-functionality not supported
SSL_CertificateLogDir dir-functionality not supported
AuthCertDir dir-functionality not supported
SSL_Group name-functionality not supported
SSLProxyMachineCertPath dir-functionality not supported
SSLProxyMachineCertFile file-functionality not supported
SSLProxyCACertificatePath dir-functionality not supported
SSLProxyCACertificateFile file-functionality not supported
SSLProxyVerifyDepth number-functionality not supported
SSLProxyCipherList spec-functionality not supported
+
+
+
+

+
+

Environment Variables

+When you use ``SSLOptions +CompatEnvVars'' additional environment +variables are generated. They all correspond to existing official mod_ssl +variables. The currently implemented variable derivation is listed in Table 2. +

+

+ + + +
Table 2: Environment Variable Derivation
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Old Variablemod_ssl VariableComment
SSL_PROTOCOL_VERSIONSSL_PROTOCOLrenamed
SSLEAY_VERSIONSSL_VERSION_LIBRARYrenamed
HTTPS_SECRETKEYSIZESSL_CIPHER_USEKEYSIZErenamed
HTTPS_KEYSIZESSL_CIPHER_ALGKEYSIZErenamed
HTTPS_CIPHERSSL_CIPHERrenamed
HTTPS_EXPORTSSL_CIPHER_EXPORTrenamed
SSL_SERVER_KEY_SIZESSL_CIPHER_ALGKEYSIZErenamed
SSL_SERVER_CERTIFICATESSL_SERVER_CERTrenamed
SSL_SERVER_CERT_STARTSSL_SERVER_V_STARTrenamed
SSL_SERVER_CERT_ENDSSL_SERVER_V_ENDrenamed
SSL_SERVER_CERT_SERIALSSL_SERVER_M_SERIALrenamed
SSL_SERVER_SIGNATURE_ALGORITHMSSL_SERVER_A_SIGrenamed
SSL_SERVER_DNSSL_SERVER_S_DNrenamed
SSL_SERVER_CNSSL_SERVER_S_DN_CNrenamed
SSL_SERVER_EMAILSSL_SERVER_S_DN_Emailrenamed
SSL_SERVER_OSSL_SERVER_S_DN_Orenamed
SSL_SERVER_OUSSL_SERVER_S_DN_OUrenamed
SSL_SERVER_CSSL_SERVER_S_DN_Crenamed
SSL_SERVER_SPSSL_SERVER_S_DN_SPrenamed
SSL_SERVER_LSSL_SERVER_S_DN_Lrenamed
SSL_SERVER_IDNSSL_SERVER_I_DNrenamed
SSL_SERVER_ICNSSL_SERVER_I_DN_CNrenamed
SSL_SERVER_IEMAILSSL_SERVER_I_DN_Emailrenamed
SSL_SERVER_IOSSL_SERVER_I_DN_Orenamed
SSL_SERVER_IOUSSL_SERVER_I_DN_OUrenamed
SSL_SERVER_ICSSL_SERVER_I_DN_Crenamed
SSL_SERVER_ISPSSL_SERVER_I_DN_SPrenamed
SSL_SERVER_ILSSL_SERVER_I_DN_Lrenamed
SSL_CLIENT_CERTIFICATESSL_CLIENT_CERTrenamed
SSL_CLIENT_CERT_STARTSSL_CLIENT_V_STARTrenamed
SSL_CLIENT_CERT_ENDSSL_CLIENT_V_ENDrenamed
SSL_CLIENT_CERT_SERIALSSL_CLIENT_M_SERIALrenamed
SSL_CLIENT_SIGNATURE_ALGORITHMSSL_CLIENT_A_SIGrenamed
SSL_CLIENT_DNSSL_CLIENT_S_DNrenamed
SSL_CLIENT_CNSSL_CLIENT_S_DN_CNrenamed
SSL_CLIENT_EMAILSSL_CLIENT_S_DN_Emailrenamed
SSL_CLIENT_OSSL_CLIENT_S_DN_Orenamed
SSL_CLIENT_OUSSL_CLIENT_S_DN_OUrenamed
SSL_CLIENT_CSSL_CLIENT_S_DN_Crenamed
SSL_CLIENT_SPSSL_CLIENT_S_DN_SPrenamed
SSL_CLIENT_LSSL_CLIENT_S_DN_Lrenamed
SSL_CLIENT_IDNSSL_CLIENT_I_DNrenamed
SSL_CLIENT_ICNSSL_CLIENT_I_DN_CNrenamed
SSL_CLIENT_IEMAILSSL_CLIENT_I_DN_Emailrenamed
SSL_CLIENT_IOSSL_CLIENT_I_DN_Orenamed
SSL_CLIENT_IOUSSL_CLIENT_I_DN_OUrenamed
SSL_CLIENT_ICSSL_CLIENT_I_DN_Crenamed
SSL_CLIENT_ISPSSL_CLIENT_I_DN_SPrenamed
SSL_CLIENT_ILSSL_CLIENT_I_DN_Lrenamed
SSL_EXPORTSSL_CIPHER_EXPORTrenamed
SSL_KEYSIZESSL_CIPHER_ALGKEYSIZErenamed
SSL_SECKEYSIZESSL_CIPHER_USEKEYSIZErenamed
SSL_SSLEAY_VERSIONSSL_VERSION_LIBRARYrenamed
SSL_STRONG_CRYPTO-Not supported by mod_ssl
SSL_SERVER_KEY_EXP-Not supported by mod_ssl
SSL_SERVER_KEY_ALGORITHM-Not supported by mod_ssl
SSL_SERVER_KEY_SIZE-Not supported by mod_ssl
SSL_SERVER_SESSIONDIR-Not supported by mod_ssl
SSL_SERVER_CERTIFICATELOGDIR-Not supported by mod_ssl
SSL_SERVER_CERTFILE-Not supported by mod_ssl
SSL_SERVER_KEYFILE-Not supported by mod_ssl
SSL_SERVER_KEYFILETYPE-Not supported by mod_ssl
SSL_CLIENT_KEY_EXP-Not supported by mod_ssl
SSL_CLIENT_KEY_ALGORITHM-Not supported by mod_ssl
SSL_CLIENT_KEY_SIZE-Not supported by mod_ssl
+
+
+
+

+
+

Custom Log Functions

+When mod_ssl is built into Apache or at least loaded (under DSO situation) +additional functions exist for the Custom Log Format of mod_log_config as documented in the Reference +Chapter. Beside the ``%{varname}x'' +eXtension format function which can be used to expand any variables provided +by any module, an additional Cryptography +``%{name}c'' cryptography format function +exists for backward compatibility. The currently implemented function calls +are listed in Table 3. +

+

+ + + +
Table 3: Custom Log Cryptography Function
+ + +
+ + + + + + + + + + + +
Function CallDescription
%...{version}c SSL protocol version
%...{cipher}c SSL cipher
%...{subjectdn}c Client Certificate Subject Distinguished Name
%...{issuerdn}c Client Certificate Issuer Distinguished Name
%...{errcode}c Certificate Verification Error (numerical)
%...{errstr}c Certificate Verification Error (string)
+
+
+
+

+
+ + + + + + + + + + +
+ + + + + +
+previous page
Reference +
+next page
HowTo +
+
+ + + + +
+ mod_ssl 2.8, User Manual
+ The Apache Interface to OpenSSL +
+
+ Copyright © 1998-2001 + Ralf S. Engelschall
+ All Rights Reserved
+
+
+
+

+
+ + diff --git a/docs/manual/ssl/ssl_faq.html b/docs/manual/ssl/ssl_faq.html new file mode 100644 index 00000000000..e3d3aa8f26d --- /dev/null +++ b/docs/manual/ssl/ssl_faq.html @@ -0,0 +1,1643 @@ + + +mod_ssl: F.A.Q. + + + + + + + + + + +
+ + + + +
+
+ + + + + + + + + + + + + +
+ + + + + +
+ mod_ssl + + Chapter 6 +
+
+ + + + + +
+previous page
HowTo +
+next page
Glossary +
+
+
+ F.A.Q. +
+
+ + + + + + + +
+ +``The wise man doesn't give the right answers, +he poses the right questions.'' + +
+ +Claude Levi-Strauss + +
+
+

+ + + + + + +
+T +his chapter is a collection of frequently asked questions (FAQ) and +corresponding answers following the popular USENET tradition. Most of these +questions occured on the Newsgroup +comp.infosystems.www.servers.unix or the mod_ssl Support +Mailing List +modssl-users@modssl.org. They are collected at this place +to avoid answering the same questions over and over. +

+Please read this chapter at least once when installing mod_ssl or at least +search for your problem here before submitting a problem report to the +author. +

+   + +
+ + + + + + + +
+ +Table Of Contents + +
+ +        About the module
+                What is the history of mod_ssl?
+                Apache-SSL vs. mod_ssl: differences?
+                mod_ssl vs. commercial alternatives?
+                mod_ssl/Apache versions?
+                mod_ssl and Year 2000?
+                mod_ssl and Wassenaar Arrangement?
+        About Installation
+                Core dumps for HTTPS requests?
+                Core dumps for Apache+mod_ssl+PHP3?
+                Undefined symbols on startup?
+                Permission problem on SSLMutex
+                Shared memory and process size?
+                Shared memory and pathname?
+                PRNG and not enough entropy?
+        About Configuration
+                HTTP and HTTPS with a single server?
+                Where is the HTTPS port?
+                How to test HTTPS manually?
+                Why does my connection hang?
+                Why do I get connection refused?
+                Why are the SSL_XXX variables missing?
+                How to switch with relative hyperlinks?
+        About Certificates
+                What are Keys, CSRs and Certs?
+                Difference on startup?
+                How to create a dummy cert?
+                How to create a real cert?
+                How to create my own CA?
+                How to change a pass phrase?
+                How to remove a pass phrase?
+                How to verify a key/cert pair?
+                Bad Certificate Error?
+                Why does a 2048-bit key not work?
+                Why is client auth broken?
+                How to convert from PEM to DER?
+                Verisign and the magic getca program?
+                Global IDs or SGC?
+                Global IDs and Cert Chain?
+        About SSL Protocol
+                Random SSL errors under heavy load?
+                Why has the server a higher load?
+                Why are connections horribly slow?
+                Which ciphers are supported?
+                How to use Anonymous-DH ciphers
+                Why do I get 'no shared ciphers'?
+                HTTPS and name-based vhosts
+                The lock icon in Netscape locks very late
+                Why do I get I/O errors with MSIE clients?
+                Why do I get I/O errors with NS clients?
+        About Support
+                Resources in case of problems?
+                Support in case of problems?
+                How to write a problem report?
+                I got a core dump, can you help me?
+                How to get a backtrace?
+
+
+
+
+

About the module

+
    +

    +

  • + + +What is the history of mod_ssl? +   + [L] +

    + The mod_ssl v1 package was initially created in April 1998 by Ralf S. Engelschall via porting Ben Laurie's Apache-SSL 1.17 source patches for + Apache 1.2.6 to Apache 1.3b6. Because of conflicts with Ben + Laurie's development cycle it then was re-assembled from scratch for + Apache 1.3.0 by merging the old mod_ssl 1.x with the newer Apache-SSL + 1.18. From this point on mod_ssl lived its own life as mod_ssl v2. The + first publically released version was mod_ssl 2.0.0 from August 10th, + 1998. As of this writing (August 1999) the current mod_ssl version is 2.4.0. +

    + After one year of very active development with over 1000 working hours and + over 40 releases mod_ssl reached its current state. The result is an + already very clean source base implementing a very rich functionality. + The code size increased by a factor of 4 to currently a total of over + 10.000 lines of ANSI C consisting of approx. 70% code and 30% code + documentation. From the original Apache-SSL code currently approx. 5% is + remaining only. +

    +

  • + + +What are the functional differences between mod_ssl and Apache-SSL, from where +it is originally derived? +   + [L] +

    + This neither can be answered in short (there were too many code changes) + nor can be answered at all by the author (there would immediately be flame + wars with no reasonable results at the end). But as you easily can guess + from the 5% of remaining Apache-SSL code, a lot of differences exists, + although user-visible backward compatibility exists for most things. +

    + When you really want a detailed comparison you have to read the entries in + the large CHANGES file that is in the mod_ssl + distribution. Usually this is much too hard-core. So I recommend you to + either believe in the opinion and recommendations of other users (the + simplest approach) or do a comparison yourself (the most reasonable + approach). For the latter, grab distributions of mod_ssl (from http://www.modssl.org) and Apache-SSL + (from http://www.apache-ssl.org), + install both packages, read their documentation and try them out yourself. + Then choose the one which pleases you most. +

    + A few final hints to help direct your comparison: quality of documentation + ("can you easily find answers and are they sufficient?"), quality of + source code ("is the source code reviewable so you can make sure there + aren't any trapdoors or inherent security risks because of bad programming + style?"), easy and clean installation ("can the SSL functionality easily + added to an Apache source tree without manual editing or patching?"), + clean integration into Apache ("is the SSL functionality encapsulated and + cleanly separated from the remaining Apache functionality?"), support for + Dynamic Shared Object (DSO) facility ("can the SSL functionality built as + a separate DSO for maximum flexibility?"), Win32 port ("is the SSL + functionality available also under the Win32 platform?"), amount and + quality of functionality ("is the provided SSL functionality and control + possibilities sufficient for your situation?"), quality of problem tracing + ("is it possible for you to easily trace down the problems via logfiles, + etc?"), etc. pp. +

    +

  • + + +What are the major differences between mod_ssl and +the commercial alternatives like Raven or Stronghold? +   + [L] +

    + In the past (until September 20th, 2000) the major difference was + the RSA license which one received (very cheaply in contrast to + a direct licensing from RSA DSI) with the commercial Apache SSL + products. On the other hand, one needed this license only in the US, + of course. So for non-US citizens this point was useless. But now + even for US citizens the situations changed because the RSA patent + expired on September 20th, 2000 and RSA DSI also placed the RSA + algorithm explicitly into the public domain. +

    + Second, there is the point that one has guaranteed support from + the commercial vendors. On the other hand, if you monitored the + Open Source quality of mod_ssl and the support activities + found on + modssl-users@modssl.org, you could ask yourself + whether you are really convinced that you can get better support + from a commercial vendor. +

    + Third, people often think they would receive perhaps at least a + better technical SSL solution than mod_ssl from the commercial + vendors. But this is not really true, because all commercial + alternatives (Raven 1.4.x, Stronghold 3.x, RedHat SWS 2.x, etc.) + are actually based on mod_ssl and OpenSSL. The reason for + this common misunderstanding is mainly because some vendors make no + attempt to make it reasonably clear that their product is actually + mod_ssl based. So, do not think, just because the commercial + alternatives are usually more expensive, that you are also receiving + an alternative technical SSL solution. This is usually not + the case. Actually the vendor versions of Apache, mod_ssl and OpenSSL + often stay behind the latest free versions and perhaps this way still do not + include important bug and security fixes. On the other hand, + it sometimes occurs that a vendor version includes useful changes + which are not available through the official freely available + packages. But most vendors play fair and contribute back those + changes to the free software world, of course. +

    + So, in short: There are lots of commercial versions of the popular + Apache+mod_ssl+OpenSSL server combination available. Every user + should decide carefully whether they really need to buy a commercial + version or whether it would not be sufficient to directly use the + free and official versions of the Apache, mod_ssl and OpenSSL + packages. +

    +

  • + + +How do I know which mod_ssl version is for which Apache version? +   + [L] +

    + That's trivial: mod_ssl uses version strings of the syntax + <mod_ssl-version>-<apache-version>, for + instance 2.4.0-1.3.9. This directly indicates that it's + mod_ssl version 2.4.0 for Apache version 1.3.9. And this also means you + only can apply this mod_ssl version to exactly this Apache + version (unless you use the --force option to mod_ssl's + configure command ;-). +

    +

  • + + +Is mod_ssl Year 2000 compliant? +   + [L] +

    + Yes, mod_ssl is Year 2000 compliant. +

    + Because first mod_ssl internally never stores years as two digits. + Instead it always uses the ANSI C & POSIX numerical data type + time_t type, which on almost all Unix platforms at the moment + is a signed long (usually 32-bits) representing seconds since + epoch of January 1st, 1970, 00:00 UTC. This signed value overflows in + early January 2038 and not in the year 2000. Second, date and time + presentations (for instance the variable ``%{TIME_YEAR}'') + are done with full year value instead of abbreviating to two digits. +

    + Additionally according to a Year 2000 + statement from the Apache Group, the Apache webserver is Year 2000 + compliant, too. But whether OpenSSL or the underlaying Operating System + (either a Unix or Win32 platform) is Year 2000 compliant is a different + question which cannot be answered here. +

    +

  • + + +What about mod_ssl and the Wassenaar Arrangement? +   + [L] +

    + First, let us explain what Wassenaar and it's Arrangement on + Export Controls for Conventional Arms and Dual-Use Goods and + Technologies is: This is a international regime, established 1995, to + control trade in conventional arms and dual-use goods and technology. It + replaced the previous CoCom regime. 33 countries are signatories: + Argentina, Australia, Austria, Belgium, Bulgaria, Canada, Czech Republic, + Denmark, Finland, France, Germany, Greece, Hungary, Ireland, Italy, Japan, + Luxembourg, Netherlands, New Zealand, Norway, Poland, Portugal, Republic + of Korea, Romania, Russian Federation, Slovak Republic, Spain, Sweden, + Switzerland, Turkey, Ukraine, United Kingdom and United States. For more + details look at http://www.wassenaar.org/. +

    + In short: The aim of the Wassenaar Arrangement is to prevent the build up + of military capabilities that threaten regional and international security + and stability. The Wassenaar Arrangement controls the export of + cryptography as a dual-use good, i.e., one that has both military and + civilian applications. However, the Wassenaar Arrangement also provides an + exemption from export controls for mass-market software and free software. +

    + In the current Wassenaar ``List of Dual Use Goods and Technologies And + Munitions'', under ``GENERAL SOFTWARE NOTE'' (GSN) it says + ``The Lists do not control "software" which is either: 1. [...] 2. "in + the public domain".'' And under ``DEFINITIONS OF TERMS USED IN + THESE LISTS'' one can find the definition: ``"In the public + domain": This means "technology" or "software" which has been made + available without restrictions upon its further dissemination. N.B. + Copyright restrictions do not remove "technology" or "software" from being + "in the public domain".'' +

    + So, both mod_ssl and OpenSSL are ``in the public domain'' for the purposes + of the Wassenaar Agreement and its ``List of Dual Use Goods and + Technologies And Munitions List''. +

    + Additionally the Wassenaar Agreement itself has no direct consequence for + exporting cryptography software. What is actually allowed or forbidden to + be exported from the countries has still to be defined in the local laws + of each country. And at least according to official press releases from + the German BMWi (see here) and the + Switzerland Bawi (see here) there + will be no forthcoming export restriction for free cryptography software + for their countries. Remember that mod_ssl is created in Germany and + distributed from Switzerland. +

    + So, mod_ssl and OpenSSL are not affected by the Wassenaar Agreement. +

+

+
+

About Installation

+
    +

    +

  • + + +When I access my website the first time via HTTPS I get a core dump? +   + [L] +

    + There can be a lot of reasons why a core dump can occur, of course. + Ranging from buggy third-party modules, over buggy vendor libraries up to + a buggy mod_ssl version. But the above situation is often caused by old or + broken vendor DBM libraries. To solve it either build mod_ssl with the + built-in SDBM library (specify --enable-rule=SSL_SDBM at the + APACI command line) or switch from ``SSLSessionCache dbm:'' to the + newer ``SSLSessionCache shm:'' variant (after you have rebuilt + Apache with MM, of course). +

    +

  • + + +My Apache dumps core when I add both mod_ssl and PHP3? +   + [L] +

    + Make sure you add mod_ssl to the Apache source tree first and then do a + fresh configuration and installation of PHP3. For SSL support EAPI patches + are required which have to change internal Apache structures. PHP3 needs + to know about these in order to work correctly. Always make sure that + -DEAPI is contained in the compiler flags when PHP3 is build. +

    +

  • + + +When I startup Apache I get errors about undefined symbols like ap_global_ctx? +   + [L] +

    + This actually means you installed mod_ssl as a DSO, but without rebuilding + Apache with EAPI. Because EAPI is a requirement for mod_ssl, you need an + extra patched Apache (containing the EAPI patches) and you have to build + this Apache with EAPI enabled (explicitly specify + --enable-rule=EAPI at the APACI command line). +

    +

  • + + +When I startup Apache I get permission errors related to SSLMutex? +   + [L] +

    + When you receive entries like ``mod_ssl: Child could not open + SSLMutex lockfile /opt/apache/logs/ssl_mutex.18332 (System error follows) + [...] System: Permission denied (errno: 13)'' this is usually + caused by to restrictive permissions on the parent directories. + Make sure that all parent directories (here /opt, + /opt/apache and /opt/apache/logs) have the x-bit + set at least for the UID under which Apache's children are running (see + the User directive of Apache). +

    +

  • + + +When I use the MM library and the shared memory cache each process grows +1.5MB according to `top' although I specified 512000 as the cache size? +   + [L] +

    + The additional 1MB are caused by the global shared memory pool EAPI + allocates for all modules and which is not used by mod_ssl for + various reasons. So the actually allocated shared memory is always + 1MB more than what you specify on SSLSessionCache. + But don't be confused by the display of `top': although is + indicates that each process grow, this is not reality, of + course. Instead the additional memory consumption is shared by + all processes, i.e. the 1.5MB are allocated only once per Apache + instance and not once per Apache server process. +

    +

  • + + +Apache creates files in a directory declared by the internal +EAPI_MM_CORE_PATH define. Is there a way to override the path using a +configuration directive? +   + [L] +

    + No, there is not configuration directive, because for technical + bootstrapping reasons, a directive not possible at all. Instead + use ``CFLAGS='-DEAPI_MM_CORE_PATH="/path/to/wherever/"' + ./configure ...'' when building Apache or use option + -d when starting httpd. +

    +

  • + + +When I fire up the server, mod_ssl stops with the error +"Failed to generate temporary 512 bit RSA private key", why? +And a "PRNG not seeded" error occurs if I try "make certificate". +   + [L] +

    + Cryptographic software needs a source of unpredictable data + to work correctly. Many open source operating systems provide + a "randomness device" that serves this purpose (usually named + /dev/random). On other systems, applications have to + seed the OpenSSL Pseudo Random Number Generator (PRNG) manually with + appropriate data before generating keys or performing public key + encryption. As of version 0.9.5, the OpenSSL functions that need + randomness report an error if the PRNG has not been seeded with + at least 128 bits of randomness. So mod_ssl has to provide enough + entropy to the PRNG to work correctly. For this one has to use the + SSLRandomSeed directives (to solve the run-time problem) + and create a $HOME/.rnd file to make sure enough + entropy is available also for the "make certificate" + step (in case the "make certificate" procedure is not + able to gather enough entropy theirself by searching for system + files). +

+

+
+

About Configuration

+
    +

    +

  • + + +Is it possible to provide HTTP and HTTPS with a single server? +   + [L] +

    + Yes, HTTP and HTTPS use different server ports, so there is no direct + conflict between them. Either run two separate server instances (one binds + to port 80, the other to port 443) or even use Apache's elegant virtual + hosting facility where you can easily create two virtual servers which + Apache dispatches: one responding to port 80 and speaking HTTP and one + responding to port 443 speaking HTTPS. +

    +

  • + + +I know that HTTP is on port 80, but where is HTTPS? +   + [L] +

    + You can run HTTPS on any port, but the standards specify port 443, which + is where any HTTPS compliant browser will look by default. You can force + your browser to look on a different port by specifying it in the URL like + this (for port 666): https://secure.server.dom:666/ +

    +

  • + + +How can I speak HTTPS manually for testing purposes? +   + [L] +

    + While you usually just use +

    + $ telnet localhost 80
    + GET / HTTP/1.0 +

    + for simple testing the HTTP protocol of Apache, it's not such easy for + HTTPS because of the SSL protocol between TCP and HTTP. But with the + help of OpenSSL's s_client command you can do a similar + check even for HTTPS: +

    + $ openssl s_client -connect localhost:443 -state -debug
    + GET / HTTP/1.0 +

    + Before the actual HTTP response you receive detailed information about the + SSL handshake. For a more general command line client which directly + understands both the HTTP and HTTPS scheme, can perform GET and POST + methods, can use a proxy, supports byte ranges, etc. you should have a + look at nifty cURL + tool. With it you can directly check if your Apache is running fine on + Port 80 and 443 as following: +

    + $ curl http://localhost/
    + $ curl https://localhost/
    +

    +

  • + + +Why does the connection hang when I connect to my SSL-aware Apache server? +   + [L] +

    + Because you connected with HTTP to the HTTPS port, i.e. you used an URL of + the form ``http://'' instead of ``https://''. + This also happens the other way round when you connect via HTTPS to a HTTP + port, i.e. when you try to use ``https://'' on a server that + doesn't support SSL (on this port). Make sure you are connecting to a + virtual server that supports SSL, which is probably the IP associated with + your hostname, not localhost (127.0.0.1). +

    +

  • + + +Why do I get ``Connection Refused'' messages when trying to access my freshly +installed Apache+mod_ssl server via HTTPS? +   + [L] +

    + There can be various reasons. Some of the common mistakes is that people + start Apache with just ``apachectl start'' (or + ``httpd'') instead of ``apachectl startssl'' (or + ``httpd -DSSL''. Or you're configuration is not correct. At + least make sure that your ``Listen'' directives match your + ``<VirtualHost>'' directives. And if all fails, please do + yourself a favor and start over with the default configuration mod_ssl + provides you. +

    +

  • + + +In my CGI programs and SSI scripts the various documented +SSL_XXX variables do not exists. Why? +   + [L] +

    + Just make sure you have ``SSLOptions +StdEnvVars'' + enabled for the context of your CGI/SSI requests. +

    +

  • + + +How can I use relative hyperlinks to switch between HTTP and HTTPS? +   + [L] +

    + Usually you have to use fully-qualified hyperlinks because + you have to change the URL scheme. But with the help of some URL + manipulations through mod_rewrite you can achieve the same effect while + you still can use relative URLs: +

    +    RewriteEngine on
    +    RewriteRule   ^/(.*):SSL$   https://%{SERVER_NAME}/$1 [R,L]
    +    RewriteRule   ^/(.*):NOSSL$ http://%{SERVER_NAME}/$1  [R,L]
    +    
    + This rewrite ruleset lets you use hyperlinks of the form +
    +    <a href="document.html:SSL">
    +    
    +
+

+
+

About Certificates

+
    +

    +

  • + + +What are RSA Private Keys, CSRs and Certificates? +   + [L] +

    + The RSA private key file is a digital file that you can use to decrypt + messages sent to you. It has a public component which you distribute (via + your Certificate file) which allows people to encrypt those messages to + you. A Certificate Signing Request (CSR) is a digital file which contains + your public key and your name. You send the CSR to a Certifying Authority + (CA) to be converted into a real Certificate. A Certificate contains your + RSA public key, your name, the name of the CA, and is digitally signed by + your CA. Browsers that know the CA can verify the signature on that + Certificate, thereby obtaining your RSA public key. That enables them to + send messages which only you can decrypt. + See the Introduction chapter for a general + description of the SSL protocol. +

    +

  • + + +Seems like there is a difference on startup between the original Apache and an SSL-aware Apache? +   + [L] +

    + Yes, in general, starting Apache with a built-in mod_ssl is just like + starting an unencumbered Apache, except for the fact that when you have a + pass phrase on your SSL private key file. Then a startup dialog pops up + asking you to enter the pass phrase. +

    + To type in the pass phrase manually when starting the server can be + problematic, for instance when starting the server from the system boot + scripts. As an alternative to this situation you can follow the steps + below under ``How can I get rid of the pass-phrase dialog at Apache + startup time?''. +

    +

  • + + +How can I create a dummy SSL server Certificate for testing purposes? +   + [L] +

    + A Certificate does not have to be signed by a public CA. You can use your + private key to sign the Certificate which contains your public key. You + can install this Certificate into your server, and people using Netscape + Navigator (not MSIE) will be able to connect after clicking OK to a + warning dialogue. You can get MSIE to work, and your customers can + eliminate the dialogue, by installing that Certificate manually into their + browsers. +

    + Just use the ``make certificate'' command at the top-level + directory of the Apache source tree right before installing Apache via + ``make install''. This creates a self-signed SSL Certificate + which expires after 30 days and isn't encrypted (which means you don't + need to enter a pass-phrase at Apache startup time). +

    + BUT REMEMBER: YOU REALLY HAVE TO CREATE A REAL CERTIFICATE FOR THE LONG + RUN! HOW THIS IS DONE IS DESCRIBED IN THE NEXT ANSWER. +

    +

  • + + +Ok, I've got my server installed and want to create a real SSL +server Certificate for it. How do I do it? +   + [L] +

    + Here is a step-by-step description: +

    +

      +
    1. Make sure OpenSSL is really installed and in your PATH. + But some commands even work ok when you just run the + ``openssl'' program from within the OpenSSL source tree as + ``./apps/openssl''. +

      +

    2. Create a RSA private key for your Apache server + (will be Triple-DES encrypted and PEM formatted): +

      + $ openssl genrsa -des3 -out server.key 1024 +

      + Please backup this server.key file and remember the + pass-phrase you had to enter at a secure location. + You can see the details of this RSA private key via the command: +

      + $ openssl rsa -noout -text -in server.key +

      + And you could create a decrypted PEM version (not recommended) + of this RSA private key via: +

      + $ openssl rsa -in server.key -out server.key.unsecure +

      +

    3. Create a Certificate Signing Request (CSR) with the server RSA private + key (output will be PEM formatted): +

      + $ openssl req -new -key server.key -out server.csr +

      + Make sure you enter the FQDN ("Fully Qualified Domain Name") of the + server when OpenSSL prompts you for the "CommonName", i.e. when you + generate a CSR for a website which will be later accessed via + https://www.foo.dom/, enter "www.foo.dom" here. + You can see the details of this CSR via the command +

      + $ openssl req -noout -text -in server.csr +

      +

    4. You now have to send this Certificate Signing Request (CSR) to + a Certifying Authority (CA) for signing. The result is then a real + Certificate which can be used for Apache. Here you have two options: + First you can let the CSR sign by a commercial CA like Verisign or + Thawte. Then you usually have to post the CSR into a web form, pay for + the signing and await the signed Certificate you then can store into a + server.crt file. For more information about commercial CAs have a look + at the following locations: +

      +

      +

      + Second you can use your own CA and now have to sign the CSR yourself by + this CA. Read the next answer in this FAQ on how to sign a CSR with + your CA yourself. + You can see the details of the received Certificate via the command: +

      + $ openssl x509 -noout -text -in server.crt +

      +

    5. Now you have two files: server.key and + server.crt. These now can be used as following inside your + Apache's httpd.conf file: +
      +       SSLCertificateFile    /path/to/this/server.crt
      +       SSLCertificateKeyFile /path/to/this/server.key
      +       
      + The server.csr file is no longer needed. +
    +

    +

  • + + +How can I create and use my own Certificate Authority (CA)? +   + [L] +

    + The short answer is to use the CA.sh or CA.pl + script provided by OpenSSL. The long and manual answer is this: +

    +

      +
    1. Create a RSA private key for your CA + (will be Triple-DES encrypted and PEM formatted): +

      + $ openssl genrsa -des3 -out ca.key 1024 +

      + Please backup this ca.key file and remember the + pass-phrase you currently entered at a secure location. + You can see the details of this RSA private key via the command +

      + $ openssl rsa -noout -text -in ca.key +

      + And you can create a decrypted PEM version (not recommended) of this + private key via: +

      + $ openssl rsa -in ca.key -out ca.key.unsecure +

      +

    2. Create a self-signed CA Certificate (X509 structure) + with the RSA key of the CA (output will be PEM formatted): +

      + $ openssl req -new -x509 -days 365 -key ca.key -out ca.crt +

      + You can see the details of this Certificate via the command: +

      + $ openssl x509 -noout -text -in ca.crt +

      +

    3. Prepare a script for signing which is needed because + the ``openssl ca'' command has some strange requirements + and the default OpenSSL config doesn't allow one easily to use + ``openssl ca'' directly. So a script named + sign.sh is distributed with the mod_ssl distribution + (subdir pkg.contrib/). Use this script for signing. +

      +

    4. Now you can use this CA to sign server CSR's in order to create real + SSL Certificates for use inside an Apache webserver (assuming + you already have a server.csr at hand): +

      + $ ./sign.sh server.csr +

      + This signs the server CSR and results in a server.crt file. +

    +

    +

  • + + +How can I change the pass-phrase on my private key file? +   + [L] +

    + You simply have to read it with the old pass-phrase and write it again + by specifying the new pass-phrase. You can accomplish this with the following + commands: +

    + $ openssl rsa -des3 -in server.key -out server.key.new
    + $ mv server.key.new server.key
    +

    + Here you're asked two times for a PEM pass-phrase. At the first + prompt enter the old pass-phrase and at the second prompt + enter the new pass-phrase. +

    +

  • + + +How can I get rid of the pass-phrase dialog at Apache startup time? +   + [L] +

    + The reason why this dialog pops up at startup and every re-start + is that the RSA private key inside your server.key file is stored in + encrypted format for security reasons. The pass-phrase is needed to be + able to read and parse this file. When you can be sure that your server is + secure enough you perform two steps: +

    +

      +
    1. Remove the encryption from the RSA private key (while + preserving the original file): +

      + $ cp server.key server.key.org
      + $ openssl rsa -in server.key.org -out server.key +

      +

    2. Make sure the server.key file is now only readable by root: +

      + $ chmod 400 server.key +

    +

    + Now server.key will contain an unencrypted copy of the key. + If you point your server at this file it will not prompt you for a + pass-phrase. HOWEVER, if anyone gets this key they will be able to + impersonate you on the net. PLEASE make sure that the permissions on that + file are really such that only root or the web server user can read it + (preferably get your web server to start as root but run as another + server, and have the key readable only by root). +

    + As an alternative approach you can use the ``SSLPassPhraseDialog + exec:/path/to/program'' facility. But keep in mind that this is + neither more nor less secure, of course. +

    +

  • + + +How do I verify that a private key matches its Certificate? +   + [L] +

    + The private key contains a series of numbers. Two of those numbers form + the "public key", the others are part of your "private key". The "public + key" bits are also embedded in your Certificate (we get them from your + CSR). To check that the public key in your cert matches the public + portion of your private key, you need to view the cert and the key and + compare the numbers. To view the Certificate and the key run the + commands: +

    + $ openssl x509 -noout -text -in server.crt
    + $ openssl rsa -noout -text -in server.key +

    + The `modulus' and the `public exponent' portions in the key and the + Certificate must match. But since the public exponent is usually 65537 + and it's bothering comparing long modulus you can use the following + approach: +

    + $ openssl x509 -noout -modulus -in server.crt | openssl md5
    + $ openssl rsa -noout -modulus -in server.key | openssl md5 +

    + And then compare these really shorter numbers. With overwhelming + probability they will differ if the keys are different. BTW, if I want to + check to which key or certificate a particular CSR belongs you can compute +

    + $ openssl req -noout -modulus -in server.csr | openssl md5 +

    +

  • + + +What does it mean when my connections fail with an "alert bad certificate" +error? +   + [L] +

    + Usually when you see errors like ``OpenSSL: error:14094412: SSL + routines:SSL3_READ_BYTES:sslv3 alert bad certificate'' in the SSL + logfile, this means that the browser was unable to handle the server + certificate/private-key which perhaps contain a RSA-key not equal to 1024 + bits. For instance Netscape Navigator 3.x is one of those browsers. +

    +

  • + + +Why does my 2048-bit private key not work? +   + [L] +

    + The private key sizes for SSL must be either 512 or 1024 for compatibility + with certain web browsers. A keysize of 1024 bits is recommended because + keys larger than 1024 bits are incompatible with some versions of Netscape + Navigator and Microsoft Internet Explorer, and with other browsers that + use RSA's BSAFE cryptography toolkit. +

    +

  • + + +Why is client authentication broken after upgrading from +SSLeay version 0.8 to 0.9? +   + [L] +

    + The CA certificates under the path you configured with + SSLCACertificatePath are found by SSLeay through hash + symlinks. These hash values are generated by the `openssl x509 -noout + -hash' command. But the algorithm used to calculate the hash for a + certificate has changed between SSLeay 0.8 and 0.9. So you have to remove + all old hash symlinks and re-create new ones after upgrading. Use the + Makefile mod_ssl placed into this directory. +

    +

  • + + +How can I convert a certificate from PEM to DER format? +   + [L] +

    + The default certificate format for SSLeay/OpenSSL is PEM, which actually + is Base64 encoded DER with header and footer lines. For some applications + (e.g. Microsoft Internet Explorer) you need the certificate in plain DER + format. You can convert a PEM file cert.pem into the + corresponding DER file cert.der with the following command: + $ openssl x509 -in cert.pem -out cert.der -outform DER +

    +

  • + + +I try to install a Verisign certificate. Why can't I find neither the +getca nor getverisign programs Verisign mentions? +   + [L] +

    + This is because Verisign has never provided specific instructions + for Apache+mod_ssl. Rather they tell you what you should do + if you were using C2Net's Stronghold (a commercial Apache + based server with SSL support). The only thing you have to do + is to save the certificate into a file and give the name of + that file to the SSLCertificateFile directive. + Remember that you need to give the key file in as well (see + SSLCertificateKeyFile directive). For a better + CA-related overview on SSL certificate fiddling you can look at + Thawte's mod_ssl instructions. +

    +

  • + + +Can I use the Server Gated Cryptography (SGC) facility (aka Verisign Global +ID) also with mod_ssl? +   + [L] +

    + Yes, mod_ssl since version 2.1 supports the SGC facility. You don't have + to configure anything special for this, just use a Global ID as your + server certificate. The step up of the clients are then + automatically handled by mod_ssl under run-time. For details please read + the README.GlobalID document in the mod_ssl distribution. +

    +

  • + + +After I have installed my new Verisign Global ID server certificate, the +browsers complain that they cannot verify the server certificate? +   + [L] +

    + That is because Verisign uses an intermediate CA certificate between + the root CA certificate (which is installed in the browsers) and + the server certificate (which you installed in the server). You + should have received this additional CA certificate from Verisign. + If not, complain to them. Then configure this certificate with the + SSLCertificateChainFile directive in the server. This + makes sure the intermediate CA certificate is send to the browser + and this way fills the gap in the certificate chain. +

+

+
+

About SSL Protocol

+
    +

    +

  • + + +Why do I get lots of random SSL protocol errors under heavy server load? +   + [L] +

    + There can be a number of reasons for this, but the main one + is problems with the SSL session Cache specified by the + SSLSessionCache directive. The DBM session cache is most + likely the source of the problem, so trying the SHM session cache or + no cache at all may help. +

    +

  • + + +Why has my webserver a higher load now that I run SSL there? +   + [L] +

    + Because SSL uses strong cryptographic encryption and this needs a lot of + number crunching. And because when you request a webpage via HTTPS even + the images are transfered encrypted. So, when you have a lot of HTTPS + traffic the load increases. +

    +

  • + + +Often HTTPS connections to my server require up to 30 seconds for establishing +the connection, although sometimes it works faster? +   + [L] +

    + Usually this is caused by using a /dev/random device for + SSLRandomSeed which is blocking in read(2) calls if not + enough entropy is available. Read more about this problem in the refernce + chapter under SSLRandomSeed. +

    +

  • + + +What SSL Ciphers are supported by mod_ssl? +   + [L] +

    + Usually just all SSL ciphers which are supported by the + version of OpenSSL in use (can depend on the way you built + OpenSSL). Typically this at least includes the following: +

    +

      +
    • RC4 with MD5 +
    • RC4 with MD5 (export version restricted to 40-bit key) +
    • RC2 with MD5 +
    • RC2 with MD5 (export version restricted to 40-bit key) +
    • IDEA with MD5 +
    • DES with MD5 +
    • Triple-DES with MD5 +
    +

    + To determine the actual list of supported ciphers you can + run the following command: +

    + $ openssl ciphers -v
    +

    +

  • + + +I want to use Anonymous Diffie-Hellman (ADH) ciphers, but I always get ``no +shared cipher'' errors? +   + [L] +

    + In order to use Anonymous Diffie-Hellman (ADH) ciphers, it is not enough + to just put ``ADH'' into your SSLCipherSuite. + Additionally you have to build OpenSSL with + ``-DSSL_ALLOW_ADH''. Because per default OpenSSL does not + allow ADH ciphers for security reasons. So if you are actually enabling + these ciphers make sure you are informed about the side-effects. +

    +

  • + + +I always just get a 'no shared ciphers' error if +I try to connect to my freshly installed server? +   + [L] +

    + Either you have messed up your SSLCipherSuite + directive (compare it with the pre-configured example in + httpd.conf-dist) or you have choosen the DSA/DH + algorithms instead of RSA under "make certificate" + and ignored or overseen the warnings. Because if you have choosen + DSA/DH, then your server no longer speaks RSA-based SSL ciphers + (at least not until you also configure an additional RSA-based + certificate/key pair). But current browsers like NS or IE only speak + RSA ciphers. The result is the "no shared ciphers" error. To fix + this, regenerate your server certificate/key pair and this time + choose the RSA algorithm. +

    +

  • + + +Why can't I use SSL with name-based/non-IP-based virtual hosts? +   + [L] +

    + The reason is very technical. Actually it's some sort of a chicken and + egg problem: The SSL protocol layer stays below the HTTP protocol layer + and encapsulates HTTP. When an SSL connection (HTTPS) is established + Apache/mod_ssl has to negotiate the SSL protocol parameters with the + client. For this mod_ssl has to consult the configuration of the virtual + server (for instance it has to look for the cipher suite, the server + certificate, etc.). But in order to dispatch to the correct virtual server + Apache has to know the Host HTTP header field. For this the + HTTP request header has to be read. This cannot be done before the SSL + handshake is finished. But the information is already needed at the SSL + handshake phase. Bingo! +

    +

  • + + +When I use Basic Authentication over HTTPS the lock icon in Netscape browsers +still show the unlocked state when the dialog pops up. Does this mean the +username/password is still transmitted unencrypted? +   + [L] +

    + No, the username/password is already transmitted encrypted. The icon in + Netscape browsers is just not really synchronized with the SSL/TLS layer + (it toggles to the locked state when the first part of the actual webpage + data is transferred which is not quite correct) and this way confuses + people. The Basic Authentication facility is part of the HTTP layer and + this layer is above the SSL/TLS layer in HTTPS. And before any HTTP data + communication takes place in HTTPS the SSL/TLS layer has already done the + handshake phase and switched to encrypted communication. So, don't get + confused by this icon. +

    +

  • + + +When I connect via HTTPS to an Apache+mod_ssl+OpenSSL server with Microsoft Internet +Explorer (MSIE) I get various I/O errors. What is the reason? +   + [L] +

    + The first reason is that the SSL implementation in some MSIE versions has + some subtle bugs related to the HTTP keep-alive facility and the SSL close + notify alerts on socket connection close. Additionally the interaction + between SSL and HTTP/1.1 features are problematic with some MSIE versions, + too. You've to work-around these problems by forcing + Apache+mod_ssl+OpenSSL to not use HTTP/1.1, keep-alive connections or + sending the SSL close notify messages to MSIE clients. This can be done by + using the following directive in your SSL-aware virtual host section: +

    +    SetEnvIf User-Agent ".*MSIE.*" \
    +             nokeepalive ssl-unclean-shutdown \
    +             downgrade-1.0 force-response-1.0
    + Additionally it is known some MSIE versions have also problems + with particular ciphers. Unfortunately one cannot workaround these + bugs only for those MSIE particular clients, because the ciphers + are already used in the SSL handshake phase. So a MSIE-specific + SetEnvIf doesn't work to solve these problems. Instead one + has to do more drastic adjustments to the global parameters. But + before you decide to do this, make sure your clients really have + problems. If not, do not do this, because it affects all(!) your + clients, i.e., also your non-MSIE clients. +

    + The next problem is that 56bit export versions of MSIE 5.x browsers have a + broken SSLv3 implementation which badly interacts with OpenSSL versions + greater than 0.9.4. You can either accept this and force your clients to + upgrade their browsers, or you downgrade to OpenSSL 0.9.4 (hmmm), or you + can decide to workaround it by accepting the drawback that your workaround + will horribly affect also other browsers: +

    +    SSLProtocol all -SSLv3
    + This completely disables the SSLv3 protocol and lets those browsers work. + But usually this is an even less acceptable workaround. A more reasonable + workaround is to address the problem more closely and disable only the + ciphers which cause trouble. +
    +    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
    + This also lets the broken MSIE versions work, but only removes the + newer 56bit TLS ciphers. +

    + Another problem with MSIE 5.x clients is that they refuse to connect to + URLs of the form https://12.34.56.78/ (IP-addresses are used + instead of the hostname), if the server is using the Server Gated + Cryptography (SGC) facility. This can only be avoided by using the fully + qualified domain name (FQDN) of the website in hyperlinks instead, because + MSIE 5.x has an error in the way it handles the SGC negotiation. +

    + And finally there are versions of MSIE which seem to require that + an SSL session can be reused (a totally non standard-conforming + behaviour, of course). Connection with those MSIE versions only work + if a SSL session cache is used. So, as a work-around, make sure you + are using a session cache (see SSLSessionCache directive). +

    +

  • + + +When I connect via HTTPS to an Apache+mod_ssl server with Netscape Navigator I +get I/O errors and the message "Netscape has encountered bad data from the +server" What's the reason? +   + [L] +

    + The problem usually is that you had created a new server certificate with + the same DN, but you had told your browser to accept forever the old + server certificate. Once you clear the entry in your browser for the old + certificate, everything usually will work fine. Netscape's SSL + implementation is correct, so when you encounter I/O errors with Netscape + Navigator it is most of the time caused by the configured certificates. +

+

+
+

About Support

+
    +

    +

  • + + +What information resources are available in case of mod_ssl problems? +   + [L] +

    +The following information resources are available. +In case of problems you should search here first. +

    +

      +
    1. Answers in the User Manual's F.A.Q. List (this)
      + + http://www.modssl.org/docs/2.8/ssl_faq.html
      + First look inside the F.A.Q. (this text), perhaps your problem is such + popular that it was already answered a lot of times in the past. +

      +

    2. Postings from the modssl-users Support Mailing List + + http://www.modssl.org/support/
      + Second search for your problem in one of the existing archives of the + modssl-users mailing list. Perhaps your problem popped up at least once for + another user, too. +

      +

    3. Problem Reports in the Bug Database + + http://www.modssl.org/support/bugdb/
      + Third look inside the mod_ssl Bug Database. Perhaps + someone else already has reported the problem. +
    +

    +

  • + + +What support contacts are available in case of mod_ssl problems? +   + [L] +

    +The following lists all support possibilities for mod_ssl, in order of +preference, i.e. start in this order and do not pick the support possibility +you just like most, please. +

    +

      +
    1. Write a Problem Report into the Bug Database
      + + http://www.modssl.org/support/bugdb/
      + This is the preferred way of submitting your problem report, because this + way it gets filed into the bug database (it cannot be lost) and + send to the modssl-users mailing list (others see the current problems and + learn from answers). +

      +

    2. Write a Problem Report to the modssl-users Support Mailing List
      + + modssl-users @ modssl.org
      + This is the second way of submitting your problem report. You have to + subscribe to the list first, but then you can easily discuss your problem + with both the author and the whole mod_ssl user community. +

      +

    3. Write a Problem Report to the author
      + + rse @ engelschall.com
      + This is the last way of submitting your problem report. Please avoid this + in your own interest because the author is really a very busy men. Your + mail will always be filed to one of his various mail-folders and is + usually not processed as fast as a posting on modssl-users. +
    +

    +

  • + + +What information and details I've to provide to +the author when writing a bug report? +   + [L] +

    +You have to at least always provide the following information: +

    +

      +
    • Apache, mod_ssl and OpenSSL version information
      + The mod_ssl version you should really know. For instance, it's the version + number in the distribution tarball. The Apache version can be determined + by running ``httpd -v''. The OpenSSL version can be + determined by running ``openssl version''. Alternatively when + you have Lynx installed you can run the command ``lynx -mime_header + http://localhost/ | grep Server'' to determine all information in a + single step. +

      +

    • The details on how you built and installed Apache+mod_ssl+OpenSSL
      + For this you can provide a logfile of your terminal session which shows + the configuration and install steps. Alternatively you can at least + provide the author with the APACI `configure'' command line + you used (assuming you used APACI, of course). +

      +

    • In case of core dumps please include a Backtrace
      + In case your Apache+mod_ssl+OpenSSL should really dumped core please attach + a stack-frame ``backtrace'' (see the next question on how to get it). + Without this information the reason for your core dump cannot be found. + So you have to provide the backtrace, please. +

      +

    • A detailed description of your problem
      + Don't laugh, I'm totally serious. I already got a lot of problem reports + where the people not really said what's the actual problem is. So, in your + own interest (you want the problem be solved, don't you?) include as much + details as possible, please. But start with the essentials first, of + course. +
    +

    +

  • + + +I got a core dump, can you help me? +   + [L] +

    + In general no, at least not unless you provide more details about the code + location where Apache dumped core. What is usually always required in + order to help you is a backtrace (see next question). Without this + information it is mostly impossible to find the problem and help you in + fixing it. +

    +

  • + + +Ok, I got a core dump but how do I get a backtrace to find out the reason for it? +   + [L] +

    +Follow the following steps: +

    +

      +
    1. Make sure you have debugging symbols available in at least + Apache and mod_ssl. On platforms where you use GCC/GDB you have to build + Apache+mod_ssl with ``OPTIM="-g -ggdb3"'' to achieve this. On + other platforms at least ``OPTIM="-g"'' is needed. +

      +

    2. Startup the server and try to produce the core-dump. For this you perhaps + want to use a directive like ``CoreDumpDirectory /tmp'' to + make sure that the core-dump file can be written. You then should get a + /tmp/core or /tmp/httpd.core file. When you + don't get this, try to run your server under an UID != 0 (root), because + most "current" kernels do not allow a process to dump core after it has + done a setuid() (unless it does an exec()) for + security reasons (there can be privileged information left over in + memory). Additionally you can run ``/path/to/httpd -X'' + manually to force Apache to not fork. +

      +

    3. Analyze the core-dump. For this run ``gdb /path/to/httpd + /tmp/httpd.core'' or a similar command has to run. In GDB you then + just have to enter the ``bt'' command and, voila, you get the + backtrace. For other debuggers consult your local debugger manual. Send + this backtrace to the author. +
    +
+

+
+ + + + + + + + + + +
+ + + + + +
+previous page
HowTo +
+next page
Glossary +
+
+ + + + +
+ mod_ssl 2.8, User Manual
+ The Apache Interface to OpenSSL +
+
+ Copyright © 1998-2001 + Ralf S. Engelschall
+ All Rights Reserved
+
+
+
+

+
+ + diff --git a/docs/manual/ssl/ssl_howto.html b/docs/manual/ssl/ssl_howto.html new file mode 100644 index 00000000000..01ff7a99ac1 --- /dev/null +++ b/docs/manual/ssl/ssl_howto.html @@ -0,0 +1,929 @@ + + +mod_ssl: HowTo + + + + + + + + + + +
+ + + + +
+
+ + + + + + + + + + + + + +
+ + + + + +
+ mod_ssl + + Chapter 5 +
+
+ + + + + +
+previous page
Compatibility +
+next page
F.A.Q. List +
+
+
+ HowTo +
+
+ + + + + + + +
+ +``The solution of this problem is trivial + and is left as an exercise for the reader.'' + +
+ +Standard textbook cookie + +
+
+

+ + + + + + +
+H +ow to solve particular security constraints for an SSL-aware webserver +is not always obvious because of the coherences between SSL, HTTP and Apache's +way of processing requests. This chapter gives instructions on how to solve +such typical situations. Treat is as a first step to find out the final +solution, but always try to understand the stuff before you use it. Nothing is +worse than using a security solution without knowing it's restrictions and +coherences. + +   + +
+ + + + + + + +
+ +Table Of Contents + +
+ +        Cipher Suites and Enforced Strong Security
+                SSLv2 only server
+                strong encryption only server
+                server gated cryptography
+                stronger per-directory requirements
+        Client Authentication and Access Control
+                simple certificate-based client authentication
+                selective certificate-based client authentication
+                particular certificate-based client authentication
+                intranet vs. internet authentication
+
+
+
+
+

Cipher Suites and Enforced Strong Security

+
    +

    +

  • + + +How can I create a real SSLv2-only server? +   + [L] +

    +The following creates an SSL server which speaks only the SSLv2 protocol and +its ciphers. +

    + + + + + + + + + + + + + + + + + + + + + + + + +
      httpd.conf  
    + + + + +
    +
    +
    +SSLProtocol -all +SSLv2
    +SSLCipherSuite SSLv2:+HIGH:+MEDIUM:+LOW:+EXP
    +
    +
    +
    +
    +

    +

  • + + +How can I create an SSL server which accepts strong encryption only? +   + [L] +

    +The following enables only the seven strongest ciphers: +

    + + + + + + + + + + + + + + + + + + + + + + + + +
      httpd.conf  
    + + + + +
    +
    +
    +SSLProtocol all
    +SSLCipherSuite HIGH:MEDIUM
    +
    +
    +
    +
    +

    +

  • + + +How can I create an SSL server which accepts strong encryption only, +but allows export browsers to upgrade to stronger encryption? +   + [L] +

    +This facility is called Server Gated Cryptography (SGC) and details you can +find in the README.GlobalID document in the mod_ssl distribution. +In short: The server has a Global ID server certificate, signed by a special +CA certificate from Verisign which enables strong encryption in export +browsers. This works as following: The browser connects with an export cipher, +the server sends it's Global ID certificate, the browser verifies it and +subsequently upgrades the cipher suite before any HTTP communication takes +place. The question now is: How can we allow this upgrade, but enforce strong +encryption. Or in other words: Browser either have to initially connect with +strong encryption or have to upgrade to strong encryption, but are not allowed +to keep the export ciphers. The following does the trick: +

    + + + + + + + + + + + + + + + + + + + + + + + + +
      httpd.conf  
    + + + + +
    +
    +
    +#   allow all ciphers for the inital handshake,
    +#   so export browsers can upgrade via SGC facility
    +SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    +<Directory /usr/local/apache/htdocs>
    +#   but finally deny all browsers which haven't upgraded
    +SSLRequire %{SSL_CIPHER_USEKEYSIZE} >= 128
    +</Directory>
    +
    +
    +
    +
    +

    +

  • + + +How can I create an SSL server which accepts all types of ciphers in general, +but requires a strong ciphers for access to a particular URL? +   + [L] +

    +Obviously you cannot just use a server-wide SSLCipherSuite which +restricts the ciphers to the strong variants. But mod_ssl allows you to +reconfigure the cipher suite in per-directory context and automatically forces +a renegotiation of the SSL parameters to meet the new configuration. So, the +solution is: +

    + + + + + + + + + + + + + + + + + + + + + + + + +
      httpd.conf  
    + + + + +
    +
    +
    +#   be liberal in general
    +SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    +<Location /strong/area>
    +#   but https://hostname/strong/area/ and below requires strong ciphers
    +SSLCipherSuite HIGH:MEDIUM
    +</Location>
    +
    +
    +
    +
    +

+

Client Authentication and Access Control

+
    +

    +

  • + + +How can I authenticate clients based on certificates when I know all my +clients? +   + [L] +

    +When you know your user community (i.e. a closed user group situation), as +it's the case for instance in an Intranet, you can use plain certificate +authentication. All you have to do is to create client certificates signed by +your own CA certificate ca.crt and then verifiy the clients +against this certificate. +

    + + + + + + + + + + + + + + + + + + + + + + + + +
      httpd.conf  
    + + + + +
    +
    +
    +#   require a client certificate which has to be directly
    +#   signed by our CA certificate in ca.crt
    +SSLVerifyClient require
    +SSLVerifyDepth 1
    +SSLCACertificateFile conf/ssl.crt/ca.crt
    +
    +
    +
    +
    +

    +

  • + + +How can I authenticate my clients for a particular URL based on certificates +but still allow arbitrary clients to access the remaining parts of the server? +   + [L] +

    +For this we again use the per-directory reconfiguration feature of mod_ssl: +

    + + + + + + + + + + + + + + + + + + + + + + + + +
      httpd.conf  
    + + + + +
    +
    +
    +SSLVerifyClient none
    +SSLCACertificateFile conf/ssl.crt/ca.crt
    +<Location /secure/area>
    +SSLVerifyClient require
    +SSLVerifyDepth 1
    +</Location>
    +
    +
    +
    +
    +

    +

  • + + +How can I authenticate only particular clients for a some URLs based +on certificates but still allow arbitrary clients to access the remaining +parts of the server? +   + [L] +

    +The key is to check for various ingredients of the client certficate. Usually +this means to check the whole or part of the Distinguished Name (DN) of the +Subject. For this two methods exists: The mod_auth based variant +and the SSLRequire variant. The first method is good when the +clients are of totally different type, i.e. when their DNs have no common +fields (usually the organisation, etc.). In this case you've to establish a +password database containing all clients. The second method is better +when your clients are all part of a common hierarchy which is encoded into the +DN. Then you can match them more easily. +

    +The first method: +

    + + + + + + + + + + + + + + + + + + + + + + + + +
      /usr/local/apache/conf/httpd.conf  
    + + + + +
    +
    +
    +SSLVerifyClient      none
    +<Directory /usr/local/apache/htdocs/secure/area>
    +SSLVerifyClient      require
    +SSLVerifyDepth       5
    +SSLCACertificateFile conf/ssl.crt/ca.crt
    +SSLCACertificatePath conf/ssl.crt
    +SSLOptions           +FakeBasicAuth
    +SSLRequireSSL
    +AuthName             "Snake Oil Authentication"
    +AuthType             Basic
    +AuthUserFile         /usr/local/apache/conf/httpd.passwd
    +require              valid-user
    +</Directory>
    +
    +
    +
    +
    +

    + + + + + + + + + + + + + + + + + + + + + + + + +
      /usr/local/apache/conf/httpd.passwd  
    + + + + +
    +
    +
    +/C=DE/L=Munich/O=Snake Oil, Ltd./OU=Staff/CN=Foo:xxj31ZMTZzkVA
    +/C=US/L=S.F./O=Snake Oil, Ltd./OU=CA/CN=Bar:xxj31ZMTZzkVA
    +/C=US/L=L.A./O=Snake Oil, Ltd./OU=Dev/CN=Quux:xxj31ZMTZzkVA
    +
    +
    +
    +
    +

    +The second method: +

    + + + + + + + + + + + + + + + + + + + + + + + + +
      httpd.conf  
    + + + + +
    +
    +
    +SSLVerifyClient      none
    +<Directory /usr/local/apache/htdocs/secure/area>
    +SSLVerifyClient      require
    +SSLVerifyDepth       5
    +SSLCACertificateFile conf/ssl.crt/ca.crt
    +SSLCACertificatePath conf/ssl.crt
    +SSLOptions           +FakeBasicAuth
    +SSLRequireSSL
    +SSLRequire           %{SSL_CLIENT_S_DN_O}  eq "Snake Oil, Ltd." and \
    +                     %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"}
    +</Directory>
    +
    +
    +
    +
    +

    +

  • + + How can +I require HTTPS with strong ciphers and either basic authentication or client +certificates for access to a subarea on the Intranet website for clients +coming from the Internet but still allow plain HTTP access for clients on the +Intranet? +   + [L] +

    +Let us assume the Intranet can be distinguished through the IP network +192.160.1.0/24 and the subarea on the Intranet website has the URL +/subarea. Then configure the following outside your HTTPS virtual +host (so it applies to both HTTPS and HTTP): +

    + + + + + + + + + + + + + + + + + + + + + + + + +
      httpd.conf  
    + + + + +
    +
    +
    +SSLCACertificateFile conf/ssl.crt/company-ca.crt
    +
    +<Directory /usr/local/apache/htdocs>
    +#   Outside the subarea only Intranet access is granted
    +Order                deny,allow
    +Deny                 from all
    +Allow                from 192.168.1.0/24
    +</Directory>
    +
    +<Directory /usr/local/apache/htdocs/subarea>
    +#   Inside the subarea any Intranet access is allowed
    +#   but from the Internet only HTTPS + Strong-Cipher + Password
    +#   or the alternative HTTPS + Strong-Cipher + Client-Certificate
    +
    +#   If HTTPS is used, make sure a strong cipher is used.
    +#   Additionally allow client certs as alternative to basic auth.
    +SSLVerifyClient      optional
    +SSLVerifyDepth       1
    +SSLOptions           +FakeBasicAuth +StrictRequire
    +SSLRequire           %{SSL_CIPHER_USEKEYSIZE} >= 128
    +
    +#   Force clients from the Internet to use HTTPS
    +RewriteEngine        on
    +RewriteCond          %{REMOTE_ADDR} !^192\.168\.1\.[0-9]+$
    +RewriteCond          %{HTTPS} !=on
    +RewriteRule          .* - [F]
    +
    +#   Allow Network Access and/or Basic Auth
    +Satisfy              any
    +
    +#   Network Access Control
    +Order                deny,allow
    +Deny                 from all
    +Allow                192.168.1.0/24
    +
    +#   HTTP Basic Authentication
    +AuthType             basic
    +AuthName             "Protected Intranet Area"
    +AuthUserFile         conf/protected.passwd
    +Require              valid-user
    +</Directory>
    +
    +
    +
    +
    +

+

+
+ + + + + + + + + + +
+ + + + + +
+previous page
Compatibility +
+next page
F.A.Q. List +
+
+ + + + +
+ mod_ssl 2.8, User Manual
+ The Apache Interface to OpenSSL +
+
+ Copyright © 1998-2001 + Ralf S. Engelschall
+ All Rights Reserved
+
+
+
+

+
+ + diff --git a/docs/manual/ssl/ssl_intro.html b/docs/manual/ssl/ssl_intro.html new file mode 100644 index 00000000000..fae805f07a4 --- /dev/null +++ b/docs/manual/ssl/ssl_intro.html @@ -0,0 +1,919 @@ + + +mod_ssl: Introduction + + + + + + + + + + +
+ + + + +
+
+ + + + + + + + + + + + + +
+ + + + + +
+ mod_ssl + + Chapter 2 +
+
+ + + + + +
+previous page
Overview +
+next page
Reference +
+
+
+ Introduction +
+
+ + + + + + + +
+ +``The nice thing about standards is that there are so many to choose from. +And if you really don't like all the standards you just have to wait another +year until the one arises you are looking for.'' + +
+ +A. Tanenbaum, ``Introduction to Computer Networks'' + +
+
+

+ + + + + + +
+A +s an introduction this chapter is aimed at readers who are familiar +with the Web, HTTP, and Apache, but are not security experts. It is not +intended to be a definitive guide to the SSL protocol, nor does it discuss +specific techniques for managing certificates in an organization, or the +important legal issues of patents and import and export restrictions. Rather, +it is intended to provide a common background to mod_ssl users by pulling +together various concepts, definitions, and examples as a starting point for +further exploration. +

+The presented content is mainly derived, with permission by the author, from +the article Introducing SSL +and Certificates using SSLeay from Frederick J. Hirsch, of The Open +Group Research Institute, which was published in Web Security: A Matter of +Trust, World Wide Web Journal, Volume 2, Issue 3, Summer 1997. +Please send any postive feedback to Frederick Hirsch (the original +article author) and all negative feedback to Ralf S. Engelschall (the mod_ssl +author). +

+   + +
+ + + + + + + +
+ +Table Of Contents + +
+ +        Cryptographic Techniques
+                Cryptographic Algorithms
+                Message Digests
+                Digital Signatures
+        Certificates
+                Certificate Contents
+                Certificate Authorities
+                        Certificate Chains
+                        Creating a Root-Level CA
+                        Certificate Management
+        Secure Sockets Layer (SSL)
+                Session Establishment
+                Key Exchange Method
+                Cipher for Data Transfer
+                Digest Function
+                Handshake Sequence Protocol
+                Data Transfer
+                Securing HTTP Communication
+        References
+
+
+
+
+

Cryptographic Techniques

+Understanding SSL requires an understanding of cryptographic algorithms, +message digest functions (aka. one-way or hash functions), and digital +signatures. These techniques are the subject of entire books (see for instance +[AC96]) and provide the basis for privacy, integrity, and +authentication. +

Cryptographic Algorithms

+Suppose Alice wants to send a message to her bank to transfer some money. +Alice would like the message to be private, since it will include information +such as her account number and transfer amount. One solution is to use a +cryptographic algorithm, a technique that would transform her message into an +encrypted form, unreadable except by those it is intended for. Once in this +form, the message may only be interpreted through the use of a secret key. +Without the key the message is useless: good cryptographic algorithms make it +so difficult for intruders to decode the original text that it isn't worth +their effort. +

+There are two categories of cryptographic algorithms: +conventional and public key. +

    +
  • Conventional cryptography, also known as symmetric +cryptography, requires the sender and receiver to share a key: a secret +piece of information that may be used to encrypt or decrypt a message. +If this key is secret, then nobody other than the sender or receiver may +read the message. If Alice and the bank know a secret key, then they +may send each other private messages. The task of privately choosing a key +before communicating, however, can be problematic. +

    +

  • Public key cryptography, also known as asymmetric cryptography, +solves the key exchange problem by defining an algorithm which uses two keys, +each of which may be used to encrypt a message. If one key is used to encrypt +a message then the other must be used to decrypt it. This makes it possible +to receive secure messages by simply publishing one key (the public key) and +keeping the other secret (the private key). +

    +Anyone may encrypt a message using the public key, but only the owner of the +private key will be able to read it. In this way, Alice may send private +messages to the owner of a key-pair (the bank), by encrypting it using their +public key. Only the bank will be able to decrypt it. +

+

Message Digests

+Although Alice may encrypt her message to make it private, there is still a +concern that someone might modify her original message or substitute +it with a different one, in order to transfer the money to themselves, for +instance. One way of guaranteeing the integrity of Alice's message is to +create a concise summary of her message and send this to the bank as well. +Upon receipt of the message, the bank creates its own summary and compares it +with the one Alice sent. If they agree then the message was received intact. +

+A summary such as this is called a message digest, one-way +function or hash function. Message digests are used to create +short, fixed-length representations of longer, variable-length messages. +Digest algorithms are designed to produce unique digests for different +messages. Message digests are designed to make it too difficult to determine +the message from the digest, and also impossible to find two different +messages which create the same digest -- thus eliminating the possibility of +substituting one message for another while maintaining the same digest. +

+Another challenge that Alice faces is finding a way to send the digest to the +bank securely; when this is achieved, the integrity of the associated message +is assured. One way to to this is to include the digest in a digital +signature. +

Digital Signatures

+When Alice sends a message to the bank, the bank needs to ensure that the +message is really from her, so an intruder does not request a transaction +involving her account. A digital signature, created by Alice and +included with the message, serves this purpose. +

+Digital signatures are created by encrypting a digest of the message, +and other information (such as a sequence number) with the sender's +private key. Though anyone may decrypt the signature using the public +key, only the signer knows the private key. This means that only they may +have signed it. Including the digest in the signature means the signature is +only good for that message; it also ensures the integrity of the message since +no one can change the digest and still sign it. +

+To guard against interception and reuse of the signature by an intruder at a +later date, the signature contains a unique sequence number. This protects +the bank from a fraudulent claim from Alice that she did not send the message +-- only she could have signed it (non-repudiation). +

Certificates

+Although Alice could have sent a private message to the bank, signed it, and +ensured the integrity of the message, she still needs to be sure that she is +really communicating with the bank. This means that she needs to be sure that +the public key she is using corresponds to the bank's private key. Similarly, +the bank also needs to verify that the message signature really corresponds to +Alice's signature. +

+If each party has a certificate which validates the other's identity, confirms +the public key, and is signed by a trusted agency, then they both will be +assured that they are communicating with whom they think they are. Such a +trusted agency is called a Certificate Authority, and certificates are +used for authentication. +

Certificate Contents

+A certificate associates a public key with the real identity of an individual, +server, or other entity, known as the subject. As shown in Table 1, information about the subject includes identifying +information (the distinguished name), and the public key. It also includes +the identification and signature of the Certificate Authority that issued the +certificate, and the period of time during which the certificate is valid. It +may have additional information (or extensions) as well as administrative +information for the Certificate Authority's use, such as a serial number. +

+

+ + + +
Table 1: Certificate Information
+ + +
+ + + + + + + + + + + +
Subject:Distinguished Name, Public Key
Issuer:Distinguished Name, Signature
Period of Validity:Not Before Date, Not After Date
Administrative Information:Version, Serial Number
Extended Information:Basic Contraints, Netscape Flags, etc.
+
+
+
+

+A distinguished name is used to provide an identity in a specific context -- +for instance, an individual might have a personal certificate as well as one +for their identity as an employee. Distinguished names are defined by the +X.509 standard [X509], which defines the fields, field +names, and abbreviations used to refer to the fields +(see Table 2). +

+

+ + + +
Table 2: Distinguished Name Information
+ + +
+ + + + + + + + + + + + + + + + +
DN Field:Abbrev.:Description:Example:
Common NameCNName being certifiedCN=Joe Average
Organization or CompanyOName is associated with this
organization
O=Snake Oil, Ltd.
Organizational UnitOUName is associated with this
organization unit, such as a department
OU=Research Institute
City/LocalityLName is located in this CityL=Snake City
State/ProvinceSTName is located in this State/ProvinceST=Desert
CountryCName is located in this Country (ISO code)C=XZ
+
+
+
+

+A Certificate Authority may define a policy specifying which distinguished +field names are optional, and which are required. It may also place +requirements upon the field contents, as may users of certificates. As an +example, a Netscape browser requires that the Common Name for a certificate +representing a server has a name which matches a wildcard pattern for the +domain name of that server, such as *.snakeoil.com. +

+The binary format of a certificate is defined using the ASN.1 notation [ X208] [PKCS]. This notation defines how to +specify the contents, and encoding rules define how this information is +translated into binary form. The binary encoding of the certificate is +defined using Distinguished Encoding Rules (DER), which are based on the more +general Basic Encoding Rules (BER). For those transmissions which cannot +handle binary, the binary form may be translated into an ASCII form by using +Base64 encoding [MIME]. This encoded version is called PEM +encoded (the name comes from "Privacy Enhanced Mail"), when placed between +begin and end delimiter lines as illustrated in Table 3. +

+

+ + + +
Table 3: Example of a PEM-encoded certificate (snakeoil.crt)
+ + +
+
+
+-----BEGIN CERTIFICATE-----
+MIIC7jCCAlegAwIBAgIBATANBgkqhkiG9w0BAQQFADCBqTELMAkGA1UEBhMCWFkx
+FTATBgNVBAgTDFNuYWtlIERlc2VydDETMBEGA1UEBxMKU25ha2UgVG93bjEXMBUG
+A1UEChMOU25ha2UgT2lsLCBMdGQxHjAcBgNVBAsTFUNlcnRpZmljYXRlIEF1dGhv
+cml0eTEVMBMGA1UEAxMMU25ha2UgT2lsIENBMR4wHAYJKoZIhvcNAQkBFg9jYUBz
+bmFrZW9pbC5kb20wHhcNOTgxMDIxMDg1ODM2WhcNOTkxMDIxMDg1ODM2WjCBpzEL
+MAkGA1UEBhMCWFkxFTATBgNVBAgTDFNuYWtlIERlc2VydDETMBEGA1UEBxMKU25h
+a2UgVG93bjEXMBUGA1UEChMOU25ha2UgT2lsLCBMdGQxFzAVBgNVBAsTDldlYnNl
+cnZlciBUZWFtMRkwFwYDVQQDExB3d3cuc25ha2VvaWwuZG9tMR8wHQYJKoZIhvcN
+AQkBFhB3d3dAc25ha2VvaWwuZG9tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
+gQDH9Ge/s2zcH+da+rPTx/DPRp3xGjHZ4GG6pCmvADIEtBtKBFAcZ64n+Dy7Np8b
+vKR+yy5DGQiijsH1D/j8HlGE+q4TZ8OFk7BNBFazHxFbYI4OKMiCxdKzdif1yfaa
+lWoANFlAzlSdbxeGVHoT0K+gT5w3UxwZKv2DLbCTzLZyPwIDAQABoyYwJDAPBgNV
+HRMECDAGAQH/AgEAMBEGCWCGSAGG+EIBAQQEAwIAQDANBgkqhkiG9w0BAQQFAAOB
+gQAZUIHAL4D09oE6Lv2k56Gp38OBDuILvwLg1v1KL8mQR+KFjghCrtpqaztZqcDt
+2q2QoyulCgSzHbEGmi0EsdkPfg6mp0penssIFePYNI+/8u9HT4LuKMJX15hxBam7
+dUHzICxBVC1lnHyYGjDuAMhe396lYAn8bCld1/L4NMGBCQ==
+-----END CERTIFICATE-----
+
+
+
+
+

Certificate Authorities

+By first verifying the information in a certificate request before granting +the certificate, the Certificate Authority assures the identity of the private +key owner of a key-pair. For instance, if Alice requests a personal +certificate, the Certificate Authority must first make sure that Alice really +is the person the certificate request claims. +

Certificate Chains

+A Certificate Authority may also issue a certificate for another Certificate +Authority. When examining a certificate, Alice may need to examine the +certificate of the issuer, for each parent Certificate Authority, until +reaching one which she has confidence in. She may decide to trust only +certificates with a limited chain of issuers, to reduce her risk of a "bad" +certificate in the chain. +

Creating a Root-Level CA

+As noted earlier, each certificate requires an issuer to assert the validity +of the identity of the certificate subject, up to the top-level Certificate +Authority (CA). This presents a problem: Since this is who vouches for the +certificate of the top-level authority, which has no issuer? +In this unique case, the certificate is "self-signed", so the issuer of the +certificate is the same as the subject. As a result, one must exercise extra +care in trusting a self-signed certificate. The wide publication of a public +key by the root authority reduces the risk in trusting this key -- it would be +obvious if someone else publicized a key claiming to be the authority. +Browsers are preconfigured to trust well-known certificate authorities. +

+A number of companies, such as Thawte and +VeriSign have established themselves as +Certificate Authorities. These companies provide the following services: +

    +
  • Verifying certificate requests +
  • Processing certificate requests +
  • Issuing and managing certificates +
+

+It is also possible to create your own Certificate Authority. Although risky +in the Internet environment, it may be useful within an Intranet where the +organization can easily verify the identities of individuals and servers. +

Certificate Management

+Establishing a Certificate Authority is a responsibility which requires a +solid administrative, technical, and management framework. +Certificate Authorities not only issue certificates, they also manage them -- +that is, they determine how long certificates are valid, they renew them, and +they keep lists of certificates that have already been issued but are no +longer valid (Certificate Revocation Lists, or CRLs). +Say Alice is entitled to a certificate as an employee of a company. Say too, +that the certificate needs to be revoked when Alice leaves the company. Since +certificates are objects that get passed around, it is impossible to tell from +the certificate alone that it has been revoked. +When examining certificates for validity, therefore, it is necessary to +contact the issuing Certificate Authority to check CRLs -- this is not usually +an automated part of the process. +

+

Note:
+If you use a Certificate Authority that is not configured into browsers by +default, it is necessary to load the Certificate Authority certificate into +the browser, enabling the browser to validate server certificates signed by +that Certificate Authority. Doing so may be dangerous, since once loaded, the +browser will accept all certificates signed by that Certificate Authority. +

Secure Sockets Layer (SSL)

+The Secure Sockets Layer protocol is a protocol layer which may be placed +between a reliable connection-oriented network layer protocol (e.g. TCP/IP) +and the application protocol layer (e.g. HTTP). SSL provides for secure +communication between client and server by allowing mutual authentication, the +use of digital signatures for integrity, and encryption for privacy. +

+The protocol is designed to support a range of choices for specific algorithms +used for cryptography, digests, and signatures. This allows algorithm +selection for specific servers to be made based on legal, export or other +concerns, and also enables the protocol to take advantage of new algorithms. +Choices are negotiated between client and server at the start of establishing +a protocol session. +

+

+ + + +
Table 4: Versions of the SSL protocol
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
Version:Source:Description:Browser Support:
SSL v2.0Vendor Standard (from Netscape Corp.) [SSL2]First SSL protocol for which implementations exists- NS Navigator 1.x/2.x
+ - MS IE 3.x
+ - Lynx/2.8+OpenSSL +
SSL v3.0Expired Internet Draft (from Netscape Corp.) [SSL3]Revisions to prevent specific security attacks, add non-RSA ciphers, and support for certificate chains- NS Navigator 2.x/3.x/4.x
+ - MS IE 3.x/4.x
+ - Lynx/2.8+OpenSSL +
TLS v1.0Proposed Internet Standard (from IETF) [TLS1]Revision of SSL 3.0 to update the MAC layer to HMAC, add block padding for + block ciphers, message order standardization and more alert messages. +- Lynx/2.8+OpenSSL
+
+
+
+

+There are a number of versions of the SSL protocol, as shown in Table 4. As noted there, one of the benefits in SSL 3.0 is +that it adds support of certificate chain loading. This feature allows a +server to pass a server certificate along with issuer certificates to the +browser. Chain loading also permits the browser to validate the server +certificate, even if Certificate Authority certificates are not installed for +the intermediate issuers, since they are included in the certificate chain. +SSL 3.0 is the basis for the Transport Layer Security [TLS] protocol standard, currently in development by the +Internet Engineering Task Force (IETF). +

Session Establishment

+The SSL session is established by following a handshake sequence +between client and server, as shown in Figure 1. This +sequence may vary, depending on whether the server is configured to provide a +server certificate or request a client certificate. Though cases exist where +additional handshake steps are required for management of cipher information, +this article summarizes one common scenario: see the SSL specification for the +full range of possibilities. +

+

Note
+Once an SSL session has been established it may be reused, thus avoiding the +performance penalty of repeating the many steps needed to start a session. +For this the server assigns each SSL session a unique session identifier which +is cached in the server and which the client can use on forthcoming +connections to reduce the handshake (until the session identifer expires in +the cache of the server). +

+

+ + + +
Figure 1: Simplified SSL Handshake Sequence
+ + +
+ +
+
+
+

+The elements of the handshake sequence, as used by the client and server, are +listed below: +

    +
  1. Negotiate the Cipher Suite to be used during data transfer +
  2. Establish and share a session key between client and server +
  3. Optionally authenticate the server to the client +
  4. Optionally authenticate the client to the server +
+

+The first step, Cipher Suite Negotiation, allows the client and server to +choose a Cipher Suite supportable by both of them. The SSL3.0 protocol +specification defines 31 Cipher Suites. A Cipher Suite is defined by the +following components: +

    +
  • Key Exchange Method +
  • Cipher for Data Transfer +
  • Message Digest for creating the Message Authentication Code (MAC) +
+These three elements are described in the sections that follow. +

Key Exchange Method

+The key exchange method defines how the shared secret symmetric cryptography +key used for application data transfer will be agreed upon by client and +server. SSL 2.0 uses RSA key exchange only, while SSL 3.0 supports a choice of +key exchange algorithms including the RSA key exchange when certificates are +used, and Diffie-Hellman key exchange for exchanging keys without certificates +and without prior communication between client and server. +

+One variable in the choice of key exchange methods is digital signatures -- +whether or not to use them, and if so, what kind of signatures to use. +Signing with a private key provides assurance against a +man-in-the-middle-attack during the information exchange used in generating +the shared key [AC96, p516]. +

Cipher for Data Transfer

+SSL uses the conventional cryptography algorithm (symmetric cryptography) +described earlier for encrypting messages in a session. There are nine +choices, including the choice to perform no encryption: +
    +
  • No encryption +
  • Stream Ciphers +
      +
    • RC4 with 40-bit keys +
    • RC4 with 128-bit keys +
    +
  • CBC Block Ciphers +
      +
    • RC2 with 40 bit key +
    • DES with 40 bit key +
    • DES with 56 bit key +
    • Triple-DES with 168 bit key +
    • Idea (128 bit key) +
    • Fortezza (96 bit key) +
    +
+Here "CBC" refers to Cipher Block Chaining, which means that a portion of the +previously encrypted cipher text is used in the encryption of the current +block. "DES" refers to the Data Encryption Standard [AC96, +ch12], which has a number of variants (including DES40 and 3DES_EDE). "Idea" +is one of the best and cryptographically strongest available algorithms, and +"RC2" is a proprietary algorithm from RSA DSI [AC96, +ch13]. +

Digest Function

+The choice of digest function determines how a digest is created from a record +unit. SSL supports the following: +
    +
  • No digest (Null choice) +
  • MD5, a 128-bit hash +
  • Secure Hash Algorithm (SHA-1), a 160-bit hash +
+The message digest is used to create a Message Authentication Code (MAC) which +is encrypted with the message to provide integrity and to prevent against +replay attacks. +

Handshake Sequence Protocol

+The handshake sequence uses three protocols: +
    +
  • The SSL Handshake Protocol + for performing the client and server SSL session establishment. +
  • The SSL Change Cipher Spec Protocol for actually establishing agreement + on the Cipher Suite for the session. +
  • The SSL Alert Protocol for + conveying SSL error messages between client and server. +
+These protocols, as well as application protocol data, are encapsulated in the +SSL Record Protocol, as shown in Figure 2. An +encapsulated protocol is transferred as data by the lower layer protocol, +which does not examine the data. The encapsulated protocol has no knowledge of +the underlying protocol. +

+

+ + + +
Figure 2: SSL Protocol Stack
+ + +
+ +
+
+
+

+The encapsulation of SSL control protocols by the record protocol means that +if an active session is renegotiated the control protocols will be transmitted +securely. If there were no session before, then the Null cipher suite is +used, which means there is no encryption and messages have no integrity +digests until the session has been established. +

Data Transfer

+The SSL Record Protocol, shown in Figure 3, is used to +transfer application and SSL Control data between the client and server, +possibly fragmenting this data into smaller units, or combining multiple +higher level protocol data messages into single units. It may compress, attach +digest signatures, and encrypt these units before transmitting them using the +underlying reliable transport protocol (Note: currently all major SSL +implementations lack support for compression). +

+

+ + + +
Figure 3: SSL Record Protocol
+ + +
+ +
+
+
+

Securing HTTP Communication

+One common use of SSL is to secure Web HTTP communication between a browser +and a webserver. This case does not preclude the use of non-secured HTTP. The +secure version is mainly plain HTTP over SSL (named HTTPS), but with one major +difference: it uses the URL scheme https rather than +http and a different server port (by default 443). This mainly +is what mod_ssl provides to you for the Apache webserver... +

References

+ +

+
+ + + + + + + + + + +
+ + + + + +
+previous page
Overview +
+next page
Reference +
+
+ + + + +
+ mod_ssl 2.8, User Manual
+ The Apache Interface to OpenSSL +
+
+ Copyright © 1998-2001 + Ralf S. Engelschall
+ All Rights Reserved
+
+
+
+

+
+ + diff --git a/docs/manual/ssl/ssl_intro_fig1.gif b/docs/manual/ssl/ssl_intro_fig1.gif new file mode 100644 index 00000000000..3c209864f19 Binary files /dev/null and b/docs/manual/ssl/ssl_intro_fig1.gif differ diff --git a/docs/manual/ssl/ssl_intro_fig2.gif b/docs/manual/ssl/ssl_intro_fig2.gif new file mode 100644 index 00000000000..26b295a67b0 Binary files /dev/null and b/docs/manual/ssl/ssl_intro_fig2.gif differ diff --git a/docs/manual/ssl/ssl_intro_fig3.gif b/docs/manual/ssl/ssl_intro_fig3.gif new file mode 100644 index 00000000000..00a975b5a4e Binary files /dev/null and b/docs/manual/ssl/ssl_intro_fig3.gif differ diff --git a/docs/manual/style/modulesynopsis.dtd b/docs/manual/style/modulesynopsis.dtd new file mode 100644 index 00000000000..65b3c30a762 --- /dev/null +++ b/docs/manual/style/modulesynopsis.dtd @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/NWGNUmakefile b/modules/NWGNUmakefile new file mode 100644 index 00000000000..ca36291d9e6 --- /dev/null +++ b/modules/NWGNUmakefile @@ -0,0 +1,35 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + aaa \ + dav\main \ + dav\fs \ + echo \ + generators \ + mappers \ + metadata \ + proxy \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(AP_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +ifeq "$(wildcard NWGNUmakefile.mak)" "NWGNUmakefile.mak" +include NWGNUmakefile.mak +endif + +# +# You can use this target if all that is needed is to copy files to the +# installation area +# +install :: nlms FORCE + diff --git a/modules/aaa/NWGNUmakefile b/modules/aaa/NWGNUmakefile new file mode 100644 index 00000000000..fc72c7355e4 --- /dev/null +++ b/modules/aaa/NWGNUmakefile @@ -0,0 +1,246 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(AP_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/authanon.nlm \ + $(OBJDIR)/authdbm.nlm \ + $(OBJDIR)/digest.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/arch/netware/libprews.c b/modules/arch/netware/libprews.c new file mode 100644 index 00000000000..efa475fc697 --- /dev/null +++ b/modules/arch/netware/libprews.c @@ -0,0 +1,54 @@ +/*------------------------------------------------------------------ + These functions are to be called when the shared NLM starts and + stops. By using these functions instead of defining a main() + and calling ExitThread(TSR_THREAD, 0), the load time of the + shared NLM is faster and memory size reduced. + + You may also want to override these in your own Apache module + to do any cleanup other than the mechanism Apache modules + provide. +------------------------------------------------------------------*/ +#include +//#include "stddef.h" +#include "ws2nlm.h" + +int _NonAppStart +( + void *NLMHandle, + void *errorScreen, + const char *cmdLine, + const char *loadDirPath, + size_t uninitializedDataLength, + void *NLMFileHandle, + int (*readRoutineP)( int conn, void *fileHandle, size_t offset, + size_t nbytes, size_t *bytesRead, void *buffer ), + size_t customDataOffset, + size_t customDataSize, + int messageCount, + const char **messages +) +{ +#pragma unused(cmdLine) +#pragma unused(loadDirPath) +#pragma unused(uninitializedDataLength) +#pragma unused(NLMFileHandle) +#pragma unused(readRoutineP) +#pragma unused(customDataOffset) +#pragma unused(customDataSize) +#pragma unused(messageCount) +#pragma unused(messages) + + WSADATA wsaData; + + return WSAStartup((WORD) MAKEWORD(2, 0), &wsaData); +} + +void _NonAppStop( void ) +{ + WSACleanup(); +} + +int _NonAppCheckUnload( void ) +{ + return 0; +} diff --git a/modules/arch/netware/mod_auth_digest.def b/modules/arch/netware/mod_auth_digest.def new file mode 100644 index 00000000000..6a3aa085d21 --- /dev/null +++ b/modules/arch/netware/mod_auth_digest.def @@ -0,0 +1 @@ +EXPORT auth_digest_module diff --git a/modules/arch/netware/mod_cache.def b/modules/arch/netware/mod_cache.def new file mode 100644 index 00000000000..c7ab6ca4e95 --- /dev/null +++ b/modules/arch/netware/mod_cache.def @@ -0,0 +1,6 @@ +EXPORT cache_module +EXPORT cache_hook_create_entity +EXPORT cache_hook_open_entity +EXPORT cache_hook_remove_url + + diff --git a/modules/arch/netware/mod_cern_meta.def b/modules/arch/netware/mod_cern_meta.def new file mode 100644 index 00000000000..5638325bbda --- /dev/null +++ b/modules/arch/netware/mod_cern_meta.def @@ -0,0 +1 @@ +EXPORT cern_meta_module diff --git a/modules/arch/netware/mod_dav.def b/modules/arch/netware/mod_dav.def new file mode 100644 index 00000000000..fb56c92fc67 --- /dev/null +++ b/modules/arch/netware/mod_dav.def @@ -0,0 +1,3 @@ +EXPORT dav_module +EXPORT @dav.imp + diff --git a/modules/arch/netware/mod_echo.def b/modules/arch/netware/mod_echo.def new file mode 100644 index 00000000000..694135a52c1 --- /dev/null +++ b/modules/arch/netware/mod_echo.def @@ -0,0 +1,2 @@ +EXPORT echo_module + diff --git a/modules/arch/netware/mod_expires.def b/modules/arch/netware/mod_expires.def new file mode 100644 index 00000000000..bc416630b0a --- /dev/null +++ b/modules/arch/netware/mod_expires.def @@ -0,0 +1 @@ +EXPORT expires_module diff --git a/modules/arch/netware/mod_file_cache.def b/modules/arch/netware/mod_file_cache.def new file mode 100644 index 00000000000..8ab98cfb22d --- /dev/null +++ b/modules/arch/netware/mod_file_cache.def @@ -0,0 +1,2 @@ +EXPORT file_cache_module + diff --git a/modules/arch/netware/mod_headers.def b/modules/arch/netware/mod_headers.def new file mode 100644 index 00000000000..2fe35a858b3 --- /dev/null +++ b/modules/arch/netware/mod_headers.def @@ -0,0 +1 @@ +EXPORT headers_module diff --git a/modules/arch/netware/mod_info.def b/modules/arch/netware/mod_info.def new file mode 100644 index 00000000000..ce71cb37cf0 --- /dev/null +++ b/modules/arch/netware/mod_info.def @@ -0,0 +1 @@ +EXPORT info_module diff --git a/modules/arch/netware/mod_mem_cache.def b/modules/arch/netware/mod_mem_cache.def new file mode 100644 index 00000000000..ce8b67a5ca4 --- /dev/null +++ b/modules/arch/netware/mod_mem_cache.def @@ -0,0 +1,5 @@ +IMPORT cache_hook_create_entity +IMPORT cache_hook_open_entity +IMPORT cache_hook_remove_url +EXPORT mem_cache_module + diff --git a/modules/arch/netware/mod_mime_magic.def b/modules/arch/netware/mod_mime_magic.def new file mode 100644 index 00000000000..95307476de8 --- /dev/null +++ b/modules/arch/netware/mod_mime_magic.def @@ -0,0 +1 @@ +EXPORT mime_magic_module diff --git a/modules/arch/netware/mod_nw_ssl.c b/modules/arch/netware/mod_nw_ssl.c new file mode 100644 index 00000000000..c29d6bda31e --- /dev/null +++ b/modules/arch/netware/mod_nw_ssl.c @@ -0,0 +1,462 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +/* + * mod_tls.c - Apache SSL/TLS module for NetWare by Mike Gardiner. + * + * This module gives Apache the ability to do SSL/TLS with a minimum amount + * of effort. All of the SSL/TLS logic is already on NetWare versions 5 and + * above and is interfaced through WinSock on NetWare. As you can see in + * the code below SSL/TLS sockets can be created with three WinSock calls. + * + * To load, simply place the module in the modules directory under the main + * apache tree. Then add a "SecureListen" with two arguments. The first + * argument is an address and/or port. The second argument is the key pair + * name as created in ConsoleOne. + * + * Examples: + * + * SecureListen 443 "SSL CertificateIP" + * SecureListen 123.45.67.89:443 mycert + */ + +#define WS_SSL + +#define MAX_ADDRESS 512 +#define MAX_KEY 80 + + +#include "httpd.h" +#include "http_config.h" +#include "http_log.h" +#include "ap_listen.h" +#include "apr_strings.h" + +module AP_MODULE_DECLARE_DATA nwssl_module; + +typedef struct NWSSLSrvConfigRec NWSSLSrvConfigRec; +typedef struct seclisten_rec seclisten_rec; + +struct seclisten_rec { + seclisten_rec *next; + struct sockaddr_in local_addr; /* local IP address and port */ + int fd; + int used; /* Only used during restart */ + char key[MAX_KEY]; + int mutual; + char *addr; + int port; +}; + +struct NWSSLSrvConfigRec { + apr_table_t *sltable; +}; + +static seclisten_rec* ap_seclisteners = NULL; + +#define get_nwssl_cfg(srv) (NWSSLSrvConfigRec *) ap_get_module_config(srv->module_config, &nwssl_module) + +/* + * Parses a host of the form
[:port] + * :port is permitted if 'port' is not NULL + */ +static unsigned long parse_addr(const char *w, unsigned short *ports) +{ + struct hostent *hep; + unsigned long my_addr; + char *p; + + p = strchr(w, ':'); + if (ports != NULL) { + *ports = 0; + if (p != NULL && strcmp(p + 1, "*") != 0) + *ports = atoi(p + 1); + } + + if (p != NULL) + *p = '\0'; + if (strcmp(w, "*") == 0) { + if (p != NULL) + *p = ':'; + return htonl(INADDR_ANY); + } + + my_addr = apr_inet_addr((char *)w); + if (my_addr != INADDR_NONE) { + if (p != NULL) + *p = ':'; + return my_addr; + } + + hep = gethostbyname(w); + + if ((!hep) || (hep->h_addrtype != AF_INET || !hep->h_addr_list[0])) { + fprintf(stderr, "Cannot resolve host name %s --- exiting!\n", w); + exit(1); + } + + if (hep->h_addr_list[1]) { + fprintf(stderr, "Host %s has multiple addresses ---\n", w); + fprintf(stderr, "you must choose one explicitly for use as\n"); + fprintf(stderr, "a secure port. Exiting!!!\n"); + exit(1); + } + + if (p != NULL) + *p = ':'; + + return ((struct in_addr *) (hep->h_addr))->s_addr; +} + +static int find_secure_listener(seclisten_rec *lr) +{ + seclisten_rec *sl; + + for (sl = ap_seclisteners; sl; sl = sl->next) { + if (!memcmp(&sl->local_addr, &lr->local_addr, sizeof(sl->local_addr))) { + sl->used = 1; + return sl->fd; + } + } + return -1; +} + + +static int make_secure_socket(apr_pool_t *pconf, const struct sockaddr_in *server, + char* key, int mutual, server_rec *server_conf) +{ + int s; + int one = 1; + char addr[MAX_ADDRESS]; + struct sslserveropts opts; + unsigned int optParam; + WSAPROTOCOL_INFO SecureProtoInfo; + int no = 1; + + if (server->sin_addr.s_addr != htonl(INADDR_ANY)) + apr_snprintf(addr, sizeof(addr), "address %s port %d", + inet_ntoa(server->sin_addr), ntohs(server->sin_port)); + else + apr_snprintf(addr, sizeof(addr), "port %d", ntohs(server->sin_port)); + + /* note that because we're about to slack we don't use psocket */ + memset(&SecureProtoInfo, 0, sizeof(WSAPROTOCOL_INFO)); + + SecureProtoInfo.iAddressFamily = AF_INET; + SecureProtoInfo.iSocketType = SOCK_STREAM; + SecureProtoInfo.iProtocol = IPPROTO_TCP; + SecureProtoInfo.iSecurityScheme = SECURITY_PROTOCOL_SSL; + + s = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, + (LPWSAPROTOCOL_INFO)&SecureProtoInfo, 0, 0); + + if (s == INVALID_SOCKET) { + errno = WSAGetLastError(); + ap_log_error(APLOG_MARK, APLOG_CRIT, errno, server_conf, + "make_secure_socket: failed to get a socket for %s", addr); + return -1; + } + + if (!mutual) { + optParam = SO_SSL_ENABLE | SO_SSL_SERVER; + + if (WSAIoctl(s, SO_SSL_SET_FLAGS, (char *)&optParam, + sizeof(optParam), NULL, 0, NULL, NULL, NULL)) { + errno = WSAGetLastError(); + ap_log_error(APLOG_MARK, APLOG_CRIT, errno, server_conf, + "make_secure_socket: for %s, WSAIoctl: (SO_SSL_SET_FLAGS)", addr); + return -1; + } + } + + opts.cert = key; + opts.certlen = strlen(key); + opts.sidtimeout = 0; + opts.sidentries = 0; + opts.siddir = NULL; + + if (WSAIoctl(s, SO_SSL_SET_SERVER, (char *)&opts, sizeof(opts), + NULL, 0, NULL, NULL, NULL) != 0) { + errno = WSAGetLastError(); + ap_log_error(APLOG_MARK, APLOG_CRIT, errno, server_conf, + "make_secure_socket: for %s, WSAIoctl: (SO_SSL_SET_SERVER)", addr); + return -1; + } + + if (mutual) { + optParam = 0x07; // SO_SSL_AUTH_CLIENT + + if(WSAIoctl(s, SO_SSL_SET_FLAGS, (char*)&optParam, + sizeof(optParam), NULL, 0, NULL, NULL, NULL)) { + errno = WSAGetLastError(); + ap_log_error( APLOG_MARK, APLOG_CRIT, errno, server_conf, + "make_secure_socket: for %s, WSAIoctl: (SO_SSL_SET_FLAGS)", addr ); + return -1; + } + } + + return s; +} + +static const char *set_secure_listener(cmd_parms *cmd, void *dummy, + const char *ips, const char* key, + const char* mutual) +{ + NWSSLSrvConfigRec* sc = get_nwssl_cfg(cmd->server); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); + char *ports, *addr; + unsigned short port; + seclisten_rec *new; + + + if (err != NULL) + return err; + + ports = strchr(ips, ':'); + + if (ports != NULL) { + if (ports == ips) + return "Missing IP address"; + else if (ports[1] == '\0') + return "Address must end in :"; + + *(ports++) = '\0'; + } + else { + ports = (char*)ips; + } + + new = apr_pcalloc(cmd->pool, sizeof(seclisten_rec)); + new->local_addr.sin_family = AF_INET; + + if (ports == ips) { + new->local_addr.sin_addr.s_addr = htonl(INADDR_ANY); + addr = apr_pstrdup(cmd->pool, "0.0.0.0"); + } + else { + new->local_addr.sin_addr.s_addr = parse_addr(ips, NULL); + addr = apr_pstrdup(cmd->pool, ips); + } + + port = atoi(ports); + + if (!port) + return "Port must be numeric"; + + apr_table_set(sc->sltable, ports, "T"); + + new->local_addr.sin_port = htons(port); + new->fd = -1; + new->used = 0; + new->next = ap_seclisteners; + strcpy(new->key, key); + new->mutual = (mutual) ? 1 : 0; + new->addr = addr; + new->port = port; + ap_seclisteners = new; + return NULL; +} + +static apr_status_t nwssl_socket_cleanup(void *data) +{ + ap_listen_rec* slr = (ap_listen_rec*)data; + ap_listen_rec* lr; + + /* Remove our secure listener from the listener list */ + for (lr = ap_listeners; lr; lr = lr->next) { + /* slr is at the head of the list */ + if (lr == slr) { + ap_listeners = slr->next; + break; + } + /* slr is somewhere in between or at the end*/ + if (lr->next == slr) { + lr->next = slr->next; + break; + } + } + return APR_SUCCESS; +} + +static void nwssl_pre_config(apr_pool_t *pconf, apr_pool_t *plog, + apr_pool_t *ptemp) +{ + ap_seclisteners = NULL; +} + +static void nwssl_post_config(apr_pool_t *pconf, apr_pool_t *plog, + apr_pool_t *ptemp, server_rec *s) +{ + seclisten_rec* sl; + ap_listen_rec* lr; + apr_socket_t* sd; + apr_status_t status; + + for (sl = ap_seclisteners; sl != NULL; sl = sl->next) { + sl->fd = find_secure_listener(sl); + + if (sl->fd < 0) + sl->fd = make_secure_socket(pconf, &sl->local_addr, sl->key, sl->mutual, s); + + if (sl->fd >= 0) { + apr_os_sock_info_t sock_info; + + sock_info.os_sock = &(sl->fd); + sock_info.local = (struct sockaddr*)&(sl->local_addr); + sock_info.remote = NULL; + sock_info.family = APR_INET; + sock_info.type = SOCK_STREAM; + + apr_os_sock_make(&sd, &sock_info, pconf); + + lr = apr_pcalloc(pconf, sizeof(ap_listen_rec)); + + if (lr) { + lr->sd = sd; + if ((status = apr_sockaddr_info_get(&lr->bind_addr, sl->addr, APR_UNSPEC, sl->port, 0, + pconf)) != APR_SUCCESS) { + ap_log_perror(APLOG_MARK, APLOG_CRIT, status, pconf, + "alloc_listener: failed to set up sockaddr for %s:%d", sl->addr, sl->port); + exit(1); + } + lr->next = ap_listeners; + ap_listeners = lr; + apr_pool_cleanup_register(pconf, lr, nwssl_socket_cleanup, apr_pool_cleanup_null); + } + } else { + exit(1); + } + } +} + +static void *nwssl_config_server_create(apr_pool_t *p, server_rec *s) +{ + NWSSLSrvConfigRec *new = apr_palloc(p, sizeof(NWSSLSrvConfigRec)); + new->sltable = apr_table_make(p, 5); + return new; +} + +static void *nwssl_config_server_merge(apr_pool_t *p, void *basev, void *addv) +{ + NWSSLSrvConfigRec *base = (NWSSLSrvConfigRec *)basev; + NWSSLSrvConfigRec *add = (NWSSLSrvConfigRec *)addv; + NWSSLSrvConfigRec *merged = (NWSSLSrvConfigRec *)apr_palloc(p, sizeof(NWSSLSrvConfigRec)); + return merged; +} + +static int isSecure (const request_rec *r) +{ + NWSSLSrvConfigRec *sc = get_nwssl_cfg(r->server); + const char *s_secure = NULL; + char port[8]; + int ret = 0; + + itoa(((r->connection)->local_addr)->port, port, 10); + s_secure = apr_table_get(sc->sltable, port); + if (s_secure) + ret = 1; + + return ret; +} + +static int nwssl_hook_Fixup(request_rec *r) +{ + apr_table_t *e = r->subprocess_env; + if (!isSecure(r)) + return DECLINED; + + apr_table_set(e, "HTTPS", "on"); + + return DECLINED; +} + +static const char *nwssl_hook_http_method (const request_rec *r) +{ + if (isSecure(r)) + return "https"; + + return NULL; +} + +static const command_rec nwssl_module_cmds[] = +{ + AP_INIT_TAKE23("SecureListen", set_secure_listener, NULL, RSRC_CONF, + "specify an address and/or port with a key pair name.\n" + "Optional third parameter of MUTUAL configures the port for mutual authentication."), + {NULL} +}; + +static void register_hooks(apr_pool_t *p) +{ + ap_hook_pre_config(nwssl_pre_config, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_post_config(nwssl_post_config, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_fixups(nwssl_hook_Fixup, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_http_method(nwssl_hook_http_method, NULL,NULL, APR_HOOK_MIDDLE); +} + +module AP_MODULE_DECLARE_DATA nwssl_module = +{ + STANDARD20_MODULE_STUFF, + NULL, /* dir config creater */ + NULL, /* dir merger --- default is to override */ + nwssl_config_server_create, /* server config */ + nwssl_config_server_merge, /* merge server config */ + nwssl_module_cmds, /* command apr_table_t */ + register_hooks +}; + diff --git a/modules/arch/netware/mod_proxy.def b/modules/arch/netware/mod_proxy.def new file mode 100644 index 00000000000..6e51eedb50d --- /dev/null +++ b/modules/arch/netware/mod_proxy.def @@ -0,0 +1 @@ +EXPORT proxy_module diff --git a/modules/arch/netware/mod_rewrite.def b/modules/arch/netware/mod_rewrite.def new file mode 100644 index 00000000000..cfdcf6b1326 --- /dev/null +++ b/modules/arch/netware/mod_rewrite.def @@ -0,0 +1 @@ +EXPORT rewrite_module diff --git a/modules/arch/netware/mod_speling.def b/modules/arch/netware/mod_speling.def new file mode 100644 index 00000000000..3d45a6aa1ab --- /dev/null +++ b/modules/arch/netware/mod_speling.def @@ -0,0 +1 @@ +EXPORT speling_module diff --git a/modules/arch/netware/mod_status.def b/modules/arch/netware/mod_status.def new file mode 100644 index 00000000000..9a5a32d46cf --- /dev/null +++ b/modules/arch/netware/mod_status.def @@ -0,0 +1,2 @@ +EXPORT status_module + diff --git a/modules/arch/netware/mod_unique_id.def b/modules/arch/netware/mod_unique_id.def new file mode 100644 index 00000000000..0b72c1ecc04 --- /dev/null +++ b/modules/arch/netware/mod_unique_id.def @@ -0,0 +1 @@ +EXPORT unique_id_module diff --git a/modules/arch/netware/mod_usertrack.def b/modules/arch/netware/mod_usertrack.def new file mode 100644 index 00000000000..7264c41ecff --- /dev/null +++ b/modules/arch/netware/mod_usertrack.def @@ -0,0 +1 @@ +EXPORT usertrack_module diff --git a/modules/arch/netware/mod_vhost_alias.def b/modules/arch/netware/mod_vhost_alias.def new file mode 100644 index 00000000000..574b85f9873 --- /dev/null +++ b/modules/arch/netware/mod_vhost_alias.def @@ -0,0 +1,2 @@ +EXPORT vhost_alias_module + diff --git a/modules/arch/netware/moddavfs.def b/modules/arch/netware/moddavfs.def new file mode 100644 index 00000000000..67ec311758d --- /dev/null +++ b/modules/arch/netware/moddavfs.def @@ -0,0 +1 @@ +EXPORT dav_fs_module diff --git a/modules/arch/win32/.cvsignore b/modules/arch/win32/.cvsignore new file mode 100644 index 00000000000..14ac4568b5c --- /dev/null +++ b/modules/arch/win32/.cvsignore @@ -0,0 +1,4 @@ +Debug +Release +*.mak +*.rc diff --git a/modules/arch/win32/mod_isapi.dsp b/modules/arch/win32/mod_isapi.dsp new file mode 100644 index 00000000000..bf9fb802fa6 --- /dev/null +++ b/modules/arch/win32/mod_isapi.dsp @@ -0,0 +1,128 @@ +# Microsoft Developer Studio Project File - Name="mod_isapi" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_isapi - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_isapi.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_isapi.mak" CFG="mod_isapi - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_isapi - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_isapi - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_isapi - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../../include" /I "../../../srclib/apr/include" /I "../../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_isapi" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_isapi.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_isapi +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_isapi.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_isapi + +!ELSEIF "$(CFG)" == "mod_isapi - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../../include" /I "../../../srclib/apr/include" /I "../../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_isapi" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_isapi.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_isapi +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/mod_isapi.so" /base:@..\..\..\os\win32\BaseAddr.ref,mod_isapi + +!ENDIF + +# Begin Target + +# Name "mod_isapi - Win32 Release" +# Name "mod_isapi - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_isapi.c +# End Source File +# Begin Source File + +SOURCE=.\mod_isapi.rc +# End Source File +# Begin Source File + +SOURCE=..\..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_isapi - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\..\build\win32\win32ver.awk + +".\mod_isapi.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../../build/win32/win32ver.awk mod_isapi "isapi_module for Apache" ../../../include/ap_release.h > .\mod_isapi.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_isapi - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\..\build\win32\win32ver.awk + +".\mod_isapi.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../../build/win32/win32ver.awk mod_isapi "isapi_module for Apache" ../../../include/ap_release.h > .\mod_isapi.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/arch/win32/mod_win32.c b/modules/arch/win32/mod_win32.c new file mode 100644 index 00000000000..77fb0cdec0e --- /dev/null +++ b/modules/arch/win32/mod_win32.c @@ -0,0 +1,510 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + + +#include "apr_strings.h" +#include "apr_portable.h" +#include "apr_buckets.h" +#include "ap_config.h" +#include "httpd.h" +#include "http_config.h" +#include "http_core.h" +#include "http_protocol.h" +#include "http_request.h" +#include "http_log.h" +#include "util_script.h" +#include "mod_core.h" +#include "apr_optional.h" +#include "apr_lib.h" + +#ifdef WIN32 + +/* + * CGI Script stuff for Win32... + */ +typedef enum { eFileTypeUNKNOWN, eFileTypeBIN, eFileTypeEXE16, eFileTypeEXE32, + eFileTypeSCRIPT } file_type_e; +typedef enum { INTERPRETER_SOURCE_UNSET, INTERPRETER_SOURCE_REGISTRY_STRICT, + INTERPRETER_SOURCE_REGISTRY, INTERPRETER_SOURCE_SHEBANG + } interpreter_source_e; +AP_DECLARE(file_type_e) ap_get_win32_interpreter(const request_rec *, + char **interpreter, + char **arguments); + +module AP_MODULE_DECLARE_DATA win32_module; + +typedef struct { + /* Where to find interpreter to run scripts */ + interpreter_source_e script_interpreter_source; +} win32_dir_conf; + +static void *create_win32_dir_config(apr_pool_t *p, char *dir) +{ + win32_dir_conf *conf = (win32_dir_conf*)apr_palloc(p, sizeof(win32_dir_conf)); + conf->script_interpreter_source = INTERPRETER_SOURCE_UNSET; + return conf; +} + +static void *merge_win32_dir_configs(apr_pool_t *p, void *basev, void *addv) +{ + win32_dir_conf *new = (win32_dir_conf *) apr_pcalloc(p, sizeof(win32_dir_conf)); + win32_dir_conf *base = (win32_dir_conf *) basev; + win32_dir_conf *add = (win32_dir_conf *) addv; + + new->script_interpreter_source = (add->script_interpreter_source + != INTERPRETER_SOURCE_UNSET) + ? add->script_interpreter_source + : base->script_interpreter_source; + return new; +} + +static const char *set_interpreter_source(cmd_parms *cmd, void *dv, + char *arg) +{ + win32_dir_conf *d = (win32_dir_conf *)dv; + if (!strcasecmp(arg, "registry")) { + d->script_interpreter_source = INTERPRETER_SOURCE_REGISTRY; + } else if (!strcasecmp(arg, "registry-strict")) { + d->script_interpreter_source = INTERPRETER_SOURCE_REGISTRY_STRICT; + } else if (!strcasecmp(arg, "script")) { + d->script_interpreter_source = INTERPRETER_SOURCE_SHEBANG; + } else { + return apr_pstrcat(cmd->temp_pool, "ScriptInterpreterSource \"", arg, + "\" must be \"registry\", \"registry-strict\" or " + "\"script\"", NULL); + } + return NULL; +} + +/* Pretty unexciting ... yank a registry value, and explode any envvars + * that the system has configured (e.g. %SystemRoot%/someapp.exe) + * + * XXX: Need Unicode versions for i18n + */ +static apr_status_t get_win32_registry_default_value(apr_pool_t *p, HKEY hkey, + char* relativepath, + char **value) +{ + HKEY hkeyOpen; + DWORD type; + DWORD size = 0; + DWORD result = RegOpenKeyEx(hkey, relativepath, 0, + KEY_QUERY_VALUE, &hkeyOpen); + + if (result != ERROR_SUCCESS) + return APR_FROM_OS_ERROR(result); + + /* Read to NULL buffer to determine value size */ + result = RegQueryValueEx(hkeyOpen, "", 0, &type, NULL, &size); + + if (result == ERROR_SUCCESS) { + if ((size < 2) || (type != REG_SZ && type != REG_EXPAND_SZ)) { + result = ERROR_INVALID_PARAMETER; + } + else { + *value = apr_palloc(p, size); + /* Read value based on size query above */ + result = RegQueryValueEx(hkeyOpen, "", 0, &type, *value, &size); + } + } + + /* TODO: This might look fine, but we need to provide some warning + * somewhere that some environment variables may -not- be translated, + * seeing as we may have chopped the environment table down somewhat. + */ + if ((result == ERROR_SUCCESS) && (type == REG_EXPAND_SZ)) + { + char *tmp = *value; + size = ExpandEnvironmentStrings(tmp, *value, 0); + if (size) { + *value = apr_palloc(p, size); + size = ExpandEnvironmentStrings(tmp, *value, size); + } + } + + RegCloseKey(hkeyOpen); + return APR_FROM_OS_ERROR(result); +} + +/* Somewhat more exciting ... figure out where the registry has stashed the + * ExecCGI or Open command - it may be nested one level deep (or more???) + */ +static char* get_interpreter_from_win32_registry(apr_pool_t *p, + const char* ext, + int strict) +{ + char execcgi_path[] = "SHELL\\EXECCGI\\COMMAND"; + char execopen_path[] = "SHELL\\OPEN\\COMMAND"; + char typeName[MAX_PATH]; + int cmdOfName = FALSE; + HKEY hkeyName; + HKEY hkeyType; + DWORD type; + int size; + int result; + char *buffer; + + if (!ext) + return NULL; + /* + * Future optimization: + * When the registry is successfully searched, store the strings for + * interpreter and arguments in an ext hash to speed up subsequent look-ups + */ + + /* Open the key associated with the script filetype extension */ + result = RegOpenKeyEx(HKEY_CLASSES_ROOT, ext, 0, KEY_QUERY_VALUE, + &hkeyType); + + if (result != ERROR_SUCCESS) + return NULL; + + /* Retrieve the name of the script filetype extension */ + size = sizeof(typeName); + result = RegQueryValueEx(hkeyType, "", NULL, &type, typeName, &size); + + if (result == ERROR_SUCCESS && type == REG_SZ && typeName[0]) { + /* Open the key associated with the script filetype extension */ + result = RegOpenKeyEx(HKEY_CLASSES_ROOT, typeName, 0, + KEY_QUERY_VALUE, &hkeyName); + + if (result == ERROR_SUCCESS) + cmdOfName = TRUE; + } + + /* Open the key for the script command path by: + * + * 1) the 'named' filetype key for ExecCGI/Command + * 2) the extension's type key for ExecCGI/Command + * + * and if the strict arg is false, then continue trying: + * + * 3) the 'named' filetype key for Open/Command + * 4) the extension's type key for Open/Command + */ + + if (cmdOfName) { + result = get_win32_registry_default_value(p, hkeyName, + execcgi_path, &buffer); + } + + if (!cmdOfName || (result != ERROR_SUCCESS)) { + result = get_win32_registry_default_value(p, hkeyType, + execcgi_path, &buffer); + } + + if (!strict && cmdOfName && (result != ERROR_SUCCESS)) { + result = get_win32_registry_default_value(p, hkeyName, + execopen_path, &buffer); + } + + if (!strict && (result != ERROR_SUCCESS)) { + result = get_win32_registry_default_value(p, hkeyType, + execopen_path, &buffer); + } + + if (cmdOfName) + RegCloseKey(hkeyName); + + RegCloseKey(hkeyType); + + if (result != ERROR_SUCCESS || !buffer[0]) + return NULL; + + return buffer; +} + + +static apr_array_header_t *split_argv(apr_pool_t *p, const char *interp, const char *cgiprg, const char *cgiargs) +{ + apr_array_header_t *args = apr_array_make(p, 8, sizeof(char*)); + char *d = apr_palloc(p, strlen(interp)); + const char *ch = interp; + const char **arg; + int prgtaken = 0; + int argtaken = 0; + int inquo; + int sl; + + while (*ch) { + /* Skip on through Deep Space */ + if (isspace(*ch)) { + ++ch; continue; + } + /* One Arg */ + if (((*ch == '$') || (*ch == '%')) && (*(ch + 1) == '*')) { + const char *cgiarg = cgiargs; + argtaken = 1; + for (;;) { + char *w = ap_getword_nulls(p, &cgiarg, '+'); + if (!*w) + break; + ap_unescape_url(w); + arg = (const char**)apr_array_push(args); + *arg = ap_escape_shell_cmd(p, w); + } + ch += 2; + continue; + } + if (((*ch == '$') || (*ch == '%')) && (*(ch + 1) == '1')) { + prgtaken = 1; + arg = (const char**)apr_array_push(args); + *arg = cgiprg; + ch += 2; + continue; + } + if ((*ch == '\"') && ((*(ch + 1) == '$') + || (*(ch + 1) == '%')) && (*(ch + 2) == '1') + && (*(ch + 3) == '\"')) { + prgtaken = 1; + arg = (const char**)apr_array_push(args); + *arg = cgiprg; + ch += 4; + continue; + } + arg = (const char**)apr_array_push(args); + *arg = d; + inquo = 0; + while (*ch) { + if (isspace(*ch) && !inquo) { + ++ch; break; + } + /* Get 'em backslashes */ + for (sl = 0; *ch == '\\'; ++sl) + *d++ = *ch++; + if (sl & 1) { + /* last unmatched '\' + '"' sequence is a '"' */ + if (*ch == '\"') + *(d - 1) = *ch++; + continue; + } + if (*ch == '\"') { + /* '""' sequence within quotes is a '"' */ + if (*++ch == '\"' && inquo) { + *d++ = *ch++; continue; + } + /* Flip quote state */ + inquo = !inquo; + if (isspace(*ch) && !inquo) { + ++ch; break; + } + /* All other '"'s are Munched */ + continue; + } + /* Anything else is, well, something else */ + *d++ = *ch++; + } + /* Term that arg, already pushed on args */ + *d++ = '\0'; + } + + if (!prgtaken) { + arg = (const char**)apr_array_push(args); + *arg = cgiprg; + } + + if (!argtaken) { + char *cgiargs = cgiarg; + for (;;) { + char *w = ap_getword_nulls(p, &cgiargs, '+'); + if (!*w) + break; + ap_unescape_url(w); + arg = (const char**)apr_array_push(args); + *arg = ap_escape_shell_cmd(p, w); + } + } + + arg = (const char**)apr_array_push(args); + *arg = NULL; + + return args; +} + + +static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv, + request_rec *r, apr_pool_t *p) +{ + const char *ext = NULL; + const char *interpreter = NULL; + win32_dir_conf *d = + (win32_dir_conf *)ap_get_module_config(r->per_dir_config, + &win32_module); + apr_file_t *fh; + const char *args = r->args; + + /* Handle the complete file name, we DON'T want to follow suexec, since + * an unrooted command is as predictable as shooting craps in Win32. + * + * Notice that unlike most mime extension parsing, we have to use the + * win32 parsing here, therefore the final extension is the only one + * we will consider + */ + ext = strrchr(apr_filename_of_pathname(r->filename), '.'); + if (ext) + ++ext; + + /* If the file has an extension and it is not .com and not .exe and + * we've been instructed to search the registry, then do so. + */ + if (ext && (!strcasecmp(ext,".exe") || !strcasecmp(ext,".com") + || !strcasecmp(ext,".bat") || !strcasecmp(ext,".cmd"))) { + interpreter = ""; + } + if (!interpreter) + { + apr_status_t rv; + char buffer[1024]; + apr_size_t bytes = sizeof(buffer); + int i; + + /* Need to peek into the file figure out what it really is... + * ### aught to go back and build a cache for this one of these days. + */ + if (((rv = apr_file_open(&fh, r->filename, APR_READ | APR_BUFFERED, + APR_OS_DEFAULT, r->pool)) != APR_SUCCESS) + || ((rv = apr_file_read(fh, buffer, &bytes)) != APR_SUCCESS)) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, + "Failed to read cgi file %s for testing", r->filename); + return rv; + } + apr_file_close(fh); + + /* Script or executable, that is the question... */ + if ((buffer[0] == '#') && (buffer[1] == '!')) { + /* Assuming file is a script since it starts with a shebang */ + for (i = 2; i < sizeof(buffer); i++) { + if ((buffer[i] == '\r') || (buffer[i] == '\n')) { + buffer[i] = '\0'; + break; + } + } + if (i < sizeof(buffer)) { + interpreter = buffer + 2; + while (isspace(*interpreter)) + ++interpreter; + } + } + else { + /* Not a script, is it an executable? */ + IMAGE_DOS_HEADER *hdr = (IMAGE_DOS_HEADER*)buffer; + if ((bytes >= sizeof(IMAGE_DOS_HEADER)) && (hdr->e_magic == IMAGE_DOS_SIGNATURE)) { + if (hdr->e_lfarlc < 0x40) + /* Aught to invoke this 16 bit exe by a stub, (cmd /c?) */ + interpreter = ""; + else + interpreter = ""; + } + } + } + if (!interpreter && ext && + (d->script_interpreter_source == INTERPRETER_SOURCE_REGISTRY || + d->script_interpreter_source == INTERPRETER_SOURCE_REGISTRY_STRICT)) { + /* Check the registry */ + int strict = (d->script_interpreter_source + == INTERPRETER_SOURCE_REGISTRY_STRICT); + interpreter = get_interpreter_from_win32_registry(r->pool, ext, strict); + if (!interpreter) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r->server, + strict ? "No ExecCGI verb found for files of type '%s'." + : "No ExecCGI or Open verb found for files of type '%s'.", + ext); + } + } + if (!interpreter) { + ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r, + "%s is not executable; ensure interpreted scripts have " + "\"#!\" first line", + r->filename); + return APR_EBADF; + } + + if (!args || ap_strchr_c(args, '=')) + args = ""; + + *argv = (const char **)(split_argv(p, interpreter, r->filename, args)->elts); + *cmd = (*argv)[0]; + return APR_SUCCESS; +} + +APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_cgi_build_command, (const char **cmd, + const char ***argv, request_rec *r, apr_pool_t *p)); + +static void register_hooks(apr_pool_t *p) +{ + APR_REGISTER_OPTIONAL_FN(ap_cgi_build_command); +} + +static const command_rec win32_cmds[] = { +AP_INIT_TAKE1("ScriptInterpreterSource", set_interpreter_source, NULL, + OR_FILEINFO, + "Where to find interpreter to run Win32 scripts (Registry or script shebang line)"), +{ NULL } +}; + +module AP_MODULE_DECLARE_DATA win32_module = { + STANDARD20_MODULE_STUFF, + create_win32_dir_config, /* create per-dir config */ + merge_win32_dir_configs, /* merge per-dir config */ + NULL, /* server config */ + NULL, /* merge server config */ + win32_cmds, /* command apr_table_t */ + register_hooks /* register hooks */ +}; + +#endif \ No newline at end of file diff --git a/modules/cache/mod_file_cache.exp b/modules/cache/mod_file_cache.exp new file mode 100644 index 00000000000..23b092a6406 --- /dev/null +++ b/modules/cache/mod_file_cache.exp @@ -0,0 +1 @@ +file_cache_module diff --git a/modules/dav/fs/NWGNUmakefile b/modules/dav/fs/NWGNUmakefile new file mode 100644 index 00000000000..eb3c0fc5a4b --- /dev/null +++ b/modules/dav/fs/NWGNUmakefile @@ -0,0 +1,270 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(AP_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/include/arch/NetWare \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/include \ + $(AP_WORK)/os/NetWare \ + $(AP_WORK)/server/mpm/NetWare \ + $(AP_WORK)/srclib/pcre \ + $(AP_WORK)/modules/dav/main \ + $(NWOS) \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + XDCData $(NWOS)\apache.xdc \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = modDAVFS + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Apache DAV_FS module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = modDAVFS Thread + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 65536 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If this is specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# Declare all target files (you must add your files here) +# + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/moddavfs.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_dav_fs.o \ + $(OBJDIR)/dbm.o \ + $(OBJDIR)/lock.o \ + $(OBJDIR)/repos.o \ + $(OBJDIR)/libprews.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + Apache2 \ + Libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @libc.imp \ + @$(APR)/aprlib.imp \ + @httpd.imp \ + @ws2nlm.imp \ + @../main/dav.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + dav_fs_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + copy $(OBJDIR)\moddavfs.nlm $(INSTALL)\Apache2\modules +# +# Any specialized rules here +# + +$(OBJDIR)/%.o: ../../arch/netware/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + + + diff --git a/modules/dav/main/NWGNUmakefile b/modules/dav/main/NWGNUmakefile new file mode 100644 index 00000000000..507384276f3 --- /dev/null +++ b/modules/dav/main/NWGNUmakefile @@ -0,0 +1,272 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(AP_WORK)\build\NWGNUhead.inc + +# +# build this level's files +# +# Make sure all needed macro's are defined +# + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/include/arch/NetWare \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/include \ + $(AP_WORK)/os/NetWare \ + $(AP_WORK)/server/mpm/NetWare \ + $(AP_WORK)/srclib/pcre \ + $(NWOS) \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = mod_DAV + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Apache DAV module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = mod_DAV + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 65536 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If this is specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# Declare all target files (you must add your files here) +# + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/mod_dav.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_dav.o \ + $(OBJDIR)/props.o \ + $(OBJDIR)/util.o \ + $(OBJDIR)/util_lock.o \ + $(OBJDIR)/liveprop.o \ + $(OBJDIR)/providers.o \ + $(OBJDIR)/std_liveprop.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + Apache2 \ + Libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @libc.imp \ + @$(APR)/aprlib.imp \ + @httpd.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + dav_module \ + @dav.imp \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + copy $(OBJDIR)\mod_dav.nlm $(INSTALL)\Apache2\modules\*.* + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + + + diff --git a/modules/dav/main/dav.imp b/modules/dav/main/dav.imp new file mode 100644 index 00000000000..725bfb4ba01 --- /dev/null +++ b/modules/dav/main/dav.imp @@ -0,0 +1,19 @@ +(mod_dav) +dav_hook_gather_propsets, +dav_hook_find_liveprop, +dav_hook_insert_all_liveprops, +dav_new_error, +dav_set_bufsize, +dav_xmlns_add, +dav_check_bufsize, +dav_push_error, +dav_buffer_init, +dav_buffer_place, +dav_buffer_append, +dav_add_response, +dav_buffer_place_mem, +dav_lock_query, +dav_get_liveprop_info, +dav_do_find_liveprop, +dav_register_liveprop_group, +dav_register_provider \ No newline at end of file diff --git a/modules/echo/NWGNUmakefile b/modules/echo/NWGNUmakefile new file mode 100644 index 00000000000..afc37342846 --- /dev/null +++ b/modules/echo/NWGNUmakefile @@ -0,0 +1,261 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(AP_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + -prefix pre_nw.h \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = echo + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Echo Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = Echo Module + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/echo.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_echo.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + echo_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + + + diff --git a/modules/experimental/mod_auth_ldap.def b/modules/experimental/mod_auth_ldap.def new file mode 100644 index 00000000000..599636fb491 --- /dev/null +++ b/modules/experimental/mod_auth_ldap.def @@ -0,0 +1,6 @@ +IMPORT util_ldap_connection_find +IMPORT util_ldap_connection_close +IMPORT util_ldap_cache_checkuserid +IMPORT util_ldap_cache_compare +IMPORT util_ldap_cache_comparedn +EXPORT auth_ldap_module diff --git a/modules/experimental/mod_charset_lite.exp b/modules/experimental/mod_charset_lite.exp new file mode 100644 index 00000000000..3f0bf14b4a1 --- /dev/null +++ b/modules/experimental/mod_charset_lite.exp @@ -0,0 +1 @@ +charset_lite_module diff --git a/modules/experimental/mod_disk_cache.dsp b/modules/experimental/mod_disk_cache.dsp new file mode 100644 index 00000000000..c008ffc1ff4 --- /dev/null +++ b/modules/experimental/mod_disk_cache.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="mod_disk_cache" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_disk_cache - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_disk_cache.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_disk_cache.mak" CFG="mod_disk_cache - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_disk_cache - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_disk_cache - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_disk_cache - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MOD_DISK_CACHE_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MOD_DISK_CACHE_EXPORTS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 + +!ELSEIF "$(CFG)" == "mod_disk_cache - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MOD_DISK_CACHE_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MOD_DISK_CACHE_EXPORTS" /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "mod_disk_cache - Win32 Release" +# Name "mod_disk_cache - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\mod_disk_cache.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\mod_cache.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/modules/experimental/mod_mem_cache.dsp b/modules/experimental/mod_mem_cache.dsp new file mode 100644 index 00000000000..bbc9129134b --- /dev/null +++ b/modules/experimental/mod_mem_cache.dsp @@ -0,0 +1,111 @@ +# Microsoft Developer Studio Project File - Name="mod_mem_cache" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_mem_cache - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_mem_cache.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_mem_cache.mak" CFG="mod_mem_cache - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_mem_cache - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_mem_cache - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_mem_cache - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "mod_mem_cache_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../../os/win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"Release/mod_mem_cache.so" + +!ELSEIF "$(CFG)" == "mod_mem_cache - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "mod_mem_cache_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "../../srclib/apr-util/include" /I "../../srclib/apr/include" /I "../../include" /I "../../os/win32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug/mod_mem_cache.so" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "mod_mem_cache - Win32 Release" +# Name "mod_mem_cache - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\mod_mem_cache.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\mod_cache.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/modules/experimental/util_ldap.def b/modules/experimental/util_ldap.def new file mode 100644 index 00000000000..d1fac89b354 --- /dev/null +++ b/modules/experimental/util_ldap.def @@ -0,0 +1,6 @@ +EXPORT ldap_module +EXPORT util_ldap_connection_find +EXPORT util_ldap_connection_close +EXPORT util_ldap_cache_checkuserid +EXPORT util_ldap_cache_compare +EXPORT util_ldap_cache_comparedn diff --git a/modules/filters/mod_include.dsp b/modules/filters/mod_include.dsp new file mode 100644 index 00000000000..94b6dfb9b89 --- /dev/null +++ b/modules/filters/mod_include.dsp @@ -0,0 +1,132 @@ +# Microsoft Developer Studio Project File - Name="mod_include" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_include - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_include.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_include.mak" CFG="mod_include - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_include - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_include - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_include - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_include" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_include.so" /base:@..\..\os\win32\BaseAddr.ref,mod_include +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_include.so" /base:@..\..\os\win32\BaseAddr.ref,mod_include + +!ELSEIF "$(CFG)" == "mod_include - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_include" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_include.so" /base:@..\..\os\win32\BaseAddr.ref,mod_include +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_include.so" /base:@..\..\os\win32\BaseAddr.ref,mod_include + +!ENDIF + +# Begin Target + +# Name "mod_include - Win32 Release" +# Name "mod_include - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_include.c +# End Source File +# Begin Source File + +SOURCE=.\mod_include.h +# End Source File +# Begin Source File + +SOURCE=.\mod_include.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_include - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_include.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_include "include_module for Apache" ../../include/ap_release.h > .\mod_include.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_include - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_include.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_include "include_module for Apache" ../../include/ap_release.h > .\mod_include.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/generators/NWGNUinfo b/modules/generators/NWGNUinfo new file mode 100644 index 00000000000..4cad0688b2d --- /dev/null +++ b/modules/generators/NWGNUinfo @@ -0,0 +1,250 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(AP_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + -prefix pre_nw.h \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = info + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Info Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = Info Module + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/info.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_info.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + info_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/generators/NWGNUmakefile b/modules/generators/NWGNUmakefile new file mode 100644 index 00000000000..7f7d343bdee --- /dev/null +++ b/modules/generators/NWGNUmakefile @@ -0,0 +1,247 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(AP_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/info.nlm \ + $(OBJDIR)/status.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + + + diff --git a/modules/generators/NWGNUstatus b/modules/generators/NWGNUstatus new file mode 100644 index 00000000000..9a91236852c --- /dev/null +++ b/modules/generators/NWGNUstatus @@ -0,0 +1,250 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(AP_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + -prefix pre_nw.h \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = status + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Status Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = Status Module + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/status.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_status.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + status_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/generators/mod_asis.dsp b/modules/generators/mod_asis.dsp new file mode 100644 index 00000000000..b4d2a47de35 --- /dev/null +++ b/modules/generators/mod_asis.dsp @@ -0,0 +1,128 @@ +# Microsoft Developer Studio Project File - Name="mod_asis" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_asis - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_asis.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_asis.mak" CFG="mod_asis - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_asis - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_asis - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_asis - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_asis" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_asis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_asis +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_asis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_asis + +!ELSEIF "$(CFG)" == "mod_asis - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_asis" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_asis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_asis +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_asis.so" /base:@..\..\os\win32\BaseAddr.ref,mod_asis + +!ENDIF + +# Begin Target + +# Name "mod_asis - Win32 Release" +# Name "mod_asis - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_asis.c +# End Source File +# Begin Source File + +SOURCE=.\mod_asis.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_asis - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_asis.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_asis "asis_module for Apache" ../../include/ap_release.h > .\mod_asis.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_asis - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_asis.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_asis "asis_module for Apache" ../../include/ap_release.h > .\mod_asis.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/generators/mod_autoindex.dsp b/modules/generators/mod_autoindex.dsp new file mode 100644 index 00000000000..40303919059 --- /dev/null +++ b/modules/generators/mod_autoindex.dsp @@ -0,0 +1,128 @@ +# Microsoft Developer Studio Project File - Name="mod_autoindex" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_autoindex - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_autoindex.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_autoindex.mak" CFG="mod_autoindex - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_autoindex - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_autoindex - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_autoindex - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_autoindex" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_autoindex.so" /base:@..\..\os\win32\BaseAddr.ref,mod_autoindex +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_autoindex.so" /base:@..\..\os\win32\BaseAddr.ref,mod_autoindex + +!ELSEIF "$(CFG)" == "mod_autoindex - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_autoindex" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_autoindex.so" /base:@..\..\os\win32\BaseAddr.ref,mod_autoindex +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_autoindex.so" /base:@..\..\os\win32\BaseAddr.ref,mod_autoindex + +!ENDIF + +# Begin Target + +# Name "mod_autoindex - Win32 Release" +# Name "mod_autoindex - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_autoindex.c +# End Source File +# Begin Source File + +SOURCE=.\mod_autoindex.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_autoindex - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_autoindex.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_autoindex "autoindex_module for Apache" ../../include/ap_release.h > .\mod_autoindex.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_autoindex - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_autoindex.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_autoindex "autoindex_module for Apache" ../../include/ap_release.h > .\mod_autoindex.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/generators/mod_cgi.dsp b/modules/generators/mod_cgi.dsp new file mode 100644 index 00000000000..be4d4a96471 --- /dev/null +++ b/modules/generators/mod_cgi.dsp @@ -0,0 +1,132 @@ +# Microsoft Developer Studio Project File - Name="mod_cgi" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_cgi - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_cgi.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_cgi.mak" CFG="mod_cgi - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_cgi - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_cgi - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_cgi - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_cgi" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_cgi.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cgi +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_cgi.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cgi + +!ELSEIF "$(CFG)" == "mod_cgi - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_cgi" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_cgi.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cgi +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_cgi.so" /base:@..\..\os\win32\BaseAddr.ref,mod_cgi + +!ENDIF + +# Begin Target + +# Name "mod_cgi - Win32 Release" +# Name "mod_cgi - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_cgi.c +# End Source File +# Begin Source File + +SOURCE=.\mod_cgi.h +# End Source File +# Begin Source File + +SOURCE=.\mod_cgi.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_cgi - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_cgi.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_cgi "cgi_module for Apache" ../../include/ap_release.h > .\mod_cgi.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_cgi - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_cgi.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_cgi "cgi_module for Apache" ../../include/ap_release.h > .\mod_cgi.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/generators/mod_cgid.exp b/modules/generators/mod_cgid.exp new file mode 100644 index 00000000000..5f10d486daa --- /dev/null +++ b/modules/generators/mod_cgid.exp @@ -0,0 +1 @@ +cgid_module diff --git a/modules/http/mod_mime.dsp b/modules/http/mod_mime.dsp new file mode 100644 index 00000000000..4af27fb68fa --- /dev/null +++ b/modules/http/mod_mime.dsp @@ -0,0 +1,128 @@ +# Microsoft Developer Studio Project File - Name="mod_mime" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_mime - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_mime.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_mime.mak" CFG="mod_mime - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_mime - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_mime - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_mime - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_mime" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_mime.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_mime.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime + +!ELSEIF "$(CFG)" == "mod_mime - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_mime" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_mime.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_mime.so" /base:@..\..\os\win32\BaseAddr.ref,mod_mime + +!ENDIF + +# Begin Target + +# Name "mod_mime - Win32 Release" +# Name "mod_mime - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_mime.c +# End Source File +# Begin Source File + +SOURCE=.\mod_mime.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_mime - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_mime.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_mime "mime_module for Apache" ../../include/ap_release.h > .\mod_mime.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_mime - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_mime.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_mime "mime_module for Apache" ../../include/ap_release.h > .\mod_mime.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/loggers/mod_log_config.dsp b/modules/loggers/mod_log_config.dsp new file mode 100644 index 00000000000..e043dabec9d --- /dev/null +++ b/modules/loggers/mod_log_config.dsp @@ -0,0 +1,128 @@ +# Microsoft Developer Studio Project File - Name="mod_log_config" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_log_config - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_log_config.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_log_config.mak" CFG="mod_log_config - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_log_config - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_log_config - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_log_config - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_log_config" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_log_config.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_config +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_log_config.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_config + +!ELSEIF "$(CFG)" == "mod_log_config - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_log_config" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_log_config.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_config +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_log_config.so" /base:@..\..\os\win32\BaseAddr.ref,mod_log_config + +!ENDIF + +# Begin Target + +# Name "mod_log_config - Win32 Release" +# Name "mod_log_config - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_log_config.c +# End Source File +# Begin Source File + +SOURCE=.\mod_log_config.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_log_config - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_log_config.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_log_config "log_config_module for Apache" ../../include/ap_release.h > .\mod_log_config.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_log_config - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_log_config.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_log_config "log_config_module for Apache" ../../include/ap_release.h > .\mod_log_config.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/mappers/NWGNUmakefile b/modules/mappers/NWGNUmakefile new file mode 100644 index 00000000000..62c9624d97b --- /dev/null +++ b/modules/mappers/NWGNUmakefile @@ -0,0 +1,247 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(AP_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/rewrite.nlm \ + $(OBJDIR)/speling.nlm \ + $(OBJDIR)/vhost.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + + diff --git a/modules/mappers/NWGNUrewrite b/modules/mappers/NWGNUrewrite new file mode 100644 index 00000000000..9e8b21f9601 --- /dev/null +++ b/modules/mappers/NWGNUrewrite @@ -0,0 +1,249 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(AP_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = rewrite + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Rewrite Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = Rewrite Module + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/rewrite.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_rewrite.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + rewrite_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/mappers/NWGNUspeling b/modules/mappers/NWGNUspeling new file mode 100644 index 00000000000..fdd42631cfa --- /dev/null +++ b/modules/mappers/NWGNUspeling @@ -0,0 +1,249 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(AP_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = speling + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Speling Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = Speling Module + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/speling.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_speling.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + speling_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/mappers/NWGNUvhost b/modules/mappers/NWGNUvhost new file mode 100644 index 00000000000..a2ee7789bb8 --- /dev/null +++ b/modules/mappers/NWGNUvhost @@ -0,0 +1,249 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(AP_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = vhost + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Vhost Alias Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = Vhost Alias Module + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/vhost.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_vhost_alias.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + vhost_alias_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/mappers/mod_actions.dsp b/modules/mappers/mod_actions.dsp new file mode 100644 index 00000000000..39fed166dbb --- /dev/null +++ b/modules/mappers/mod_actions.dsp @@ -0,0 +1,128 @@ +# Microsoft Developer Studio Project File - Name="mod_actions" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_actions - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_actions.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_actions.mak" CFG="mod_actions - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_actions - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_actions - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_actions - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_actions" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_actions.so" /base:@..\..\os\win32\BaseAddr.ref,mod_actions +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_actions.so" /base:@..\..\os\win32\BaseAddr.ref,mod_actions + +!ELSEIF "$(CFG)" == "mod_actions - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_actions" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_actions.so" /base:@..\..\os\win32\BaseAddr.ref,mod_actions +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_actions.so" /base:@..\..\os\win32\BaseAddr.ref,mod_actions + +!ENDIF + +# Begin Target + +# Name "mod_actions - Win32 Release" +# Name "mod_actions - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_actions.c +# End Source File +# Begin Source File + +SOURCE=.\mod_actions.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_actions - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_actions.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_actions "actions_module for Apache" ../../include/ap_release.h > .\mod_actions.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_actions - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_actions.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_actions "actions_module for Apache" ../../include/ap_release.h > .\mod_actions.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/mappers/mod_alias.dsp b/modules/mappers/mod_alias.dsp new file mode 100644 index 00000000000..d09c7affec4 --- /dev/null +++ b/modules/mappers/mod_alias.dsp @@ -0,0 +1,128 @@ +# Microsoft Developer Studio Project File - Name="mod_alias" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_alias - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_alias.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_alias.mak" CFG="mod_alias - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_alias - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_alias - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_alias - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_alias" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_alias +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_alias + +!ELSEIF "$(CFG)" == "mod_alias - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_alias" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_alias +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_alias.so" /base:@..\..\os\win32\BaseAddr.ref,mod_alias + +!ENDIF + +# Begin Target + +# Name "mod_alias - Win32 Release" +# Name "mod_alias - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_alias.c +# End Source File +# Begin Source File + +SOURCE=.\mod_alias.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_alias - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_alias.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_alias "alias_module for Apache" ../../include/ap_release.h > .\mod_alias.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_alias - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_alias.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_alias "alias_module for Apache" ../../include/ap_release.h > .\mod_alias.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/mappers/mod_dir.dsp b/modules/mappers/mod_dir.dsp new file mode 100644 index 00000000000..aad198e8817 --- /dev/null +++ b/modules/mappers/mod_dir.dsp @@ -0,0 +1,128 @@ +# Microsoft Developer Studio Project File - Name="mod_dir" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_dir - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_dir.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_dir.mak" CFG="mod_dir - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_dir - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_dir - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_dir - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_dir" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_dir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dir +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_dir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dir + +!ELSEIF "$(CFG)" == "mod_dir - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_dir" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_dir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dir +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_dir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_dir + +!ENDIF + +# Begin Target + +# Name "mod_dir - Win32 Release" +# Name "mod_dir - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_dir.c +# End Source File +# Begin Source File + +SOURCE=.\mod_dir.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_dir - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_dir.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_dir "dir_module for Apache" ../../include/ap_release.h > .\mod_dir.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_dir - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_dir.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_dir "dir_module for Apache" ../../include/ap_release.h > .\mod_dir.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/mappers/mod_imap.dsp b/modules/mappers/mod_imap.dsp new file mode 100644 index 00000000000..94570696f62 --- /dev/null +++ b/modules/mappers/mod_imap.dsp @@ -0,0 +1,128 @@ +# Microsoft Developer Studio Project File - Name="mod_imap" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_imap - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_imap.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_imap.mak" CFG="mod_imap - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_imap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_imap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_imap - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_imap" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_imap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_imap +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_imap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_imap + +!ELSEIF "$(CFG)" == "mod_imap - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_imap" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_imap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_imap +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_imap.so" /base:@..\..\os\win32\BaseAddr.ref,mod_imap + +!ENDIF + +# Begin Target + +# Name "mod_imap - Win32 Release" +# Name "mod_imap - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_imap.c +# End Source File +# Begin Source File + +SOURCE=.\mod_imap.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_imap - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_imap.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_imap "imap_module for Apache" ../../include/ap_release.h > .\mod_imap.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_imap - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_imap.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_imap "imap_module for Apache" ../../include/ap_release.h > .\mod_imap.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/mappers/mod_negotiation.dsp b/modules/mappers/mod_negotiation.dsp new file mode 100644 index 00000000000..fd264fb1dea --- /dev/null +++ b/modules/mappers/mod_negotiation.dsp @@ -0,0 +1,128 @@ +# Microsoft Developer Studio Project File - Name="mod_negotiation" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_negotiation - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_negotiation.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_negotiation.mak" CFG="mod_negotiation - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_negotiation - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_negotiation - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_negotiation - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_negotiation" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_negotiation.so" /base:@..\..\os\win32\BaseAddr.ref,mod_negotiation +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_negotiation.so" /base:@..\..\os\win32\BaseAddr.ref,mod_negotiation + +!ELSEIF "$(CFG)" == "mod_negotiation - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_negotiation" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_negotiation.so" /base:@..\..\os\win32\BaseAddr.ref,mod_negotiation +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_negotiation.so" /base:@..\..\os\win32\BaseAddr.ref,mod_negotiation + +!ENDIF + +# Begin Target + +# Name "mod_negotiation - Win32 Release" +# Name "mod_negotiation - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_negotiation.c +# End Source File +# Begin Source File + +SOURCE=.\mod_negotiation.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_negotiation - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_negotiation.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_negotiation "negotiation_module for Apache" ../../include/ap_release.h > .\mod_negotiation.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_negotiation - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_negotiation.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_negotiation "negotiation_module for Apache" ../../include/ap_release.h > .\mod_negotiation.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/mappers/mod_userdir.dsp b/modules/mappers/mod_userdir.dsp new file mode 100644 index 00000000000..be606a95500 --- /dev/null +++ b/modules/mappers/mod_userdir.dsp @@ -0,0 +1,128 @@ +# Microsoft Developer Studio Project File - Name="mod_userdir" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_userdir - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_userdir.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_userdir.mak" CFG="mod_userdir - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_userdir - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_userdir - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_userdir - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_userdir" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_userdir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_userdir +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_userdir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_userdir + +!ELSEIF "$(CFG)" == "mod_userdir - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_userdir" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_userdir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_userdir +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_userdir.so" /base:@..\..\os\win32\BaseAddr.ref,mod_userdir + +!ENDIF + +# Begin Target + +# Name "mod_userdir - Win32 Release" +# Name "mod_userdir - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_userdir.c +# End Source File +# Begin Source File + +SOURCE=.\mod_userdir.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_userdir - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_userdir.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_userdir "userdir_module for Apache" ../../include/ap_release.h > .\mod_userdir.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_userdir - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_userdir.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_userdir "userdir_module for Apache" ../../include/ap_release.h > .\mod_userdir.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/mappers/mod_vhost_alias.exp b/modules/mappers/mod_vhost_alias.exp new file mode 100644 index 00000000000..b17666fc86f --- /dev/null +++ b/modules/mappers/mod_vhost_alias.exp @@ -0,0 +1 @@ +vhost_alias_module diff --git a/modules/metadata/NWGNUcernmeta b/modules/metadata/NWGNUcernmeta new file mode 100644 index 00000000000..abc4cab1e30 --- /dev/null +++ b/modules/metadata/NWGNUcernmeta @@ -0,0 +1,250 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(AP_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + -prefix pre_nw.h \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = cernmeta + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = CERN Meta Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = CERN Meta Module + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/cernmeta.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_cern_meta.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + cern_meta_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/NWGNUexpires b/modules/metadata/NWGNUexpires new file mode 100644 index 00000000000..e55fa0dad74 --- /dev/null +++ b/modules/metadata/NWGNUexpires @@ -0,0 +1,250 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(AP_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + -prefix pre_nw.h \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = expires + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Expires Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = Expires Module + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/expires.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_expires.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + expires_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/NWGNUheaders b/modules/metadata/NWGNUheaders new file mode 100644 index 00000000000..88be58ee348 --- /dev/null +++ b/modules/metadata/NWGNUheaders @@ -0,0 +1,250 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(AP_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + -prefix pre_nw.h \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = headers + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Headers Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = Headers Module + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/headers.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_headers.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + headers_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/NWGNUmakefile b/modules/metadata/NWGNUmakefile new file mode 100644 index 00000000000..c23e762a0fc --- /dev/null +++ b/modules/metadata/NWGNUmakefile @@ -0,0 +1,251 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(AP_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/cernmeta.nlm \ + $(OBJDIR)/expires.nlm \ + $(OBJDIR)/headers.nlm \ + $(OBJDIR)/mimemagi.nlm \ + $(OBJDIR)/uniqueid.nlm \ + $(OBJDIR)/usertrk.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + + diff --git a/modules/metadata/NWGNUmimemagi b/modules/metadata/NWGNUmimemagi new file mode 100644 index 00000000000..8a989e323b4 --- /dev/null +++ b/modules/metadata/NWGNUmimemagi @@ -0,0 +1,250 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(AP_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + -prefix pre_nw.h \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = mimemagi + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = CERN Meta Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = CERN Meta Module + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/mimemagi.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_mime_magic.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + mime_magic_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/NWGNUuniqueid b/modules/metadata/NWGNUuniqueid new file mode 100644 index 00000000000..c7dace40df8 --- /dev/null +++ b/modules/metadata/NWGNUuniqueid @@ -0,0 +1,256 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(AP_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + -prefix pre_nw.h \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = uniqueid + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Unique ID Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = Unique ID Module + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/uniqueid.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_unique_id.o \ + $(OBJDIR)/libprews.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + @ws2nlm.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + unique_id_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +$(OBJDIR)/%.o: ../arch/netware/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/NWGNUusertrk b/modules/metadata/NWGNUusertrk new file mode 100644 index 00000000000..44bcb48a8a3 --- /dev/null +++ b/modules/metadata/NWGNUusertrk @@ -0,0 +1,250 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(AP_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/arch/netware \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + -prefix pre_nw.h \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = usertrk + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = User Track Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = User Track Module + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/usertrk.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_usertrack.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + usertrack_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/modules/metadata/mod_env.dsp b/modules/metadata/mod_env.dsp new file mode 100644 index 00000000000..13a4123ec1f --- /dev/null +++ b/modules/metadata/mod_env.dsp @@ -0,0 +1,128 @@ +# Microsoft Developer Studio Project File - Name="mod_env" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_env - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_env.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_env.mak" CFG="mod_env - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_env - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_env - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_env - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_env" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_env.so" /base:@..\..\os\win32\BaseAddr.ref,mod_env +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_env.so" /base:@..\..\os\win32\BaseAddr.ref,mod_env + +!ELSEIF "$(CFG)" == "mod_env - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_env" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_env.so" /base:@..\..\os\win32\BaseAddr.ref,mod_env +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_env.so" /base:@..\..\os\win32\BaseAddr.ref,mod_env + +!ENDIF + +# Begin Target + +# Name "mod_env - Win32 Release" +# Name "mod_env - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_env.c +# End Source File +# Begin Source File + +SOURCE=.\mod_env.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_env - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_env.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_env "env_module for Apache" ../../include/ap_release.h > .\mod_env.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_env - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_env.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_env "env_module for Apache" ../../include/ap_release.h > .\mod_env.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/metadata/mod_setenvif.dsp b/modules/metadata/mod_setenvif.dsp new file mode 100644 index 00000000000..8779ec8ce83 --- /dev/null +++ b/modules/metadata/mod_setenvif.dsp @@ -0,0 +1,128 @@ +# Microsoft Developer Studio Project File - Name="mod_setenvif" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_setenvif - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_setenvif.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_setenvif.mak" CFG="mod_setenvif - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_setenvif - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_setenvif - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_setenvif - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_setenvif" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_setenvif.so" /base:@..\..\os\win32\BaseAddr.ref,mod_setenvif +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_setenvif.so" /base:@..\..\os\win32\BaseAddr.ref,mod_setenvif + +!ELSEIF "$(CFG)" == "mod_setenvif - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_setenvif" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_setenvif.so" /base:@..\..\os\win32\BaseAddr.ref,mod_setenvif +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_setenvif.so" /base:@..\..\os\win32\BaseAddr.ref,mod_setenvif + +!ENDIF + +# Begin Target + +# Name "mod_setenvif - Win32 Release" +# Name "mod_setenvif - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_setenvif.c +# End Source File +# Begin Source File + +SOURCE=.\mod_setenvif.rc +# End Source File +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_setenvif - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_setenvif.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_setenvif "setenvif_module for Apache" ../../include/ap_release.h > .\mod_setenvif.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_setenvif - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_setenvif.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_setenvif "setenvif_module for Apache" ../../include/ap_release.h > .\mod_setenvif.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/proxy/NWGNUmakefile b/modules/proxy/NWGNUmakefile new file mode 100644 index 00000000000..b86fab5e673 --- /dev/null +++ b/modules/proxy/NWGNUmakefile @@ -0,0 +1,271 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(AP_WORK)\build\NWGNUhead.inc + +# +# build this level's files +# +# Make sure all needed macro's are defined +# + + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(AP_WORK)/include \ + $(NWOS) \ + $(AP_WORK)/modules/http \ + $(AP_WORK)/modules/arch/netware \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + -prefix pre_nw.h \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = proxy + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Proxy Module + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = Proxy Module + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/proxy.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/mod_proxy.o \ + $(OBJDIR)/proxy_connect.o \ + $(OBJDIR)/proxy_ftp.o \ + $(OBJDIR)/proxy_http.o \ + $(OBJDIR)/proxy_util.o \ + $(OBJDIR)/libprews.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @$(NWOS)/httpd.imp \ + @libc.imp \ + @ws2nlm.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + proxy_module \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\modules\*.* + +# +# Any specialized rules here +# + +$(OBJDIR)/%.o: ../arch/netware/%.c $(OBJDIR)\cc.opt + @echo compiling $< + $(CC) $< -o=$(OBJDIR)\$(@F) @$(OBJDIR)\cc.opt + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + + diff --git a/modules/proxy/mod_proxy_connect.dsp b/modules/proxy/mod_proxy_connect.dsp new file mode 100644 index 00000000000..c6b9d5f650e --- /dev/null +++ b/modules/proxy/mod_proxy_connect.dsp @@ -0,0 +1,136 @@ +# Microsoft Developer Studio Project File - Name="mod_proxy_connect" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_proxy_connect - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_proxy_connect.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_proxy_connect.mak" CFG="mod_proxy_connect - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_proxy_connect - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_proxy_connect - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_proxy_connect - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_proxy_connect" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_proxy_connect.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_connect +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_proxy_connect.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_connect + +!ELSEIF "$(CFG)" == "mod_proxy_connect - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_proxy_connect" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_proxy_connect.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_connect +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_proxy_connect.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_connect + +!ENDIF + +# Begin Target + +# Name "mod_proxy_connect - Win32 Release" +# Name "mod_proxy_connect - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90" +# Begin Source File + +SOURCE=.\proxy_connect.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter ".h" +# Begin Source File + +SOURCE=.\mod_proxy.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_proxy_connect - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_proxy_connect.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_proxy_connect "proxy_connect_module for Apache" ../../include/ap_release.h > .\mod_proxy_connect.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_proxy_connect - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_proxy_connect.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_proxy_connect "proxy_connect_module for Apache" ../../include/ap_release.h > .\mod_proxy_connect.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/proxy/mod_proxy_ftp.dsp b/modules/proxy/mod_proxy_ftp.dsp new file mode 100644 index 00000000000..9a232fbb4db --- /dev/null +++ b/modules/proxy/mod_proxy_ftp.dsp @@ -0,0 +1,136 @@ +# Microsoft Developer Studio Project File - Name="mod_proxy_ftp" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_proxy_ftp - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_proxy_ftp.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_proxy_ftp.mak" CFG="mod_proxy_ftp - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_proxy_ftp - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_proxy_ftp - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_proxy_ftp - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_proxy_ftp" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_proxy_ftp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ftp +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_proxy_ftp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ftp + +!ELSEIF "$(CFG)" == "mod_proxy_ftp - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_proxy_ftp" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_proxy_ftp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ftp +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_proxy_ftp.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_ftp + +!ENDIF + +# Begin Target + +# Name "mod_proxy_ftp - Win32 Release" +# Name "mod_proxy_ftp - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90" +# Begin Source File + +SOURCE=.\proxy_ftp.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter ".h" +# Begin Source File + +SOURCE=.\mod_proxy.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_proxy_ftp - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_proxy_ftp.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_proxy_ftp "proxy_ftp_module for Apache" ../../include/ap_release.h > .\mod_proxy_ftp.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_proxy_ftp - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_proxy_ftp.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_proxy_ftp "proxy_ftp_module for Apache" ../../include/ap_release.h > .\mod_proxy_ftp.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/proxy/mod_proxy_http.dsp b/modules/proxy/mod_proxy_http.dsp new file mode 100644 index 00000000000..8764b548ee5 --- /dev/null +++ b/modules/proxy/mod_proxy_http.dsp @@ -0,0 +1,136 @@ +# Microsoft Developer Studio Project File - Name="mod_proxy_http" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_proxy_http - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_proxy_http.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_proxy_http.mak" CFG="mod_proxy_http - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_proxy_http - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_proxy_http - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_proxy_http - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_proxy_http" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_proxy_http.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_http +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /map /machine:I386 /out:"Release/mod_proxy_http.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_http + +!ELSEIF "$(CFG)" == "mod_proxy_http - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_proxy_http" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_proxy_http.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_http +# ADD LINK32 kernel32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /out:"Debug/mod_proxy_http.so" /base:@..\..\os\win32\BaseAddr.ref,mod_proxy_http + +!ENDIF + +# Begin Target + +# Name "mod_proxy_http - Win32 Release" +# Name "mod_proxy_http - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90" +# Begin Source File + +SOURCE=.\proxy_http.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter ".h" +# Begin Source File + +SOURCE=.\mod_proxy.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\..\build\win32\win32ver.awk + +!IF "$(CFG)" == "mod_proxy_http - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_proxy_http.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_proxy_http "proxy_http_module for Apache" ../../include/ap_release.h > .\mod_proxy_http.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "mod_proxy_http - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\..\build\win32\win32ver.awk + +".\mod_proxy_http.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../../build/win32/win32ver.awk mod_proxy_http "proxy_http_module for Apache" ../../include/ap_release.h > .\mod_proxy_http.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/modules/test/mod_bucketeer.c b/modules/test/mod_bucketeer.c new file mode 100644 index 00000000000..b77c86a2f6d --- /dev/null +++ b/modules/test/mod_bucketeer.c @@ -0,0 +1,224 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * (zlib functions gz_open and gzwrite) + */ + +/* + * mod_bucketeer.c: split buckets whenever we find a control-char + * + * Written by Ian Holsman (IanH@apache.org) + * + */ + +#include "httpd.h" +#include "http_config.h" +#include "http_log.h" +#include "apr_strings.h" +#include "apr_general.h" +#include "util_filter.h" +#include "apr_buckets.h" +#include "http_request.h" + + +static const char bucketeerFilterName[] = "BUCKETEER"; +module AP_MODULE_DECLARE_DATA bucketeer_module; + +typedef struct bucketeer_filter_config_t +{ + char bucketdelimter; + char flushdelimiter; + +} bucketeer_filter_config_t; + + +static void *create_bucketeer_server_config(apr_pool_t *p, server_rec *s) +{ + bucketeer_filter_config_t *c = apr_pcalloc(p, sizeof *c); + + c->bucketdelimter = 0x02; /* ^B */ + c->flushdelimiter = 0x06; /* ^F */ + + return c; +} + + +typedef struct bucketeer_ctx_t +{ + apr_bucket_brigade *bb; +} bucketeer_ctx_t; + +static apr_status_t bucketeer_out_filter(ap_filter_t *f, + apr_bucket_brigade *bb) +{ + apr_bucket *e; + request_rec *r = f->r; + bucketeer_ctx_t *ctx = f->ctx; + + bucketeer_filter_config_t *c = ap_get_module_config(r->server->module_config, + &bucketeer_module); + + /* If we don't have a context, we need to ensure that it is okay to send + * the deflated content. If we have a context, that means we've done + * this before and we liked it. + * This could be not so nice if we always fail. But, if we succeed, + * we're in better shape. + */ + if (!ctx) { + if (strncmp(r->content_type, "text/", 5)) { + ap_remove_output_filter(f); + return ap_pass_brigade(f->next, bb); + } + + /* We're cool with filtering this. */ + ctx = f->ctx = apr_pcalloc(f->r->pool, sizeof(*ctx)); + ctx->bb = apr_brigade_create(f->r->pool); + } + + APR_BRIGADE_FOREACH(e, bb) { + const char *data; + apr_size_t len; + + int done = 0; + apr_size_t i; + apr_size_t lastpos; + + if (APR_BUCKET_IS_EOS(e)) { + + APR_BUCKET_REMOVE(e); + APR_BRIGADE_INSERT_TAIL(ctx->bb, e); + + /* Okay, we've seen the EOS. + * Time to pass it along down the chain. + */ + return ap_pass_brigade(f->next, ctx->bb); + } + + if (APR_BUCKET_IS_FLUSH(e)) { + /* + * Ignore flush buckets for the moment.. + * we decide what to stream + */ + continue; + } + + /* read */ + apr_bucket_read(e, &data, &len, APR_BLOCK_READ); + if (len>0) { + lastpos=0; + for (i=0; iflushdelimiter ) { + apr_bucket *p; + if ( i-lastpos>0) { + p = apr_bucket_pool_create(apr_pmemdup( f->r->pool, + &data[lastpos], + i-lastpos), + i-lastpos, + f->r->pool); + APR_BRIGADE_INSERT_TAIL(ctx->bb,p); + } + lastpos=i+1; + + p = apr_bucket_flush_create(); + APR_BRIGADE_INSERT_TAIL(ctx->bb,p); + + } + else { + if (data[i] == c->bucketdelimter) { + apr_bucket *p; + if ( i-lastpos>0) { + p = apr_bucket_pool_create(apr_pmemdup( f->r->pool, + &data[lastpos], + i-lastpos), + i-lastpos, + f->r->pool); + + APR_BRIGADE_INSERT_TAIL(ctx->bb,p); + } + lastpos=i+1; + } + } + } + /* XXX: really should append this to the next 'real' bucket */ + if ( lastpos < i ) { + apr_bucket *p; + p = apr_bucket_pool_create(apr_pmemdup( f->r->pool,&data[lastpos],i-lastpos),i-lastpos,f->r->pool); + lastpos=i; + APR_BRIGADE_INSERT_TAIL(ctx->bb,p); + } + } + } + + return APR_SUCCESS; +} + +static void register_hooks(apr_pool_t * p) +{ + ap_register_output_filter(bucketeerFilterName, bucketeer_out_filter, + AP_FTYPE_CONTENT-1); +} + +static const command_rec bucketeer_filter_cmds[] = { + {NULL} +}; + +module AP_MODULE_DECLARE_DATA bucketeer_module = { + STANDARD20_MODULE_STUFF, + NULL, + NULL, + create_bucketeer_server_config, + NULL, + bucketeer_filter_cmds, + register_hooks +}; diff --git a/os/netware/Apache.def b/os/netware/Apache.def new file mode 100644 index 00000000000..ef051ebf23a --- /dev/null +++ b/os/netware/Apache.def @@ -0,0 +1,4 @@ +#MODULE APRLIB.NLM +MODULE LIBC.NLM +MODULE WS2_32.NLM +FLAG_ON 3 diff --git a/os/netware/apache.xdc b/os/netware/apache.xdc new file mode 100644 index 00000000000..12a7f6ba2df Binary files /dev/null and b/os/netware/apache.xdc differ diff --git a/os/netware/modules.c b/os/netware/modules.c new file mode 100644 index 00000000000..3868521c856 --- /dev/null +++ b/os/netware/modules.c @@ -0,0 +1,77 @@ +/* modules.c --- major modules compiled into Apache for NetWare. + * Only insert an entry for a module if it must be compiled into + * the core server + */ + +#define CORE_PRIVATE +#include "httpd.h" +#include "http_config.h" + +extern module core_module; +extern module mpm_netware_module; +extern module http_module; +extern module so_module; +extern module mime_module; +extern module access_module; +extern module auth_module; +extern module negotiation_module; +extern module include_module; +extern module autoindex_module; +extern module dir_module; +extern module cgi_module; +extern module userdir_module; +extern module alias_module; +extern module env_module; +extern module log_config_module; +extern module asis_module; +extern module imap_module; +extern module actions_module; +extern module setenvif_module; + +module *ap_prelinked_modules[] = { + &core_module, + &mpm_netware_module, + &http_module, + &so_module, + &mime_module, + &access_module, + &auth_module, + &negotiation_module, + &include_module, + &autoindex_module, + &dir_module, + &cgi_module, + &userdir_module, + &alias_module, + &env_module, + &log_config_module, + &asis_module, + &imap_module, + &actions_module, + &setenvif_module, + NULL +}; + +module *ap_preloaded_modules[] = { + &core_module, + &mpm_netware_module, + &http_module, + &so_module, + &mime_module, + &access_module, + &auth_module, + &negotiation_module, + &include_module, + &autoindex_module, + &dir_module, + &cgi_module, + &userdir_module, + &alias_module, + &env_module, + &log_config_module, + &asis_module, + &imap_module, + &actions_module, + &setenvif_module, + NULL +}; diff --git a/os/netware/os.h b/os/netware/os.h new file mode 100644 index 00000000000..df9e1feabe9 --- /dev/null +++ b/os/netware/os.h @@ -0,0 +1,74 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +#ifndef APACHE_OS_H +#define APACHE_OS_H + +#ifndef PLATFORM +#define PLATFORM "NETWARE" +#endif + +#define CASE_BLIND_FILESYSTEM +#define NO_WRITEV + +#define APACHE_MPM_DIR "server/mpm/netware" /* generated on unix */ + +#define getpid NXThreadGetId +//#define exit(s) _exit(s) + +#endif /* ! APACHE_OS_H */ diff --git a/os/netware/pre_nw.h b/os/netware/pre_nw.h new file mode 100644 index 00000000000..6a3d99c45d9 --- /dev/null +++ b/os/netware/pre_nw.h @@ -0,0 +1,43 @@ +#ifndef __pre_nw__ +#define __pre_nw__ + +#pragma precompile_target "precomp.mch" +#define NETWARE + + +#define N_PLAT_NLM + +/* hint for MSL C++ that we're on NetWare platform */ +#define __NETWARE__ + +/* the FAR keyword has no meaning in a 32-bit environment + but is used in the SDK headers so we take it out */ +#define FAR +#define far + +/* no-op for Codewarrior C compiler; a functions are cdecl + by default */ +#define cdecl + +/* if we have wchar_t enabled in C++, predefine this type to avoid + a conflict in Novell's header files */ +#if (__option(cplusplus) && __option(wchar_type)) +#define _WCHAR_T +#endif + +/* C9X defintion used by MSL C++ library */ +#define DECIMAL_DIG 17 + +/* define long long typedefs for Watcom compatiblity */ +typedef long long int64_t; +typedef unsigned long long uint64_t; + +/* some code may want to use the MS convention for long long */ +#ifndef __int64 +#define __int64 long long +#endif + +#endif + + + diff --git a/os/netware/util_nw.c b/os/netware/util_nw.c new file mode 100644 index 00000000000..77219815bed --- /dev/null +++ b/os/netware/util_nw.c @@ -0,0 +1,76 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +#include "httpd.h" +#include "http_log.h" +#include "apr_strings.h" + +#include +#include +#include + + +AP_DECLARE(apr_status_t) ap_os_create_privileged_process( + const request_rec *r, + apr_proc_t *newproc, const char *progname, + const char * const *args, + const char * const *env, + apr_procattr_t *attr, apr_pool_t *p) +{ + return APR_ENOTIMPL; +} diff --git a/server/NWGNUmakefile b/server/NWGNUmakefile new file mode 100644 index 00000000000..7dabc8ec670 --- /dev/null +++ b/server/NWGNUmakefile @@ -0,0 +1,250 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(AP_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(NWOS) \ + $(APR)/include \ + $(AP_WORK)/include \ + $(APRUTIL)/include \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = genchars + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = Generate Test Characters + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = genchars + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\NWGNUNetWare.rul +# +NLM_VERSION = 1,0,0 + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM =_LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM =_LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If this is specified it will be used by the link '-flags' directive +# +NLM_FLAGS = PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# Declare all target files (you must add your files here) +# + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ +$(OBJDIR)/genchars.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/gen_test_char.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + Libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/server/mpm/netware/mpm.h b/server/mpm/netware/mpm.h new file mode 100644 index 00000000000..1ce59331e5d --- /dev/null +++ b/server/mpm/netware/mpm.h @@ -0,0 +1,87 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ +#include "scoreboard.h" +//#include "unixd.h" + +#ifndef APACHE_MPM_THREADED_H +#define APACHE_MPM_THREADED_H + +#define THREADED_MPM + +#define MPM_NAME "NetWare_Threaded" + +//#define AP_MPM_WANT_RECLAIM_CHILD_PROCESSES +#define AP_MPM_WANT_WAIT_OR_TIMEOUT +//#define AP_MPM_WANT_PROCESS_CHILD_STATUS +#define AP_MPM_WANT_SET_PIDFILE +#define AP_MPM_WANT_SET_SCOREBOARD +#define AP_MPM_WANT_SET_LOCKFILE +#define AP_MPM_WANT_SET_MAX_REQUESTS +#define AP_MPM_WANT_SET_COREDUMPDIR +//#define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH + +#define MPM_SYNC_CHILD_TABLE() (ap_sync_scoreboard_image()) +#define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid) +#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0) + +extern int ap_threads_per_child; +extern int ap_thread_stack_size; +extern int ap_max_workers_limit; +extern server_rec *ap_server_conf; + +#endif /* APACHE_MPM_THREADED_H */ diff --git a/server/mpm/netware/mpm_default.h b/server/mpm/netware/mpm_default.h new file mode 100644 index 00000000000..6ae8d1a81bd --- /dev/null +++ b/server/mpm/netware/mpm_default.h @@ -0,0 +1,145 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +#ifndef APACHE_MPM_DEFAULT_H +#define APACHE_MPM_DEFAULT_H + +#define AP_ID_FROM_CHILD_THREAD(c, t) ((c * HARD_THREAD_LIMIT) + t) +#define AP_CHILD_THREAD_FROM_ID(i) (0), (i) + +/* Number of servers to spawn off by default --- also, if fewer than + * this free when the caretaker checks, it will spawn more. + */ +#ifndef DEFAULT_START_DAEMON +#define DEFAULT_START_DAEMON 1 +#endif + +/* Maximum number of *free* server processes --- more than this, and + * they will die off. + */ + +#ifndef DEFAULT_MAX_FREE_DAEMON +#define DEFAULT_MAX_FREE_DAEMON 1 +#endif + +/* Minimum --- fewer than this, and more will be created */ + +#ifndef DEFAULT_MIN_FREE_DAEMON +#define DEFAULT_MIN_FREE_DAEMON 1 +#endif + +/* Limit on the total --- clients will be locked out if more servers than + * this are needed. It is intended solely to keep the server from crashing + * when things get out of hand. + * + * We keep a hard maximum number of servers, for two reasons --- first off, + * in case something goes seriously wrong, we want to stop the fork bomb + * short of actually crashing the machine we're running on by filling some + * kernel table. Secondly, it keeps the size of the scoreboard file small + * enough that we can read the whole thing without worrying too much about + * the overhead. + */ +#ifndef HARD_SERVER_LIMIT +#define HARD_SERVER_LIMIT 1 +#endif + +/* Limit on the threads per process. Clients will be locked out if more than + * this * HARD_SERVER_LIMIT are needed. + * + * We keep this for one reason it keeps the size of the scoreboard file small + * enough that we can read the whole thing without worrying too much about + * the overhead. + */ +#ifndef HARD_THREAD_LIMIT +#define HARD_THREAD_LIMIT 2048 +#endif + +#ifndef DEFAULT_THREADS_PER_CHILD +#define DEFAULT_THREADS_PER_CHILD 50 +#endif + +/* File used for accept locking, when we use a file */ +#ifndef DEFAULT_LOCKFILE +#define DEFAULT_LOCKFILE "logs/accept.lock" +#endif + +/* Scoreboard file, if there is one */ +#ifndef DEFAULT_SCOREBOARD +#define DEFAULT_SCOREBOARD "logs/apache_runtime_status" +#endif + +/* Where the main/parent process's pid is logged */ +#ifndef DEFAULT_PIDLOG +#define DEFAULT_PIDLOG "logs/httpd.pid" +#endif + +/* + * Interval, in microseconds, between scoreboard maintenance. + */ +#ifndef SCOREBOARD_MAINTENANCE_INTERVAL +#define SCOREBOARD_MAINTENANCE_INTERVAL 1000000 +#endif + +/* Number of requests to try to handle in a single process. If <= 0, + * the children don't die off. + */ +#ifndef DEFAULT_MAX_REQUESTS_PER_CHILD +#define DEFAULT_MAX_REQUESTS_PER_CHILD 10000 +#endif + +#endif /* AP_MPM_DEFAULT_H */ diff --git a/server/mpm/netware/mpm_netware.c b/server/mpm/netware/mpm_netware.c new file mode 100644 index 00000000000..e16a7ab5921 --- /dev/null +++ b/server/mpm/netware/mpm_netware.c @@ -0,0 +1,1255 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +/* + * httpd.c: simple http daemon for answering WWW file requests + * + * + * 03-21-93 Rob McCool wrote original code (up to NCSA HTTPd 1.3) + * + * 03-06-95 blong + * changed server number for child-alone processes to 0 and changed name + * of processes + * + * 03-10-95 blong + * Added numerous speed hacks proposed by Robert S. Thau (rst@ai.mit.edu) + * including set group before fork, and call gettime before to fork + * to set up libraries. + * + * 04-14-95 rst / rh + * Brandon's code snarfed from NCSA 1.4, but tinkered to work with the + * Apache server, and also to have child processes do accept() directly. + * + * April-July '95 rst + * Extensive rework for Apache. + */ + +/* TODO: this is a cobbled together prefork MPM example... it should mostly + * TODO: behave like apache-1.3... here's a short list of things I think + * TODO: need cleaning up still: + */ + +#include "apr.h" +#include "apr_portable.h" +#include "apr_strings.h" +#include "apr_thread_proc.h" +#include "apr_signal.h" +#include "apr_tables.h" +#include "apr_getopt.h" + +#define APR_WANT_STDIO +#define APR_WANT_STRFUNC +#include "apr_want.h" + +#if APR_HAVE_UNISTD_H +#include +#endif +#if APR_HAVE_SYS_TYPES_H +#include +#endif + +#define CORE_PRIVATE + +#include "ap_config.h" +#include "httpd.h" +#include "mpm_default.h" +#include "http_main.h" +#include "http_log.h" +#include "http_config.h" +#include "http_core.h" /* for get_remote_host */ +#include "http_connection.h" +#include "scoreboard.h" +#include "ap_mpm.h" +#include "mpm_common.h" +#include "ap_listen.h" +#include "ap_mmn.h" + +#ifdef HAVE_TIME_H +#include +#endif + +#include + +#define WORKER_DEAD SERVER_DEAD +#define WORKER_STARTING SERVER_STARTING +#define WORKER_READY SERVER_READY + +/* config globals */ + +int ap_threads_per_child=0; /* Worker threads per child */ +int ap_thread_stack_size=65536; +static apr_lock_t *accept_lock; +static int ap_threads_to_start=0; +static int ap_threads_min_free=0; +static int ap_threads_max_free=0; +static int ap_threads_limit=0; + +/* + * The max child slot ever assigned, preserved across restarts. Necessary + * to deal with MaxClients changes across SIGWINCH restarts. We use this + * value to optimize routines that have to scan the entire scoreboard. + */ +int ap_max_workers_limit = -1; +server_rec *ap_server_conf; + +/* *Non*-shared http_main globals... */ + +static apr_socket_t *sd; +static fd_set listenfds; +static int listenmaxfd; + +/* one_process --- debugging mode variable; can be set from the command line + * with the -X flag. If set, this gets you the child_main loop running + * in the process which originally started up (no detach, no make_child), + * which is a pretty nice debugging environment. (You'll get a SIGHUP + * early in standalone_main; just continue through. This is the server + * trying to kill off any child processes which it might have lying + * around --- Apache doesn't keep track of their pids, it just sends + * SIGHUP to the process group, ignoring it in the root process. + * Continue through and you'll be fine.). + */ + +static int one_process = 0; + +static apr_pool_t *pconf; /* Pool for config stuff */ +static apr_pool_t *pmain; /* Pool for httpd child stuff */ + +static pid_t ap_my_pid; /* it seems silly to call getpid all the time */ +static pid_t parent_pid; +#ifndef MULTITHREAD +static int my_child_num; +#endif + +static int die_now = 0; +static apr_lock_t *accept_mutex = NULL; + +/* Keep track of the number of worker threads currently active */ +static int worker_thread_count; +static apr_lock_t *worker_thread_count_mutex; + + +#ifdef GPROF +/* + * change directory for gprof to plop the gmon.out file + * configure in httpd.conf: + * GprofDir logs/ -> $ServerRoot/logs/gmon.out + * GprofDir logs/% -> $ServerRoot/logs/gprof.$pid/gmon.out + */ +static void chdir_for_gprof(void) +{ + core_server_config *sconf = + ap_get_module_config(ap_server_conf->module_config, &core_module); + char *dir = sconf->gprof_dir; + const char *use_dir; + + if(dir) { + apr_status_t res; + char buf[512]; + int len = strlen(sconf->gprof_dir) - 1; + if(*(dir + len) == '%') { + dir[len] = '\0'; + apr_snprintf(buf, sizeof(buf), "%sgprof.%d", dir, (int)getpid()); + } + use_dir = ap_server_root_relative(pconf, buf[0] ? buf : dir); + res = apr_dir_make(use_dir, 0755, pconf); + if(res != APR_SUCCESS && !APR_STATUS_IS_EEXIST(res)) { + ap_log_error(APLOG_MARK, APLOG_ERR, errno, ap_server_conf, + "gprof: error creating directory %s", dir); + } + } + else { + use_dir = ap_server_root_relative(pconf, "logs"); + } + + chdir(dir); +} +#else +#define chdir_for_gprof() +#endif + +/* XXX - I don't know if TPF will ever use this module or not, so leave + * the ap_check_signals calls in but disable them - manoj */ +#define ap_check_signals() + +/* a clean exit from a child with proper cleanup */ +static void clean_child_exit(int code) __attribute__ ((noreturn)); +static void clean_child_exit(int code) +{ + apr_thread_mutex_lock(worker_thread_count_mutex); + worker_thread_count--; + apr_thread_mutex_unlock(worker_thread_count_mutex); + NXThreadExit((void*)&code); +} + +static apr_status_t accept_mutex_child_cleanup(void *foo) +{ + return apr_thread_mutex_unlock(accept_mutex); +} + +/* Initialize mutex lock. + * Done by each child at its birth + */ +static void accept_mutex_child_init(apr_pool_t *p) +{ + apr_pool_cleanup_register(p, NULL, accept_mutex_child_cleanup, apr_pool_cleanup_null); +} + +static void accept_mutex_on(void) +{ + apr_status_t rc = apr_thread_mutex_lock(accept_mutex); + + if (rc != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_EMERG, rc, ap_server_conf, + "Error getting accept lock. Exiting!"); + clean_child_exit(APEXIT_CHILDFATAL); + } +} + +static void accept_mutex_off(void) +{ + apr_status_t rc = apr_thread_mutex_unlock(accept_mutex); + + if (rc != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_EMERG, rc, ap_server_conf, + "Error freeing accept lock. Exiting!"); + clean_child_exit(APEXIT_CHILDFATAL); + } +} + +/* On some architectures it's safe to do unserialized accept()s in the single + * Listen case. But it's never safe to do it in the case where there's + * multiple Listen statements. Define SINGLE_LISTEN_UNSERIALIZED_ACCEPT + * when it's safe in the single Listen case. + */ +#ifdef SINGLE_LISTEN_UNSERIALIZED_ACCEPT +#define SAFE_ACCEPT(stmt) do {if (ap_listeners->next) {stmt;}} while(0) +#else +#define SAFE_ACCEPT(stmt) do {stmt;} while(0) +#endif + +//#ifdef NO_SERIALIZED_ACCEPT +//#define SAFE_ACCEPT(stmt) APR_SUCCESS +//#else +//#define SAFE_ACCEPT(stmt) (stmt) +//#endif + +AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result) +{ + switch(query_code){ + case AP_MPMQ_MAX_DAEMON_USED: + *result = ap_threads_limit; + return APR_SUCCESS; + case AP_MPMQ_IS_THREADED: + *result = AP_MPMQ_NOT_SUPPORTED; + return APR_SUCCESS; + case AP_MPMQ_IS_FORKED: + *result = AP_MPMQ_DYNAMIC; + return APR_SUCCESS; + case AP_MPMQ_HARD_LIMIT_DAEMONS: + *result = HARD_SERVER_LIMIT; + return APR_SUCCESS; + case AP_MPMQ_HARD_LIMIT_THREADS: + *result = HARD_THREAD_LIMIT; + return APR_SUCCESS; + case AP_MPMQ_MAX_THREADS: + *result = 0; + return APR_SUCCESS; + case AP_MPMQ_MIN_SPARE_DEAMONS: + *result = ap_threads_min_free; + return APR_SUCCESS; + case AP_MPMQ_MIN_SPARE_THREADS: + *result = 0; + return APR_SUCCESS; + case AP_MPMQ_MAX_SPARE_DAEMONS: + *result = ap_threads_max_free; + return APR_SUCCESS; + case AP_MPMQ_MAX_SPARE_THREADS: + *result = 0; + return APR_SUCCESS; + case AP_MPMQ_MAX_REQUESTS_DEAMON: + *result = ap_max_requests_per_child; + return APR_SUCCESS; + case AP_MPMQ_MAX_DAEMONS: + *result = ap_threads_limit; + return APR_SUCCESS; + } + return APR_ENOTIMPL; +} + + +/***************************************************************** + * Connection structures and accounting... + */ + +static void just_die(int sig) +{ + clean_child_exit(0); +} + +/* volatile just in case */ +static int volatile shutdown_pending; +static int volatile restart_pending; +static int volatile is_graceful; +static int volatile wait_to_finish=1; +ap_generation_t volatile ap_my_generation=0; + +static void sig_term(int sig) +{ + if (shutdown_pending == 1) { + /* Um, is this _probably_ not an error, if the user has + * tried to do a shutdown twice quickly, so we won't + * worry about reporting it. + */ + return; + } + shutdown_pending = 1; + + while (wait_to_finish) + delay(500); +// NXThreadYield(); + delay(2000); +// The shut down flag wait_to_finish needs to be set in +// the atexit() routine when it is finally working. +} + +/* restart() is the signal handler for SIGHUP and SIGWINCH + * in the parent process, unless running in ONE_PROCESS mode + */ +static void restart(int sig) +{ + if (restart_pending == 1) { + /* Probably not an error - don't bother reporting it */ + return; + } + restart_pending = 1; +} + +static void set_signals(void) +{ + apr_signal(SIGTERM, sig_term); +} + +/***************************************************************** + * Child process main loop. + * The following vars are static to avoid getting clobbered by longjmp(); + * they are really private to child_main. + */ + +//static int srv; +//static apr_socket_t *csd; +//static int requests_this_child; +static fd_set main_fds; + +int ap_graceful_stop_signalled(void) +{ + /* not ever called anymore... */ + return 0; +} + +static int setup_listen_poll(apr_pool_t *pmain, apr_pollfd_t **listen_poll) +{ + ap_listen_rec *lr; + int numfds = 0; + + for (lr = ap_listeners; lr; lr = lr->next) { + numfds++; + } + + apr_poll_setup(listen_poll, numfds, pmain); + + for (lr = ap_listeners; lr; lr = lr->next) { + apr_poll_socket_add(*listen_poll, lr->sd, APR_POLLIN); + } + return 0; +} + + +static void worker_main(void *arg) +{ + ap_listen_rec *lr; + ap_listen_rec *last_lr; + ap_listen_rec *first_lr; + apr_pool_t *ptrans; + conn_rec *current_conn; + apr_status_t stat = APR_EINIT; + int sockdes; + int worker_num_arg = *((int*)arg); + apr_pollfd_t *listen_poll; + int nsds, rv; + + int my_worker_num = worker_num_arg; + apr_socket_t *csd = NULL; + int requests_this_child = 0; + int srv; + struct timeval tv; + + last_lr = NULL; + tv.tv_sec = 1; + tv.tv_usec = 0; + + apr_pool_create(&ptrans, pmain); + + apr_thread_mutex_lock(worker_thread_count_mutex); + worker_thread_count++; + apr_thread_mutex_unlock(worker_thread_count_mutex); + + if (setup_listen_poll(pmain, &listen_poll)) { + clean_child_exit(1); + } + + ap_update_child_status(AP_CHILD_THREAD_FROM_ID(my_child_num), WORKER_READY, (request_rec *) NULL); + +// ap_sync_scoreboard_image(); + while (!die_now) { + /* + * (Re)initialize this child to a pre-connection state. + */ + current_conn = NULL; + apr_pool_clear(ptrans); + + if ((ap_max_requests_per_child > 0 + && requests_this_child++ >= ap_max_requests_per_child)) { + clean_child_exit(0); + } + + ap_update_child_status(AP_CHILD_THREAD_FROM_ID(my_child_num), WORKER_READY, (request_rec *) NULL); + + /* + * Wait for an acceptable connection to arrive. + */ + + /* Lock around "accept", if necessary */ + SAFE_ACCEPT(accept_mutex_on()); + + for (;;) { + if (shutdown_pending) { +printf ("Thread %d is shutting down\n", getpid()); + SAFE_ACCEPT(accept_mutex_off()); + clean_child_exit(0); + } + + /* more than one socket */ + memcpy(&main_fds, &listenfds, sizeof(fd_set)); + srv = select(listenmaxfd + 1, &main_fds, NULL, NULL, &tv); + + if (srv < 0 && h_errno != EINTR) { + /* Single Unix documents select as returning errnos + * EBADF, EINTR, and EINVAL... and in none of those + * cases does it make sense to continue. In fact + * on Linux 2.0.x we seem to end up with EFAULT + * occasionally, and we'd loop forever due to it. + */ + ap_log_error(APLOG_MARK, APLOG_ERR, h_errno, ap_server_conf, "select: (listen)"); + clean_child_exit(1); + } + + if (srv <= 0) + continue; + + /* we remember the last_lr we searched last time around so that + we don't end up starving any particular listening socket */ + if (last_lr == NULL) { + lr = ap_listeners; + } + else { + lr = last_lr->next; + if (!lr) + lr = ap_listeners; + } + first_lr = lr; + do { + apr_os_sock_get(&sockdes, lr->sd); + if (FD_ISSET(sockdes, &main_fds)) + goto got_listener; + lr = lr->next; + if (!lr) + lr = ap_listeners; + } while (lr != first_lr); + /* FIXME: if we get here, something bad has happened, and we're + probably gonna spin forever. + */ + continue; +got_listener: + last_lr = lr; + sd = lr->sd; + + /* if we accept() something we don't want to die, so we have to + * defer the exit + */ + for (;;) { +// ap_sync_scoreboard_image(); + stat = apr_accept(&csd, sd, ptrans); + if (stat == APR_SUCCESS || !APR_STATUS_IS_EINTR(stat)) + break; + } + + if (stat == APR_SUCCESS) + break; /* We have a socket ready for reading */ + else { + /* Our old behaviour here was to continue after accept() + * errors. But this leads us into lots of troubles + * because most of the errors are quite fatal. For + * example, EMFILE can be caused by slow descriptor + * leaks (say in a 3rd party module, or libc). It's + * foolish for us to continue after an EMFILE. We also + * seem to tickle kernel bugs on some platforms which + * lead to never-ending loops here. So it seems best + * to just exit in most cases. + */ + switch (stat) { + + /* Linux generates the rest of these, other tcp + * stacks (i.e. bsd) tend to hide them behind + * getsockopt() interfaces. They occur when + * the net goes sour or the client disconnects + * after the three-way handshake has been done + * in the kernel but before userland has picked + * up the socket. + */ + case ECONNRESET: + case ETIMEDOUT: + case EHOSTUNREACH: + case ENETUNREACH: + break; + + case ENETDOWN: + /* + * When the network layer has been shut down, there + * is not much use in simply exiting: the parent + * would simply re-create us (and we'd fail again). + * Use the CHILDFATAL code to tear the server down. + * @@@ Martin's idea for possible improvement: + * A different approach would be to define + * a new APEXIT_NETDOWN exit code, the reception + * of which would make the parent shutdown all + * children, then idle-loop until it detected that + * the network is up again, and restart the children. + * Ben Hyde noted that temporary ENETDOWN situations + * occur in mobile IP. + */ + ap_log_error(APLOG_MARK, APLOG_EMERG, stat, ap_server_conf, + "apr_accept: giving up."); + clean_child_exit(APEXIT_CHILDFATAL); + + default: + ap_log_error(APLOG_MARK, APLOG_ERR, stat, ap_server_conf, + "apr_accept: (client socket)"); + clean_child_exit(1); + } + } + +// ap_sync_scoreboard_image(); + } + + SAFE_ACCEPT(accept_mutex_off()); /* unlock after "accept" */ + + /* + * We now have a connection, so set it up with the appropriate + * socket options, file descriptors, and read/write buffers. + */ + + apr_os_sock_get(&sockdes, csd); + + if (sockdes >= FD_SETSIZE) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, NULL, + "new file descriptor %d is too large; you probably need " + "to rebuild Apache with a larger FD_SETSIZE " + "(currently %d)", + sockdes, FD_SETSIZE); + apr_socket_close(csd); +// ap_sync_scoreboard_image(); + continue; + } + + ap_sock_disable_nagle(csd); + + current_conn = ap_new_connection(ptrans, ap_server_conf, csd, + my_child_num); + if (current_conn) { + ap_process_connection(current_conn); + ap_lingering_close(current_conn); + } + +// ap_sync_scoreboard_image(); + } + clean_child_exit(0); +} + + +static int make_child(server_rec *s, int slot) +{ + int tid; + int err=0; + NXContext_t ctx; + + if (slot + 1 > ap_max_workers_limit) { + ap_max_workers_limit = slot + 1; + } + + if (one_process) { + apr_signal(SIGINT, just_die); + apr_signal(SIGTERM, just_die); + worker_main((void*)&slot); + } + + ap_update_child_status(AP_CHILD_THREAD_FROM_ID(slot), WORKER_STARTING, (request_rec *) NULL); + + if (ctx = NXContextAlloc((void (*)(void *)) worker_main, &slot, NX_PRIO_MED, ap_thread_stack_size, NX_CTX_NORMAL, &err)) { + char threadName[32]; + + sprintf (threadName, "Apache_Worker %d", slot); + NXContextSetName(ctx, threadName); + err = NXThreadCreate(ctx, NX_THR_BIND_CONTEXT, &tid); + if (err) { + NXContextFree (ctx); + } + } + + if (err) { + /* create thread didn't succeed. Fix the scoreboard or else + * it will say SERVER_STARTING forever and ever + */ + ap_update_child_status(AP_CHILD_THREAD_FROM_ID(slot), WORKER_DEAD, (request_rec *) NULL); + + /* In case system resources are maxxed out, we don't want + Apache running away with the CPU trying to fork over and + over and over again. */ + apr_thread_yield(); + + return -1; + } + + ap_scoreboard_image->servers[0][slot].tid = tid; + + return 0; +} + + +/* start up a bunch of worker threads */ +static void startup_workers(int number_to_start) +{ + int i; + + for (i = 0; number_to_start && i < ap_threads_limit; ++i) { + if (ap_scoreboard_image->servers[0][i].status != WORKER_DEAD) { + continue; + } + if (make_child(ap_server_conf, i) < 0) { + break; + } + --number_to_start; + } +} + + +/* + * idle_spawn_rate is the number of children that will be spawned on the + * next maintenance cycle if there aren't enough idle servers. It is + * doubled up to MAX_SPAWN_RATE, and reset only when a cycle goes by + * without the need to spawn. + */ +static int idle_spawn_rate = 1; +#ifndef MAX_SPAWN_RATE +#define MAX_SPAWN_RATE (32) +#endif +static int hold_off_on_exponential_spawning; + +static void perform_idle_server_maintenance(apr_pool_t *p) +{ + int i; + int to_kill; + int idle_count; + worker_score *ws; + int free_length; + int free_slots[MAX_SPAWN_RATE]; + int last_non_dead; + int total_non_dead; + + /* initialize the free_list */ + free_length = 0; + + to_kill = -1; + idle_count = 0; + last_non_dead = -1; + total_non_dead = 0; + + ap_sync_scoreboard_image(); + for (i = 0; i < ap_threads_limit; ++i) { + int status; + + if (i >= ap_max_workers_limit && free_length == idle_spawn_rate) + break; + ws = &ap_scoreboard_image->servers[i][0]; + status = ws->status; + if (status == WORKER_DEAD) { + /* try to keep children numbers as low as possible */ + if (free_length < idle_spawn_rate) { + free_slots[free_length] = i; + ++free_length; + } + } + else { + /* We consider a starting server as idle because we started it + * at least a cycle ago, and if it still hasn't finished starting + * then we're just going to swamp things worse by forking more. + * So we hopefully won't need to fork more if we count it. + * This depends on the ordering of SERVER_READY and SERVER_STARTING. + */ + if (status <= SERVER_READY) { + ++ idle_count; + /* always kill the highest numbered child if we have to... + * no really well thought out reason ... other than observing + * the server behaviour under linux where lower numbered children + * tend to service more hits (and hence are more likely to have + * their data in cpu caches). + */ + to_kill = i; + } + + ++total_non_dead; + last_non_dead = i; + } + } + ap_max_workers_limit = last_non_dead + 1; + if (idle_count > ap_threads_max_free) { + /* kill off one child... we use the pod because that'll cause it to + * shut down gracefully, in case it happened to pick up a request + * while we were counting + */ + idle_spawn_rate = 1; + } + else if (idle_count < ap_threads_min_free) { + /* terminate the free list */ + if (free_length == 0) { + /* only report this condition once */ + static int reported = 0; + + if (!reported) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, ap_server_conf, + "server reached MaxClients setting, consider" + " raising the MaxClients setting"); + reported = 1; + } + idle_spawn_rate = 1; + } + else { + if (idle_spawn_rate >= 8) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, ap_server_conf, + "server seems busy, (you may need " + "to increase StartServers, or Min/MaxSpareServers), " + "spawning %d children, there are %d idle, and " + "%d total children", idle_spawn_rate, + idle_count, total_non_dead); + } + for (i = 0; i < free_length; ++i) { + make_child(ap_server_conf, free_slots[i]); + } + /* the next time around we want to spawn twice as many if this + * wasn't good enough, but not if we've just done a graceful + */ + if (hold_off_on_exponential_spawning) { + --hold_off_on_exponential_spawning; + } + else if (idle_spawn_rate < MAX_SPAWN_RATE) { + idle_spawn_rate *= 2; + } + } + } + else { + idle_spawn_rate = 1; + } +} + +static int setup_listeners(server_rec *s) +{ + ap_listen_rec *lr; + int sockdes; + + if (ap_setup_listeners(s) < 1 ) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, 0, s, + "no listening sockets available, shutting down"); + return -1; + } + + listenmaxfd = -1; + FD_ZERO(&listenfds); + for (lr = ap_listeners; lr; lr = lr->next) { + apr_os_sock_get(&sockdes, lr->sd); + FD_SET(sockdes, &listenfds); + if (sockdes > listenmaxfd) { + listenmaxfd = sockdes; + } + } + return 0; +} + +/***************************************************************** + * Executive routines. + */ + +int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) +{ + int index; + int remaining_workers_to_start; + apr_status_t status=0; + + pconf = _pconf; + ap_server_conf = s; + + if (setup_listeners(s)) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, status, s, + "no listening sockets available, shutting down"); + return -1; + } + + ap_log_pid(pconf, ap_pid_fname); + + worker_thread_count = 0; + apr_thread_mutex_create(&worker_thread_count_mutex, pconf); + apr_thread_mutex_create(&accept_mutex, pconf); + if (!is_graceful) { + ap_run_pre_mpm(pconf, SB_NOT_SHARED); + } + + set_signals(); + +/* Normal child main stuff */ + + apr_pool_create(&pmain, pconf); + + /* needs to be done before we switch UIDs so we have permissions */ + reopen_scoreboard(pmain); + + ap_run_child_init(pmain, ap_server_conf); + + +/* End Normal child main stuff */ + + if (ap_threads_max_free < ap_threads_min_free + 1) /* Don't thrash... */ + ap_threads_max_free = ap_threads_min_free + 1; + + /* If we're doing a graceful_restart then we're going to see a lot + * of children exiting immediately when we get into the main loop + * below (because we just sent them SIGWINCH). This happens pretty + * rapidly... and for each one that exits we'll start a new one until + * we reach at least daemons_min_free. But we may be permitted to + * start more than that, so we'll just keep track of how many we're + * supposed to start up without the 1 second penalty between each fork. + */ + remaining_workers_to_start = ap_threads_to_start; + if (remaining_workers_to_start > ap_threads_limit) { + remaining_workers_to_start = ap_threads_limit; + } + if (!is_graceful) { + startup_workers(remaining_workers_to_start); + remaining_workers_to_start = 0; + } + else { + /* give the system some time to recover before kicking into + * exponential mode */ + hold_off_on_exponential_spawning = 10; + } + + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf, + "%s configured -- resuming normal operations", + ap_get_server_version()); + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, ap_server_conf, + "Server built: %s", ap_get_server_built()); + restart_pending = shutdown_pending = 0; + + printf("%s \n", ap_get_server_version()); + + while (!restart_pending && !shutdown_pending) { + int worker_slot; + apr_wait_t status; + +// /* this is a memory leak, but I'll fix it later. */ +// apr_proc_t pid; +// +// ap_wait_or_timeout(&status, &pid, pconf); +// +// /* XXX: if it takes longer than 1 second for all our children +// * to start up and get into IDLE state then we may spawn an +// * extra child +// */ +// if (pid.pid != -1) { +// ap_process_child_status(&pid, status); +// /* non-fatal death... note that it's gone in the scoreboard. */ +// ap_sync_scoreboard_image(); +// child_slot = find_child_by_pid(&pid); +// if (child_slot >= 0) { +// ap_update_child_status(AP_CHILD_THREAD_FROM_ID(child_slot), WORKER_DEAD, +// (request_rec *) NULL); +// if (remaining_workers_to_start && child_slot < ap_threads_limit) { +// /* we're still doing a 1-for-1 replacement of dead +// * children with new children +// */ +// make_child(ap_server_conf, child_slot); +// --remaining_workers_to_start; +// } +//#if APR_HAS_OTHER_CHILD +// } +// else if (apr_proc_other_child_read(&pid, status) == 0) { +// /* handled */ +//#endif +// } +// else if (is_graceful) { +// /* Great, we've probably just lost a slot in the +// * scoreboard. Somehow we don't know about this +// * child. +// */ +// ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, +// 0, ap_server_conf, +// "long lost child came home! (pid %ld)", (long)pid.pid); +// } +// /* Don't perform idle maintenance when a child dies, +// * only do it when there's a timeout. Remember only a +// * finite number of children can die, and it's pretty +// * pathological for a lot to die suddenly. +// */ +// continue; +// } +// else if (remaining_workers_to_start) { +// /* we hit a 1 second timeout in which none of the previous +// * generation of children needed to be reaped... so assume +// * they're all done, and pick up the slack if any is left. +// */ +// startup_children(remaining_workers_to_start); +// remaining_workers_to_start = 0; +// /* In any event we really shouldn't do the code below because +// * few of the servers we just started are in the IDLE state +// * yet, so we'd mistakenly create an extra server. +// */ +// continue; +// } + +// perform_idle_server_maintenance(pconf); + apr_thread_yield(); + } + + if (shutdown_pending) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf, + "caught SIGTERM, shutting down"); + + while (worker_thread_count > 0) + apr_thread_yield(); + + printf ("Press any key to continue..."); + getc(stdin); + wait_to_finish = 0; + return 1; + } + + /* we've been told to restart */ +// apr_signal(SIGHUP, SIG_IGN); + if (one_process) { + /* not worth thinking about */ + return 1; + } + + /* advance to the next generation */ + /* XXX: we really need to make sure this new generation number isn't in + * use by any of the children. + */ + ++ap_my_generation; + ap_scoreboard_image->global.running_generation = ap_my_generation; + update_scoreboard_global(); + + if (is_graceful) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf, + "Graceful restart requested, doing restart"); + + /* kill off the idle ones */ + +#ifndef SCOREBOARD_FILE + /* This is mostly for debugging... so that we know what is still + * gracefully dealing with existing request. But we can't really + * do it if we're in a SCOREBOARD_FILE because it'll cause + * corruption too easily. + */ + ap_sync_scoreboard_image(); + for (index = 0; index < ap_threads_limit; ++index) { + if (ap_scoreboard_image->servers[0][index].status != WORKER_DEAD) { + ap_scoreboard_image->servers[0][index].status = SERVER_GRACEFUL; + } + } +#endif + } + else { + /* Kill 'em off */ + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf, + "SIGHUP received. Attempting to restart"); + } + + return 0; +} + +static void netware_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp) +{ + static int restart_num = 0; + int no_detach, debug; + + debug = ap_exists_config_define("DEBUG"); + + if (debug) + no_detach = one_process = 1; + else + { + no_detach = ap_exists_config_define("NO_DETACH"); + one_process = ap_exists_config_define("ONE_PROCESS"); + } + + /* sigh, want this only the second time around */ + if (restart_num++ == 1) { + is_graceful = 0; + + if (!one_process && !no_detach) { + apr_proc_detach(); + } + + parent_pid = ap_my_pid = getpid(); + } + + ap_listen_pre_config(); + ap_threads_to_start = DEFAULT_START_DAEMON; + ap_threads_min_free = DEFAULT_MIN_FREE_DAEMON; + ap_threads_max_free = DEFAULT_MAX_FREE_DAEMON; + ap_threads_limit = HARD_THREAD_LIMIT; + ap_pid_fname = DEFAULT_PIDLOG; + ap_scoreboard_fname = DEFAULT_SCOREBOARD; + ap_lock_fname = DEFAULT_LOCKFILE; + ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD; + ap_extended_status = 0; + + apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir)); +} + +static void netware_mpm_hooks(apr_pool_t *p) +{ + ap_hook_pre_config(netware_pre_config, NULL, NULL, APR_HOOK_MIDDLE); +} + +void netware_rewrite_args(process_rec *process) +{ + char *def_server_root; + char optbuf[3]; + const char *optarg; + apr_getopt_t *opt; + apr_array_header_t *mpm_new_argv; + + + /* Rewrite process->argv[]; + * + * add default -d serverroot from the path of this executable + * + * The end result will look like: + * The -d serverroot default from the running executable + */ + if (process->argc > 0) { + char *s = apr_pstrdup (process->pconf, process->argv[0]); + if (s) { + int i, len = strlen(s); + + for (i=len; i; i--) { + if (s[i] == '\\' || s[i] == '/') { + s[i] = NULL; + apr_filepath_merge(&def_server_root, NULL, s, + APR_FILEPATH_TRUENAME, process->pool); + break; + } + } + /* Use process->pool so that the rewritten argv + * lasts for the lifetime of the server process, + * because pconf will be destroyed after the + * initial pre-flight of the config parser. + */ + mpm_new_argv = apr_array_make(process->pool, process->argc + 2, + sizeof(const char *)); + *(const char **)apr_array_push(mpm_new_argv) = process->argv[0]; + *(const char **)apr_array_push(mpm_new_argv) = "-d"; + *(const char **)apr_array_push(mpm_new_argv) = def_server_root; + + optbuf[0] = '-'; + optbuf[2] = '\0'; + apr_getopt_init(&opt, process->pool, process->argc, (char**) process->argv); + while (apr_getopt(opt, AP_SERVER_BASEARGS, optbuf + 1, &optarg) == APR_SUCCESS) { + switch (optbuf[1]) { + default: + *(const char **)apr_array_push(mpm_new_argv) = + apr_pstrdup(process->pool, optbuf); + + if (optarg) { + *(const char **)apr_array_push(mpm_new_argv) = optarg; + } + break; + } + } + process->argc = mpm_new_argv->nelts; + process->argv = (const char * const *) mpm_new_argv->elts; + } + } +} + +static const char *set_threads_to_start(cmd_parms *cmd, void *dummy, const char *arg) +{ + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); + if (err != NULL) { + return err; + } + + ap_threads_to_start = atoi(arg); + return NULL; +} + +static const char *set_min_free_threads(cmd_parms *cmd, void *dummy, const char *arg) +{ + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); + if (err != NULL) { + return err; + } + + ap_threads_min_free = atoi(arg); + if (ap_threads_min_free <= 0) { + ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, + "WARNING: detected MinSpareServers set to non-positive."); + ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, + "Resetting to 1 to avoid almost certain Apache failure."); + ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, + "Please read the documentation."); + ap_threads_min_free = 1; + } + + return NULL; +} + +static const char *set_max_free_threads(cmd_parms *cmd, void *dummy, const char *arg) +{ + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); + if (err != NULL) { + return err; + } + + ap_threads_max_free = atoi(arg); + return NULL; +} + +static const char *set_thread_limit (cmd_parms *cmd, void *dummy, const char *arg) +{ + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); + if (err != NULL) { + return err; + } + + ap_threads_limit = atoi(arg); + if (ap_threads_limit > HARD_THREAD_LIMIT) { + ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, + "WARNING: MaxClients of %d exceeds compile time limit " + "of %d servers,", ap_threads_limit, HARD_SERVER_LIMIT); + ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, + " lowering MaxClients to %d. To increase, please " + "see the", HARD_SERVER_LIMIT); + ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, + " HARD_SERVER_LIMIT define in %s.", + AP_MPM_HARD_LIMITS_FILE); + ap_threads_limit = HARD_THREAD_LIMIT; + } + else if (ap_threads_limit < 1) { + ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, + "WARNING: Require MaxClients > 0, setting to 1"); + ap_threads_limit = 1; + } + return NULL; +} + +static const char *set_thread_stacksize(cmd_parms *cmd, void *dummy, + const char *arg) +{ + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); + if (err != NULL) { + return err; + } + + ap_thread_stack_size = atoi(arg); + return NULL; +} + +static const command_rec netware_mpm_cmds[] = { +AP_INIT_TAKE1("ThreadStackSize", set_thread_stacksize, NULL, RSRC_CONF, + "Stack size each created thread will use."), +LISTEN_COMMANDS +AP_INIT_TAKE1("StartThreads", set_threads_to_start, NULL, RSRC_CONF, + "Number of worker threads launched at server startup"), +AP_INIT_TAKE1("MinSpareThreads", set_min_free_threads, NULL, RSRC_CONF, + "Minimum number of idle threads, to handle request spikes"), +AP_INIT_TAKE1("MaxSpareThreads", set_max_free_threads, NULL, RSRC_CONF, + "Maximum number of idle threads"), +AP_INIT_TAKE1("MaxThreads", set_thread_limit, NULL, RSRC_CONF, + "Maximum number of worker threads alive at the same time"), +{ NULL } +}; + +module AP_MODULE_DECLARE_DATA mpm_netware_module = { + MPM20_MODULE_STUFF, + netware_rewrite_args, /* hook to run before apache parses args */ + NULL, /* create per-directory config structure */ + NULL, /* merge per-directory config structures */ + NULL, /* create per-server config structure */ + NULL, /* merge per-server config structures */ + netware_mpm_cmds, /* command apr_table_t */ + netware_mpm_hooks, /* register hooks */ +}; diff --git a/server/mpm/winnt/nt_eventlog.c b/server/mpm/winnt/nt_eventlog.c new file mode 100644 index 00000000000..962ebc77a4b --- /dev/null +++ b/server/mpm/winnt/nt_eventlog.c @@ -0,0 +1,225 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +#define CORE_PRIVATE + +#include "httpd.h" +#include "http_log.h" +#include "mpm_winnt.h" +#include "apr_strings.h" +#include "apr_lib.h" + +#include "apr_dbg_win32_handles.h" + + +static char *display_name = NULL; +static HANDLE stderr_thread = NULL; +static HANDLE stderr_ready; + +static DWORD WINAPI service_stderr_thread(LPVOID hPipe) +{ + HANDLE hPipeRead = (HANDLE) hPipe; + HANDLE hEventSource; + char errbuf[256]; + char *errmsg = errbuf; + const char *errarg[9]; + DWORD errres; + HKEY hk; + + errarg[0] = "The Apache service named"; + errarg[1] = display_name; + errarg[2] = "reported the following error:\r\n>>>"; + errarg[3] = errbuf; + errarg[4] = NULL; + errarg[5] = NULL; + errarg[6] = NULL; + errarg[7] = NULL; + errarg[8] = NULL; + + /* What are we going to do in here, bail on the user? not. */ + if (!RegCreateKey(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services" + "\\EventLog\\Application\\Apache Service", &hk)) + { + /* The stock message file */ + char *netmsgkey = "%SystemRoot%\\System32\\netmsg.dll"; + DWORD dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | + EVENTLOG_INFORMATION_TYPE; + + RegSetValueEx(hk, "EventMessageFile", 0, REG_EXPAND_SZ, + (LPBYTE) netmsgkey, strlen(netmsgkey) + 1); + + RegSetValueEx(hk, "TypesSupported", 0, REG_DWORD, + (LPBYTE) &dwData, sizeof(dwData)); + RegCloseKey(hk); + } + + hEventSource = RegisterEventSource(NULL, "Apache Service"); + + SetEvent(stderr_ready); + + while (ReadFile(hPipeRead, errmsg, 1, &errres, NULL) && (errres == 1)) + { + if ((errmsg > errbuf) || !isspace(*errmsg)) + { + ++errmsg; + if ((*(errmsg - 1) == '\n') + || (errmsg >= errbuf + sizeof(errbuf) - 1)) + { + while ((errmsg > errbuf) && isspace(*(errmsg - 1))) { + --errmsg; + } + *errmsg = '\0'; + + /* Generic message: '%1 %2 %3 %4 %5 %6 %7 %8 %9' + * The event code in netmsg.dll is 3299 + */ + ReportEvent(hEventSource, EVENTLOG_ERROR_TYPE, 0, + 3299, NULL, 9, 0, errarg, NULL); + errmsg = errbuf; + } + } + } + + if ((errres = GetLastError()) != ERROR_BROKEN_PIPE) { + apr_snprintf(errbuf, sizeof(errbuf), + "Win32 error %d reading stderr pipe stream\r\n", + GetLastError()); + + ReportEvent(hEventSource, EVENTLOG_ERROR_TYPE, 0, + 3299, NULL, 9, 0, errarg, NULL); + } + + CloseHandle(hPipeRead); + DeregisterEventSource(hEventSource); + CloseHandle(stderr_thread); + stderr_thread = NULL; + return 0; +} + + +void mpm_nt_eventlog_stderr_flush(void) +{ + HANDLE cleanup_thread = stderr_thread; + + if (cleanup_thread) { + HANDLE hErr = GetStdHandle(STD_ERROR_HANDLE); + fclose(stderr); + CloseHandle(hErr); + WaitForSingleObject(cleanup_thread, 30000); + CloseHandle(cleanup_thread); + } +} + + +void mpm_nt_eventlog_stderr_open(char *argv0, apr_pool_t *p) +{ + SECURITY_ATTRIBUTES sa; + HANDLE hProc = GetCurrentProcess(); + HANDLE hPipeRead = NULL; + HANDLE hPipeWrite = NULL; + HANDLE hDup = NULL; + DWORD threadid; + int fd; + + display_name = argv0; + + /* Create a pipe to send stderr messages to the system error log. + * + * _dup2() duplicates the write handle inheritable for us. + */ + sa.nLength = sizeof(sa); + sa.lpSecurityDescriptor = NULL; + sa.bInheritHandle = FALSE; + CreatePipe(&hPipeRead, &hPipeWrite, NULL, 0); + ap_assert(hPipeRead && hPipeWrite); + + stderr_ready = CreateEvent(NULL, FALSE, FALSE, NULL); + stderr_thread = CreateThread(NULL, 0, service_stderr_thread, + (LPVOID) hPipeRead, 0, &threadid); + ap_assert(stderr_ready && stderr_thread); + + WaitForSingleObject(stderr_ready, INFINITE); + + /* Flush stderr and unset its buffer, then commit and replace stderr. + * This is typically a noop for Win2K/XP since services with NULL std + * handles [but valid FILE *'s, oddly enough], but is required + * for NT 4.0 and to use this code outside of services. + */ + fflush(stderr); + setvbuf(stderr, NULL, _IONBF, 0); + _commit(2 /* stderr */); + fd = _open_osfhandle((long) hPipeWrite, + _O_WRONLY | _O_BINARY); + _dup2(fd, 2); + _close(fd); + _setmode(2, _O_BINARY); + + /* hPipeWrite was _close()'ed above, and _dup2()'ed + * to fd 2 creating a new, inherited Win32 handle. + * Recover that real handle from fd 2. + */ + hPipeWrite = (HANDLE)_get_osfhandle(2); + + SetStdHandle(STD_ERROR_HANDLE, hPipeWrite); + + /* The code above _will_ corrupt the StdHandle... + * and we must do so anyways. We set this up only + * after we initialized the posix stderr API. + */ + ap_open_stderr_log(p); +} diff --git a/server/mpm/worker/pod.c b/server/mpm/worker/pod.c new file mode 100644 index 00000000000..c869e43832a --- /dev/null +++ b/server/mpm/worker/pod.c @@ -0,0 +1,234 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +#include "apr.h" +#include "apr_strings.h" +#include "apr_lock.h" +#define APR_WANT_STRFUNC +#include "apr_want.h" + +#include "httpd.h" +#include "http_config.h" +#include "http_log.h" +#include "http_main.h" +#include "mpm.h" +#include "pod.h" +#include "mpm_common.h" +#include "ap_mpm.h" +#include "ap_listen.h" +#include "mpm_default.h" + +AP_DECLARE(apr_status_t) ap_mpm_pod_open(apr_pool_t *p, ap_pod_t **pod) +{ + apr_status_t rv; + + *pod = apr_palloc(p, sizeof(**pod)); + rv = apr_file_pipe_create(&((*pod)->pod_in), &((*pod)->pod_out), p); + if (rv != APR_SUCCESS) { + return rv; + } +/* + apr_file_pipe_timeout_set((*pod)->pod_in, 0); +*/ + (*pod)->p = p; + + apr_sockaddr_info_get(&(*pod)->sa, ap_listeners->bind_addr->hostname, + APR_UNSPEC, ap_listeners->bind_addr->port, 0, p); + + return APR_SUCCESS; +} + +AP_DECLARE(int) ap_mpm_pod_check(ap_pod_t *pod) +{ + char c; + apr_size_t len = 1; + apr_status_t rv; + + rv = apr_file_read(pod->pod_in, &c, &len); + + if ((rv == APR_SUCCESS) && (len ==1)) { + if (c == RESTART_CHAR) { + return AP_RESTART; + } + if (c == GRACEFUL_CHAR) { + return AP_GRACEFUL; + } + } + else if (rv != APR_SUCCESS) { + return rv; + } + return AP_NORESTART; +} + +AP_DECLARE(apr_status_t) ap_mpm_pod_close(ap_pod_t *pod) +{ + apr_status_t rv; + + rv = apr_file_close(pod->pod_out); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_file_close(pod->pod_in); + if (rv != APR_SUCCESS) { + return rv; + } + return rv; +} + +static apr_status_t pod_signal_internal(ap_pod_t *pod, int graceful) +{ + apr_status_t rv; + char char_of_death = graceful ? GRACEFUL_CHAR : RESTART_CHAR; + apr_size_t one = 1; + + do { + rv = apr_file_write(pod->pod_out, &char_of_death, &one); + } while (APR_STATUS_IS_EINTR(rv)); + if (rv != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, + "write pipe_of_death"); + } + return rv; +} + +/* This function connects to the server, then immediately closes the connection. + * This permits the MPM to skip the poll when there is only one listening + * socket, because it provides a alternate way to unblock an accept() when + * the pod is used. + */ + +static apr_status_t dummy_connection(ap_pod_t *pod) +{ + apr_status_t rv; + apr_socket_t *sock; + apr_pool_t *p; + + /* create a temporary pool for the socket. pconf stays around too long */ + rv = apr_pool_create(&p, pod->p); + if (rv != APR_SUCCESS) { + return rv; + } + + rv = apr_socket_create(&sock, pod->sa->family, SOCK_STREAM, p); + if (rv != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, + "get socket to connect to listener"); + return rv; + } + /* on some platforms (e.g., FreeBSD), the kernel won't accept many + * queued connections before it starts blocking local connects... + * we need to keep from blocking too long and instead return an error, + * because the MPM won't want to hold up a graceful restart for a + * long time + */ + rv = apr_setsocketopt(sock, APR_SO_TIMEOUT, 3 * APR_USEC_PER_SEC); + if (rv != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, + "set timeout on socket to connect to listener"); + return rv; + } + + rv = apr_connect(sock, pod->sa); + if (rv != APR_SUCCESS) { + int log_level = APLOG_WARNING; + + if (APR_STATUS_IS_TIMEUP(rv)) { + /* probably some server processes bailed out already and there + * is nobody around to call accept and clear out the kernel + * connection queue; usually this is not worth logging + */ + log_level = APLOG_DEBUG; + } + + ap_log_error(APLOG_MARK, log_level, rv, ap_server_conf, + "connect to listener"); + } + + apr_socket_close(sock); + apr_pool_destroy(p); + + return rv; +} + +AP_DECLARE(apr_status_t) ap_mpm_pod_signal(ap_pod_t *pod, int graceful) +{ + apr_status_t rv; + + rv = pod_signal_internal(pod, graceful); + if (rv != APR_SUCCESS) { + return rv; + } + return dummy_connection(pod); +} + +AP_DECLARE(void) ap_mpm_pod_killpg(ap_pod_t *pod, int num, int graceful) +{ + int i; + apr_status_t rv = APR_SUCCESS; + + for (i = 0; i < num && rv == APR_SUCCESS; i++) { + rv = pod_signal_internal(pod, graceful); + } + if (rv == APR_SUCCESS) { + for (i = 0; i < num && rv == APR_SUCCESS; i++) { + rv = dummy_connection(pod); + } + } +} + diff --git a/server/mpm/worker/pod.h b/server/mpm/worker/pod.h new file mode 100644 index 00000000000..cc68b4b6e38 --- /dev/null +++ b/server/mpm/worker/pod.h @@ -0,0 +1,94 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +#include "apr.h" +#include "apr_strings.h" +#include "apr_lock.h" +#define APR_WANT_STRFUNC +#include "apr_want.h" + +#include "httpd.h" +#include "http_config.h" +#include "http_log.h" +#include "http_main.h" +#include "mpm.h" +#include "mpm_common.h" +#include "ap_mpm.h" +#include "ap_listen.h" +#include "mpm_default.h" + +#define RESTART_CHAR '$' +#define GRACEFUL_CHAR '!' + +#define AP_RESTART 0 +#define AP_GRACEFUL 1 + +typedef struct ap_pod_t ap_pod_t; + +struct ap_pod_t { + apr_file_t *pod_in; + apr_file_t *pod_out; + apr_pool_t *p; + apr_sockaddr_t *sa; +}; + +AP_DECLARE(apr_status_t) ap_mpm_pod_open(apr_pool_t *p, ap_pod_t **pod); +AP_DECLARE(int) ap_mpm_pod_check(ap_pod_t *pod); +AP_DECLARE(apr_status_t) ap_mpm_pod_close(ap_pod_t *pod); +AP_DECLARE(apr_status_t) ap_mpm_pod_signal(ap_pod_t *pod, int graceful); +AP_DECLARE(void) ap_mpm_pod_killpg(ap_pod_t *pod, int num, int graceful); diff --git a/srclib/pcre/RunTest.in b/srclib/pcre/RunTest.in new file mode 100755 index 00000000000..63c4b26b159 --- /dev/null +++ b/srclib/pcre/RunTest.in @@ -0,0 +1,149 @@ +#! /bin/sh + +# This file is generated by configure from RunTest.in. Make any changes +# to that file. + +# Run PCRE tests + +cf=diff +testdata=@top_srcdir@/testdata + +# Select which tests to run; if no selection, run all + +do1=no +do2=no +do3=no +do4=no +do5=no +do6=no + +while [ $# -gt 0 ] ; do + case $1 in + 1) do1=yes;; + 2) do2=yes;; + 3) do3=yes;; + 4) do4=yes;; + 5) do5=yes;; + 6) do6=yes;; + *) echo "Unknown test number $1"; exit 1;; + esac + shift +done + +if [ "@UTF8@" = "" ] ; then + if [ $do5 = yes ] ; then + echo "Can't run test 5 because UFT8 support is not configured" + exit 1 + fi + if [ $do6 = yes ] ; then + echo "Can't run test 6 because UFT8 support is not configured" + exit 1 + fi +fi + +if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a\ + $do5 = no -a $do6 = no ] ; then + do1=yes + do2=yes + do3=yes + do4=yes + if [ "@UTF8@" != "" ] ; then do5=yes; fi + if [ "@UTF8@" != "" ] ; then do6=yes; fi +fi + +# Primary test, Perl-compatible + +if [ $do1 = yes ] ; then + echo "Testing main functionality (Perl compatible)" + ./pcretest $testdata/testinput1 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput1 + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi +fi + +# PCRE tests that are not Perl-compatible - API & error tests, mostly + +if [ $do2 = yes ] ; then + echo "Testing API and error handling (not Perl compatible)" + ./pcretest -i $testdata/testinput2 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput2 + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi +fi + +# Additional Perl-compatible tests for Perl 5.005's new features + +if [ $do3 = yes ] ; then + echo "Testing Perl 5.005 features (Perl 5.005 compatible)" + ./pcretest $testdata/testinput3 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput3 + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi +fi + +if [ $do1 = yes -a $do2 = yes -a $do3 = yes ] ; then + echo " " + echo "The three main tests all ran OK" + echo " " +fi + +# Locale-specific tests, provided the "fr" locale is available + +if [ $do4 = yes ] ; then + locale -a | grep '^fr$' >/dev/null + if [ $? -eq 0 ] ; then + echo "Testing locale-specific features (using 'fr' locale)" + ./pcretest $testdata/testinput4 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput4 + if [ $? != 0 ] ; then + echo " " + echo "Locale test did not run entirely successfully." + echo "This usually means that there is a problem with the locale" + echo "settings rather than a bug in PCRE." + else + echo "Locale test ran OK" + fi + echo " " + else exit 1 + fi + else + echo "Cannot test locale-specific features - 'fr' locale not found," + echo "or the \"locale\" command is not available to check for it." + echo " " + fi +fi + +# Additional tests for UTF8 support + +if [ $do5 = yes ] ; then + echo "Testing experimental, incomplete UTF8 support (Perl compatible)" + ./pcretest $testdata/testinput5 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput5 + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo "UTF8 test ran OK" + echo " " +fi + +if [ $do6 = yes ] ; then + echo "Testing API and internals for UTF8 support (not Perl compatible)" + ./pcretest $testdata/testinput6 testtry + if [ $? = 0 ] ; then + $cf testtry $testdata/testoutput6 + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo "UTF8 internals test ran OK" + echo " " +fi + +# End diff --git a/srclib/pcre/doc/pcregrep.1 b/srclib/pcre/doc/pcregrep.1 new file mode 100644 index 00000000000..5d3151e8677 --- /dev/null +++ b/srclib/pcre/doc/pcregrep.1 @@ -0,0 +1,88 @@ +.TH PCREGREP 1 +.SH NAME +pcregrep - a grep with Perl-compatible regular expressions. +.SH SYNOPSIS +.B pcregrep [-Vcfhilnrsvx] pattern [file] ... + + +.SH DESCRIPTION +\fBpcregrep\fR searches files for character patterns, in the same way as other +grep commands do, but it uses the PCRE regular expression library to support +patterns that are compatible with the regular expressions of Perl 5. See +\fBpcre(3)\fR for a full description of syntax and semantics. + +If no files are specified, \fBpcregrep\fR reads the standard input. By default, +each line that matches the pattern is copied to the standard output, and if +there is more than one file, the file name is printed before each line of +output. However, there are options that can change how \fBpcregrep\fR behaves. + +Lines are limited to BUFSIZ characters. BUFSIZ is defined in \fB\fR. +The newline character is removed from the end of each line before it is matched +against the pattern. + + +.SH OPTIONS +.TP 10 +\fB-V\fR +Write the version number of the PCRE library being used to the standard error +stream. +.TP +\fB-c\fR +Do not print individual lines; instead just print a count of the number of +lines that would otherwise have been printed. If several files are given, a +count is printed for each of them. +.TP +\fB-f\fIfilename\fR +Read patterns from the file, one per line, and match all patterns against each +line. There is a maximum of 100 patterns. Trailing white space is removed, and +blank lines are ignored. An empty file contains no patterns and therefore +matches nothing. +.TP +\fB-h\fR +Suppress printing of filenames when searching multiple files. +.TP +\fB-i\fR +Ignore upper/lower case distinctions during comparisons. +.TP +\fB-l\fR +Instead of printing lines from the files, just print the names of the files +containing lines that would have been printed. Each file name is printed +once, on a separate line. +.TP +\fB-n\fR +Precede each line by its line number in the file. +.TP +\fB-r\fR +If any file is a directory, recursively scan the files it contains. Without +\fB-r\fR a directory is scanned as a normal file. +.TP +\fB-s\fR +Work silently, that is, display nothing except error messages. +The exit status indicates whether any matches were found. +.TP +\fB-v\fR +Invert the sense of the match, so that lines which do \fInot\fR match the +pattern are now the ones that are found. +.TP +\fB-x\fR +Force the pattern to be anchored (it must start matching at the beginning of +the line) and in addition, require it to match the entire line. This is +equivalent to having ^ and $ characters at the start and end of each +alternative branch in the regular expression. + + +.SH SEE ALSO +\fBpcre(3)\fR, Perl 5 documentation + + +.SH DIAGNOSTICS +Exit status is 0 if any matches were found, 1 if no matches were found, and 2 +for syntax errors or inacessible files (even if matches were found). + + +.SH AUTHOR +Philip Hazel + +Last updated: 15 August 2001 +.br +Copyright (c) 1997-2001 University of Cambridge. diff --git a/srclib/pcre/doc/pcregrep.html b/srclib/pcre/doc/pcregrep.html new file mode 100644 index 00000000000..7bc210c65a2 --- /dev/null +++ b/srclib/pcre/doc/pcregrep.html @@ -0,0 +1,120 @@ + + +pcregrep specification + + +

pcregrep specification

+This HTML document has been generated automatically from the original man page. +If there is any nonsense in it, please consult the man page in case the +conversion went wrong. + +
  • NAME +

    +pcregrep - a grep with Perl-compatible regular expressions. +

    +
  • SYNOPSIS +

    +pcregrep [-Vcfhilnrsvx] pattern [file] ... +

    +
  • DESCRIPTION +

    +pcregrep searches files for character patterns, in the same way as other +grep commands do, but it uses the PCRE regular expression library to support +patterns that are compatible with the regular expressions of Perl 5. See +pcre(3) for a full description of syntax and semantics. +

    +

    +If no files are specified, pcregrep reads the standard input. By default, +each line that matches the pattern is copied to the standard output, and if +there is more than one file, the file name is printed before each line of +output. However, there are options that can change how pcregrep behaves. +

    +

    +Lines are limited to BUFSIZ characters. BUFSIZ is defined in <stdio.h>. +The newline character is removed from the end of each line before it is matched +against the pattern. +

    +
  • OPTIONS +

    +-V +Write the version number of the PCRE library being used to the standard error +stream. +

    +

    +-c +Do not print individual lines; instead just print a count of the number of +lines that would otherwise have been printed. If several files are given, a +count is printed for each of them. +

    +

    +\fB-ffilename +Read patterns from the file, one per line, and match all patterns against each +line. There is a maximum of 100 patterns. Trailing white space is removed, and +blank lines are ignored. An empty file contains no patterns and therefore +matches nothing. +

    +

    +-h +Suppress printing of filenames when searching multiple files. +

    +

    +-i +Ignore upper/lower case distinctions during comparisons. +

    +

    +-l +Instead of printing lines from the files, just print the names of the files +containing lines that would have been printed. Each file name is printed +once, on a separate line. +

    +

    +-n +Precede each line by its line number in the file. +

    +

    +-r +If any file is a directory, recursively scan the files it contains. Without +-r a directory is scanned as a normal file. +

    +

    +-s +Work silently, that is, display nothing except error messages. +The exit status indicates whether any matches were found. +

    +

    +-v +Invert the sense of the match, so that lines which do not match the +pattern are now the ones that are found. +

    +

    +-x +Force the pattern to be anchored (it must start matching at the beginning of +the line) and in addition, require it to match the entire line. This is +equivalent to having ^ and $ characters at the start and end of each +alternative branch in the regular expression. +

    +
  • SEE ALSO +

    +pcre(3), Perl 5 documentation +

    +
  • DIAGNOSTICS +

    +Exit status is 0 if any matches were found, 1 if no matches were found, and 2 +for syntax errors or inacessible files (even if matches were found). +

    +
  • AUTHOR +

    +Philip Hazel <ph10@cam.ac.uk> +

    +

    +Last updated: 15 August 2001 +
    +Copyright (c) 1997-2001 University of Cambridge. diff --git a/srclib/pcre/doc/pcregrep.txt b/srclib/pcre/doc/pcregrep.txt new file mode 100644 index 00000000000..16002284025 --- /dev/null +++ b/srclib/pcre/doc/pcregrep.txt @@ -0,0 +1,101 @@ +NAME + pcregrep - a grep with Perl-compatible regular expressions. + + + +SYNOPSIS + pcregrep [-Vcfhilnrsvx] pattern [file] ... + + + +DESCRIPTION + pcregrep searches files for character patterns, in the same + way as other grep commands do, but it uses the PCRE regular + expression library to support patterns that are compatible + with the regular expressions of Perl 5. See pcre(3) for a + full description of syntax and semantics. + + If no files are specified, pcregrep reads the standard + input. By default, each line that matches the pattern is + copied to the standard output, and if there is more than one + file, the file name is printed before each line of output. + However, there are options that can change how pcregrep + behaves. + + Lines are limited to BUFSIZ characters. BUFSIZ is defined in + . The newline character is removed from the end of + each line before it is matched against the pattern. + + + +OPTIONS + -V Write the version number of the PCRE library being + used to the standard error stream. + + -c Do not print individual lines; instead just print + a count of the number of lines that would other- + wise have been printed. If several files are + given, a count is printed for each of them. + + -ffilename + Read patterns from the file, one per line, and + match all patterns against each line. There is a + maximum of 100 patterns. Trailing white space is + removed, and blank lines are ignored. An empty + file contains no patterns and therefore matches + nothing. + + -h Suppress printing of filenames when searching mul- + tiple files. + + -i Ignore upper/lower case distinctions during com- + parisons. + + -l Instead of printing lines from the files, just + + print the names of the files containing lines that + would have been printed. Each file name is printed + once, on a separate line. + + -n Precede each line by its line number in the file. + + -r If any file is a directory, recursively scan the + files it contains. Without -r a directory is + scanned as a normal file. + + -s Work silently, that is, display nothing except + error messages. The exit status indicates whether + any matches were found. + + -v Invert the sense of the match, so that lines which + do not match the pattern are now the ones that are + found. + + -x Force the pattern to be anchored (it must start + matching at the beginning of the line) and in + addition, require it to match the entire line. + This is equivalent to having ^ and $ characters at + the start and end of each alternative branch in + the regular expression. + + + +SEE ALSO + pcre(3), Perl 5 documentation + + + + + +DIAGNOSTICS + Exit status is 0 if any matches were found, 1 if no matches + were found, and 2 for syntax errors or inacessible files + (even if matches were found). + + + +AUTHOR + Philip Hazel + + Last updated: 15 August 2001 + Copyright (c) 1997-2001 University of Cambridge. diff --git a/srclib/pcre/doc/pcretest.1 b/srclib/pcre/doc/pcretest.1 new file mode 100644 index 00000000000..b2e25560d7a --- /dev/null +++ b/srclib/pcre/doc/pcretest.1 @@ -0,0 +1,282 @@ +.TH PCRETEST 1 +.SH NAME +pcretest - a program for testing Perl-compatible regular expressions. +.SH SYNOPSIS +.B pcretest "[-d] [-i] [-m] [-o osize] [-p] [-t] [source] [destination]" + +\fBpcretest\fR was written as a test program for the PCRE regular expression +library itself, but it can also be used for experimenting with regular +expressions. This man page describes the features of the test program; for +details of the regular expressions themselves, see the \fBpcre\fR man page. + +.SH OPTIONS +.TP 10 +\fB-d\fR +Behave as if each regex had the \fB/D\fR modifier (see below); the internal +form is output after compilation. +.TP 10 +\fB-i\fR +Behave as if each regex had the \fB/I\fR modifier; information about the +compiled pattern is given after compilation. +.TP 10 +\fB-m\fR +Output the size of each compiled pattern after it has been compiled. This is +equivalent to adding /M to each regular expression. For compatibility with +earlier versions of pcretest, \fB-s\fR is a synonym for \fB-m\fR. +.TP 10 +\fB-o\fR \fIosize\fR +Set the number of elements in the output vector that is used when calling PCRE +to be \fIosize\fR. The default value is 45, which is enough for 14 capturing +subexpressions. The vector size can be changed for individual matching calls by +including \\O in the data line (see below). +.TP 10 +\fB-p\fR +Behave as if each regex has \fB/P\fR modifier; the POSIX wrapper API is used +to call PCRE. None of the other options has any effect when \fB-p\fR is set. +.TP 10 +\fB-t\fR +Run each compile, study, and match 20000 times with a timer, and output +resulting time per compile or match (in milliseconds). Do not set \fB-t\fR with +\fB-m\fR, because you will then get the size output 20000 times and the timing +will be distorted. + + +.SH DESCRIPTION + +If \fBpcretest\fR is given two filename arguments, it reads from the first and +writes to the second. If it is given only one filename argument, it reads from +that file and writes to stdout. Otherwise, it reads from stdin and writes to +stdout, and prompts for each line of input, using "re>" to prompt for regular +expressions, and "data>" to prompt for data lines. + +The program handles any number of sets of input on a single input file. Each +set starts with a regular expression, and continues with any number of data +lines to be matched against the pattern. An empty line signals the end of the +data lines, at which point a new regular expression is read. The regular +expressions are given enclosed in any non-alphameric delimiters other than +backslash, for example + + /(a|bc)x+yz/ + +White space before the initial delimiter is ignored. A regular expression may +be continued over several input lines, in which case the newline characters are +included within it. It is possible to include the delimiter within the pattern +by escaping it, for example + + /abc\\/def/ + +If you do so, the escape and the delimiter form part of the pattern, but since +delimiters are always non-alphameric, this does not affect its interpretation. +If the terminating delimiter is immediately followed by a backslash, for +example, + + /abc/\\ + +then a backslash is added to the end of the pattern. This is done to provide a +way of testing the error condition that arises if a pattern finishes with a +backslash, because + + /abc\\/ + +is interpreted as the first line of a pattern that starts with "abc/", causing +pcretest to read the next line as a continuation of the regular expression. + + +.SH PATTERN MODIFIERS + +The pattern may be followed by \fBi\fR, \fBm\fR, \fBs\fR, or \fBx\fR to set the +PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, or PCRE_EXTENDED options, +respectively. For example: + + /caseless/i + +These modifier letters have the same effect as they do in Perl. There are +others which set PCRE options that do not correspond to anything in Perl: +\fB/A\fR, \fB/E\fR, and \fB/X\fR set PCRE_ANCHORED, PCRE_DOLLAR_ENDONLY, and +PCRE_EXTRA respectively. + +Searching for all possible matches within each subject string can be requested +by the \fB/g\fR or \fB/G\fR modifier. After finding a match, PCRE is called +again to search the remainder of the subject string. The difference between +\fB/g\fR and \fB/G\fR is that the former uses the \fIstartoffset\fR argument to +\fBpcre_exec()\fR to start searching at a new point within the entire string +(which is in effect what Perl does), whereas the latter passes over a shortened +substring. This makes a difference to the matching process if the pattern +begins with a lookbehind assertion (including \\b or \\B). + +If any call to \fBpcre_exec()\fR in a \fB/g\fR or \fB/G\fR sequence matches an +empty string, the next call is done with the PCRE_NOTEMPTY and PCRE_ANCHORED +flags set in order to search for another, non-empty, match at the same point. +If this second match fails, the start offset is advanced by one, and the normal +match is retried. This imitates the way Perl handles such cases when using the +\fB/g\fR modifier or the \fBsplit()\fR function. + +There are a number of other modifiers for controlling the way \fBpcretest\fR +operates. + +The \fB/+\fR modifier requests that as well as outputting the substring that +matched the entire pattern, pcretest should in addition output the remainder of +the subject string. This is useful for tests where the subject contains +multiple copies of the same substring. + +The \fB/L\fR modifier must be followed directly by the name of a locale, for +example, + + /pattern/Lfr + +For this reason, it must be the last modifier letter. The given locale is set, +\fBpcre_maketables()\fR is called to build a set of character tables for the +locale, and this is then passed to \fBpcre_compile()\fR when compiling the +regular expression. Without an \fB/L\fR modifier, NULL is passed as the tables +pointer; that is, \fB/L\fR applies only to the expression on which it appears. + +The \fB/I\fR modifier requests that \fBpcretest\fR output information about the +compiled expression (whether it is anchored, has a fixed first character, and +so on). It does this by calling \fBpcre_fullinfo()\fR after compiling an +expression, and outputting the information it gets back. If the pattern is +studied, the results of that are also output. + +The \fB/D\fR modifier is a PCRE debugging feature, which also assumes \fB/I\fR. +It causes the internal form of compiled regular expressions to be output after +compilation. + +The \fB/S\fR modifier causes \fBpcre_study()\fR to be called after the +expression has been compiled, and the results used when the expression is +matched. + +The \fB/M\fR modifier causes the size of memory block used to hold the compiled +pattern to be output. + +The \fB/P\fR modifier causes \fBpcretest\fR to call PCRE via the POSIX wrapper +API rather than its native API. When this is done, all other modifiers except +\fB/i\fR, \fB/m\fR, and \fB/+\fR are ignored. REG_ICASE is set if \fB/i\fR is +present, and REG_NEWLINE is set if \fB/m\fR is present. The wrapper functions +force PCRE_DOLLAR_ENDONLY always, and PCRE_DOTALL unless REG_NEWLINE is set. + +The \fB/8\fR modifier causes \fBpcretest\fR to call PCRE with the PCRE_UTF8 +option set. This turns on the (currently incomplete) support for UTF-8 +character handling in PCRE, provided that it was compiled with this support +enabled. This modifier also causes any non-printing characters in output +strings to be printed using the \\x{hh...} notation if they are valid UTF-8 +sequences. + + +.SH DATA LINES + +Before each data line is passed to \fBpcre_exec()\fR, leading and trailing +whitespace is removed, and it is then scanned for \\ escapes. The following are +recognized: + + \\a alarm (= BEL) + \\b backspace + \\e escape + \\f formfeed + \\n newline + \\r carriage return + \\t tab + \\v vertical tab + \\nnn octal character (up to 3 octal digits) + \\xhh hexadecimal character (up to 2 hex digits) + \\x{hh...} hexadecimal UTF-8 character + + \\A pass the PCRE_ANCHORED option to \fBpcre_exec()\fR + \\B pass the PCRE_NOTBOL option to \fBpcre_exec()\fR + \\Cdd call pcre_copy_substring() for substring dd + after a successful match (any decimal number + less than 32) + \\Gdd call pcre_get_substring() for substring dd + after a successful match (any decimal number + less than 32) + \\L call pcre_get_substringlist() after a + successful match + \\N pass the PCRE_NOTEMPTY option to \fBpcre_exec()\fR + \\Odd set the size of the output vector passed to + \fBpcre_exec()\fR to dd (any number of decimal + digits) + \\Z pass the PCRE_NOTEOL option to \fBpcre_exec()\fR + +When \\O is used, it may be higher or lower than the size set by the \fB-O\fR +option (or defaulted to 45); \\O applies only to the call of \fBpcre_exec()\fR +for the line in which it appears. + +A backslash followed by anything else just escapes the anything else. If the +very last character is a backslash, it is ignored. This gives a way of passing +an empty line as data, since a real empty line terminates the data input. + +If \fB/P\fR was present on the regex, causing the POSIX wrapper API to be used, +only \fB\B\fR, and \fB\Z\fR have any effect, causing REG_NOTBOL and REG_NOTEOL +to be passed to \fBregexec()\fR respectively. + +The use of \\x{hh...} to represent UTF-8 characters is not dependent on the use +of the \fB/8\fR modifier on the pattern. It is recognized always. There may be +any number of hexadecimal digits inside the braces. The result is from one to +six bytes, encoded according to the UTF-8 rules. + + +.SH OUTPUT FROM PCRETEST + +When a match succeeds, pcretest outputs the list of captured substrings that +\fBpcre_exec()\fR returns, starting with number 0 for the string that matched +the whole pattern. Here is an example of an interactive pcretest run. + + $ pcretest + PCRE version 2.06 08-Jun-1999 + + re> /^abc(\\d+)/ + data> abc123 + 0: abc123 + 1: 123 + data> xyz + No match + +If the strings contain any non-printing characters, they are output as \\0x +escapes, or as \\x{...} escapes if the \fB/8\fR modifier was present on the +pattern. If the pattern has the \fB/+\fR modifier, then the output for +substring 0 is followed by the the rest of the subject string, identified by +"0+" like this: + + re> /cat/+ + data> cataract + 0: cat + 0+ aract + +If the pattern has the \fB/g\fR or \fB/G\fR modifier, the results of successive +matching attempts are output in sequence, like this: + + re> /\\Bi(\\w\\w)/g + data> Mississippi + 0: iss + 1: ss + 0: iss + 1: ss + 0: ipp + 1: pp + +"No match" is output only if the first match attempt fails. + +If any of the sequences \fB\\C\fR, \fB\\G\fR, or \fB\\L\fR are present in a +data line that is successfully matched, the substrings extracted by the +convenience functions are output with C, G, or L after the string number +instead of a colon. This is in addition to the normal full list. The string +length (that is, the return from the extraction function) is given in +parentheses after each string for \fB\\C\fR and \fB\\G\fR. + +Note that while patterns can be continued over several lines (a plain ">" +prompt is used for continuations), data lines may not. However newlines can be +included in data by means of the \\n escape. + + +.SH AUTHOR +Philip Hazel +.br +University Computing Service, +.br +New Museums Site, +.br +Cambridge CB2 3QG, England. +.br +Phone: +44 1223 334714 + +Last updated: 15 August 2001 +.br +Copyright (c) 1997-2001 University of Cambridge. diff --git a/srclib/pcre/doc/pcretest.html b/srclib/pcre/doc/pcretest.html new file mode 100644 index 00000000000..918e6dec2b5 --- /dev/null +++ b/srclib/pcre/doc/pcretest.html @@ -0,0 +1,369 @@ + + +pcretest specification + + +

    pcretest specification

    +This HTML document has been generated automatically from the original man page. +If there is any nonsense in it, please consult the man page in case the +conversion went wrong. + +
  • NAME +

    +pcretest - a program for testing Perl-compatible regular expressions. +

    +
  • SYNOPSIS +

    +pcretest [-d] [-i] [-m] [-o osize] [-p] [-t] [source] [destination] +

    +

    +pcretest was written as a test program for the PCRE regular expression +library itself, but it can also be used for experimenting with regular +expressions. This man page describes the features of the test program; for +details of the regular expressions themselves, see the pcre man page. +

    +
  • OPTIONS +

    +-d +Behave as if each regex had the /D modifier (see below); the internal +form is output after compilation. +

    +

    +-i +Behave as if each regex had the /I modifier; information about the +compiled pattern is given after compilation. +

    +

    +-m +Output the size of each compiled pattern after it has been compiled. This is +equivalent to adding /M to each regular expression. For compatibility with +earlier versions of pcretest, -s is a synonym for -m. +

    +

    +-o osize +Set the number of elements in the output vector that is used when calling PCRE +to be osize. The default value is 45, which is enough for 14 capturing +subexpressions. The vector size can be changed for individual matching calls by +including \O in the data line (see below). +

    +

    +-p +Behave as if each regex has /P modifier; the POSIX wrapper API is used +to call PCRE. None of the other options has any effect when -p is set. +

    +

    +-t +Run each compile, study, and match 20000 times with a timer, and output +resulting time per compile or match (in milliseconds). Do not set -t with +-m, because you will then get the size output 20000 times and the timing +will be distorted. +

    +
  • DESCRIPTION +

    +If pcretest is given two filename arguments, it reads from the first and +writes to the second. If it is given only one filename argument, it reads from +that file and writes to stdout. Otherwise, it reads from stdin and writes to +stdout, and prompts for each line of input, using "re>" to prompt for regular +expressions, and "data>" to prompt for data lines. +

    +

    +The program handles any number of sets of input on a single input file. Each +set starts with a regular expression, and continues with any number of data +lines to be matched against the pattern. An empty line signals the end of the +data lines, at which point a new regular expression is read. The regular +expressions are given enclosed in any non-alphameric delimiters other than +backslash, for example +

    +

    +

    +  /(a|bc)x+yz/
    +
    +

    +

    +White space before the initial delimiter is ignored. A regular expression may +be continued over several input lines, in which case the newline characters are +included within it. It is possible to include the delimiter within the pattern +by escaping it, for example +

    +

    +

    +  /abc\/def/
    +
    +

    +

    +If you do so, the escape and the delimiter form part of the pattern, but since +delimiters are always non-alphameric, this does not affect its interpretation. +If the terminating delimiter is immediately followed by a backslash, for +example, +

    +

    +

    +  /abc/\
    +
    +

    +

    +then a backslash is added to the end of the pattern. This is done to provide a +way of testing the error condition that arises if a pattern finishes with a +backslash, because +

    +

    +

    +  /abc\/
    +
    +

    +

    +is interpreted as the first line of a pattern that starts with "abc/", causing +pcretest to read the next line as a continuation of the regular expression. +

    +
  • PATTERN MODIFIERS +

    +The pattern may be followed by i, m, s, or x to set the +PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, or PCRE_EXTENDED options, +respectively. For example: +

    +

    +

    +  /caseless/i
    +
    +

    +

    +These modifier letters have the same effect as they do in Perl. There are +others which set PCRE options that do not correspond to anything in Perl: +/A, /E, and /X set PCRE_ANCHORED, PCRE_DOLLAR_ENDONLY, and +PCRE_EXTRA respectively. +

    +

    +Searching for all possible matches within each subject string can be requested +by the /g or /G modifier. After finding a match, PCRE is called +again to search the remainder of the subject string. The difference between +/g and /G is that the former uses the startoffset argument to +pcre_exec() to start searching at a new point within the entire string +(which is in effect what Perl does), whereas the latter passes over a shortened +substring. This makes a difference to the matching process if the pattern +begins with a lookbehind assertion (including \b or \B). +

    +

    +If any call to pcre_exec() in a /g or /G sequence matches an +empty string, the next call is done with the PCRE_NOTEMPTY and PCRE_ANCHORED +flags set in order to search for another, non-empty, match at the same point. +If this second match fails, the start offset is advanced by one, and the normal +match is retried. This imitates the way Perl handles such cases when using the +/g modifier or the split() function. +

    +

    +There are a number of other modifiers for controlling the way pcretest +operates. +

    +

    +The /+ modifier requests that as well as outputting the substring that +matched the entire pattern, pcretest should in addition output the remainder of +the subject string. This is useful for tests where the subject contains +multiple copies of the same substring. +

    +

    +The /L modifier must be followed directly by the name of a locale, for +example, +

    +

    +

    +  /pattern/Lfr
    +
    +

    +

    +For this reason, it must be the last modifier letter. The given locale is set, +pcre_maketables() is called to build a set of character tables for the +locale, and this is then passed to pcre_compile() when compiling the +regular expression. Without an /L modifier, NULL is passed as the tables +pointer; that is, /L applies only to the expression on which it appears. +

    +

    +The /I modifier requests that pcretest output information about the +compiled expression (whether it is anchored, has a fixed first character, and +so on). It does this by calling pcre_fullinfo() after compiling an +expression, and outputting the information it gets back. If the pattern is +studied, the results of that are also output. +

    +

    +The /D modifier is a PCRE debugging feature, which also assumes /I. +It causes the internal form of compiled regular expressions to be output after +compilation. +

    +

    +The /S modifier causes pcre_study() to be called after the +expression has been compiled, and the results used when the expression is +matched. +

    +

    +The /M modifier causes the size of memory block used to hold the compiled +pattern to be output. +

    +

    +The /P modifier causes pcretest to call PCRE via the POSIX wrapper +API rather than its native API. When this is done, all other modifiers except +/i, /m, and /+ are ignored. REG_ICASE is set if /i is +present, and REG_NEWLINE is set if /m is present. The wrapper functions +force PCRE_DOLLAR_ENDONLY always, and PCRE_DOTALL unless REG_NEWLINE is set. +

    +

    +The /8 modifier causes pcretest to call PCRE with the PCRE_UTF8 +option set. This turns on the (currently incomplete) support for UTF-8 +character handling in PCRE, provided that it was compiled with this support +enabled. This modifier also causes any non-printing characters in output +strings to be printed using the \x{hh...} notation if they are valid UTF-8 +sequences. +

    +
  • DATA LINES +

    +Before each data line is passed to pcre_exec(), leading and trailing +whitespace is removed, and it is then scanned for \ escapes. The following are +recognized: +

    +

    +

    +  \a         alarm (= BEL)
    +  \b         backspace
    +  \e         escape
    +  \f         formfeed
    +  \n         newline
    +  \r         carriage return
    +  \t         tab
    +  \v         vertical tab
    +  \nnn       octal character (up to 3 octal digits)
    +  \xhh       hexadecimal character (up to 2 hex digits)
    +  \x{hh...}  hexadecimal UTF-8 character
    +
    +

    +

    +

    +  \A         pass the PCRE_ANCHORED option to pcre_exec()
    +  \B         pass the PCRE_NOTBOL option to pcre_exec()
    +  \Cdd       call pcre_copy_substring() for substring dd
    +                after a successful match (any decimal number
    +                less than 32)
    +  \Gdd       call pcre_get_substring() for substring dd
    +                after a successful match (any decimal number
    +                less than 32)
    +  \L         call pcre_get_substringlist() after a
    +                successful match
    +  \N         pass the PCRE_NOTEMPTY option to pcre_exec()
    +  \Odd       set the size of the output vector passed to
    +                pcre_exec() to dd (any number of decimal
    +                digits)
    +  \Z         pass the PCRE_NOTEOL option to pcre_exec()
    +
    +

    +

    +When \O is used, it may be higher or lower than the size set by the -O +option (or defaulted to 45); \O applies only to the call of pcre_exec() +for the line in which it appears. +

    +

    +A backslash followed by anything else just escapes the anything else. If the +very last character is a backslash, it is ignored. This gives a way of passing +an empty line as data, since a real empty line terminates the data input. +

    +

    +If /P was present on the regex, causing the POSIX wrapper API to be used, +only \B, and \Z have any effect, causing REG_NOTBOL and REG_NOTEOL +to be passed to regexec() respectively. +

    +

    +The use of \x{hh...} to represent UTF-8 characters is not dependent on the use +of the /8 modifier on the pattern. It is recognized always. There may be +any number of hexadecimal digits inside the braces. The result is from one to +six bytes, encoded according to the UTF-8 rules. +

    +
  • OUTPUT FROM PCRETEST +

    +When a match succeeds, pcretest outputs the list of captured substrings that +pcre_exec() returns, starting with number 0 for the string that matched +the whole pattern. Here is an example of an interactive pcretest run. +

    +

    +

    +  $ pcretest
    +  PCRE version 2.06 08-Jun-1999
    +
    +

    +

    +

    +    re> /^abc(\d+)/
    +  data> abc123
    +   0: abc123
    +   1: 123
    +  data> xyz
    +  No match
    +
    +

    +

    +If the strings contain any non-printing characters, they are output as \0x +escapes, or as \x{...} escapes if the /8 modifier was present on the +pattern. If the pattern has the /+ modifier, then the output for +substring 0 is followed by the the rest of the subject string, identified by +"0+" like this: +

    +

    +

    +    re> /cat/+
    +  data> cataract
    +   0: cat
    +   0+ aract
    +
    +

    +

    +If the pattern has the /g or /G modifier, the results of successive +matching attempts are output in sequence, like this: +

    +

    +

    +    re> /\Bi(\w\w)/g
    +  data> Mississippi
    +   0: iss
    +   1: ss
    +   0: iss
    +   1: ss
    +   0: ipp
    +   1: pp
    +
    +

    +

    +"No match" is output only if the first match attempt fails. +

    +

    +If any of the sequences \C, \G, or \L are present in a +data line that is successfully matched, the substrings extracted by the +convenience functions are output with C, G, or L after the string number +instead of a colon. This is in addition to the normal full list. The string +length (that is, the return from the extraction function) is given in +parentheses after each string for \C and \G. +

    +

    +Note that while patterns can be continued over several lines (a plain ">" +prompt is used for continuations), data lines may not. However newlines can be +included in data by means of the \n escape. +

    +
  • AUTHOR +

    +Philip Hazel <ph10@cam.ac.uk> +
    +University Computing Service, +
    +New Museums Site, +
    +Cambridge CB2 3QG, England. +
    +Phone: +44 1223 334714 +

    +

    +Last updated: 15 August 2001 +
    +Copyright (c) 1997-2001 University of Cambridge. diff --git a/srclib/pcre/pcredemo.c b/srclib/pcre/pcredemo.c new file mode 100644 index 00000000000..cb4e46f137d --- /dev/null +++ b/srclib/pcre/pcredemo.c @@ -0,0 +1,94 @@ +#include +#include +#include + +/* Compile thuswise: + gcc -Wall pcredemo.c -I/opt/local/include -L/opt/local/lib \ + -R/opt/local/lib -lpcre +*/ + +#define OVECCOUNT 30 /* should be a multiple of 3 */ + +int main(int argc, char **argv) +{ +pcre *re; +const char *error; +int erroffset; +int ovector[OVECCOUNT]; +int rc, i; + +if (argc != 3) + { + printf("Two arguments required: a regex and a subject string\n"); + return 1; + } + +/* Compile the regular expression in the first argument */ + +re = pcre_compile( + argv[1], /* the pattern */ + 0, /* default options */ + &error, /* for error message */ + &erroffset, /* for error offset */ + NULL); /* use default character tables */ + +/* Compilation failed: print the error message and exit */ + +if (re == NULL) + { + printf("PCRE compilation failed at offset %d: %s\n", erroffset, error); + return 1; + } + +/* Compilation succeeded: match the subject in the second argument */ + +rc = pcre_exec( + re, /* the compiled pattern */ + NULL, /* no extra data - we didn't study the pattern */ + argv[2], /* the subject string */ + (int)strlen(argv[2]), /* the length of the subject */ + 0, /* start at offset 0 in the subject */ + 0, /* default options */ + ovector, /* output vector for substring information */ + OVECCOUNT); /* number of elements in the output vector */ + +/* Matching failed: handle error cases */ + +if (rc < 0) + { + switch(rc) + { + case PCRE_ERROR_NOMATCH: printf("No match\n"); break; + /* + Handle other special cases if you like + */ + default: printf("Matching error %d\n", rc); break; + } + return 1; + } + +/* Match succeded */ + +printf("Match succeeded\n"); + +/* The output vector wasn't big enough */ + +if (rc == 0) + { + rc = OVECCOUNT/3; + printf("ovector only has room for %d captured substrings\n", rc - 1); + } + +/* Show substrings stored in the output vector */ + +for (i = 0; i < rc; i++) + { + char *substring_start = argv[2] + ovector[2*i]; + int substring_length = ovector[2*i+1] - ovector[2*i]; + printf("%2d: %.*s\n", i, substring_length, substring_start); + } + +return 0; +} + + diff --git a/srclib/pcre/pcregrep.c b/srclib/pcre/pcregrep.c new file mode 100644 index 00000000000..b50ed0780bf --- /dev/null +++ b/srclib/pcre/pcregrep.c @@ -0,0 +1,540 @@ +/************************************************* +* pcregrep program * +*************************************************/ + +/* This is a grep program that uses the PCRE regular expression library to do +its pattern matching. On a Unix system it can recurse into directories. */ + +#include +#include +#include +#include +#include +#include "config.h" +#include "pcre.h" + +#define FALSE 0 +#define TRUE 1 + +typedef int BOOL; + +#define VERSION "2.0 01-Aug-2001" +#define MAX_PATTERN_COUNT 100 + + +/************************************************* +* Global variables * +*************************************************/ + +static char *pattern_filename = NULL; +static int pattern_count = 0; +static pcre **pattern_list; +static pcre_extra **hints_list; + +static BOOL count_only = FALSE; +static BOOL filenames = TRUE; +static BOOL filenames_only = FALSE; +static BOOL invert = FALSE; +static BOOL number = FALSE; +static BOOL recurse = FALSE; +static BOOL silent = FALSE; +static BOOL whole_lines = FALSE; + +/* Structure for options and list of them */ + +typedef struct option_item { + int one_char; + char *long_name; + char *help_text; +} option_item; + +static option_item optionlist[] = { + { -1, "help", "display this help and exit" }, + { 'c', "count", "print only a count of matching lines per FILE" }, + { 'h', "no-filename", "suppress the prefixing filename on output" }, + { 'i', "ignore-case", "ignore case distinctions" }, + { 'l', "files-with-matches", "print only FILE names containing matches" }, + { 'n', "line-number", "print line number with output lines" }, + { 'r', "recursive", "recursively scan sub-directories" }, + { 's', "no-messages", "suppress error messages" }, + { 'V', "version", "print version information and exit" }, + { 'v', "invert-match", "select non-matching lines" }, + { 'x', "line-regex", "force PATTERN to match only whole lines" }, + { 'x', "line-regexp", "force PATTERN to match only whole lines" }, + { 0, NULL, NULL } +}; + + +/************************************************* +* Functions for directory scanning * +*************************************************/ + +/* These functions are defined so that they can be made system specific, +although at present the only ones are for Unix, and for "no directory recursion +support". */ + + +/************* Directory scanning in Unix ***********/ + +#if IS_UNIX +#include +#include +#include + +typedef DIR directory_type; + +int +isdirectory(char *filename) +{ +struct stat statbuf; +if (stat(filename, &statbuf) < 0) + return 0; /* In the expectation that opening as a file will fail */ +return ((statbuf.st_mode & S_IFMT) == S_IFDIR)? '/' : 0; +} + +directory_type * +opendirectory(char *filename) +{ +return opendir(filename); +} + +char * +readdirectory(directory_type *dir) +{ +for (;;) + { + struct dirent *dent = readdir(dir); + if (dent == NULL) return NULL; + if (strcmp(dent->d_name, ".") != 0 && strcmp(dent->d_name, "..") != 0) + return dent->d_name; + } +return NULL; /* Keep compiler happy; never executed */ +} + +void +closedirectory(directory_type *dir) +{ +closedir(dir); +} + + +#else + + +/************* Directory scanning when we can't do it ***********/ + +/* The type is void, and apart from isdirectory(), the functions do nothing. */ + +typedef void directory_type; + +int isdirectory(char *filename) { return FALSE; } +directory_type * opendirectory(char *filename) {} +char *readdirectory(directory_type *dir) {} +void closedirectory(directory_type *dir) {} + +#endif + + + +#if ! HAVE_STRERROR +/************************************************* +* Provide strerror() for non-ANSI libraries * +*************************************************/ + +/* Some old-fashioned systems still around (e.g. SunOS4) don't have strerror() +in their libraries, but can provide the same facility by this simple +alternative function. */ + +extern int sys_nerr; +extern char *sys_errlist[]; + +char * +strerror(int n) +{ +if (n < 0 || n >= sys_nerr) return "unknown error number"; +return sys_errlist[n]; +} +#endif /* HAVE_STRERROR */ + + + +/************************************************* +* Grep an individual file * +*************************************************/ + +static int +pcregrep(FILE *in, char *name) +{ +int rc = 1; +int linenumber = 0; +int count = 0; +int offsets[99]; +char buffer[BUFSIZ]; + +while (fgets(buffer, sizeof(buffer), in) != NULL) + { + BOOL match = FALSE; + int i; + int length = (int)strlen(buffer); + if (length > 0 && buffer[length-1] == '\n') buffer[--length] = 0; + linenumber++; + + for (i = 0; !match && i < pattern_count; i++) + { + match = pcre_exec(pattern_list[i], hints_list[i], buffer, length, 0, 0, + offsets, 99) >= 0; + if (match && whole_lines && offsets[1] != length) match = FALSE; + } + + if (match != invert) + { + if (count_only) count++; + + else if (filenames_only) + { + fprintf(stdout, "%s\n", (name == NULL)? "" : name); + return 0; + } + + else if (silent) return 0; + + else + { + if (name != NULL) fprintf(stdout, "%s:", name); + if (number) fprintf(stdout, "%d:", linenumber); + fprintf(stdout, "%s\n", buffer); + } + + rc = 0; + } + } + +if (count_only) + { + if (name != NULL) fprintf(stdout, "%s:", name); + fprintf(stdout, "%d\n", count); + } + +return rc; +} + + + + +/************************************************* +* Grep a file or recurse into a directory * +*************************************************/ + +static int +grep_or_recurse(char *filename, BOOL recurse, BOOL show_filenames, + BOOL only_one_at_top) +{ +int rc = 1; +int sep; +FILE *in; + +/* If the file is a directory and we are recursing, scan each file within it. +The scanning code is localized so it can be made system-specific. */ + +if ((sep = isdirectory(filename)) != 0 && recurse) + { + char buffer[1024]; + char *nextfile; + directory_type *dir = opendirectory(filename); + + if (dir == NULL) + { + fprintf(stderr, "pcregrep: Failed to open directory %s: %s\n", filename, + strerror(errno)); + return 2; + } + + while ((nextfile = readdirectory(dir)) != NULL) + { + int frc; + sprintf(buffer, "%.512s%c%.128s", filename, sep, nextfile); + frc = grep_or_recurse(buffer, recurse, TRUE, FALSE); + if (frc == 0 && rc == 1) rc = 0; + } + + closedirectory(dir); + return rc; + } + +/* If the file is not a directory, or we are not recursing, scan it. If this is +the first and only argument at top level, we don't show the file name. +Otherwise, control is via the show_filenames variable. */ + +in = fopen(filename, "r"); +if (in == NULL) + { + fprintf(stderr, "pcregrep: Failed to open %s: %s\n", filename, strerror(errno)); + return 2; + } + +rc = pcregrep(in, (show_filenames && !only_one_at_top)? filename : NULL); +fclose(in); +return rc; +} + + + + +/************************************************* +* Usage function * +*************************************************/ + +static int +usage(int rc) +{ +fprintf(stderr, "Usage: pcregrep [-Vcfhilnrsvx] [long-options] pattern [file] ...\n"); +fprintf(stderr, "Type `pcregrep --help' for more information.\n"); +return rc; +} + + + + +/************************************************* +* Help function * +*************************************************/ + +static void +help(void) +{ +option_item *op; + +printf("Usage: pcregrep [OPTION]... PATTERN [FILE] ...\n"); +printf("Search for PATTERN in each FILE or standard input.\n"); +printf("Example: pcregrep -i 'hello.*world' menu.h main.c\n\n"); + +printf("Options:\n"); + +for (op = optionlist; op->one_char != 0; op++) + { + int n; + char s[4]; + if (op->one_char > 0) sprintf(s, "-%c,", op->one_char); else strcpy(s, " "); + printf(" %s --%s%n", s, op->long_name, &n); + n = 30 - n; + if (n < 1) n = 1; + printf("%.*s%s\n", n, " ", op->help_text); + } + +printf("\n -f or --file=\n"); +printf(" Read patterns from instead of using a command line option.\n"); +printf(" Trailing white space is removed; blanks lines are ignored.\n"); +printf(" There is a maximum of %d patterns.\n", MAX_PATTERN_COUNT); + +printf("\nWith no FILE, read standard input. If fewer than two FILEs given, assume -h.\n"); +printf("Exit status is 0 if any matches, 1 if no matches, and 2 if trouble.\n"); +} + + + + +/************************************************* +* Handle an option * +*************************************************/ + +static int +handle_option(int letter, int options) +{ +switch(letter) + { + case -1: help(); exit(0); + case 'c': count_only = TRUE; break; + case 'h': filenames = FALSE; break; + case 'i': options |= PCRE_CASELESS; break; + case 'l': filenames_only = TRUE; + case 'n': number = TRUE; break; + case 'r': recurse = TRUE; break; + case 's': silent = TRUE; break; + case 'v': invert = TRUE; break; + case 'x': whole_lines = TRUE; options |= PCRE_ANCHORED; break; + + case 'V': + fprintf(stderr, "pcregrep version %s using ", VERSION); + fprintf(stderr, "PCRE version %s\n", pcre_version()); + exit(0); + break; + + default: + fprintf(stderr, "pcregrep: Unknown option -%c\n", letter); + exit(usage(2)); + } + +return options; +} + + + + +/************************************************* +* Main program * +*************************************************/ + +int +main(int argc, char **argv) +{ +int i, j; +int rc = 1; +int options = 0; +int errptr; +const char *error; +BOOL only_one_at_top; + +/* Process the options */ + +for (i = 1; i < argc; i++) + { + if (argv[i][0] != '-') break; + + /* Long name options */ + + if (argv[i][1] == '-') + { + option_item *op; + + if (strncmp(argv[i]+2, "file=", 5) == 0) + { + pattern_filename = argv[i] + 7; + continue; + } + + for (op = optionlist; op->one_char != 0; op++) + { + if (strcmp(argv[i]+2, op->long_name) == 0) + { + options = handle_option(op->one_char, options); + break; + } + } + if (op->one_char == 0) + { + fprintf(stderr, "pcregrep: Unknown option %s\n", argv[i]); + exit(usage(2)); + } + } + + /* One-char options */ + + else + { + char *s = argv[i] + 1; + while (*s != 0) + { + if (*s == 'f') + { + pattern_filename = s + 1; + if (pattern_filename[0] == 0) + { + if (i >= argc - 1) + { + fprintf(stderr, "pcregrep: File name missing after -f\n"); + exit(usage(2)); + } + pattern_filename = argv[++i]; + } + break; + } + else options = handle_option(*s++, options); + } + } + } + +pattern_list = malloc(MAX_PATTERN_COUNT * sizeof(pcre *)); +hints_list = malloc(MAX_PATTERN_COUNT * sizeof(pcre_extra *)); + +if (pattern_list == NULL || hints_list == NULL) + { + fprintf(stderr, "pcregrep: malloc failed\n"); + return 2; + } + +/* Compile the regular expression(s). */ + +if (pattern_filename != NULL) + { + FILE *f = fopen(pattern_filename, "r"); + char buffer[BUFSIZ]; + if (f == NULL) + { + fprintf(stderr, "pcregrep: Failed to open %s: %s\n", pattern_filename, + strerror(errno)); + return 2; + } + while (fgets(buffer, sizeof(buffer), f) != NULL) + { + char *s = buffer + (int)strlen(buffer); + if (pattern_count >= MAX_PATTERN_COUNT) + { + fprintf(stderr, "pcregrep: Too many patterns in file (max %d)\n", + MAX_PATTERN_COUNT); + return 2; + } + while (s > buffer && isspace((unsigned char)(s[-1]))) s--; + if (s == buffer) continue; + *s = 0; + pattern_list[pattern_count] = pcre_compile(buffer, options, &error, + &errptr, NULL); + if (pattern_list[pattern_count++] == NULL) + { + fprintf(stderr, "pcregrep: Error in regex number %d at offset %d: %s\n", + pattern_count, errptr, error); + return 2; + } + } + fclose(f); + } + +/* If no file name, a single regex must be given inline */ + +else + { + if (i >= argc) return usage(0); + pattern_list[0] = pcre_compile(argv[i++], options, &error, &errptr, NULL); + if (pattern_list[0] == NULL) + { + fprintf(stderr, "pcregrep: Error in regex at offset %d: %s\n", errptr, + error); + return 2; + } + pattern_count++; + } + +/* Study the regular expressions, as we will be running them may times */ + +for (j = 0; j < pattern_count; j++) + { + hints_list[j] = pcre_study(pattern_list[j], 0, &error); + if (error != NULL) + { + char s[16]; + if (pattern_count == 1) s[0] = 0; else sprintf(s, " number %d", j); + fprintf(stderr, "pcregrep: Error while studying regex%s: %s\n", s, error); + return 2; + } + } + +/* If there are no further arguments, do the business on stdin and exit */ + +if (i >= argc) return pcregrep(stdin, NULL); + +/* Otherwise, work through the remaining arguments as files or directories. +Pass in the fact that there is only one argument at top level - this suppresses +the file name if the argument is not a directory. */ + +only_one_at_top = (i == argc - 1); +if (filenames_only) filenames = TRUE; + +for (; i < argc; i++) + { + int frc = grep_or_recurse(argv[i], recurse, filenames, only_one_at_top); + if (frc == 0 && rc == 1) rc = 0; + } + +return rc; +} + +/* End */ diff --git a/srclib/pcre/perltest8 b/srclib/pcre/perltest8 new file mode 100755 index 00000000000..2fe522d60d3 --- /dev/null +++ b/srclib/pcre/perltest8 @@ -0,0 +1,208 @@ +#! /usr/bin/perl + +# Program for testing regular expressions with perl to check that PCRE handles +# them the same. This is the version that supports /8 for UTF-8 testing. It +# requires at least Perl 5.6. + + +# Function for turning a string into a string of printing chars. There are +# currently problems with UTF-8 strings; this fudges round them. + +sub pchars { +my($t) = ""; + +if ($utf8) + { + use utf8; + @p = unpack('U*', $_[0]); + foreach $c (@p) + { + if ($c >= 32 && $c < 127) { $t .= chr $c; } + else { $t .= sprintf("\\x{%02x}", $c); } + } + } + +else + { + foreach $c (split(//, $_[0])) + { + if (ord $c >= 32 && ord $c < 127) { $t .= $c; } + else { $t .= sprintf("\\x%02x", ord $c); } + } + } + +$t; +} + + + +# Read lines from named file or stdin and write to named file or stdout; lines +# consist of a regular expression, in delimiters and optionally followed by +# options, followed by a set of test data, terminated by an empty line. + +# Sort out the input and output files + +if (@ARGV > 0) + { + open(INFILE, "<$ARGV[0]") || die "Failed to open $ARGV[0]\n"; + $infile = "INFILE"; + } +else { $infile = "STDIN"; } + +if (@ARGV > 1) + { + open(OUTFILE, ">$ARGV[1]") || die "Failed to open $ARGV[1]\n"; + $outfile = "OUTFILE"; + } +else { $outfile = "STDOUT"; } + +printf($outfile "Perl $] Regular Expressions\n\n"); + +# Main loop + +NEXT_RE: +for (;;) + { + printf " re> " if $infile eq "STDIN"; + last if ! ($_ = <$infile>); + printf $outfile "$_" if $infile ne "STDIN"; + next if ($_ eq ""); + + $pattern = $_; + + while ($pattern !~ /^\s*(.).*\1/s) + { + printf " > " if $infile eq "STDIN"; + last if ! ($_ = <$infile>); + printf $outfile "$_" if $infile ne "STDIN"; + $pattern .= $_; + } + + chomp($pattern); + $pattern =~ s/\s+$//; + + # The private /+ modifier means "print $' afterwards". + + $showrest = ($pattern =~ s/\+(?=[a-z]*$)//); + + # The private /8 modifier means "operate in UTF-8". Currently, Perl + # has bugs that we try to work around using this flag. + + $utf8 = ($pattern =~ s/8(?=[a-z]*$)//); + + # Check that the pattern is valid + + if ($utf8) + { + use utf8; + eval "\$_ =~ ${pattern}"; + } + else + { + eval "\$_ =~ ${pattern}"; + } + + if ($@) + { + printf $outfile "Error: $@"; + next NEXT_RE; + } + + # If the /g modifier is present, we want to put a loop round the matching; + # otherwise just a single "if". + + $cmd = ($pattern =~ /g[a-z]*$/)? "while" : "if"; + + # If the pattern is actually the null string, Perl uses the most recently + # executed (and successfully compiled) regex is used instead. This is a + # nasty trap for the unwary! The PCRE test suite does contain null strings + # in places - if they are allowed through here all sorts of weird and + # unexpected effects happen. To avoid this, we replace such patterns with + # a non-null pattern that has the same effect. + + $pattern = "/(?#)/$2" if ($pattern =~ /^(.)\1(.*)$/); + + # Read data lines and test them + + for (;;) + { + printf "data> " if $infile eq "STDIN"; + last NEXT_RE if ! ($_ = <$infile>); + chomp; + printf $outfile "$_\n" if $infile ne "STDIN"; + + s/\s+$//; + s/^\s+//; + + last if ($_ eq ""); + + $x = eval "\"$_\""; # To get escapes processed + + # Empty array for holding results, then do the matching. + + @subs = (); + + $pushes = "push \@subs,\$&;" . + "push \@subs,\$1;" . + "push \@subs,\$2;" . + "push \@subs,\$3;" . + "push \@subs,\$4;" . + "push \@subs,\$5;" . + "push \@subs,\$6;" . + "push \@subs,\$7;" . + "push \@subs,\$8;" . + "push \@subs,\$9;" . + "push \@subs,\$10;" . + "push \@subs,\$11;" . + "push \@subs,\$12;" . + "push \@subs,\$13;" . + "push \@subs,\$14;" . + "push \@subs,\$15;" . + "push \@subs,\$16;" . + "push \@subs,\$'; }"; + + if ($utf8) + { + use utf8; + eval "${cmd} (\$x =~ ${pattern}) {" . $pushes; + } + else + { + eval "${cmd} (\$x =~ ${pattern}) {" . $pushes; + } + + if ($@) + { + printf $outfile "Error: $@\n"; + next NEXT_RE; + } + elsif (scalar(@subs) == 0) + { + printf $outfile "No match\n"; + } + else + { + while (scalar(@subs) != 0) + { + printf $outfile (" 0: %s\n", &pchars($subs[0])); + printf $outfile (" 0+ %s\n", &pchars($subs[17])) if $showrest; + $last_printed = 0; + for ($i = 1; $i <= 16; $i++) + { + if (defined $subs[$i]) + { + while ($last_printed++ < $i-1) + { printf $outfile ("%2d: \n", $last_printed); } + printf $outfile ("%2d: %s\n", $i, &pchars($subs[$i])); + $last_printed = $i; + } + } + splice(@subs, 0, 18); + } + } + } + } + +printf $outfile "\n"; + +# End diff --git a/srclib/pcre/testdata/testinput5 b/srclib/pcre/testdata/testinput5 new file mode 100644 index 00000000000..d66cfbddf30 --- /dev/null +++ b/srclib/pcre/testdata/testinput5 @@ -0,0 +1,118 @@ +/-- Because of problems with Perl 5.6 in handling UTF-8 vs non UTF-8 --/ +/-- strings automatically, do not use the \x{} construct except with --/ +/-- patterns that have the /8 option set, and don't use them without! --/ + +/a.b/8 + acb + a\x7fb + a\x{100}b + *** Failers + a\nb + +/a(.{3})b/8 + a\x{4000}xyb + a\x{4000}\x7fyb + a\x{4000}\x{100}yb + *** Failers + a\x{4000}b + ac\ncb + +/a(.*?)(.)/ + a\xc0\x88b + +/a(.*?)(.)/8 + a\x{100}b + +/a(.*)(.)/ + a\xc0\x88b + +/a(.*)(.)/8 + a\x{100}b + +/a(.)(.)/ + a\xc0\x92bcd + +/a(.)(.)/8 + a\x{240}bcd + +/a(.?)(.)/ + a\xc0\x92bcd + +/a(.?)(.)/8 + a\x{240}bcd + +/a(.??)(.)/ + a\xc0\x92bcd + +/a(.??)(.)/8 + a\x{240}bcd + +/a(.{3})b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + *** Failers + a\x{1234}b + ac\ncb + +/a(.{3,})b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + axxxxbcdefghijb + a\x{1234}\x{4321}\x{3412}\x{3421}b + *** Failers + a\x{1234}b + +/a(.{3,}?)b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + axxxxbcdefghijb + a\x{1234}\x{4321}\x{3412}\x{3421}b + *** Failers + a\x{1234}b + +/a(.{3,5})b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + axxxxbcdefghijb + a\x{1234}\x{4321}\x{3412}\x{3421}b + axbxxbcdefghijb + axxxxxbcdefghijb + *** Failers + a\x{1234}b + axxxxxxbcdefghijb + +/a(.{3,5}?)b/8 + a\x{1234}xyb + a\x{1234}\x{4321}yb + a\x{1234}\x{4321}\x{3412}b + axxxxbcdefghijb + a\x{1234}\x{4321}\x{3412}\x{3421}b + axbxxbcdefghijb + axxxxxbcdefghijb + *** Failers + a\x{1234}b + axxxxxxbcdefghijb + +/^[a\x{c0}]/8 + *** Failers + \x{100} + +/(?<=aXb)cd/8 + aXbcd + +/(?<=a\x{100}b)cd/8 + a\x{100}bcd + +/(?<=a\x{100000}b)cd/8 + a\x{100000}bcd + +/(?:\x{100}){3}b/8 + \x{100}\x{100}\x{100}b + *** Failers + \x{100}\x{100}b + +/ End of testinput5 / diff --git a/srclib/pcre/testdata/testinput6 b/srclib/pcre/testdata/testinput6 new file mode 100644 index 00000000000..00748513c65 --- /dev/null +++ b/srclib/pcre/testdata/testinput6 @@ -0,0 +1,78 @@ +/\x{100}/8DM + +/\x{1000}/8DM + +/\x{10000}/8DM + +/\x{100000}/8DM + +/\x{1000000}/8DM + +/\x{4000000}/8DM + +/\x{7fffFFFF}/8DM + +/[\x{ff}]/8DM + +/[\x{100}]/8DM + +/\x{ffffffff}/8 + +/\x{100000000}/8 + +/^\x{100}a\x{1234}/8 + \x{100}a\x{1234}bcd + +/\x80/8D + +/\xff/8D + +/\x{0041}\x{2262}\x{0391}\x{002e}/D8 + \x{0041}\x{2262}\x{0391}\x{002e} + +/\x{D55c}\x{ad6d}\x{C5B4}/D8 + \x{D55c}\x{ad6d}\x{C5B4} + +/\x{65e5}\x{672c}\x{8a9e}/D8 + \x{65e5}\x{672c}\x{8a9e} + +/\x{80}/D8 + +/\x{084}/D8 + +/\x{104}/D8 + +/\x{861}/D8 + +/\x{212ab}/D8 + +/.{3,5}X/D8 + \x{212ab}\x{212ab}\x{212ab}\x{861}X + + +/.{3,5}?/D8 + \x{212ab}\x{212ab}\x{212ab}\x{861} + +/-- These tests are here rather than in testinput5 because Perl 5.6 has --/ +/-- some problems with UTF-8 support, in the area of \x{..} where the --/ +/-- value is < 255. It grumbles about invalid UTF-8 strings. --/ + +/^[a\x{c0}]b/8 + \x{c0}b + +/^([a\x{c0}]*?)aa/8 + a\x{c0}aaaa/ + +/^([a\x{c0}]*?)aa/8 + a\x{c0}aaaa/ + a\x{c0}a\x{c0}aaa/ + +/^([a\x{c0}]*)aa/8 + a\x{c0}aaaa/ + a\x{c0}a\x{c0}aaa/ + +/^([a\x{c0}]*)a\x{c0}/8 + a\x{c0}aaaa/ + a\x{c0}a\x{c0}aaa/ + +/ End of testinput6 / diff --git a/srclib/pcre/testdata/testoutput5 b/srclib/pcre/testdata/testoutput5 new file mode 100644 index 00000000000..6bb9ad31b4e --- /dev/null +++ b/srclib/pcre/testdata/testoutput5 @@ -0,0 +1,242 @@ +PCRE version 3.9 02-Jan-2002 + +/-- Because of problems with Perl 5.6 in handling UTF-8 vs non UTF-8 --/ +/-- strings automatically, do not use the \x{} construct except with --/ +No match +/-- patterns that have the /8 option set, and don't use them without! --/ +No match + +/a.b/8 + acb + 0: acb + a\x7fb + 0: a\x{7f}b + a\x{100}b + 0: a\x{100}b + *** Failers +No match + a\nb +No match + +/a(.{3})b/8 + a\x{4000}xyb + 0: a\x{4000}xyb + 1: \x{4000}xy + a\x{4000}\x7fyb + 0: a\x{4000}\x{7f}yb + 1: \x{4000}\x{7f}y + a\x{4000}\x{100}yb + 0: a\x{4000}\x{100}yb + 1: \x{4000}\x{100}y + *** Failers +No match + a\x{4000}b +No match + ac\ncb +No match + +/a(.*?)(.)/ + a\xc0\x88b + 0: a\xc0 + 1: + 2: \xc0 + +/a(.*?)(.)/8 + a\x{100}b + 0: a\x{100} + 1: + 2: \x{100} + +/a(.*)(.)/ + a\xc0\x88b + 0: a\xc0\x88b + 1: \xc0\x88 + 2: b + +/a(.*)(.)/8 + a\x{100}b + 0: a\x{100}b + 1: \x{100} + 2: b + +/a(.)(.)/ + a\xc0\x92bcd + 0: a\xc0\x92 + 1: \xc0 + 2: \x92 + +/a(.)(.)/8 + a\x{240}bcd + 0: a\x{240}b + 1: \x{240} + 2: b + +/a(.?)(.)/ + a\xc0\x92bcd + 0: a\xc0\x92 + 1: \xc0 + 2: \x92 + +/a(.?)(.)/8 + a\x{240}bcd + 0: a\x{240}b + 1: \x{240} + 2: b + +/a(.??)(.)/ + a\xc0\x92bcd + 0: a\xc0 + 1: + 2: \xc0 + +/a(.??)(.)/8 + a\x{240}bcd + 0: a\x{240} + 1: + 2: \x{240} + +/a(.{3})b/8 + a\x{1234}xyb + 0: a\x{1234}xyb + 1: \x{1234}xy + a\x{1234}\x{4321}yb + 0: a\x{1234}\x{4321}yb + 1: \x{1234}\x{4321}y + a\x{1234}\x{4321}\x{3412}b + 0: a\x{1234}\x{4321}\x{3412}b + 1: \x{1234}\x{4321}\x{3412} + *** Failers +No match + a\x{1234}b +No match + ac\ncb +No match + +/a(.{3,})b/8 + a\x{1234}xyb + 0: a\x{1234}xyb + 1: \x{1234}xy + a\x{1234}\x{4321}yb + 0: a\x{1234}\x{4321}yb + 1: \x{1234}\x{4321}y + a\x{1234}\x{4321}\x{3412}b + 0: a\x{1234}\x{4321}\x{3412}b + 1: \x{1234}\x{4321}\x{3412} + axxxxbcdefghijb + 0: axxxxbcdefghijb + 1: xxxxbcdefghij + a\x{1234}\x{4321}\x{3412}\x{3421}b + 0: a\x{1234}\x{4321}\x{3412}\x{3421}b + 1: \x{1234}\x{4321}\x{3412}\x{3421} + *** Failers +No match + a\x{1234}b +No match + +/a(.{3,}?)b/8 + a\x{1234}xyb + 0: a\x{1234}xyb + 1: \x{1234}xy + a\x{1234}\x{4321}yb + 0: a\x{1234}\x{4321}yb + 1: \x{1234}\x{4321}y + a\x{1234}\x{4321}\x{3412}b + 0: a\x{1234}\x{4321}\x{3412}b + 1: \x{1234}\x{4321}\x{3412} + axxxxbcdefghijb + 0: axxxxb + 1: xxxx + a\x{1234}\x{4321}\x{3412}\x{3421}b + 0: a\x{1234}\x{4321}\x{3412}\x{3421}b + 1: \x{1234}\x{4321}\x{3412}\x{3421} + *** Failers +No match + a\x{1234}b +No match + +/a(.{3,5})b/8 + a\x{1234}xyb + 0: a\x{1234}xyb + 1: \x{1234}xy + a\x{1234}\x{4321}yb + 0: a\x{1234}\x{4321}yb + 1: \x{1234}\x{4321}y + a\x{1234}\x{4321}\x{3412}b + 0: a\x{1234}\x{4321}\x{3412}b + 1: \x{1234}\x{4321}\x{3412} + axxxxbcdefghijb + 0: axxxxb + 1: xxxx + a\x{1234}\x{4321}\x{3412}\x{3421}b + 0: a\x{1234}\x{4321}\x{3412}\x{3421}b + 1: \x{1234}\x{4321}\x{3412}\x{3421} + axbxxbcdefghijb + 0: axbxxb + 1: xbxx + axxxxxbcdefghijb + 0: axxxxxb + 1: xxxxx + *** Failers +No match + a\x{1234}b +No match + axxxxxxbcdefghijb +No match + +/a(.{3,5}?)b/8 + a\x{1234}xyb + 0: a\x{1234}xyb + 1: \x{1234}xy + a\x{1234}\x{4321}yb + 0: a\x{1234}\x{4321}yb + 1: \x{1234}\x{4321}y + a\x{1234}\x{4321}\x{3412}b + 0: a\x{1234}\x{4321}\x{3412}b + 1: \x{1234}\x{4321}\x{3412} + axxxxbcdefghijb + 0: axxxxb + 1: xxxx + a\x{1234}\x{4321}\x{3412}\x{3421}b + 0: a\x{1234}\x{4321}\x{3412}\x{3421}b + 1: \x{1234}\x{4321}\x{3412}\x{3421} + axbxxbcdefghijb + 0: axbxxb + 1: xbxx + axxxxxbcdefghijb + 0: axxxxxb + 1: xxxxx + *** Failers +No match + a\x{1234}b +No match + axxxxxxbcdefghijb +No match + +/^[a\x{c0}]/8 + *** Failers +No match + \x{100} +No match + +/(?<=aXb)cd/8 + aXbcd + 0: cd + +/(?<=a\x{100}b)cd/8 + a\x{100}bcd + 0: cd + +/(?<=a\x{100000}b)cd/8 + a\x{100000}bcd + 0: cd + +/(?:\x{100}){3}b/8 + \x{100}\x{100}\x{100}b + 0: \x{100}\x{100}\x{100}b + *** Failers +No match + \x{100}\x{100}b +No match + +/ End of testinput5 / + diff --git a/srclib/pcre/testdata/testoutput6 b/srclib/pcre/testdata/testoutput6 new file mode 100644 index 00000000000..fcf084670fa --- /dev/null +++ b/srclib/pcre/testdata/testoutput6 @@ -0,0 +1,319 @@ +PCRE version 3.9 02-Jan-2002 + +/\x{100}/8DM +Memory allocation (code space): 11 +------------------------------------------------------------------ + 0 7 Bra 0 + 3 2 \xc4\x80 + 7 7 Ket + 10 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 196 +Need char = 128 + +/\x{1000}/8DM +Memory allocation (code space): 12 +------------------------------------------------------------------ + 0 8 Bra 0 + 3 3 \xe1\x80\x80 + 8 8 Ket + 11 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 225 +Need char = 128 + +/\x{10000}/8DM +Memory allocation (code space): 13 +------------------------------------------------------------------ + 0 9 Bra 0 + 3 4 \xf0\x90\x80\x80 + 9 9 Ket + 12 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 240 +Need char = 128 + +/\x{100000}/8DM +Memory allocation (code space): 13 +------------------------------------------------------------------ + 0 9 Bra 0 + 3 4 \xf4\x80\x80\x80 + 9 9 Ket + 12 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 244 +Need char = 128 + +/\x{1000000}/8DM +Memory allocation (code space): 14 +------------------------------------------------------------------ + 0 10 Bra 0 + 3 5 \xf9\x80\x80\x80\x80 + 10 10 Ket + 13 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 249 +Need char = 128 + +/\x{4000000}/8DM +Memory allocation (code space): 15 +------------------------------------------------------------------ + 0 11 Bra 0 + 3 6 \xfc\x84\x80\x80\x80\x80 + 11 11 Ket + 14 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 252 +Need char = 128 + +/\x{7fffFFFF}/8DM +Memory allocation (code space): 15 +------------------------------------------------------------------ + 0 11 Bra 0 + 3 6 \xfd\xbf\xbf\xbf\xbf\xbf + 11 11 Ket + 14 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 253 +Need char = 191 + +/[\x{ff}]/8DM +Memory allocation (code space): 40 +------------------------------------------------------------------ + 0 6 Bra 0 + 3 1 \xff + 6 6 Ket + 9 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 255 +No need char + +/[\x{100}]/8DM +Memory allocation (code space): 40 +Failed: characters with values > 255 are not yet supported in classes at offset 7 + +/\x{ffffffff}/8 +Failed: character value in \x{...} sequence is too large at offset 11 + +/\x{100000000}/8 +Failed: character value in \x{...} sequence is too large at offset 12 + +/^\x{100}a\x{1234}/8 + \x{100}a\x{1234}bcd + 0: \x{100}a\x{1234} + +/\x80/8D +------------------------------------------------------------------ + 0 7 Bra 0 + 3 2 \xc2\x80 + 7 7 Ket + 10 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 194 +Need char = 128 + +/\xff/8D +------------------------------------------------------------------ + 0 7 Bra 0 + 3 2 \xc3\xbf + 7 7 Ket + 10 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 195 +Need char = 191 + +/\x{0041}\x{2262}\x{0391}\x{002e}/D8 +------------------------------------------------------------------ + 0 12 Bra 0 + 3 7 A\xe2\x89\xa2\xce\x91. + 12 12 Ket + 15 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 'A' +Need char = '.' + \x{0041}\x{2262}\x{0391}\x{002e} + 0: A\x{2262}\x{391}. + +/\x{D55c}\x{ad6d}\x{C5B4}/D8 +------------------------------------------------------------------ + 0 14 Bra 0 + 3 9 \xed\x95\x9c\xea\xb5\xad\xec\x96\xb4 + 14 14 Ket + 17 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 237 +Need char = 180 + \x{D55c}\x{ad6d}\x{C5B4} + 0: \x{d55c}\x{ad6d}\x{c5b4} + +/\x{65e5}\x{672c}\x{8a9e}/D8 +------------------------------------------------------------------ + 0 14 Bra 0 + 3 9 \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e + 14 14 Ket + 17 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 230 +Need char = 158 + \x{65e5}\x{672c}\x{8a9e} + 0: \x{65e5}\x{672c}\x{8a9e} + +/\x{80}/D8 +------------------------------------------------------------------ + 0 7 Bra 0 + 3 2 \xc2\x80 + 7 7 Ket + 10 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 194 +Need char = 128 + +/\x{084}/D8 +------------------------------------------------------------------ + 0 7 Bra 0 + 3 2 \xc2\x84 + 7 7 Ket + 10 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 194 +Need char = 132 + +/\x{104}/D8 +------------------------------------------------------------------ + 0 7 Bra 0 + 3 2 \xc4\x84 + 7 7 Ket + 10 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 196 +Need char = 132 + +/\x{861}/D8 +------------------------------------------------------------------ + 0 8 Bra 0 + 3 3 \xe0\xa1\xa1 + 8 8 Ket + 11 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 224 +Need char = 161 + +/\x{212ab}/D8 +------------------------------------------------------------------ + 0 9 Bra 0 + 3 4 \xf0\xa1\x8a\xab + 9 9 Ket + 12 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +First char = 240 +Need char = 171 + +/.{3,5}X/D8 +------------------------------------------------------------------ + 0 14 Bra 0 + 3 Any{3} + 7 Any{0,2} + 11 1 X + 14 14 Ket + 17 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +No first char +Need char = 'X' + \x{212ab}\x{212ab}\x{212ab}\x{861}X + 0: \x{212ab}\x{212ab}\x{212ab}\x{861}X + + +/.{3,5}?/D8 +------------------------------------------------------------------ + 0 11 Bra 0 + 3 Any{3} + 7 Any{0,2}? + 11 11 Ket + 14 End +------------------------------------------------------------------ +Capturing subpattern count = 0 +Options: utf8 +No first char +No need char + \x{212ab}\x{212ab}\x{212ab}\x{861} + 0: \x{212ab}\x{212ab}\x{212ab} + +/-- These tests are here rather than in testinput5 because Perl 5.6 has --/ +/-- some problems with UTF-8 support, in the area of \x{..} where the --/ +No match +/-- value is < 255. It grumbles about invalid UTF-8 strings. --/ +No match + +/^[a\x{c0}]b/8 + \x{c0}b + 0: \x{c0}b + +/^([a\x{c0}]*?)aa/8 + a\x{c0}aaaa/ + 0: a\x{c0}aa + 1: a\x{c0} + +/^([a\x{c0}]*?)aa/8 + a\x{c0}aaaa/ + 0: a\x{c0}aa + 1: a\x{c0} + a\x{c0}a\x{c0}aaa/ + 0: a\x{c0}a\x{c0}aa + 1: a\x{c0}a\x{c0} + +/^([a\x{c0}]*)aa/8 + a\x{c0}aaaa/ + 0: a\x{c0}aaaa + 1: a\x{c0}aa + a\x{c0}a\x{c0}aaa/ + 0: a\x{c0}a\x{c0}aaa + 1: a\x{c0}a\x{c0}a + +/^([a\x{c0}]*)a\x{c0}/8 + a\x{c0}aaaa/ + 0: a\x{c0} + 1: + a\x{c0}a\x{c0}aaa/ + 0: a\x{c0}a\x{c0} + 1: a\x{c0} + +/ End of testinput6 / + diff --git a/support/NWGNUhtdigest b/support/NWGNUhtdigest new file mode 100644 index 00000000000..1cc1c962955 --- /dev/null +++ b/support/NWGNUhtdigest @@ -0,0 +1,246 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(AP_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(NWOS) \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr/misc/netware \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = htdigest + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = HT Digest Utility for NetWare + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = htdigest + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/htdigest.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/htdigest.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/support/NWGNUhtpasswd b/support/NWGNUhtpasswd new file mode 100644 index 00000000000..7000529caa7 --- /dev/null +++ b/support/NWGNUhtpasswd @@ -0,0 +1,246 @@ +# +# Make sure all needed macro's are defined +# + +# +# Get the 'head' of the build environment if necessary. This includes default +# targets and paths to tools +# + +ifndef EnvironmentDefined +include $(AP_WORK)\build\NWGNUhead.inc +endif + +# +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(NWOS) \ + $(AP_WORK)/srclib/apr/include \ + $(AP_WORK)/srclib/apr-util/include \ + $(AP_WORK)/srclib/apr/misc/netware \ + $(AP_WORK)/srclib/apr \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = htpasswd + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = HT Password Utility for NetWare + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = htpasswd + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = 8192 + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = _LibCPrelude + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = _LibCPostlude + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/htpasswd.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(OBJDIR)/htpasswd.o \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + libcpre.o \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + aprlib \ + libc \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + @$(APR)/aprlib.imp \ + @libc.imp \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + diff --git a/support/NWGNUmakefile b/support/NWGNUmakefile new file mode 100644 index 00000000000..8a1aef5f419 --- /dev/null +++ b/support/NWGNUmakefile @@ -0,0 +1,245 @@ +# +# Declare the sub-directories to be built here +# + +SUBDIRS = \ + $(EOLIST) + +# +# Get the 'head' of the build environment. This includes default targets and +# paths to tools +# + +include $(AP_WORK)\build\NWGNUhead.inc + +# +# build this level's files + +# +# Make sure all needed macro's are defined +# + +# These directories will be at the beginning of the include list, followed by +# INCDIRS +# +XINCDIRS += \ + $(EOLIST) + +# +# These flags will come after CFLAGS +# +XCFLAGS += \ + $(EOLIST) + +# +# These defines will come after DEFINES +# +XDEFINES += \ + $(EOLIST) + +# +# These flags will be added to the link.opt file +# +XLFLAGS += \ + $(EOLIST) + +# +# These values will be appended to the correct variables based on the value of +# RELEASE +# +ifeq "$(RELEASE)" "debug" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "noopt" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +ifeq "$(RELEASE)" "release" +XINCDIRS += \ + $(EOLIST) + +XCFLAGS += \ + $(EOLIST) + +XDEFINES += \ + $(EOLIST) + +XLFLAGS += \ + $(EOLIST) +endif + +# +# These are used by the link target if an NLM is being generated +# This is used by the link 'name' directive to name the nlm. If left blank +# TARGET_nlm (see below) will be used. +# +NLM_NAME = + +# +# This is used by the link '-desc ' directive. +# If left blank, NLM_NAME will be used. +# +NLM_DESCRIPTION = + +# +# This is used by the '-threadname' directive. If left blank, +# NLM_NAME Thread will be used. +# +NLM_THREAD_NAME = + +# +# If this is specified, it will override VERSION value in +# $(AP_WORK)\build\NWGNUenvironment.inc +# +NLM_VERSION = + +# +# If this is specified, it will override the default of 64K +# +NLM_STACK_SIZE = + + +# +# If this is specified it will be used by the link '-entry' directive +# +NLM_ENTRY_SYM = + +# +# If this is specified it will be used by the link '-exit' directive +# +NLM_EXIT_SYM = + +# +# If this is specified it will be used by the link '-check' directive +# +NLM_CHECK_SYM = + +# +# If these are specified it will be used by the link '-flags' directive +# +NLM_FLAGS = + +# +# If this is specified it will be linked in with the XDCData option in the def +# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled +# by setting APACHE_UNIPROC in the environment +# +XDCDATA = + +# +# If there is an NLM target, put it here +# +TARGET_nlm = \ + $(OBJDIR)/htpasswd.nlm \ + $(OBJDIR)/htdigest.nlm \ + $(EOLIST) + +# +# If there is an LIB target, put it here +# +TARGET_lib = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the NLM target above. +# Paths must all use the '/' character +# +FILES_nlm_objs = \ + $(EOLIST) + +# +# These are the LIB files needed to create the NLM target above. +# These will be added as a library command in the link.opt file. +# +FILES_nlm_libs = \ + $(EOLIST) + +# +# These are the modules that the above NLM target depends on to load. +# These will be added as a module command in the link.opt file. +# +FILES_nlm_modules = \ + $(EOLIST) + +# +# If the nlm has a msg file, put it's path here +# +FILE_nlm_msg = + +# +# If the nlm has a hlp file put it's path here +# +FILE_nlm_hlp = + +# +# If this is specified, it will override $(NWOS)\copyright.txt. +# +FILE_nlm_copyright = + +# +# Any additional imports go here +# +FILES_nlm_Ximports = \ + $(EOLIST) + +# +# Any symbols exported to here +# +FILES_nlm_exports = \ + $(EOLIST) + +# +# These are the OBJ files needed to create the LIB target above. +# Paths must all use the '/' character +# +FILES_lib_objs = \ + $(EOLIST) + +# +# implement targets and dependancies (leave this section alone) +# + +libs :: $(OBJDIR) $(TARGET_lib) + +nlms :: libs $(TARGET_nlm) + +# +# Updated this target to create necessary directories and copy files to the +# correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) +# +install :: nlms FORCE + copy $(OBJDIR)\*.nlm $(INSTALL)\Apache2\*.* + +# +# Any specialized rules here +# + +# +# Include the 'tail' makefile that has targets that depend on variables defined +# in this makefile +# + +include $(AP_WORK)\build\NWGNUtail.inc + + diff --git a/support/checkgid.c b/support/checkgid.c new file mode 100644 index 00000000000..dacec205cc3 --- /dev/null +++ b/support/checkgid.c @@ -0,0 +1,145 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +/* + * Given one or more group identifers on the command line (e.g., + * "httpd" or "#-1"), figure out whether they'll be valid for + * the server to use at run-time. + * + * If a groupname isn't found, or we can't setgid() to it, return + * -1. If all groups are valid, return 0. + * + * This may need to be run as the superuser for the setgid() to + * succeed; running it as any other user may result in a false + * negative. + */ + +#include "ap_config.h" +#if APR_HAVE_STDIO_H +#include +#endif +#if APR_HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_GRP_H +#include +#endif +#if APR_HAVE_UNISTD_H +#include +#endif + +int main(int argc, char *argv[]) +{ + int i; + int result; + gid_t gid; + struct group *grent; + struct group fake_grent; + + /* + * Assume success. :-) + */ + result = 0; + for (i = 1; i < argc; ++i) { + char *arg; + arg = argv[i]; + + /* + * If it's from a 'Group #-1' statement, get the numeric value + * and skip the group lookup stuff. + */ + if (*arg == '#') { + gid = atoi(&arg[1]); + fake_grent.gr_gid = gid; + grent = &fake_grent; + } + else { + grent = getgrnam(arg); + } + + /* + * A NULL return means no such group was found, so we're done + * with this one. + */ + if (grent == NULL) { + fprintf(stderr, "%s: group '%s' not found\n", argv[0], arg); + result = -1; + } + else { + int check; + + /* + * See if we can switch to the numeric GID we have. If so, + * all well and good; if not, well.. + */ + gid = grent->gr_gid; + check = setgid(gid); + if (check != 0) { + fprintf(stderr, "%s: invalid group '%s'\n", argv[0], arg); + perror(argv[0]); + result = -1; + } + } + } + /* + * Worst-case return value. + */ + return result; +} +/* + * Local Variables: + * mode: C + * c-file-style: "bsd" + * End: + */ diff --git a/support/envvars-std.in b/support/envvars-std.in new file mode 100644 index 00000000000..37a86062783 --- /dev/null +++ b/support/envvars-std.in @@ -0,0 +1,10 @@ +# envvars-std - default environment variables for apachectl +# +# This file is generated from envvars-std.in +# +# the following lines are automatically uncommented for +# binary builds +#binbuild @SHLIBPATH_VAR@='@prefix@/lib/:$@SHLIBPATH_VAR@' +#binbuild export @SHLIBPATH_VAR@ +# +@OS_SPECIFIC_VARS@ diff --git a/support/htdbm.c b/support/htdbm.c new file mode 100644 index 00000000000..b9a2f47eb7e --- /dev/null +++ b/support/htdbm.c @@ -0,0 +1,627 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000-2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + +/* + * htdbm.c: simple program for manipulating DBM + * password databases for the Apache HTTP server + * + * Contributed by Mladen Turk + * 12 Oct 2001 + */ + +#include "apr.h" +#include "apr_lib.h" +#include "apr_strings.h" +#include "apr_file_io.h" +#include "apr_file_info.h" +#include "apr_pools.h" +#include "apr_signal.h" +#include "apr_md5.h" +#include "apr_sha1.h" +#include "apr_dbm.h" + +#if APR_HAVE_STDLIB_H +#include +#endif +#if APR_HAVE_STRING_H +#include +#endif +#if APR_HAVE_STRINGS_H +#include +#endif + +#if APR_CHARSET_EBCDIC +#include "apr_xlate.h" +#endif /*APR_CHARSET_EBCDIC*/ + +#if APR_HAVE_CRYPT_H +#include +#endif + + +#if !APR_CHARSET_EBCDIC +#define LF 10 +#define CR 13 +#else /*APR_CHARSET_EBCDIC*/ +#define LF '\n' +#define CR '\r' +#endif /*APR_CHARSET_EBCDIC*/ + +#define MAX_STRING_LEN 256 +#define ALG_PLAIN 0 +#define ALG_APMD5 1 +#define ALG_APSHA 2 + +#if APR_HAVE_CRYPT_H +#define ALG_CRYPT 3 +#endif + + +#define ERR_FILEPERM 1 +#define ERR_SYNTAX 2 +#define ERR_PWMISMATCH 3 +#define ERR_INTERRUPTED 4 +#define ERR_OVERFLOW 5 +#define ERR_BADUSER 6 +#define ERR_EMPTY 7 + + +typedef struct apu_htdbm_t apu_htdbm_t; + +struct apu_htdbm_t { + apr_dbm_t *dbm; + apr_pool_t *pool; +#if APR_CHARSET_EBCDIC + apr_xlate_t *to_ascii; +#endif + char *filename; + char *username; + char *userpass; + char *comment; + int create; + int rdonly; + int alg; +}; + + +#define APU_HTDBM_DECLARE(x) static x +#define APU_HTDBM_STANDALONE 1 + +#define APU_HTDBM_MAKE 0 +#define APU_HTDBM_DELETE 1 +#define APU_HTDBM_VERIFY 2 +#define APU_HTDBM_LIST 3 +#define APU_HTDBM_NOFILE 4 +#define APU_HTDBM_STDIN 5 + +APU_HTDBM_DECLARE(void) apu_htdbm_terminate(apu_htdbm_t *htdbm) +{ + + if (htdbm->dbm) + apr_dbm_close(htdbm->dbm); + htdbm->dbm = NULL; +} + +#if APU_HTDBM_STANDALONE + +static apu_htdbm_t *h; + +APU_HTDBM_DECLARE(void) apu_htdbm_interrupted(void) +{ + apu_htdbm_terminate(h); + fprintf(stderr, "htdbm Interrupted !\n"); + exit(ERR_INTERRUPTED); +} +#endif + +APU_HTDBM_DECLARE(apr_status_t) apu_htdbm_init(apr_pool_t **pool, apu_htdbm_t **hdbm) +{ + +#if APR_CHARSET_EBCDIC + apr_status_t rv; +#endif + +#if APU_HTDBM_STANDALONE + apr_initialize(); + atexit(apr_terminate); + apr_pool_create( pool, NULL); + apr_signal(SIGINT, (void (*)(int)) apu_htdbm_interrupted); + +#endif + + (*hdbm) = (apu_htdbm_t *)apr_pcalloc(*pool, sizeof(apu_htdbm_t)); + (*hdbm)->pool = *pool; + +#if APR_CHARSET_EBCDIC + rv = apr_xlate_open(to_ascii, "ISO8859-1", APR_DEFAULT_CHARSET, (*hdbm)->pool); + if (rv) { + fprintf(stderr, "apr_xlate_open(to ASCII)->%d\n", rv); + return APR_EGENERAL; + } + rv = apr_SHA1InitEBCDIC((*hdbm)->to_ascii); + if (rv) { + fprintf(stderr, "apr_SHA1InitEBCDIC()->%d\n", rv); + return APR_EGENERAL; + } + rv = apr_MD5InitEBCDIC((*hdbm)->to_ascii); + if (rv) { + fprintf(stderr, "apr_MD5InitEBCDIC()->%d\n", rv); + return APR_EGENERAL; + } +#endif /*APR_CHARSET_EBCDIC*/ + + /* Set MD5 as default */ + (*hdbm)->alg = ALG_APMD5; + return APR_SUCCESS; +} + +APU_HTDBM_DECLARE(apr_status_t) apu_htdbm_open(apu_htdbm_t *htdbm) +{ + if (htdbm->create) + return apr_dbm_open(&htdbm->dbm, htdbm->filename, APR_DBM_RWCREATE, + APR_OS_DEFAULT, htdbm->pool); + else + return apr_dbm_open(&htdbm->dbm, htdbm->filename, + htdbm->rdonly ? APR_DBM_READONLY : APR_DBM_READWRITE, + APR_OS_DEFAULT, htdbm->pool); +} + +APU_HTDBM_DECLARE(char *) ap_getword(apr_pool_t *atrans, char **line, char stop) +{ + char *pos = strrchr(*line, stop); + char *res; + + if (!pos) { + res = apr_pstrdup(atrans, *line); + *line += strlen(*line); + return res; + } + + res = apr_pstrndup(atrans, *line, pos - *line); + + while (*pos == stop) + ++pos; + *line = pos; + return res; +} + +APU_HTDBM_DECLARE(apr_status_t) apu_htdbm_save(apu_htdbm_t *htdbm, int *changed) +{ + apr_datum_t key, val; + + if (!htdbm->username) + return APR_SUCCESS; + + key.dptr = htdbm->username; + key.dsize = strlen(htdbm->username); + if (apr_dbm_exists(htdbm->dbm, key)) + *changed = 1; + + val.dsize = strlen(htdbm->userpass); + if (!htdbm->comment) + val.dptr = htdbm->userpass; + else { + val.dptr = apr_pstrcat(htdbm->pool, htdbm->userpass, ";", + htdbm->comment, NULL); + val.dsize += (strlen(htdbm->comment) + 1); + } + return apr_dbm_store(htdbm->dbm, key, val); +} + +APU_HTDBM_DECLARE(apr_status_t) apu_htdbm_del(apu_htdbm_t *htdbm) +{ + apr_datum_t key; + + key.dptr = htdbm->username; + key.dsize = strlen(htdbm->username); + if (!apr_dbm_exists(htdbm->dbm, key)) + return APR_ENOENT; + + return apr_dbm_delete(htdbm->dbm, key); +} + +APU_HTDBM_DECLARE(apr_status_t) apu_htdbm_verify(apu_htdbm_t *htdbm) +{ + apr_datum_t key, val; + char pwd[MAX_STRING_LEN] = {0}; + char *rec, *cmnt; + + key.dptr = htdbm->username; + key.dsize = strlen(htdbm->username); + if (!apr_dbm_exists(htdbm->dbm, key)) + return APR_ENOENT; + if (apr_dbm_fetch(htdbm->dbm, key, &val) != APR_SUCCESS) + return APR_ENOENT; + rec = apr_pstrndup(htdbm->pool, val.dptr, val.dsize); + cmnt = strchr(rec, ';'); + if (cmnt) + strncpy(pwd, rec, cmnt - rec); + else + strcpy(pwd, rec); + return apr_password_validate(htdbm->userpass, pwd); +} + +APU_HTDBM_DECLARE(apr_status_t) apu_htdbm_list(apu_htdbm_t *htdbm) +{ + apr_status_t rv; + apr_datum_t key, val; + char *rec, *cmnt; + char kb[MAX_STRING_LEN]; + int i = 0; + + rv = apr_dbm_firstkey(htdbm->dbm, &key); + if (rv != APR_SUCCESS) { + fprintf(stderr, "Empty database -- %s\n", htdbm->filename); + return APR_ENOENT; + } + rec = apr_pcalloc(htdbm->pool, HUGE_STRING_LEN); + + fprintf(stderr, "Dumping records from database -- %s\n", htdbm->filename); + fprintf(stderr, " %-32sComment\n", "Username"); + while (key.dptr != NULL) { + rv = apr_dbm_fetch(htdbm->dbm, key, &val); + if (rv != APR_SUCCESS) { + fprintf(stderr, "Failed getting data from %s\n", htdbm->filename); + return APR_EGENERAL; + } + strncpy(kb, key.dptr, key.dsize); + kb[key.dsize] = '\0'; + fprintf(stderr, " %-32s", kb); + strncpy(rec, val.dptr, val.dsize); + rec[val.dsize] = '\0'; + cmnt = strchr(rec, ';'); + if (cmnt) + fprintf(stderr, cmnt + 1); + fprintf(stderr, "\n"); + rv = apr_dbm_nextkey(htdbm->dbm, &key); + if (rv != APR_SUCCESS) + fprintf(stderr, "Failed getting NextKey\n"); + ++i; + } + + fprintf(stderr, "Total #records : %d\n", i); + return APR_SUCCESS; +} + +static void to64(char *s, unsigned long v, int n) +{ + static unsigned char itoa64[] = /* 0 ... 63 => ASCII - 64 */ + "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + + while (--n >= 0) { + *s++ = itoa64[v&0x3f]; + v >>= 6; + } +} + +APU_HTDBM_DECLARE(apr_status_t) apu_htdbm_make(apu_htdbm_t *htdbm) +{ + char cpw[MAX_STRING_LEN]; + char salt[9]; + + switch (htdbm->alg) { + case ALG_APSHA: + /* XXX cpw >= 28 + strlen(sha1) chars - fixed len SHA */ + apr_sha1_base64(htdbm->userpass,strlen(htdbm->userpass),cpw); + break; + + case ALG_APMD5: + (void) srand((int) time((time_t *) NULL)); + to64(&salt[0], rand(), 8); + salt[8] = '\0'; + apr_md5_encode((const char *)htdbm->userpass, (const char *)salt, + cpw, sizeof(cpw)); + break; + case ALG_PLAIN: + /* XXX this len limitation is not in sync with any HTTPd len. */ + apr_cpystrn(cpw,htdbm->userpass,sizeof(cpw)); + break; +#if APR_HAVE_CRYPT_H + case ALG_CRYPT: + (void) srand((int) time((time_t *) NULL)); + to64(&salt[0], rand(), 8); + salt[8] = '\0'; + apr_cpystrn(cpw, (char *)crypt(htdbm->userpass, salt), sizeof(cpw) - 1); + fprintf(stderr, "CRYPT is now depriciated, use MD5 instead !\n"); +#endif + default: + break; + } + htdbm->userpass = apr_pstrdup(htdbm->pool, cpw); + return APR_SUCCESS; +} + +APU_HTDBM_DECLARE(apr_status_t) apu_htdbm_valid_username(apu_htdbm_t *htdbm) +{ + if (!htdbm->username || (strlen(htdbm->username) > 64) || (strlen(htdbm->username) < 1)) { + fprintf(stderr, "Invalid username length\n"); + return APR_EINVAL; + } + if (strchr(htdbm->username, ':')) { + fprintf(stderr, "Username contains invalid characters\n"); + return APR_EINVAL; + } + return APR_SUCCESS; +} + +static void htdbm_usage(void) +{ + +#if APR_HAVE_CRYPT_H +#define CRYPT_OPTION "d" +#else +#define CRYPT_OPTION "" +#endif + fprintf(stderr, "htdbm -- program for manipulating DBM password databases.\n\n"); + fprintf(stderr, "Usage: htdbm [-cm"CRYPT_OPTION"pstvx] database username\n"); + fprintf(stderr, " -b[cm"CRYPT_OPTION"ptsv] database username password\n"); + fprintf(stderr, " -n[m"CRYPT_OPTION"pst] username\n"); + fprintf(stderr, " -nb[m"CRYPT_OPTION"pst] username password\n"); + fprintf(stderr, " -v[m"CRYPT_OPTION"ps] database username\n"); + fprintf(stderr, " -vb[m"CRYPT_OPTION"ps] database username password\n"); + fprintf(stderr, " -x[m"CRYPT_OPTION"ps] database username\n"); + fprintf(stderr, " -l database\n"); + fprintf(stderr, "Options:\n"); + fprintf(stderr, " -b Use the password from the command line rather" + "than prompting for it.\n"); + fprintf(stderr, " -c Create a new database.\n"); + fprintf(stderr, " -n Don't update database; display results on stdout.\n"); + fprintf(stderr, " -m Force MD5 encryption of the password (default).\n"); +#if APR_HAVE_CRYPT_H + fprintf(stderr, " -d Force CRYPT encryption of the password (now depriciated).\n"); +#endif + fprintf(stderr, " -p Do not encrypt the password (plaintext).\n"); + fprintf(stderr, " -s Force SHA encryption of the password.\n"); + fprintf(stderr, " -l Display usernames from database on stdout.\n"); + fprintf(stderr, " -t The last param is username comment.\n"); + fprintf(stderr, " -v Verify the username/password.\n"); + fprintf(stderr, " -x Remove the username record from database.\n"); + exit(ERR_SYNTAX); + +} + + +int main(int argc, const char *argv[]) +{ + apr_pool_t *pool; + apr_status_t rv; + apr_size_t l; + char pwi[MAX_STRING_LEN]; + char pwc[MAX_STRING_LEN]; + char errbuf[MAX_STRING_LEN]; + const char *arg; + int need_file = 1; + int need_user = 1; + int need_pwd = 1; + int need_cmnt = 0; + int pwd_supplied = 0; + int changed; + int cmd = APU_HTDBM_MAKE; + int i; + int args_left = 2; + + if ((rv = apu_htdbm_init(&pool, &h)) != APR_SUCCESS) { + fprintf(stderr, "Unable to initialize htdbm terminating!\n"); + apr_strerror(rv, errbuf, sizeof(errbuf)); + exit(1); + } + /* + * Preliminary check to make sure they provided at least + * three arguments, we'll do better argument checking as + * we parse the command line. + */ + if (argc < 3) + htdbm_usage(); + /* + * Go through the argument list and pick out any options. They + * have to precede any other arguments. + */ + for (i = 1; i < argc; i++) { + arg = argv[i]; + if (*arg != '-') + break; + + while (*++arg != '\0') { + switch (*arg) { + case 'b': + pwd_supplied = 1; + need_pwd = 0; + args_left++; + break; + case 'c': + h->create = 1; + break; + case 'n': + need_file = 0; + cmd = APU_HTDBM_NOFILE; + args_left--; + break; + case 'l': + need_pwd = 0; + need_user = 0; + cmd = APU_HTDBM_LIST; + h->rdonly = 1; + args_left--; + break; + case 't': + need_cmnt = 1; + args_left++; + break; + case 'v': + h->rdonly = 1; + cmd = APU_HTDBM_VERIFY; + break; + case 'x': + need_pwd = 0; + cmd = APU_HTDBM_DELETE; + break; + case 'm': + h->alg = ALG_APMD5; + break; + case 'p': + h->alg = ALG_PLAIN; + break; + case 's': + h->alg = ALG_APSHA; + break; +#if APR_HAVE_CRYPT_H + case 'd': + h->alg = ALG_CRYPT; + break; +#endif + default: + htdbm_usage(); + break; + } + } + } + /* + * Make sure we still have exactly the right number of arguments left + * (the filename, the username, and possibly the password if -b was + * specified). + */ + if ((argc - i) != args_left) + htdbm_usage(); + + if (!need_file) + i--; + else { + h->filename = apr_pstrdup(h->pool, argv[i]); + if ((rv = apu_htdbm_open(h)) != APR_SUCCESS) { + fprintf(stderr, "Error oppening database %s\n", argv[i]); + apr_strerror(rv, errbuf, sizeof(errbuf)); + exit(ERR_FILEPERM); + } + } + if (need_user) { + h->username = apr_pstrdup(pool, argv[i+1]); + if (apu_htdbm_valid_username(h) != APR_SUCCESS) + exit(ERR_BADUSER); + } + if (pwd_supplied) + h->userpass = apr_pstrdup(pool, argv[i+2]); + + if (need_pwd) { + l = sizeof(pwc); + if (apr_password_get("Enter password : ", pwi, &l) != APR_SUCCESS) { + fprintf(stderr, "Password too long\n"); + exit(ERR_OVERFLOW); + } + l = sizeof(pwc); + if (apr_password_get("Re-type password : ", pwc, &l) != APR_SUCCESS) { + fprintf(stderr, "Password too long\n"); + exit(ERR_OVERFLOW); + } + if (strcmp(pwi, pwc) != 0) { + fprintf(stderr, "Password verification error\n"); + exit(ERR_PWMISMATCH); + } + + h->userpass = apr_pstrdup(pool, pwi); + } + if (need_cmnt && pwd_supplied) + h->comment = apr_pstrdup(pool, argv[i+3]); + else if (need_cmnt) + h->comment = apr_pstrdup(pool, argv[i+2]); + + switch (cmd) { + case APU_HTDBM_VERIFY: + if ((rv = apu_htdbm_verify(h)) != APR_SUCCESS) { + if(rv == APR_ENOENT) { + fprintf(stderr, "The user '%s' cold not be found in database\n", h->username); + exit(ERR_BADUSER); + } + else { + fprintf(stderr, "Password mismatch for user '%s'\n", h->username); + exit(ERR_PWMISMATCH); + } + } + else + fprintf(stderr, "Password validated for user '%s'\n", h->username); + break; + case APU_HTDBM_DELETE: + if (apu_htdbm_del(h) != APR_SUCCESS) { + fprintf(stderr, "Cannot find user '%s' in database\n", h->username); + exit(ERR_BADUSER); + } + h->username = NULL; + changed = 1; + break; + case APU_HTDBM_LIST: + apu_htdbm_list(h); + break; + default: + apu_htdbm_make(h); + break; + + } + if (need_file && !h->rdonly) { + if ((rv = apu_htdbm_save(h, &changed)) != APR_SUCCESS) { + apr_strerror(rv, errbuf, sizeof(errbuf)); + exit(ERR_FILEPERM); + } + fprintf(stdout, "Database %s %s.\n", h->filename, + h->create ? "created" : (changed ? "modified" : "updated")); + } + if (cmd == APU_HTDBM_NOFILE) + fprintf(stderr, "%s:%s\n", h->username, h->userpass); + apu_htdbm_terminate(h); + apr_terminate(); + + return 0; /* Supress compiler warning. */ +} diff --git a/support/htdbm.dsp b/support/htdbm.dsp new file mode 100644 index 00000000000..613c52fd02a --- /dev/null +++ b/support/htdbm.dsp @@ -0,0 +1,123 @@ +# Microsoft Developer Studio Project File - Name="htdbm" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=htdbm - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "htdbm.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "htdbm.mak" CFG="htdbm - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "htdbm - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "htdbm - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "htdbm - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../srclib/apr/include" /I "../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"Release/htdbm" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /map /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /map /machine:I386 + +!ELSEIF "$(CFG)" == "htdbm - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../srclib/apr/include" /I "../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /Fd"Debug/htdbm" /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /map /debug /machine:I386 +# ADD LINK32 kernel32.lib advapi32.lib wsock32.lib ws2_32.lib /nologo /subsystem:console /incremental:no /map /debug /machine:I386 + +!ENDIF + +# Begin Target + +# Name "htdbm - Win32 Release" +# Name "htdbm - Win32 Debug" +# Begin Source File + +SOURCE=.\htdbm.c +# End Source File +# Begin Source File + +SOURCE=.\htdbm.rc +# End Source File +# Begin Source File + +SOURCE=..\build\win32\win32ver.awk + +!IF "$(CFG)" == "htdbm - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\build\win32\win32ver.awk + +".\htdbm.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../build/win32/win32ver.awk htdbm "htdbm Utility" ../include/ap_release.h > .\htdbm.rc + +# End Custom Build + +!ELSEIF "$(CFG)" == "htdbm - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Creating Version Resource +InputPath=..\build\win32\win32ver.awk + +".\htdbm.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + awk -f ../build/win32/win32ver.awk htdbm "htdbm Utility" ../include/ap_release.h > .\htdbm.rc + +# End Custom Build + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/support/utilitiesnw.def b/support/utilitiesnw.def new file mode 100644 index 00000000000..426b8c96be7 --- /dev/null +++ b/support/utilitiesnw.def @@ -0,0 +1,3 @@ +MODULE APRLIB.NLM +MODULE LIBC.NLM +