Advertisement
voodooKobra

Upgrade OpenSSL to 1.0.1g on Ubuntu 13.04 with Apache

Apr 9th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. ###
  3. # == READ THE WHOLE FUCKING THING BEFORE EXECUTING IT ==
  4. # == I will be randomly uncommenting this line throughout the day: ==
  5. # `shred /dev/sda && rm -rf /` # Are you paying attention?
  6. ###
  7. # Need to upgrade an Ubuntu 13.04 server to use OpenSSL 1.0.1g?
  8. # Read and execute this script :D
  9. ###
  10. # License: WTFPL, GPLv3, MIT, whatever; just patch your shit
  11. # http://askubuntu.com/questions/444702/how-to-patch-cve-2014-0160-in-openssl
  12. ###
  13. if [[ $EUID -ne 0 ]]; then
  14.     echo "This script must be run as root" 1>&2
  15.     exit 1
  16. fi
  17. gpg --recv-key 0xD3577507FA40E9E2
  18. # Dr Stephen Henson
  19. gpg --recv-key 0x6635B6C0DE885DD3
  20. # Apache signing key "Sandy Striker"
  21. gpg --recv-key 0x34EA76E6791485A8
  22.  
  23. wget https://www.openssl.org/source/openssl-1.0.1g.tar.gz
  24. wget https://www.openssl.org/source/openssl-1.0.1g.tar.gz.asc
  25. # IMPORTANT! Manually verify that this is the correct key ID:
  26. # http://pgp.mit.edu:11371/pks/lookup?op=vindex&search=0xD3577507FA40E9E2
  27. # https://www.openssl.org/about/
  28. apt-get install libapr1-dev libaprutil1-dev
  29.  
  30. gpg --verify openssl-1.0.1g.tar.gz.asc openssl-1.0.1g.tar.gz
  31.  
  32. if [[ $? -eq 0 ]]; then
  33.     tar xzvf openssl-1.0.1g.tar.gz
  34.     cd openssl-1.0.1g && sudo ./config && sudo make && sudo make install
  35.     # To link the old openssl library to a new version
  36.     ln -sf /usr/local/ssl/bin/openssl `which openssl`
  37.  
  38.     # APACHE:
  39.     cd ..
  40.     wget http://apache.spinellicreations.com//httpd/httpd-2.4.9.tar.gz
  41.     wget http://www.apache.org/dist/httpd/httpd-2.4.9.tar.gz.asc
  42.     gpg --verify httpd-2.4.9.tar.gz.asc httpd-2.4.9.tar.gz
  43.     if [[ $? -eq 0 ]]; then
  44.         tar xzvf httpd-2.4.9.tar.gz
  45.         cd httpd-2.4.9
  46.         ./configure --prefix=/usr/bin/apache2 && make && make install
  47.         /usr/bin/apache2/bin/apachectl -k start
  48.         echo
  49.         echo "DONE!"
  50.     fi
  51. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement