JezK
Edit File: page-Configuration_hpp.ri
U:RDoc::TopLevel[ i I")src/apache2_module/Configuration.hpp:ETcRDoc::Parser::Simpleo:RDoc::Markup::Document:@parts[/o:RDoc::Markup::Verbatim;[I";Phusion Passenger - https://www.phusionpassenger.com/ ;TI"2Copyright (c) 2010-2016 Phusion Holding B.V. ;TI" ;TI"I"Passenger", "Phusion Passenger" and "Union Station" are registered ;TI"(trademarks of Phusion Holding B.V. ;TI" ;TI"RPermission is hereby granted, free of charge, to any person obtaining a copy ;TI"Sof this software and associated documentation files (the "Software"), to deal ;TI"Rin the Software without restriction, including without limitation the rights ;TI"Oto use, copy, modify, merge, publish, distribute, sublicense, and/or sell ;TI"Kcopies of the Software, and to permit persons to whom the Software is ;TI">furnished to do so, subject to the following conditions: ;TI" ;TI"PThe above copyright notice and this permission notice shall be included in ;TI"9all copies or substantial portions of the Software. ;TI" ;TI"PTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ;TI"NIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ;TI"QFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ;TI"LAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ;TI"SLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ;TI"OOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ;TI"THE SOFTWARE. ;T:@format0o:RDoc::Markup::Paragraph;[I"+#ifndef _PASSENGER_CONFIGURATION_HPP_ ;TI"*#define _PASSENGER_CONFIGURATION_HPP_;To:RDoc::Markup::BlankLine o;;[ I"#include <Logging.h> ;TI"#include <Constants.h> ;TI"#include <Utils.h> ;TI""#include <Utils/VariantMap.h>;T@(o; ;[I"K The APR headers must come after the Passenger headers. See Hooks.cpp ;TI" to learn why. ;TI"/ ;T; 0o;;[I"#include "Configuration.h";T@(o;;[I"#include <set> ;TI"#include <string>;T@(o;;[I"#include <sys/types.h> ;TI"#include <pwd.h> ;TI"#include <grp.h>;T@(o;;[I"/**;To; ;[ I": @defgroup Configuration Apache module configuration ;TI" @ingroup Core ;TI" @{ ;TI"/ ;T; 0o;;[I"namespace Passenger {;T@(o;;[I"using namespace std;;T@(o;;[I"$#define UNSET_INT_VALUE INT_MIN;T@(o;;[I"/**;To; ;[ I"/ Per-directory configuration information. ;TI" ;TI"M Use the getter methods to query information, because those will return ;TI"7 the default value if the value is not specified. ;TI"/ ;T; 0o;;[I"'#include "ConfigurationFields.hpp";T@(o;;[I"0struct DirConfig : GeneratedDirConfigPart {;T@(o; ;[RI"* std::set<std::string> baseURIs; ;TI" ;TI"J /** The path to the application's root (for example: RAILS_ROOT ;TI"? for Rails applications, directory containing 'config.ru' ;TI"A for Rack applications). If this value is NULL, the default ;TI"& autodetected path will be used. ;TI"/ ;TI" const char *appRoot; ;TI" ;TI"M /** Whether symlinks in the document root path should be resolved. ;TI"/ The implication of this is documented at ;TI"W https://www.phusionpassenger.com/library/indepth/ruby/app_autodetection/apache/. ;TI"/ ;TI"- Threeway resolveSymlinksInDocRoot; ;TI" ;TI" /** ;TI"R Whether encoded slashes in URLs should be supported. This however conflicts ;TI"R with mod_rewrite support because of a bug/limitation in Apache, so it's one ;TI" or the other. ;TI"/ ;TI"( Threeway allowEncodedSlashes; ;TI" ;TI"" string unionStationKey; ;TI" ;TI". vector<string> unionStationFilters; ;TI" ;TI" /** ;TI"3 Whether analytics logging should be enabled. ;TI"/ ;TI"( Threeway unionStationSupport; ;TI" ;TI" /** ;TI"5 Whether response buffering support is enabled. ;TI"/ ;TI"# Threeway bufferResponse; ;TI" ;TI"2 / ;TI"2 /*************************************/ ;TI" ;TI"# bool isEnabled() const { ;TI". return enabled != DISABLED; ;TI" } ;TI" ;TI"- bool highPerformanceMode() const { ;TI"5 return highPerformance == ENABLED; ;TI" } ;TI" ;TI". bool allowsEncodedSlashes() const { ;TI"9 return allowEncodedSlashes == ENABLED; ;TI" } ;TI" ;TI") bool useUnionStation() const { ;TI"9 return unionStationSupport == ENABLED; ;TI" } ;TI" ;TI"+ bool getBufferResponse() const { ;TI"4 return bufferResponse == ENABLED; ;TI" } ;TI" ;TI"7 string getUnionStationFilterString() const { ;TI"5 if (unionStationFilters.empty()) { ;TI"+ return string(); ;TI" } else { ;TI") string result; ;TI"= vector<string>::const_iterator it; ;TI" ;TI"j for (it = unionStationFilters.begin(); it != unionStationFilters.end(); it++) { ;TI"K if (it != unionStationFilters.begin()) { ;TI"B result.append(1, '\1'); ;TI"$ } ;TI"6 result.append(*it); ;TI" } ;TI") return result; ;TI" } ;TI" } ;TI" ;TI"2 /*************************************/ ;T; 0o;;[I"};;T@(o;;[I"/**;To; ;[ I"L Server-wide (global, not per-virtual host) configuration information. ;TI" ;TI"M Use the getter methods to query information, because those will return ;TI"7 the default value if the value is not specified. ;TI"/ ;T; 0o;;[I"struct ServerConfig {;To; ;[pI", /** The Passenger root folder. */ ;TI" const char *root; ;TI" ;TI" VariantMap ctl; ;TI" ;TI"6 /** The default Ruby interpreter to use. */ ;TI"# const char *defaultRuby; ;TI" ;TI"$ /** The log verbosity. */ ;TI" int logLevel; ;TI" ;TI"P /** A file to print debug messages to, or NULL to just use STDERR. */ ;TI" const char *logFile; ;TI"- const char *fileDescriptorLogFile; ;TI" ;TI"A /** Socket backlog for Passenger Core server socket */ ;TI"& unsigned int socketBacklog; ;TI" ;TI"E /** The maximum number of simultaneously alive application ;TI" instances. */ ;TI"$ unsigned int maxPoolSize; ;TI" ;TI"G /** The maximum number of seconds that an application may be ;TI") idle before it gets terminated. */ ;TI"% unsigned int poolIdleTime; ;TI" ;TI"4 unsigned int responseBufferHighWatermark; ;TI" ;TI") unsigned int statThrottleRate; ;TI" ;TI"< /** Whether user switching support is enabled. */ ;TI" bool userSwitching; ;TI" ;TI"0 /** See PoolOptions for more info. */ ;TI" string defaultUser; ;TI"0 /** See PoolOptions for more info. */ ;TI" string defaultGroup; ;TI" ;TI" string dataBufferDir; ;TI"& string instanceRegistryDir; ;TI" ;TI"+ bool disableSecurityUpdateCheck; ;TI"+ string securityUpdateCheckProxy; ;TI" ;TI"$ bool unionStationSupport; ;TI"- string unionStationGatewayAddress; ;TI"' int unionStationGatewayPort; ;TI"* string unionStationGatewayCert; ;TI"+ string unionStationProxyAddress; ;TI" ;TI"D /** Directory in which analytics logs should be saved. */ ;TI"# string analyticsLogUser; ;TI"$ string analyticsLogGroup; ;TI" ;TI" bool turbocaching; ;TI" ;TI"$ set<string> prestartURLs; ;TI" ;TI" ServerConfig() { ;TI"- root = NULL; ;TI"5 defaultRuby = DEFAULT_RUBY; ;TI": logLevel = DEFAULT_LOG_LEVEL; ;TI"- logFile = NULL; ;TI"0 fileDescriptorLogFile = NULL; ;TI"? socketBacklog = DEFAULT_SOCKET_BACKLOG; ;TI"> maxPoolSize = DEFAULT_MAX_POOL_SIZE; ;TI"? poolIdleTime = DEFAULT_POOL_IDLE_TIME; ;TI"X responseBufferHighWatermark = DEFAULT_RESPONSE_BUFFER_HIGH_WATERMARK; ;TI"C statThrottleRate = DEFAULT_STAT_THROTTLE_RATE; ;TI"- userSwitching = true; ;TI"6 disableSecurityUpdateCheck = false; ;TI"7 securityUpdateCheckProxy = string(); ;TI"= defaultUser = DEFAULT_WEB_APP_USER; ;TI"6 unionStationSupport = false; ;TI"V unionStationGatewayAddress = DEFAULT_UNION_STATION_GATEWAY_ADDRESS; ;TI"S unionStationGatewayPort = DEFAULT_UNION_STATION_GATEWAY_PORT; ;TI"9 unionStationGatewayCert = string(); ;TI"9 unionStationProxyAddress = string(); ;TI"C analyticsLogUser = DEFAULT_ANALYTICS_LOG_USER; ;TI"D analyticsLogGroup = DEFAULT_ANALYTICS_LOG_GROUP; ;TI"- turbocaching = true; ;TI" } ;TI" ;TI"L /** Called after the configuration files have been loaded, inside ;TI" the control process. ;TI"/ ;TI" void finalize() { ;TI". if (defaultGroup.empty()) { ;TI"T struct passwd *userEntry = getpwnam(defaultUser.c_str()); ;TI"3 if (userEntry == NULL) { ;TI"@ throw ConfigurationException( ;TI"f string("The user that PassengerDefaultUser refers to, '") + ;TI"O defaultUser + "', does not exist."); ;TI" } ;TI" ;TI"R struct group *groupEntry = getgrgid(userEntry->pw_gid); ;TI"4 if (groupEntry == NULL) { ;TI"@ throw ConfigurationException( ;TI"a string("The option PassengerDefaultUser is set to '" + ;TI"c defaultUser + "', but its primary group doesn't exist. " ;TI"a "In other words, your system's user account database " ;TI"I "is broken. Please fix it.")); ;TI" } ;TI" ;TI"> defaultGroup = groupEntry->gr_name; ;TI" } ;TI" } ;T; 0o;;[I"};;T@(o;;[I"&extern ServerConfig serverConfig;;T@(o;;[I"} // namespace Passenger;T@(o;;[I"/**;To; ;[I" @} ;TI"/ ;T; 0o;;[I"/#endif /* _PASSENGER_CONFIGURATION_HPP_ */;T: @file@:0@omit_headings_from_table_of_contents_below0