Last active
December 20, 2022 16:15
-
-
Save lindowx/8d4b41fc67b5720e3e5999d7123fb020 to your computer and use it in GitHub Desktop.
Setup CertBot on CentOS/RHEL 5
This file contains 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/sh | |
#Create working directory | |
CERTBOT_DIR=/opt/modules/src/certbot | |
mkdir $CERTBOT_DIR/src -p | |
cd $CERTBOT_DIR/src | |
#install openssl to working dir. | |
wget --no-check-certificate https://www.openssl.org/source/openssl-1.0.1t.tar.gz | |
tar xvzf openssl-1.0.1t.tar.gz && cd openssl-1.0.1t | |
./config --prefix=$CERTBOT_DIR/openssl-1.0.1t shared --openssldir=$CERTBOT_DIR/openssl-1.0.1t/openssl | |
make depend && make && make install | |
ln -s $CERTBOT_DIR/openssl-1.0.1t $CERTBOT_DIR/openssl | |
#install python 2.7 to working dir. | |
cd $CERTBOT_DIR/src | |
wget --no-check-certificate https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz | |
tar xvf Python-2.7.11.tgz | |
cd Python-2.7.11 | |
export LDFLAGS=-"Wl,-rpath=$CERTBOT_DIR/openssl/lib -L$CERTBOT_DIR/openssl/lib -L$CERTBOT_DIR/openssl/lib64/" | |
export LD_LIBRARY_PATH="$CERTBOT_DIR/openssl/lib/:$CERTBOT_DIR/openssl/lib64" | |
export CPPFLAGS="-I$CERTBOT_DIR/openssl/include -I$CERTBOT_DIR/openssl/include/openssl" | |
./configure --prefix=$CERTBOT_DIR/python-2.7.11 | |
make && make install | |
ln -s $CERTBOT_DIR/python-2.7.11 $CERTBOT_DIR/python | |
export PATH=$CERTBOT_DIR/python/bin:$PATH | |
#install pip to working dir. | |
cd $CERTBOT_DIR/src && wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py | |
python2.7 get-pip.py | |
pip install virtualenv wheel | |
#get certbot script | |
cd $CERTBOT_DIR/src | |
git clone https://github.com/certbot/certbot | |
cd certbot | |
#run certbot | |
./letsencrypt-auto certonly --no-bootstrap |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment