Tengine 安装部署

发布时间: 更新时间: 总字数:177 阅读时间:1m 作者: 分享

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

https://github.com/xiexianbin/tengine-rpm

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

参考

Home Archives Categories Tags Docs