Created
April 6, 2012 17:13
-
-
Save zachbrowne/2321426 to your computer and use it in GitHub Desktop.
Bash script that secures Apache2 with mod_evasive / mod_security & installs Google Pagespeed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################ | |
# Harden & Optimize Apache for Ubuntu 11.10 64bit Web Server # | |
# by Zach Browne - http://zachbrowne.com # | |
################################################################ | |
# Update system | |
aptitude update && aptitude -y safe-upgrade | |
# Install mod_security & mod_evasive. | |
aptitude -y install libapache2-mod-evasive libapache-mod-security php5-suhosin | |
apt-get -f install | |
# Install PageSpeed Apache2 module. | |
#wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_i386.deb # Uncomment if your server is 32bit | |
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_amd64.deb # Uncomment if your server is 64bit | |
dpkg -i mod-pagespeed-*.deb | |
apt-get -f install | |
#rm mod-pagespeed-beta_current_amd64.deb | |
rm mod-pagespeed-beta_current_i386.deb | |
# Restart Apache2 | |
service apache2 restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment