O'Reilly logo

Apache: The Definitive Guide, 3rd Edition by Peter Laurie, Ben Laurie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required