一、准备环境

检查python版本以及pip版本

[root@linux-node01 src]# python --version
Python 2.7.5
[root@linux-node01 src]# pip --version
pip 9.0.3 from /usr/lib/python2.7/site-packages (python 2.7)
[root@linux-node01 src]# 

如果没有安装pip

在安装了epel源的情况下,直接yum就可以安装python3.4

yum install python34 -y
python3 --version

没有自带pip3,从官网安装

wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py   # 执行下载
python3 get-pip.py                                                 # 改为 python  get_pip.py即可安装
pip3 -V

二、安装nginx

1. openresty简介

openresty是一个nginx套件,而非fork,这表示 :

openresty没有修改nginx源码,这和Tengine等项目不同。
openresty是给原生的nginx增加了很多功能插件,例如:支持lua脚本,支持在nginx配置文件中获取post参数,支持lua脚本连接mysql和redis等
openresty中的nginx是较新版,但不一定是最新版
openresty的官网是:

https://openresty.org/cn/

2. 安装步骤

#安装依赖的软件包

yum install -y readline-devel ncurses-libs pcre-devel perl make postgresql-devel geoip-devel libdrizzle-devel geoip-devel yum -y install gcc gcc-c++
下载最新版openresty

wget https://openresty.org/download/openresty-1.11.2.1.tar.gz
# 解压它
tar zxvf openresty-1.11.2.1

3. 配置openresty

./configure --conf-path=/etc/openresty/openresty.conf \
--error-log-path=/var/log/openresty/error.log \
--http-client-body-temp-path=/var/lib/openresty/body \
--http-fastcgi-temp-path=/var/lib/openresty/fastcgi \
--http-log-path=/var/log/openresty/access.log \
--http-proxy-temp-path=/var/lib/openresty/proxy \
--lock-path=/var/lock/openresty.lock --pid-path=/var/run/openresty.pid \
--with-debug --with-http_dav_module --with-http_flv_module \
--with-http_geoip_module --with-http_gzip_static_module --with-http_realip_module\
 --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module \
 --with-ipv6 --with-mail --with-mail_ssl_module --prefix=/usr/local/openresty \
 --with-luajit --with-http_postgres_module --with-http_iconv_module
View Code

相关文章:

  • 2022-12-23
  • 2021-06-09
  • 2021-10-21
  • 2022-02-21
  • 2022-01-18
  • 2021-10-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-23
  • 2022-12-23
  • 2021-07-07
  • 2021-05-29
  • 2021-11-24
  • 2022-12-23
  • 2021-06-28
相关资源
相似解决方案