Skip to content

Instantly share code, notes, and snippets.

@jorgeancal
Created September 28, 2020 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorgeancal/86497e2a75de54d720c726541ec6aca7 to your computer and use it in GitHub Desktop.
Save jorgeancal/86497e2a75de54d720c726541ec6aca7 to your computer and use it in GitHub Desktop.
update Apache to use TLSv1.2 In CentOS 5
#!/bin/bash
set -e
release=$(lsb_release -d | awk -F"\t" '{print $2}')
centos="CentOS"
if [[ "$release" =~ .*"$centos".* ]];
then
echo "You are in " + $release
else
echo "This is not a CentOS operating system, exiting";
exit 1
fi
for file in `ls /etc/yum.repos.d/`; do
mv /etc/yum.repos.d/$file /etc/yum.repos.d/$file.backup
done
echo "
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-\$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=os
baseurl=http://vault.centos.org/5.11/os/\$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-\$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=updates
baseurl=http://vault.centos.org/5.11/updates/\$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5" > /etc/yum.repos.d/CentOS-Base.repo
yum clean all -y
yum --disablerepo=\* --enablerepo=base,updates update -y
rpm -i http://www.tuxad.de/repo/5/tuxad.rpm
yum --disablerepo="*" --enablerepo="tuxad" --disableexcludes=all list available
yum install openssl1 httpd -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment