#! /bin/bash
#1. 升级openSSL
yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel
yum install wget -y
wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz --no-check-certificate
tar -zxvf openssl-1.1.1q.tar.gz
cd openssl-1.1.1q
./config --prefix=/usr/local/openssl no-zlib #不需要zlib
make && make install
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl/ /usr/include/openssl.bak
ln -sf /usr/local/openssl/include/openssl /usr/include/openssl
ln -sf /usr/local/openssl/lib/libssl.so.1.1 /usr/local/lib64/libssl.so
ln -sf /usr/local/openssl/bin/openssl /usr/bin/openssl
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
ldconfig -v #使修改后的/etc/ld.so.conf生效
#2. 安装python
cd /usr/
wget https://www.python.org/ftp/python/3.10.10/Python-3.10.10.tgz
tar -zxvf Python-3.10.10.tgz
cd Python-3.10.10
./configure prefix=/usr/local/python3 -with-openssl=/usr/local/openssl #<---注意-with-openssl这个参数
make && make install
ln -sf /usr/local/python3/bin/python3.10 /usr/bin/python3
ln -sf /usr/local/python3/bin/pip3.10 /usr/bin/pip3
python3 --version
#3. 安装nginx
yum install nginx -y
#4. 安装supervisor
yum install supervisor -y
cd /etc/
mkdir supervisor
# 生成示例配置文件
echo [program:example] >> example.conf
echo command=/path/to/virtual_environment/bin/gunicorn -w 4 -b 127.0.0.1:8080 main:app >> example.conf
echo directory=/path/to/project >> example.conf
echo user=root >> example.conf
echo autostart=true >> example.conf
echo autorestart=true >> example.conf
echo redirect_stderr=true >> example.conf
mkdir conf.d
#5. 安装git
yum install git -y
#6. 安装pipenv
pip3 install pipenv
# 添加软连接
ln -sf /usr/local/python3/bin/pipenv /usr/bin/pipenv
# 升级pip
/usr/local/python3/bin/python3.10 -m pip install --upgrade pip
参考:https://blog.csdn.net/weixin_43969246/article/details/109364628
标签:bin,supervisor,flask,openssl,devel,nginx,usr,conf,local From: https://www.cnblogs.com/feel-myself/p/17644840.html