passenger 4.0.23 → 4.0.24
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- data.tar.gz.asc +7 -7
- data/NEWS +17 -0
- data/bin/passenger-config +3 -0
- data/bin/passenger-install-apache2-module +1 -1
- data/bin/passenger-install-nginx-module +1 -1
- data/build/integration_tests.rb +5 -3
- data/debian.template/control.template +6 -4
- data/doc/Users guide Apache.idmap.txt +9 -5
- data/doc/Users guide Apache.txt +38 -3
- data/doc/Users guide Nginx.idmap.txt +58 -54
- data/doc/Users guide Nginx.txt +126 -63
- data/doc/Users guide Standalone.idmap.txt +19 -15
- data/doc/Users guide Standalone.txt +92 -0
- data/doc/users_guide_snippets/environment_variables.txt +11 -0
- data/doc/users_guide_snippets/installation.txt +8 -8
- data/doc/users_guide_snippets/troubleshooting/default.txt +12 -4
- data/ext/apache2/Configuration.cpp +0 -10
- data/ext/apache2/Configuration.hpp +0 -3
- data/ext/apache2/ConfigurationCommands.cpp +18 -0
- data/ext/apache2/ConfigurationFields.hpp +12 -6
- data/ext/apache2/ConfigurationFields.hpp.erb +10 -5
- data/ext/apache2/ConfigurationSetters.cpp +27 -0
- data/ext/apache2/CreateDirConfig.cpp +3 -0
- data/ext/apache2/Hooks.cpp +15 -74
- data/ext/apache2/MergeDirConfig.cpp +21 -0
- data/ext/apache2/SetHeaders.cpp +8 -0
- data/ext/common/ApplicationPool2/Group.h +1 -1
- data/ext/common/ApplicationPool2/Implementation.cpp +22 -5
- data/ext/common/ApplicationPool2/Options.h +10 -1
- data/ext/common/ApplicationPool2/Pool.h +4 -0
- data/ext/common/Constants.h +4 -2
- data/ext/common/agents/HelperAgent/RequestHandler.h +1 -0
- data/ext/nginx/CacheLocationConfig.c +20 -0
- data/ext/nginx/ConfigurationCommands.c +10 -0
- data/ext/nginx/ConfigurationFields.h +2 -0
- data/ext/nginx/CreateLocationConfig.c +5 -0
- data/ext/nginx/MergeLocationConfig.c +6 -0
- data/ext/nginx/config +14 -14
- data/lib/phusion_passenger.rb +1 -1
- data/lib/phusion_passenger/apache2/config_options.rb +23 -0
- data/lib/phusion_passenger/constants.rb +3 -1
- data/lib/phusion_passenger/nginx/config_options.rb +4 -0
- data/lib/phusion_passenger/platform_info/operating_system.rb +2 -0
- data/lib/phusion_passenger/platform_info/ruby.rb +24 -0
- data/lib/phusion_passenger/standalone/app_finder.rb +65 -25
- data/lib/phusion_passenger/standalone/command.rb +1 -1
- data/lib/phusion_passenger/standalone/start_command.rb +6 -5
- data/resources/templates/installer_common/run_installer_as_root.txt.erb +4 -1
- data/resources/templates/standalone/config.erb +1 -1
- data/test/cxx/ApplicationPool2/PoolTest.cpp +18 -0
- metadata +13 -5
- metadata.gz.asc +7 -7
- checksums.yaml +0 -15
- checksums.yaml.gz.asc +0 -12
@@ -72,33 +72,37 @@
|
|
72
72
|
|
73
73
|
4.1. Command line options => command-line-options-1njv6kt
|
74
74
|
|
75
|
-
4.2.
|
75
|
+
4.2. Configuration file => configuration-file-xng7yp
|
76
76
|
|
77
|
-
|
77
|
+
4.3. Advanced configuration => advanced-configuration-e3v4pk
|
78
78
|
|
79
|
-
5.
|
79
|
+
5. Mass deployment => mass-deployment-1xqriy4
|
80
80
|
|
81
|
-
|
81
|
+
6. Troubleshooting => troubleshooting-o7g75o
|
82
82
|
|
83
|
-
6.
|
83
|
+
6.1. Generic troubleshooting tips => generic-troubleshooting-tips-2vokcr
|
84
84
|
|
85
|
-
6.
|
85
|
+
6.2. Upon uploading a file, Phusion Passenger reports "client_body_temp/00000000xx failed (2: No such file or directory)" => upon-uploading-a-file-phusion-passenger-reports-client-body-temp-00000000xx-failed-2-no-such-file-or-directory--d01goe
|
86
86
|
|
87
|
-
|
87
|
+
7. Appendix: About environment variables => appendix-about-environment-variables-1ct91x3
|
88
88
|
|
89
|
-
|
89
|
+
7.1. Working with environment variables => working-with-environment-variables-11cmwlv
|
90
90
|
|
91
|
-
|
91
|
+
7.2. The PATH environment variable => the-path-environment-variable-yzfn3k
|
92
92
|
|
93
|
-
|
93
|
+
7.2.1. Adding Phusion Passenger’s administration tools to PATH => adding-phusion-passenger-s-administration-tools-to-path-d7k5mh
|
94
94
|
|
95
|
-
|
95
|
+
7.3. Making environment variables permanent => making-environment-variables-permanent-mkq46d
|
96
96
|
|
97
|
-
|
97
|
+
7.3.1. bash => bash-hmcscc
|
98
98
|
|
99
|
-
|
99
|
+
7.3.2. Apache => apache-15y3bm0
|
100
100
|
|
101
|
-
|
101
|
+
7.3.3. Nginx => nginx-uarf27
|
102
102
|
|
103
|
-
|
103
|
+
7.3.4. cron => cron-6272ar
|
104
|
+
|
105
|
+
7.3.5. Phusion Passenger-served apps => phusion-passenger-served-apps-127wbl2
|
106
|
+
|
107
|
+
7.4. Environment variables and sudo => environment-variables-and-sudo-znzmif
|
104
108
|
|
@@ -47,9 +47,52 @@ Most configuration is done by customizing the arguments passed to the `passenger
|
|
47
47
|
When set to "smart" (the default), Phusion Passenger preloads your app and utilizes copy-on-write in order to save memory. You can disable this by setting this option to "direct". Preloading is only supported for Ruby apps. For apps written in other languages, it is as if "direct" is always used.
|
48
48
|
`--no-friendly-error-pages`::
|
49
49
|
If your app fails to start, Phusion Passenger will tell you by showing a friendly error page in the browser. This option disables it.
|
50
|
+
`--ssl`::
|
51
|
+
Enables SSL support. If this is set, you must also set `--ssl-certificate` and `--ssl-certificate-key` to the SSL certificate and key files, respectively.
|
50
52
|
|
51
53
|
See `--help` for all available options.
|
52
54
|
|
55
|
+
|
56
|
+
[[config_file]]
|
57
|
+
=== Configuration file
|
58
|
+
:version: 4.0.24
|
59
|
+
include::users_guide_snippets/since_version.txt[]
|
60
|
+
|
61
|
+
It is possible to store some options in a configuration file `passenger-standalone.json` in the application directory. Configuration in this file overrides command line options. The configuration file format is JSON.
|
62
|
+
|
63
|
+
In case Passenger Standalone is in <<mass_deployment,mass deployment mode>>, such a configuration file allows customizing options on a per-application basis.
|
64
|
+
|
65
|
+
The following configuration options are supported:
|
66
|
+
|
67
|
+
`port`::
|
68
|
+
Equivalent to the `--port` command line option.
|
69
|
+
`environment`::
|
70
|
+
Equivalent to the `--environment` command line option.
|
71
|
+
`max_pool_size`::
|
72
|
+
Equivalent to the `--max-pool-size` command line option. But when in mass deployment mode, this option in the configuration file has no effect; the command line option should be used to customize this.
|
73
|
+
`min_instances`::
|
74
|
+
Equivalent to the `--min-instances` command line option.
|
75
|
+
`spawn_method`::
|
76
|
+
Equivalent to the `--spawn-method` command line option.
|
77
|
+
`ssl`::
|
78
|
+
Equivalent to the `--ssl` command line option. When given, you must also set `ssl_certificate` and `ssl_certificate_key` in the configuration file.
|
79
|
+
+
|
80
|
+
When in mass deployment mode, you will probably want to set a different `port` too. If you don't, and you end up in a situation in which a port is used for both HTTP and HTTPS traffic, then the builtin Nginx core will abort with an error.
|
81
|
+
|
82
|
+
Here is an example configuration file:
|
83
|
+
|
84
|
+
[source,javascript]
|
85
|
+
------------------
|
86
|
+
{
|
87
|
+
"port": 8000,
|
88
|
+
"environment": "production",
|
89
|
+
"ssl": true,
|
90
|
+
"ssl_certificate": "/path-to-cert.crt",
|
91
|
+
"ssl_certificate_key": "/path-to-cert.key"
|
92
|
+
}
|
93
|
+
------------------
|
94
|
+
|
95
|
+
|
53
96
|
=== Advanced configuration
|
54
97
|
|
55
98
|
Phusion Passenger Standalone is built on the same technology that powers link:Users%20guide%20Nginx.html[Phusion Passenger for Nginx], so any configuration option supported by Phusion Passenger for Nginx can be applied to Standalone as well. You can do this by editing the Standalone configuration template directly.
|
@@ -67,6 +110,55 @@ NOTE: If you installed Phusion Passenger using the Debian or Ubuntu packages, th
|
|
67
110
|
Please note that changes to this file only last until you reinstall or upgrade Phusion Passenger. We are currently working on a mechanism for permanently editing the configuration file.
|
68
111
|
|
69
112
|
|
113
|
+
[[mass_deployment]]
|
114
|
+
== Mass deployment
|
115
|
+
:version: 3.0.0
|
116
|
+
include::users_guide_snippets/enterprise_only.txt[]
|
117
|
+
|
118
|
+
Mass deployment is a special mode in Phusion Passenger Standalone that allows you to deploy multiple web applications without having to create configuration entries for each one of them. Given a directory with multiple web applications, Passenger Standalone will automatically give each web application its own virtual host entry, and serve all of them from a single server. The virtual host's server name is equal to the web application's directory name. Whenever a new web application is added or removed, Passenger Standalone automatically reconfigures itself without administrator intervention. This makes the mass deployment mode especially useful when there are a large number of web applications.
|
119
|
+
|
120
|
+
For example, suppose we have a directory `/webapps` with three web applications: Ruby app, a Python app and a Node.js app.
|
121
|
+
|
122
|
+
----------------------------
|
123
|
+
/webapps
|
124
|
+
|
|
125
|
+
+-- rubyapp.com
|
126
|
+
| |
|
127
|
+
| +-- config.ru
|
128
|
+
|
|
129
|
+
+-- pythonapp.com
|
130
|
+
| |
|
131
|
+
| +-- passenger_wsgi.py
|
132
|
+
|
|
133
|
+
+-- nodeapp.com
|
134
|
+
|
|
135
|
+
+-- app.js
|
136
|
+
----------------------------
|
137
|
+
|
138
|
+
You can activate Passenger Standalone in mass deployment mode by changing the working directory to `/webapps` and running `passenger start`:
|
139
|
+
|
140
|
+
----------------------------
|
141
|
+
$ cd /webapps
|
142
|
+
$ passenger start
|
143
|
+
=============== Phusion Passenger Standalone web server started ===============
|
144
|
+
PID file: /webapps/passenger.3000.pid
|
145
|
+
Log file: /webapps/passenger.3000.log
|
146
|
+
Environment: development
|
147
|
+
|
148
|
+
Serving these applications on 0.0.0.0 port 3000:
|
149
|
+
Host name Directory
|
150
|
+
.-----------------------------------------------------------
|
151
|
+
rubyapp.com /webapps/rubyapp.com
|
152
|
+
pythonapp.com /webapps/pythonapp.com
|
153
|
+
nodeapp.com /webapps/nodeapp.com
|
154
|
+
.-----------------------------------------------------------
|
155
|
+
----------------------------
|
156
|
+
|
157
|
+
If you for example remove `/webapps/rubyapp.com`, Passenger Standalone will reconfigure itself without that web application. Or if you add a new web applications `/webapps/newapp.org`, Passenger Standalone will reconfigure itself with that web application.
|
158
|
+
|
159
|
+
Any options that you pass to the `passenger` command will affect all deployed web applications. It is also possible to change options on a per-application basis through the use of <<config_file,a `passenger-standalone.json` file inside each application's directory>>.
|
160
|
+
|
161
|
+
|
70
162
|
[[troubleshooting]]
|
71
163
|
== Troubleshooting
|
72
164
|
|
@@ -247,6 +247,8 @@ os.environ['FOO'] = 'bar'
|
|
247
247
|
[[env_vars_and_sudo]]
|
248
248
|
=== Environment variables and sudo
|
249
249
|
|
250
|
+
NOTE: RVM users should always use the `rvmsudo` command instead of `sudo`. However all information in this section apply to `rvmsudo` as well.
|
251
|
+
|
250
252
|
The `sudo` command resets all environment variables before running the specified command, for security reasons. So if you set environment variables before running `sudo passenger-install-xxx-module`, `sudo passenger-status` or any other commands, then the environment variables are not correctly passed to the command. You can solve this by running sudo with `-E` (preserve environment variables):
|
251
253
|
|
252
254
|
[source,sh]
|
@@ -263,3 +265,12 @@ Password: ...
|
|
263
265
|
root@localhost bash# export APXS2=/usr/sbin/apxs2
|
264
266
|
root@localhost bash# passenger-install-apache2-module
|
265
267
|
-------------------------
|
268
|
+
|
269
|
+
Note that for security reasons, `sudo` **always resets the `PATH` environment variable**, even if you pass `-E`! You can get around this problem by obtaining a root prompt first, and then set the environment variables:
|
270
|
+
|
271
|
+
-------------------------
|
272
|
+
user@localhost bash$ sudo -s
|
273
|
+
Password: ...
|
274
|
+
root@localhost bash# export PATH=$PATH:/opt/myruby/bin
|
275
|
+
root@localhost bash# passenger-install-apache2-module
|
276
|
+
-------------------------
|
@@ -101,18 +101,18 @@ deb https://oss-binaries.phusionpassenger.com/apt/passenger squeeze main
|
|
101
101
|
[source,sh]
|
102
102
|
--------------------------------------------------------------
|
103
103
|
# Ubuntu 13.10
|
104
|
-
deb https://
|
104
|
+
deb https://download:YOUR_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_apt saucy main
|
105
105
|
# Ubuntu 12.04
|
106
|
-
deb https://
|
106
|
+
deb https://download:YOUR_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_apt precise main
|
107
107
|
# Ubuntu 10.04
|
108
|
-
deb https://
|
108
|
+
deb https://download:YOUR_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_apt lucid main
|
109
109
|
# Debian 7
|
110
|
-
deb https://
|
110
|
+
deb https://download:YOUR_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_apt wheezy main
|
111
111
|
# Debian 6
|
112
|
-
deb https://
|
112
|
+
deb https://download:YOUR_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_apt squeeze main
|
113
113
|
--------------------------------------------------------------
|
114
114
|
+
|
115
|
-
|
115
|
+
You can find the correct value for 'YOUR_DOWNLOAD_TOKEN' in the link:https://www.phusionpassenger.com/orders[Customer Area].
|
116
116
|
|
117
117
|
4. Secure `passenger.list` and update your APT cache:
|
118
118
|
+
|
@@ -323,10 +323,10 @@ First, download the *license key* from the link:https://www.phusionpassenger.com
|
|
323
323
|
Next, add the Phusion Passenger Enterprise gem server to your RubyGems source list:
|
324
324
|
+
|
325
325
|
------------------------------------------
|
326
|
-
gem source --add https://
|
326
|
+
gem source --add https://download:YOUR_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_gems/
|
327
327
|
------------------------------------------
|
328
328
|
+
|
329
|
-
Substitute '
|
329
|
+
Substitute 'YOUR_DOWNLOAD_TOKEN' with the one you find in the link:https://www.phusionpassenger.com/orders[Customer Area]. And notice the **trailing slash** in the URL! It is very important.
|
330
330
|
+
|
331
331
|
Finally, install the latest gem to obtain the files for the latest stable version of the open source Phusion Passenger:
|
332
332
|
+
|
@@ -2,18 +2,26 @@
|
|
2
2
|
|
3
3
|
One of the first things you should do upon encountering a problem, is to check
|
4
4
|
ifdef::apache[]
|
5
|
-
the *global* (not the per-vhost) Apache error log file. This is typically located in
|
5
|
+
the *global* (not the per-vhost) Apache error log file. This is typically located in `/var/log/apache2/error_log`. You can find out the exact location of the error log by running `passenger-config --detect-apache2`.
|
6
6
|
endif::[]
|
7
7
|
ifdef::nginx[]
|
8
8
|
the global Nginx error log file. This is one specified by the `error_log` directive in the main context (*not* the one inside the `http` context). The file is typically located in /var/log/nginx/error.log.
|
9
|
+
endif::[]
|
10
|
+
ifndef::standalone[]
|
11
|
+
This log file contains:
|
12
|
+
|
13
|
+
* Phusion Passenger error messages.
|
14
|
+
* Everything that the application writes to STDERR. This typically consists of errors that the application encounters during startup, but not errors that it encounters when it's handling requests.
|
15
|
+
|
9
16
|
endif::[]
|
10
17
|
ifdef::standalone[]
|
11
|
-
Phusion Passenger Standalone log file. This is typically located in `log/passenger.[PORT NUMBER].log`.
|
18
|
+
Phusion Passenger Standalone log file. This is typically located in `log/passenger.[PORT NUMBER].log`. Most problems are logged to this log file.
|
12
19
|
endif::[]
|
13
|
-
Most problems are logged to this file.
|
14
20
|
|
15
21
|
ifndef::standalone[]
|
16
|
-
If you're using Ruby on Rails, then you should
|
22
|
+
If you're using Ruby on Rails, then you should also check out `log/development.log` and `log/production.log`. When an error occurs during request handling, it is typically logged here. This file does **not** contain errors that Rails encounters during startup.
|
23
|
+
|
24
|
+
Finally, you should be aware that Phusion Passenger runs your application under the 'production' environment by default, not 'development'. You can change this using the
|
17
25
|
ifdef::apache[]
|
18
26
|
<<RailsEnv,RailsEnv>>
|
19
27
|
endif::[]
|
@@ -189,7 +189,6 @@ passenger_config_create_dir(apr_pool_t *p, char *dirspec) {
|
|
189
189
|
|
190
190
|
#include "CreateDirConfig.cpp"
|
191
191
|
|
192
|
-
config->python = NULL;
|
193
192
|
config->environment = NULL;
|
194
193
|
config->appRoot = NULL;
|
195
194
|
config->spawnMethod = DirConfig::SM_UNSET;
|
@@ -220,7 +219,6 @@ passenger_config_merge_dir(apr_pool_t *p, void *basev, void *addv) {
|
|
220
219
|
config->baseURIs.insert(*it);
|
221
220
|
}
|
222
221
|
|
223
|
-
MERGE_STR_CONFIG(python);
|
224
222
|
MERGE_STR_CONFIG(environment);
|
225
223
|
MERGE_STR_CONFIG(appRoot);
|
226
224
|
MERGE_STRING_CONFIG(appGroupName);
|
@@ -282,7 +280,6 @@ cmd_passenger_pre_start(cmd_parms *cmd, void *pcfg, const char *arg) {
|
|
282
280
|
|
283
281
|
#include "ConfigurationSetters.cpp"
|
284
282
|
|
285
|
-
DEFINE_DIR_STR_CONFIG_SETTER(cmd_passenger_python, python)
|
286
283
|
DEFINE_DIR_STR_CONFIG_SETTER(cmd_environment, environment)
|
287
284
|
DEFINE_DIR_INT_CONFIG_SETTER(cmd_passenger_stat_throttle_rate, statThrottleRate, unsigned long, 0)
|
288
285
|
DEFINE_DIR_STR_CONFIG_SETTER(cmd_passenger_app_root, appRoot)
|
@@ -650,13 +647,6 @@ const command_rec passenger_commands[] = {
|
|
650
647
|
OR_OPTIONS | ACCESS_CONF | RSRC_CONF,
|
651
648
|
"The environment under which a Rack app must run."),
|
652
649
|
|
653
|
-
// WSGI-specific settings.
|
654
|
-
AP_INIT_TAKE1("PassengerPython",
|
655
|
-
(Take1Func) cmd_passenger_python,
|
656
|
-
NULL,
|
657
|
-
OR_OPTIONS | ACCESS_CONF | RSRC_CONF,
|
658
|
-
"The Python interpreter to use."),
|
659
|
-
|
660
650
|
// Backwards compatibility options.
|
661
651
|
AP_INIT_TAKE1("RailsRuby",
|
662
652
|
(Take1Func) cmd_passenger_ruby,
|
@@ -45,6 +45,18 @@
|
|
45
45
|
OR_OPTIONS | ACCESS_CONF | RSRC_CONF,
|
46
46
|
"The Ruby interpreter to use."),
|
47
47
|
|
48
|
+
AP_INIT_TAKE1("PassengerPython",
|
49
|
+
(Take1Func) cmd_passenger_python,
|
50
|
+
NULL,
|
51
|
+
OR_OPTIONS | ACCESS_CONF | RSRC_CONF,
|
52
|
+
"The Python interpreter to use."),
|
53
|
+
|
54
|
+
AP_INIT_TAKE1("PassengerNodejs",
|
55
|
+
(Take1Func) cmd_passenger_nodejs,
|
56
|
+
NULL,
|
57
|
+
OR_OPTIONS | ACCESS_CONF | RSRC_CONF,
|
58
|
+
"The Node.js command to use."),
|
59
|
+
|
48
60
|
AP_INIT_TAKE1("PassengerMinInstances",
|
49
61
|
(Take1Func) cmd_passenger_min_instances,
|
50
62
|
NULL,
|
@@ -63,6 +75,12 @@
|
|
63
75
|
ACCESS_CONF | RSRC_CONF,
|
64
76
|
"The group that Ruby applications must run as."),
|
65
77
|
|
78
|
+
AP_INIT_FLAG("PassengerErrorOverride",
|
79
|
+
(FlagFunc) cmd_passenger_error_override,
|
80
|
+
NULL,
|
81
|
+
OR_ALL,
|
82
|
+
"Allow Apache to handle error response."),
|
83
|
+
|
66
84
|
AP_INIT_TAKE1("PassengerMaxRequests",
|
67
85
|
(Take1Func) cmd_passenger_max_requests,
|
68
86
|
NULL,
|
@@ -38,12 +38,14 @@
|
|
38
38
|
|
39
39
|
|
40
40
|
|
41
|
-
/** Whether to load environment variables from the shell before running the application. */
|
42
|
-
Threeway loadShellEnvvars;
|
43
|
-
/** Enable or disable Passenger's high performance mode. */
|
44
|
-
Threeway highPerformance;
|
45
41
|
/** Enable or disable Phusion Passenger. */
|
46
42
|
Threeway enabled;
|
43
|
+
/** Allow Apache to handle error response. */
|
44
|
+
Threeway errorOverride;
|
45
|
+
/** Enable or disable Passenger's high performance mode. */
|
46
|
+
Threeway highPerformance;
|
47
|
+
/** Whether to load environment variables from the shell before running the application. */
|
48
|
+
Threeway loadShellEnvvars;
|
47
49
|
/** The maximum number of queued requests. */
|
48
50
|
int maxRequestQueueSize;
|
49
51
|
/** The maximum number of requests that an application instance may process. */
|
@@ -54,8 +56,12 @@
|
|
54
56
|
int startTimeout;
|
55
57
|
/** The group that Ruby applications must run as. */
|
56
58
|
const char *group;
|
57
|
-
/** The
|
58
|
-
const char *
|
59
|
+
/** The Node.js command to use. */
|
60
|
+
const char *nodejs;
|
61
|
+
/** The Python interpreter to use. */
|
62
|
+
const char *python;
|
59
63
|
/** The Ruby interpreter to use. */
|
60
64
|
const char *ruby;
|
65
|
+
/** The user that Ruby applications must run as. */
|
66
|
+
const char *user;
|
61
67
|
|
@@ -62,11 +62,11 @@ def definition_for(option)
|
|
62
62
|
field = struct_field_for(option)
|
63
63
|
case option[:type]
|
64
64
|
when :string
|
65
|
-
result = ["const char *#{field}", 8 + 4]
|
65
|
+
result = ["const char *#{field}", 8 + 4, field, option[:desc]]
|
66
66
|
when :integer
|
67
|
-
result = ["int #{field}", 4]
|
67
|
+
result = ["int #{field}", 4, field, option[:desc]]
|
68
68
|
when :flag
|
69
|
-
result = ["Threeway #{field}", 1]
|
69
|
+
result = ["Threeway #{field}", 1, field, option[:desc]]
|
70
70
|
else
|
71
71
|
raise "Unknown option type #{option[:type].inspect} for option #{option[:name]}"
|
72
72
|
end
|
@@ -79,11 +79,16 @@ definitions = eligible_options.map { |o| definition_for(o) }
|
|
79
79
|
# It's possible to make it even smaller with a smarter algorithm but for now
|
80
80
|
# I don't bother.
|
81
81
|
definitions.sort! do |d1, d2|
|
82
|
-
d1[1]
|
82
|
+
if d1[1] == d2[1]
|
83
|
+
# After sorting on size, sort alphabetically.
|
84
|
+
d1[2] <=> d2[2]
|
85
|
+
else
|
86
|
+
d1[1] <=> d2[1]
|
87
|
+
end
|
83
88
|
end
|
84
89
|
%>
|
85
90
|
|
86
91
|
<% for definition in definitions -%>
|
87
|
-
/** <%= definition[
|
92
|
+
/** <%= definition[3] %> */
|
88
93
|
<%= definition[0] %>;
|
89
94
|
<% end %>
|
@@ -47,6 +47,22 @@
|
|
47
47
|
}
|
48
48
|
|
49
49
|
|
50
|
+
static const char *
|
51
|
+
cmd_passenger_python(cmd_parms *cmd, void *pcfg, const char *arg) {
|
52
|
+
DirConfig *config = (DirConfig *) pcfg;
|
53
|
+
config->python = arg;
|
54
|
+
return NULL;
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
static const char *
|
59
|
+
cmd_passenger_nodejs(cmd_parms *cmd, void *pcfg, const char *arg) {
|
60
|
+
DirConfig *config = (DirConfig *) pcfg;
|
61
|
+
config->nodejs = arg;
|
62
|
+
return NULL;
|
63
|
+
}
|
64
|
+
|
65
|
+
|
50
66
|
static const char *
|
51
67
|
cmd_passenger_min_instances(cmd_parms *cmd, void *pcfg, const char *arg) {
|
52
68
|
DirConfig *config = (DirConfig *) pcfg;
|
@@ -97,6 +113,17 @@
|
|
97
113
|
}
|
98
114
|
|
99
115
|
|
116
|
+
static const char *
|
117
|
+
cmd_passenger_error_override(cmd_parms *cmd, void *pcfg, const char *arg) {
|
118
|
+
DirConfig *config = (DirConfig *) pcfg;
|
119
|
+
config->errorOverride =
|
120
|
+
arg ?
|
121
|
+
DirConfig::ENABLED :
|
122
|
+
DirConfig::DISABLED;
|
123
|
+
return NULL;
|
124
|
+
}
|
125
|
+
|
126
|
+
|
100
127
|
static const char *
|
101
128
|
cmd_passenger_max_requests(cmd_parms *cmd, void *pcfg, const char *arg) {
|
102
129
|
DirConfig *config = (DirConfig *) pcfg;
|
@@ -39,9 +39,12 @@
|
|
39
39
|
|
40
40
|
|
41
41
|
config->ruby = NULL;
|
42
|
+
config->python = NULL;
|
43
|
+
config->nodejs = NULL;
|
42
44
|
config->minInstances = UNSET_INT_VALUE;
|
43
45
|
config->user = NULL;
|
44
46
|
config->group = NULL;
|
47
|
+
config->errorOverride = DirConfig::UNSET;
|
45
48
|
config->maxRequests = UNSET_INT_VALUE;
|
46
49
|
config->startTimeout = UNSET_INT_VALUE;
|
47
50
|
config->highPerformance = DirConfig::UNSET;
|