2 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
6 * Copyright (C) 2001-2003, Eduardo Silva P.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Library General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 #include <sys/types.h>
31 #define O_NOATIME 01000000
33 #define M_DEFAULT_CONFIG_FILE "monkey.conf"
34 #define MK_WORKERS_DEFAULT 1
37 #define VALUE_OFF "off"
39 #define MK_CONFIG_VAL_STR 0
40 #define MK_CONFIG_VAL_NUM 1
41 #define MK_CONFIG_VAL_BOOL 2
42 #define MK_CONFIG_VAL_LIST 3
48 struct mk_config
*next
;
52 /* Base struct of server */
57 char *serverconf
; /* path to configuration files */
59 mk_pointer server_addr
;
60 mk_pointer server_software
;
64 char *pid_file_path
; /* pid of server */
66 char **request_headers_allowed
;
68 int workers
; /* number of worker threads */
69 int worker_capacity
; /* how many clients per thread... */
71 int symlink
; /* symbolic links */
72 int serverport
; /* port */
73 int timeout
; /* max time to wait for a new connection */
74 int maxclients
; /* max clients (max threads) */
75 int hideversion
; /* hide version of server to clients ? */
76 int standard_port
; /* common port used in web servers (80) */
78 int resume
; /* Resume (on/off) */
81 int keep_alive
; /* it's a persisten connection ? */
82 int max_keep_alive_request
; /* max persistent connections to allow */
83 int keep_alive_timeout
; /* persistent connection timeout */
85 /* counter of threads working */
94 struct dir_html_theme
*dir_theme
;
96 /* configured host quantity */
101 struct plugin_stages
*plugins
;
104 struct server_config
*config
;
108 char *file
; /* configuration file */
109 char *servername
; /* host name */
110 mk_pointer documentroot
;
112 char *access_log_path
; /* access log file */
113 char *error_log_path
; /* error log file */
114 int getdir
; /* allow show directory info ? */
119 char *host_signature
;
120 mk_pointer header_host_signature
;
129 void mk_config_start_configure(void);
130 void mk_config_read_files(char *path_conf
, char *file_conf
);
131 void mk_config_add_index(char *indexname
);
132 void mk_config_print_error_msg(char *variable
, char *path
);
133 void mk_config_set_init_values(void);
136 struct mk_config
*mk_config_create(char *path
);
137 void mk_config_free(struct mk_config
*cnf
);
138 void *mk_config_getval(struct mk_config
*cnf
, char *key
, int mode
);
141 int mk_config_get_bool(char *value
);
142 void mk_config_read_hosts(char *path
);
143 void mk_config_sanity_check();
145 struct host
*mk_config_get_host(char *path
);
146 struct host
*mk_config_host_find(mk_pointer host
);