public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Hongli Lai (Phusion) (author)
Wed May 07 11:27:40 -0700 2008
commit  d08249a5bf9f8a34032013300da369dab6b715c4
tree    ba5cf6ba1f210542e694646039a9f425086e0979
parent  5623d73808a0c8b26229e8de2e782af14764ecdd
passenger / ext / apache2 / Configuration.h
100644 126 lines (97 sloc) 3.558 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*
 * Phusion Passenger - http://www.modrails.com/
 * Copyright (C) 2008 Phusion
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
#ifndef _PASSENGER_CONFIGURATION_H_
#define _PASSENGER_CONFIGURATION_H_
 
#include <apr_pools.h>
#include <httpd.h>
#include <http_config.h>
 
/**
 * @defgroup Configuration Apache module configuration
 * @ingroup Core
 * @{
 */
 
/** Module version number. */
#define PASSENGER_VERSION "1.0.5"
 
#ifdef __cplusplus
  #include <set>
  #include <string>
 
  namespace Passenger {
  
    using namespace std;
 
    /**
     * Per-directory configuration information.
     */
    struct DirConfig {
      enum Threeway { ENABLED, DISABLED, UNSET };
      
      std::set<std::string> base_uris;
      Threeway autoDetect;
      Threeway allowModRewrite;
    };
    
    /**
     * Server-wide configuration information.
     */
    struct ServerConfig {
      /** The filename of the Ruby interpreter to use. */
      const char *ruby;
      
      /** The environment (i.e. value for RAILS_ENV) under which the
       * Rails application should operate. */
      const char *env;
      
      /** The filename of the spawn server to use. */
      const char *spawnServer;
      
      /** The maximum number of simultaneously alive Rails application
       * instances. */
      unsigned int maxPoolSize;
      
      /** Whether the maxPoolSize option was explicitly specified in
       * this server config. */
      bool maxPoolSizeSpecified;
      
      /** The maximum number of seconds that a Rails application may be
       * idle before it gets terminated. */
      unsigned int poolIdleTime;
      
      /** Whether the poolIdleTime option was explicitly specified in
       * this server config. */
      bool poolIdleTimeSpecified;
      
      /** Whether user switching support is enabled. */
      bool userSwitching;
      
      /** Whether the userSwitching option was explicitly specified in
       * this server config. */
      bool userSwitchingSpecified;
 
      /** User that Rails applications must run as if user switching
       * fails or is disabled. NULL means the option is not specified.
       */
      const char *defaultUser;
    };
  }
 
  extern "C" {
#endif
 
/** Configuration hook for per-directory configuration structure creation. */
void *passenger_config_create_dir(apr_pool_t *p, char *dirspec);
 
/** Configuration hook for per-directory configuration structure merging. */
void *passenger_config_merge_dir(apr_pool_t *p, void *basev, void *addv);
 
/** Configuration hook for per-server configuration structure creation. */
void *passenger_config_create_server(apr_pool_t *p, server_rec *s);
 
/** Configuration hook for per-server configuration structure merging. */
void *passenger_config_merge_server(apr_pool_t *p, void *basev, void *overridesv);
 
void passenger_config_merge_all_servers(apr_pool_t *pool, server_rec *main_server);
 
/** Apache module commands array. */
extern const command_rec passenger_commands[];
 
#ifdef __cplusplus
  }
#endif
 
/**
 * @}
 */
 
#endif /* _PASSENGER_CONFIGURATION_H_ */