I\'m trying to work out what the best way to secure my staging environment would be. Currently I\'m running both staging and production on the same server.
The two
If you are deploying with multi-staging environments and so you have production environment and staging environment, you only need to add these lines to config/environments/staging.rb
MyApp::Application.configure do
# RESTRICTING ACCESS TO THE STAGE ENVIRONMENT
config.middleware.insert_before(::Rack::Runtime, "::Rack::Auth::Basic", "Staging") do |u, p|
u == 'tester' && p == 'secret'
end
...
end
By doing so, you don't need to configure Apache.
I am using Ruby 2 with Rails 4 and it works like a charm!