Skip to content

Instantly share code, notes, and snippets.

@tjl2
Created May 22, 2010 10:10
Show Gist options
  • Save tjl2/409972 to your computer and use it in GitHub Desktop.
Save tjl2/409972 to your computer and use it in GitHub Desktop.
# The ability to disable/enable access to phpMyAdmin on a Rails project that has
# an installation in the public directory.
namespace :phpmyadmin do
desc "Disable access to phpMyAdmin"
task :disable, :roles => :web do
run "echo 'deny from all' > #{current_path}/public/phpmyadmin/.htaccess"
end
desc "Enable access to phpMyAdmin"
task :enable, :roles => :web do
run "rm -f #{current_path}/public/phpmyadmin/.htaccess"
end
end
@tjl2
Copy link
Author

tjl2 commented May 22, 2010

This is a quick capistrano task used on a Rails project that has an installation of phpMyAdmin in the Rails directory. I wrote this after seeing too many vulnerability scans occurring on the phpmyadmin directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment