Apache2
HTTP Daemon Routine
Collaboration diagram for HTTP Daemon Routine:

Modules

 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...
 

Macros

#define DOCUMENT_LOCATION   HTTPD_ROOT "/htdocs"
 
#define DYNAMIC_MODULE_LIMIT   256
 
#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 DEFAULT_KEEPALIVE_TIMEOUT   5
 
#define DEFAULT_KEEPALIVE   100
 
#define DEFAULT_LIMIT_REQUEST_LINE   8190
 
#define DEFAULT_LIMIT_REQUEST_FIELDSIZE   8190
 
#define DEFAULT_LIMIT_REQUEST_FIELDS   100
 
#define DEFAULT_LIMIT_BLANK_LINES   10
 
#define DEFAULT_ADD_DEFAULT_CHARSET_NAME   "iso-8859-1"
 
#define AP_SERVER_PROTOCOL   "HTTP/1.1"
 
#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 MAX_STRING_LEN   HUGE_STRING_LEN
 
#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 APEXIT_CHILDFATAL   0xf
 
#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"
 

Typedefs

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
 

Functions

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

◆ AP_DEFAULT_INDEX

#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).

Parameters
rThe request

◆ AP_FILTER_ERROR

#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.

Parameters
rThe request

◆ AP_IOBUFSIZE

#define AP_IOBUFSIZE   8192

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

◆ ap_is_default_port

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

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

Parameters
portThe port number
rThe request
See also
ap_default_port

◆ AP_MAX_REG_MATCH

#define AP_MAX_REG_MATCH   10

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

◆ AP_MAX_SENDFILE

#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.

◆ AP_NOBODY_READ

#define AP_NOBODY_READ   -101

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

See also
ap_get_brigade().

◆ AP_NOBODY_WROTE

#define AP_NOBODY_WROTE   -100

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

See also
ap_pass_brigade().

◆ AP_SERVER_PROTOCOL

#define AP_SERVER_PROTOCOL   "HTTP/1.1"

default HTTP Server protocol

◆ APEXIT_CHILDFATAL

#define APEXIT_CHILDFATAL   0xf

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.

◆ APEXIT_CHILDINIT

#define APEXIT_CHILDINIT   0x3

The child died during its init sequence

◆ APEXIT_CHILDSICK

#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.

◆ APEXIT_INIT

#define APEXIT_INIT   0x2

A fatal error arising during the server's init sequence

◆ APEXIT_OK

#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

◆ CRLF

#define CRLF   "\015\012"

carriage return /Line Feed Combo

◆ CRLF_ASCII

#define CRLF_ASCII   "\015\012"

Useful for common code with either platform charset.

◆ DECLINED

#define DECLINED   -1

Module declines to handle

◆ DEFAULT_ACCESS_FNAME

#define DEFAULT_ACCESS_FNAME   ".htaccess"

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

◆ DEFAULT_ADD_DEFAULT_CHARSET_NAME

#define DEFAULT_ADD_DEFAULT_CHARSET_NAME   "iso-8859-1"

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

◆ DEFAULT_ADMIN

#define DEFAULT_ADMIN   "[no address given]"

Default administrator's address

◆ DEFAULT_ERRORLOG

#define DEFAULT_ERRORLOG   "logs/error_log"

The name of the log files

◆ DEFAULT_HTTP_PORT

#define DEFAULT_HTTP_PORT   80

default HTTP Port

◆ DEFAULT_HTTPS_PORT

#define DEFAULT_HTTPS_PORT   443

default HTTPS Port

◆ DEFAULT_KEEPALIVE

#define DEFAULT_KEEPALIVE   100

The number of requests to entertain per connection

◆ DEFAULT_KEEPALIVE_TIMEOUT

#define DEFAULT_KEEPALIVE_TIMEOUT   5

The timeout for waiting for keepalive timeout until next request

◆ DEFAULT_LIMIT_BLANK_LINES

#define DEFAULT_LIMIT_BLANK_LINES   10

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

◆ DEFAULT_LIMIT_REQUEST_FIELDS

#define DEFAULT_LIMIT_REQUEST_FIELDS   100

default limit on number of request header fields

◆ DEFAULT_LIMIT_REQUEST_FIELDSIZE

#define DEFAULT_LIMIT_REQUEST_FIELDSIZE   8190

default limit on bytes in any one header field

◆ DEFAULT_LIMIT_REQUEST_LINE

#define DEFAULT_LIMIT_REQUEST_LINE   8190

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

◆ DEFAULT_PATH

#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

◆ DEFAULT_TIMEOUT

#define DEFAULT_TIMEOUT   60

The timeout for waiting for messages

◆ DOCTYPE_HTML_2_0

#define DOCTYPE_HTML_2_0
Value:
"<!DOCTYPE HTML PUBLIC \"-//IETF//" \
"DTD HTML 2.0//EN\">\n"

The name of the MIME types file HTML 2.0 Doctype

◆ DOCTYPE_HTML_3_2

#define DOCTYPE_HTML_3_2
Value:
"<!DOCTYPE HTML PUBLIC \"-//W3C//" \
"DTD HTML 3.2 Final//EN\">\n"

HTML 3.2 Doctype

◆ DOCTYPE_HTML_4_01

#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

◆ DOCTYPE_HTML_4_0F

#define DOCTYPE_HTML_4_0F
Value:
"<!DOCTYPE HTML PUBLIC \"-//W3C//" \
"DTD HTML 4.0 Frameset//EN\"\n" \
"\"http://www.w3.org/TR/REC-html40/frameset.dtd\">\n"

HTML 4.0 Frameset Doctype

◆ DOCTYPE_HTML_4_0S

#define DOCTYPE_HTML_4_0S
Value:
"<!DOCTYPE HTML PUBLIC \"-//W3C//" \
"DTD HTML 4.0//EN\"\n" \
"\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"

HTML 4.0 Strict Doctype

◆ DOCTYPE_HTML_4_0T

#define DOCTYPE_HTML_4_0T
Value:
"<!DOCTYPE HTML PUBLIC \"-//W3C//" \
"DTD HTML 4.0 Transitional//EN\"\n" \
"\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n"

HTML 4.0 Transitional Doctype

◆ DOCTYPE_HTML_5

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

HTML 5 Doctype

◆ DOCTYPE_XHTML_1_0F

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

XHTML 1.0 Frameset Doctype

◆ DOCTYPE_XHTML_1_0S

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

XHTML 1.0 Strict Doctype

◆ DOCTYPE_XHTML_1_0T

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

XHTML 1.0 Transitional Doctype

◆ DOCUMENT_LOCATION

#define DOCUMENT_LOCATION   HTTPD_ROOT "/htdocs"

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.

◆ DONE

#define DONE   -2

Module has served the response completely

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

◆ DYNAMIC_MODULE_LIMIT

#define DYNAMIC_MODULE_LIMIT   256

Maximum number of dynamically loaded modules

◆ HTTP_VERSION

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

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

◆ HTTP_VERSION_MAJOR

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

Major part of HTTP protocol

◆ HTTP_VERSION_MINOR

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

Minor part of HTTP protocol

◆ HUGE_STRING_LEN

#define HUGE_STRING_LEN   8192

The length of a Huge string

◆ LF

#define LF   10

linefeed

◆ MAX_STRING_LEN

#define MAX_STRING_LEN   HUGE_STRING_LEN

The default string length

◆ OK

#define OK   0

Module has handled this stage.

◆ SUEXEC_BIN

#define SUEXEC_BIN   HTTPD_ROOT "/bin/suexec"

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

◆ SUSPENDED

#define SUSPENDED   -3

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

◆ ZERO_ASCII

#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

Parameters
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.

Returns
The server banner

◆ ap_get_server_built()

const char* ap_get_server_built ( void  )

Get the date a time that the server was built

Returns
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.

Returns
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.

Parameters
versionPointer to a version structure for returning the version information.