Centos编译安装Tengine
2021-04-10 本文已影响0人
ZZES_ZCDC
1. 安装相关依赖
yum install gcc gcc-c++ opensslopenssl-devel zib-devel zib
2. 进入 /usr/local
目录
3. 编译pcre
wget https://sourceforge.net/projects/pcre/files/pcre/8.38/pcre-8.38.tar.gz
tar xzvf pcre-8.38.tar.gz
cd pcre-8.38
./configure && make -j4 && make install
4.编译Tegine
① Tegine报错:./configure: error: SSL modules require the OpenSSL library.
yum -y install openssl openssl-devel
② 编译
wget http://tengine.taobao.org/download/tengine-2.3.3.tar.gz
tar xzvf tengine-2.3.3.tar.gz
cd tengine-2.3.3
./configure && make && make install
5. 使用
在/usr/local/nginx目录下使用即可
cd /usr/local/nginx
/sbin/nginx -t # 测试配置
/sbin/nginx # 启动
/sbin/nginx -s reload # 重启
/sbin/nginx -s stop # 停止
6. 相关问题
① 报错nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
将配置文件挂载就行 /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
② 配置http2
cd /usr/local/tengine-2.3.3
./configure --with-http_v2_module
make
make install
③ 发现一个坑,在配ssl时,会报缺少模块的错nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in ...
可以在配置的时候加上--with-http_ssl_module
比如./configure --prefix=/usr/local/nginx --with-http_ssl_module
具体参考https://www.cnblogs.com/ghjbk/p/6744131.html