Per-Server Configuration

Since a single instance of Apache may be called on to handle a request for any of the configured virtual hosts (or the main host), a structure is defined that holds the information related to each host. This structure, server_rec , is defined in httpd.h:

struct server_rec { server_rec *next; /* Description of where the definition came from */ const char *defn_name; unsigned defn_line_number; /* Full locations of server config info */ char *srm_confname; char *access_confname; /* Contact information */ char *server_admin; char *server_hostname; unsigned short port; /* For redirects, etc. */ /* Log files --- note that transfer log is now in the modules... */ char *error_fname; FILE *error_log; int loglevel; /* Module-specific configuration for server, and defaults... */ int is_virtual; /* True if this is the virtual server */ void *module_config; /* Config vector containing pointers to * modules' per-server config structures. */ void *lookup_defaults; /* MIME type info, etc., before we start * checking per-directory info. */ /* Transaction handling */ server_addr_rec *addrs; int timeout; /* Timeout, in seconds, before we give up */ int keep_alive_timeout; /* Seconds we'll wait for another request */ int keep_alive_max; /* Maximum requests per connection */ int keep_alive; /* Maximum requests per connection */ int send_buffer_size; /* Size of TCP send buffer (in bytes) */ char *path; /* Pathname for ServerPath */ int pathlen; /* Length of path */ char ...

Get Apache: The Definitive Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.