00001 /* 00002 * Phusion Passenger - http://www.modrails.com/ 00003 * Copyright (C) 2008 Phusion 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; version 2 of the License. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License along 00015 * with this program; if not, write to the Free Software Foundation, Inc., 00016 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00017 */ 00018 #ifndef _PASSENGER_CONFIGURATION_H_ 00019 #define _PASSENGER_CONFIGURATION_H_ 00020 00021 #include <apr_pools.h> 00022 #include <httpd.h> 00023 #include <http_config.h> 00024 00025 /** 00026 * @defgroup Configuration Apache module configuration 00027 * @ingroup Core 00028 * @{ 00029 */ 00030 00031 /** Module version number. */ 00032 #define PASSENGER_VERSION "1.0.5" 00033 00034 #ifdef __cplusplus 00035 #include <set> 00036 #include <string> 00037 00038 namespace Passenger { 00039 00040 using namespace std; 00041 00042 /** 00043 * Per-directory configuration information. 00044 */ 00045 struct DirConfig { 00046 enum Threeway { ENABLED, DISABLED, UNSET }; 00047 00048 std::set<std::string> base_uris; 00049 Threeway autoDetect; 00050 Threeway allowModRewrite; 00051 }; 00052 00053 /** 00054 * Server-wide configuration information. 00055 */ 00056 struct ServerConfig { 00057 /** The filename of the Ruby interpreter to use. */ 00058 const char *ruby; 00059 00060 /** The environment (i.e. value for RAILS_ENV) under which the 00061 * Rails application should operate. */ 00062 const char *env; 00063 00064 /** The filename of the spawn server to use. */ 00065 const char *spawnServer; 00066 00067 /** The maximum number of simultaneously alive Rails application 00068 * instances. */ 00069 unsigned int maxPoolSize; 00070 00071 /** Whether the maxPoolSize option was explicitly specified in 00072 * this server config. */ 00073 bool maxPoolSizeSpecified; 00074 00075 /** The maximum number of seconds that a Rails application may be 00076 * idle before it gets terminated. */ 00077 unsigned int poolIdleTime; 00078 00079 /** Whether the poolIdleTime option was explicitly specified in 00080 * this server config. */ 00081 bool poolIdleTimeSpecified; 00082 00083 /** Whether user switching support is enabled. */ 00084 bool userSwitching; 00085 00086 /** Whether the userSwitching option was explicitly specified in 00087 * this server config. */ 00088 bool userSwitchingSpecified; 00089 00090 /** User that Rails applications must run as if user switching 00091 * fails or is disabled. NULL means the option is not specified. 00092 */ 00093 const char *defaultUser; 00094 }; 00095 } 00096 00097 extern "C" { 00098 #endif 00099 00100 /** Configuration hook for per-directory configuration structure creation. */ 00101 void *passenger_config_create_dir(apr_pool_t *p, char *dirspec); 00102 00103 /** Configuration hook for per-directory configuration structure merging. */ 00104 void *passenger_config_merge_dir(apr_pool_t *p, void *basev, void *addv); 00105 00106 /** Configuration hook for per-server configuration structure creation. */ 00107 void *passenger_config_create_server(apr_pool_t *p, server_rec *s); 00108 00109 /** Configuration hook for per-server configuration structure merging. */ 00110 void *passenger_config_merge_server(apr_pool_t *p, void *basev, void *overridesv); 00111 00112 void passenger_config_merge_all_servers(apr_pool_t *pool, server_rec *main_server); 00113 00114 /** Apache module commands array. */ 00115 extern const command_rec passenger_commands[]; 00116 00117 #ifdef __cplusplus 00118 } 00119 #endif 00120 00121 /** 00122 * @} 00123 */ 00124 00125 #endif /* _PASSENGER_CONFIGURATION_H_ */