We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

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 !
Make Apache MPM detection more robust.
Hongli Lai (Phusion) (author)
Tue Apr 01 05:30:59 -0700 2008
commit  a3b3b0e38c0cfb76b66b7e39490f26944d80eb87
tree    c1871f62390f5da74f67d8435ed59151cf083dd0
parent  d517d366330a3b34b2cc0b2e42e216ec3aa2eb7e
...
113
114
115
116
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
119
120
...
113
114
115
 
 
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
0
@@ -113,8 +113,25 @@ private
0
   
0
   def check_whether_apache_uses_prefork_mpm
0
     line
0
- mpm = `#{HTTPD} -V | grep 'Server MPM'`.strip.split(/:/, 2)[1].strip
0
- if mpm != "Prefork"
0
+ # 'httpd -V' output is in the form of:
0
+ #
0
+ # Server MPM: Prefork # <--- this line is not always available!
0
+ # ...
0
+ # Server compiled with....
0
+ # -D APACHE_MPM_DIR="server/mpm/prefork"
0
+ output = `#{HTTPD} -V`
0
+ output =~ /^Server MPM: +(.*)$/
0
+ if $1
0
+ mpm = $1.downcase
0
+ else
0
+ output =~ /APACHE_MPM_DIR="server\/mpm\/(.*)"/
0
+ if $1
0
+ mpm = $1.downcase
0
+ else
0
+ mpm = nil
0
+ end
0
+ end
0
+ if mpm != "prefork"
0
       render_template 'apache_must_be_compiled_with_prefork_mpm',
0
         :current_mpm => mpm
0
       wait

Comments

    No one has commented yet.