Skip to content

Instantly share code, notes, and snippets.

@nitinsatish
Created January 13, 2012 10:57
Show Gist options
  • Save nitinsatish/1605540 to your computer and use it in GitHub Desktop.
Save nitinsatish/1605540 to your computer and use it in GitHub Desktop.
Apache upgrade script
#!/bin/bash
#script to upgrade Apache web server
/usr/local/apache2/bin/httpd -v
echo "Upgrade apache ? [y/n]"
read ans
if [ "$ans" = "y" ]
then
echo -e "\n Backing up Apache dir \n"
cp -pr /usr/local/apache2 /usr/local/apache2-`date +%F`.bk
tar -zxvf httpd-2.2.*.tar.gz
cd httpd-2.2.*
./configure --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer --with-included-apr --enable-deflate --enable-headers --enable-cache --enable-mem-cache --enable-rewrite --enable-ssl --with-expat-builtin --enable-expires
make
make install
if
test -e /usr/local/apache2/bin/httpd
then
mv /etc/init.d/httpd /etc/init.d/httpd.old
cp /usr/local/apache2/bin/httpd /etc/init.d/httpd
cp /usr/local/apache2/bin/httpd /usr/sbin/httpd
/usr/local/apache2/bin/httpd -k restart
echo "******************************************************"
echo "Successfully installed Apache Web-Server"
echo "******************************************************"
else
echo "******************************************************"
echo "Failed to compile Apache Web-Server"
echo "******************************************************"
fi
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment