Tengine 安装部署

发布时间: 更新时间: 总字数:234 阅读时间:1m 作者: IP上海 分享 网址

Tengine 是淘宝发起基于nginx的一个开源项目,旨在打造一个高效,安全的web平台。

官方 rpm

配置源

cd /etc/yum.repos.d/
wget https://mirrors.aliyun.com/opensource/149994924900000037/opsx/centos7/opsx-centos7.repo
yum clean all && yum makecache
yum install tengine

默认安装目录在:/opt/tengine/

service

  • /usr/lib/systemd/system/tengine.service
[Unit]
Description=The tengine HTTP and reverse proxy server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/opt/tengine/logs/nginx.pid
# Nginx will fail to start if /run/tengine.pid already exists but has the wrong
# SELinux context. This might happen when running `tengine -t` from the cmdline.
# https://bugzilla.redhat.com/show_bug.cgi?id=1268621
ExecStartPre=/usr/bin/rm -f /run/tengine.pid
ExecStartPre=/opt/tengine/sbin/nginx -t
ExecStart=/opt/tengine/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
KillSignal=SIGQUIT
TimeoutStopSec=5
KillMode=process
PrivateTmp=true

[Install]
WantedBy=multi-user.target

使用

  • systemctl daemon-reload
  • systemctl enable tengine
  • systemctl start tengine
  • systemctl stop tengine

私有 RPM

sudo curl -sL -o /etc/yum.repos.d/xiexianbin-tengine-rpm-epel-7.repo https://copr.fedorainfracloud.org/coprs/xiexianbin/tengine-rpm/repo/epel-7/xiexianbin-tengine-rpm-epel-7.repo

sudo yum -y install tengine

根据 nginx rpm 打包,支持与 nginx 相同的命令。

源码参考:https://github.com/xiexianbin/tengine-rpm

参考

  1. https://opsx.alibaba.com/opensource/detail/22
  2. https://tengine.taobao.org/document_cn/tengine_qat_ssl_cn.html
Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数