Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Bug 1191517 - Passenger is not hiding ErrorPages even when production is
Browse files Browse the repository at this point in the history
specified. Added additional logic to force hiding ErrorPages when not in
development.
  • Loading branch information
soltysh committed Feb 12, 2015
1 parent 77a2043 commit f870460
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 6 deletions.
2 changes: 2 additions & 0 deletions cartridges/openshift-origin-cartridge-ruby/bin/control
Expand Up @@ -6,6 +6,7 @@ source "${OPENSHIFT_RUBY_DIR}/lib/ruby_context"

HTTPD_CFG_DIR=${OPENSHIFT_RUBY_DIR}/etc/conf.d
HTTPD_CFG_FILE=$OPENSHIFT_RUBY_DIR/etc/conf/httpd_nolog.conf
ERB_HTTPD_CFG_DIR=${OPENSHIFT_RUBY_DIR}versions/${OPENSHIFT_RUBY_VERSION}/etc/conf.d/
HTTPD_PASSENV_FILE=${HTTPD_CFG_DIR}/passenv.conf
HTTPD_PID_FILE=$OPENSHIFT_RUBY_DIR/run/httpd.pid
RAILS_ENV=${RAILS_ENV:-production}
Expand Down Expand Up @@ -64,6 +65,7 @@ function restart() {
echo "${1}ing Ruby cartridge"
mkdir -p ${OPENSHIFT_REPO_DIR}public
write_httpd_passenv $HTTPD_PASSENV_FILE
oo-erb ${ERB_HTTPD_CFG_DIR}openshift.conf.erb > ${HTTPD_CFG_DIR}/openshift.conf
oo-erb ${OPENSHIFT_RUBY_DIR}conf/performance.conf.erb.hidden > $HTTPD_CFG_DIR/performance.conf
[ -d ${OPENSHIFT_REPO_DIR}/tmp ] && touch ${OPENSHIFT_REPO_DIR}/tmp/restart.txt
ensure_httpd_restart_succeed "$HTTPD_PID_FILE" "$HTTPD_CFG_FILE"
Expand Down
2 changes: 1 addition & 1 deletion cartridges/openshift-origin-cartridge-ruby/bin/setup
Expand Up @@ -20,7 +20,7 @@ done

# Create/truncate Apache PassEnv configuration file
echo > $OPENSHIFT_RUBY_DIR/etc/conf.d/passenv.conf

echo > $OPENSHIFT_RUBY_DIR/etc/conf.d/openshift.conf
echo > $OPENSHIFT_RUBY_DIR/etc/conf.d/server-status.conf

if [ $version == '1.9' ]; then
Expand Down
5 changes: 5 additions & 0 deletions cartridges/openshift-origin-cartridge-ruby/bin/upgrade
Expand Up @@ -13,3 +13,8 @@ if [[ "$next" == "0.0.14" ]]; then
rm -f ${OPENSHIFT_RUBY_DIR}env/LD_LIBRARY_PATH
fi
fi

if [[ "$next" == "0.0.24" ]]; then
chown $OPENSHIFT_GEAR_UUID:$OPENSHIFT_GEAR_UUID ${OPENSHIFT_RUBY_DIR}etc/conf.d/openshift.conf
chcon -u unconfined_u ${OPENSHIFT_RUBY_DIR}etc/conf.d/openshift.conf
fi
Expand Up @@ -12,7 +12,6 @@ locked_files:
- etc/conf/
- etc/conf/*
- etc/conf.d/
- etc/conf.d/openshift.conf
- env/
- env/OPENSHIFT_RUBY_DIR
- env/PASSENGER_TEMP_DIR
Expand Down
@@ -1,4 +1,5 @@
LoadModule passenger_module modules/mod_passenger.so

<IfModule mod_passenger.c>
PassengerRoot NativelyPackaged
PassengerRuby /usr/bin/ruby
Expand All @@ -19,8 +20,12 @@ PassengerPreStart http://<%= ENV['OPENSHIFT_RUBY_IP'] %>:<%= ENV['OPENSHIFT_RUBY
PassengerSpawnIPAddress <%= ENV['OPENSHIFT_RUBY_IP'] %>
PassengerUseGlobalQueue off
PassengerTempDir /tmp/passenger

<% unless ENV['RAILS_ENV'] == "development" %>
PassengerFriendlyErrorPages off
<% end %>

<Directory <%= ENV['OPENSHIFT_REPO_DIR'] %>/public/>
AllowOverride All
Options -Multiviews
</Directory>

Expand Up @@ -6,7 +6,6 @@ LoadModule passenger_module /usr/lib64/httpd/modules/ruby193-mod_passenger.so
PassengerSpawnMethod conservative
</IfModule>


ServerRoot "<%= ENV['OPENSHIFT_RUBY_DIR'] %>"
DocumentRoot "<%= ENV['OPENSHIFT_REPO_DIR'] %>/public"
Listen <%= ENV['OPENSHIFT_RUBY_IP'] %>:<%= ENV['OPENSHIFT_RUBY_PORT'] %>
Expand All @@ -21,8 +20,12 @@ PassengerPreStart http://<%= ENV['OPENSHIFT_RUBY_IP'] %>:<%= ENV['OPENSHIFT_RUBY
PassengerSpawnIPAddress <%= ENV['OPENSHIFT_RUBY_IP'] %>
PassengerUseGlobalQueue off
PassengerTempDir /tmp/passenger

<% unless ENV['RAILS_ENV'] == "development" %>
PassengerFriendlyErrorPages off
<% end %>

<Directory <%= ENV['OPENSHIFT_REPO_DIR'] %>/public/>
AllowOverride All
Options -Multiviews
</Directory>

Expand Up @@ -23,6 +23,10 @@ PassengerUser <%= ENV['OPENSHIFT_GEAR_UUID'] %>
PassengerPreStart http://<%= ENV['OPENSHIFT_RUBY_IP'] %>:<%= ENV['OPENSHIFT_RUBY_PORT'] %>/
PassengerTempDir /tmp/passenger

<% unless ENV['RAILS_ENV'] == "development" %>
PassengerFriendlyErrorPages off
<% end %>
<% if ENV['RAILS_ENV'] == "development" %>
PassengerLogLevel 1
<% end %>
Expand All @@ -31,4 +35,3 @@ PassengerLogLevel 1
AllowOverride All
Options -Multiviews
</Directory>

0 comments on commit f870460

Please sign in to comment.