home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

Book HomeApache: The Definitive GuideSearch this book

14.2. 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 *names;                /* Normal names for ServerAlias servers */
    array_header *wild_names;   /* Wildcarded names for ServerAlias servers
                                 */

    uid_t server_uid;    /* Effective user ID when calling exec wrapper */
    gid_t server_gid;    /* Effective group ID when calling exec wrapper */
};

Most of this structure is used by the Apache core, but each module can also have a per-server configuration, which is accessed via the module_config member, using ap_get_module_config(). Each module creates this per-module configuration structure itself, so it has complete control over its size and contents.



Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.











??????????????@Mail.ru