HTTP Daemon Routine
Collaboration diagram for HTTP Daemon Routine:


 Binary notes recognized by the server
 Binary notes recognized by the server.
 HTTP Status Codes
 HTTPD specific values of apr_status_t
 List of Methods recognized by the server
 Methods recognized (but not necessarily handled) by the server.
 Module Magic mime types
 Possible values for request_rec.read_body
 Possible values for request_rec.used_path_info
 Proxy request types

Data Structures

struct  ap_version_t
 The numeric version information is broken out into fields within this structure. More...
struct  htaccess_result
 This represents the result of calling htaccess; these are cached for each request. More...
struct  process_rec
 A structure that represents one process. More...
struct  request_rec
 A structure that represents the current request. More...


#define DEFAULT_ADMIN   "[no address given]"
#define DEFAULT_ERRORLOG   "logs/error_log"
#define DEFAULT_ACCESS_FNAME   ".htaccess"
#define DEFAULT_PATH   "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
#define SUEXEC_BIN   HTTPD_ROOT "/bin/suexec"
#define DEFAULT_TIMEOUT   60
#define AP_DEFAULT_INDEX   "index.html"
#define DOCTYPE_HTML_2_0
#define DOCTYPE_HTML_3_2
#define DOCTYPE_HTML_4_0S
#define DOCTYPE_HTML_4_0T
#define DOCTYPE_HTML_4_0F
#define DOCTYPE_HTML_4_01   "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"
#define DOCTYPE_HTML_5   "<!DOCTYPE html>\n"
#define DOCTYPE_XHTML_1_0S
#define DOCTYPE_XHTML_1_0T
#define DOCTYPE_XHTML_1_0F
#define HTTP_VERSION(major, minor)   (1000*(major)+(minor))
#define HTTP_VERSION_MAJOR(number)   ((number)/1000)
#define HTTP_VERSION_MINOR(number)   ((number)%1000)
#define DEFAULT_HTTP_PORT   80
#define DEFAULT_HTTPS_PORT   443
#define ap_is_default_port(port, r)   ((port) == ap_default_port(r))
#define ap_default_port(r)   ap_run_default_port(r)
#define ap_http_scheme(r)   ap_run_http_scheme(r)
#define HUGE_STRING_LEN   8192
#define AP_IOBUFSIZE   8192
#define AP_MAX_REG_MATCH   10
#define AP_MAX_SENDFILE   16777216 /* 2^24 */
#define APEXIT_OK   0x0
#define APEXIT_INIT   0x2
#define APEXIT_CHILDINIT   0x3
#define APEXIT_CHILDSICK   0x7
#define OK   0
#define DECLINED   -1
#define DONE   -2
#define SUSPENDED   -3
#define AP_NOBODY_WROTE   -100
#define AP_NOBODY_READ   -101
#define AP_FILTER_ERROR   -102
#define LF   10
#define CR   13
#define CRLF   "\015\012"
#define CRLF_ASCII   "\015\012"
#define ZERO_ASCII   "\060"


typedef struct process_rec process_rec
typedef struct server_rec server_rec
typedef struct conn_rec conn_rec
typedef struct conn_slave_rec conn_slave_rec
typedef struct request_rec request_rec
typedef struct conn_state_t conn_state_t


void ap_get_server_revision (ap_version_t *version)
const char * ap_get_server_banner (void)
const char * ap_get_server_description (void)
void ap_add_version_component (apr_pool_t *pconf, const char *component)
const char * ap_get_server_built (void)

Detailed Description

Macro Definition Documentation


#define AP_DEFAULT_INDEX   "index.html"

Define this to be what your HTML directory content files are called

◆ ap_default_port

#define ap_default_port (   r)    ap_run_default_port(r)

Get the default port for a request (which depends on the scheme).

rThe request


#define AP_FILTER_ERROR   -102

Returned by any filter if the filter chain encounters an error and has already dealt with the error response.

◆ ap_http_scheme

#define ap_http_scheme (   r)    ap_run_http_scheme(r)

Get the scheme for a request.

rThe request


#define AP_IOBUFSIZE   8192

The size of the server's internal read-write buffers

◆ ap_is_default_port

#define ap_is_default_port (   port,
)    ((port) == ap_default_port(r))

Check whether port is the default port for the request r.

portThe port number
rThe request
See also


#define AP_MAX_REG_MATCH   10

The max number of regex captures that can be expanded by ap_pregsub


#define AP_MAX_SENDFILE   16777216 /* 2^24 */

APR_HAS_LARGE_FILES introduces the problem of splitting sendfile into multiple buckets, no greater than MAX(apr_size_t), and more granular than that in case the brigade code/filters attempt to read it directly.

16mb is an invention, no idea if it is reasonable.


#define AP_NOBODY_READ   -101

Returned by the bottom-most filter if no data was read.

See also


#define AP_NOBODY_WROTE   -100

Returned by the bottom-most filter if no data was written.

See also



default HTTP Server protocol



A fatal error, resulting in the whole server aborting. If a child exits with this error, the parent process considers this a server-wide fatal error and aborts.


#define APEXIT_CHILDINIT   0x3

The child died during its init sequence


#define APEXIT_CHILDSICK   0x7

The child exited due to a resource shortage. The parent should limit the rate of forking until the situation is resolved.


#define APEXIT_INIT   0x2

A fatal error arising during the server's init sequence


#define APEXIT_OK   0x0

MPM child process exit status values The MPM parent process may check the status to see if special error handling is required. a normal exit

◆ CR

#define CR   13

carriage return


#define CRLF   "\015\012"

carriage return /Line Feed Combo


#define CRLF_ASCII   "\015\012"

Useful for common code with either platform charset.


#define DECLINED   -1

Module declines to handle


#define DEFAULT_ACCESS_FNAME   ".htaccess"

Define this to be what your per-directory security files are called



The default default character set name to add if AddDefaultCharset is enabled. Overridden with AddDefaultCharsetName.


#define DEFAULT_ADMIN   "[no address given]"

Default administrator's address


#define DEFAULT_ERRORLOG   "logs/error_log"

The name of the log files


#define DEFAULT_HTTP_PORT   80

default HTTP Port


#define DEFAULT_HTTPS_PORT   443

default HTTPS Port



The number of requests to entertain per connection



The timeout for waiting for keepalive timeout until next request



default/hard limit on number of leading/trailing empty lines



default limit on number of request header fields



default limit on bytes in any one header field



default limit on bytes in Request-Line (Method+URI+HTTP-version)


#define DEFAULT_PATH   "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"

The name of the server config file The default path for CGI scripts if none is currently set


#define DEFAULT_TIMEOUT   60

The timeout for waiting for messages


#define DOCTYPE_HTML_2_0
"DTD HTML 2.0//EN\">\n"

The name of the MIME types file HTML 2.0 Doctype


#define DOCTYPE_HTML_3_2
"DTD HTML 3.2 Final//EN\">\n"

HTML 3.2 Doctype


#define DOCTYPE_HTML_4_01   "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"

HTML 4.01 Doctype


#define DOCTYPE_HTML_4_0F
"DTD HTML 4.0 Frameset//EN\"\n" \

HTML 4.0 Frameset Doctype


#define DOCTYPE_HTML_4_0S
"DTD HTML 4.0//EN\"\n" \

HTML 4.0 Strict Doctype


#define DOCTYPE_HTML_4_0T
"DTD HTML 4.0 Transitional//EN\"\n" \

HTML 4.0 Transitional Doctype


#define DOCTYPE_HTML_5   "<!DOCTYPE html>\n"

HTML 5 Doctype


#define DOCTYPE_XHTML_1_0F
"<!DOCTYPE html PUBLIC \"-//W3C//" \
"DTD XHTML 1.0 Frameset//EN\"\n" \
"\"http://www.w3.org/TR/xhtml1/DTD/" \

XHTML 1.0 Frameset Doctype


#define DOCTYPE_XHTML_1_0S
"<!DOCTYPE html PUBLIC \"-//W3C//" \
"DTD XHTML 1.0 Strict//EN\"\n" \
"\"http://www.w3.org/TR/xhtml1/DTD/" \

XHTML 1.0 Strict Doctype


#define DOCTYPE_XHTML_1_0T
"<!DOCTYPE html PUBLIC \"-//W3C//" \
"DTD XHTML 1.0 Transitional//EN\"\n" \
"\"http://www.w3.org/TR/xhtml1/DTD/" \

XHTML 1.0 Transitional Doctype



Define this to be the default server home dir. Most things later in this file with a relative pathname will have this added. Default location of documents. Can be overridden by the DocumentRoot directive.


#define DONE   -2

Module has served the response completely

  • it's safe to die() with no more output



Maximum number of dynamically loaded modules


#define HTTP_VERSION (   major,
)    (1000*(major)+(minor))

Internal representation for a HTTP protocol number, e.g., HTTP/1.1


#define HTTP_VERSION_MAJOR (   number)    ((number)/1000)

Major part of HTTP protocol


#define HTTP_VERSION_MINOR (   number)    ((number)%1000)

Minor part of HTTP protocol


#define HUGE_STRING_LEN   8192

The length of a Huge string

◆ LF

#define LF   10




The default string length

◆ OK

#define OK   0

Module has handled this stage.


#define SUEXEC_BIN   HTTPD_ROOT "/bin/suexec"

The path to the suExec wrapper, can be overridden in Configuration


#define SUSPENDED   -3

Module will handle the remainder of the request. The core will never invoke the request again,


#define ZERO_ASCII   "\060"

Typedef Documentation

◆ conn_rec

typedef struct conn_rec conn_rec

A structure that represents one connection

◆ conn_slave_rec

A structure that represents one slave connection

◆ conn_state_t

typedef struct conn_state_t conn_state_t

A structure that represents the status of the current connection

◆ process_rec

typedef struct process_rec process_rec

A structure that represents one process

◆ request_rec

typedef struct request_rec request_rec

A structure that represents the current request

◆ server_rec

typedef struct server_rec server_rec

A structure that represents a virtual server

Function Documentation

◆ ap_add_version_component()

void ap_add_version_component ( apr_pool_t pconf,
const char *  component 

Add a component to the server description and banner strings

pconfThe pool to allocate the component from
componentThe string to add

◆ ap_get_server_banner()

const char* ap_get_server_banner ( void  )

Get the server banner in a form suitable for sending over the network, with the level of information controlled by the ServerTokens directive.

The server banner

◆ ap_get_server_built()

const char* ap_get_server_built ( void  )

Get the date a time that the server was built

The server build time string

◆ ap_get_server_description()

const char* ap_get_server_description ( void  )

Get the server description in a form suitable for local displays, status reports, or logging. This includes the detailed server version and information about some modules. It is not affected by the ServerTokens directive.

The server description

◆ ap_get_server_revision()

void ap_get_server_revision ( ap_version_t version)

Return httpd's version information in a numeric form.

versionPointer to a version structure for returning the version information.