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 include/httpd.h:

struct server_rec { /** The process this server is running in */ process_rec *process; /** The next server in the list */ server_rec *next; /** The name of the server */ const char *defn_name; /** The line of the config file that the server was defined on */ unsigned defn_line_number; /* Contact information */ /** The admin's contact information */ char *server_admin; /** The server hostname */ char *server_hostname; /** for redirects, etc. */ apr_port_t port; /* Log files --- note that transfer log is now in the modules... */ /** The name of the error log */ char *error_fname; /** A file descriptor that references the error log */ apr_file_t *error_log; /** The log level for this server */ int loglevel; /* Module-specific configuration for server, and defaults... */ /** true if this is the virtual server */ int is_virtual; /** Config vector containing pointers to modules' per-server config * structures. */ struct ap_conf_vector_t *module_config; /** MIME type info, etc., before we start checking per-directory info */ struct ap_conf_vector_t *lookup_defaults; /* Transaction handling */ /** I haven't got a clue */ server_addr_rec *addrs; /** Timeout, in seconds, before we give up */ int timeout; ...

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.