Centos编译安装Tengine

时间:2021-6-7 作者:qvyue

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

声明:本文内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:qvyue@qq.com 进行举报,并提供相关证据,工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。