Web服务器基础 -- Tengine 环境部署

Tengine的部署

[root@node02 ~]# wget -c http://tengine.taobao.org/download/tengine-2.3.3.tar.gz
[root@node02 ~]# yum install gcc gcc-c++ make -y
[root@node02 ~]# useradd -r -u 998 -c 'tengine user' -d /var/cache/nginx -s /sbin/nologin tengine
[root@node02 ~]# tar xf tengine-2.3.3.tar.gz -C /usr/local/src/
[root@node02 ~]# cd /usr/local/src/tengine-2.3.3/
[root@node02 tengine-2.3.3]# yum install pcre-devel -y
[root@node02 tengine-2.3.3]# yum install openssl-devel -y
[root@node02 tengine-2.3.3]# yum install perl-ExtUtils-Embed -y
[root@node02 tengine-2.3.3]# ./configure --user=tengine --group=tengine \
> --prefix=/usr/local/tengine \
> --with-http_perl_module \
> --with-http_sub_module \
> --with-http_stub_status_module \
> --with-http_ssl_module
[root@node02 tengine-2.3.3]# make
[root@node02 tengine-2.3.3]# make install
[root@node02 tengine-2.3.3]# tree /usr/local/tengine/
/usr/local/tengine/
├── conf
│   ├── fastcgi.conf
│   ├── fastcgi.conf.default
│   ├── fastcgi_params
│   ├── fastcgi_params.default
│   ├── koi-utf
│   ├── koi-win
│   ├── mime.types
│   ├── mime.types.default
│   ├── nginx.conf
│   ├── nginx.conf.default
│   ├── scgi_params
│   ├── scgi_params.default
│   ├── uwsgi_params
│   ├── uwsgi_params.default
│   └── win-utf
├── html
│   ├── 50x.html
│   └── index.html
├── logs
└── sbin
    └── nginx

4 directories, 18 files


[root@node02 tengine-2.3.3]# ln -sv /usr/local/tengine/sbin/nginx /usr/sbin/
‘/usr/sbin/nginx’ -> ‘/usr/local/tengine/sbin/nginx’
[root@node02 tengine-2.3.3]# nginx -v
Tengine version: Tengine/2.3.3
nginx version: nginx/1.18.0
[root@node02 tengine-2.3.3]# vim /usr/lib/systemd/system/tengine.service
[Unit]
Description=tengine - high performance web server
Documentation=http://tengine.taobao.org/documentation.html
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/run/tengine.pid
ExecStartPre=/usr/local/tengine/sbin/nginx -t -c /usr/local/tengine/conf/nginx.conf
ExecStart=/usr/local/tengine/sbin/nginx -c /usr/local/tengine/conf/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target


[root@node02 tengine-2.3.3]# systemctl daemon-reload 
[root@node02 tengine-2.3.3]# systemctl start tengine
[root@node02 tengine-2.3.3]# netstat -lnutp | grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      19947/nginx: master 

浏览器访问:

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-iOS3spWw-1642162648375)(C:\Users\DELL\AppData\Roaming\Typora\typora-user-images\image-20220114195809438.png)]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值