淘宝nginx(Tnginx)使用记录

淘宝nginx(Tnginx)使用记录

其实和nginx没什么区别,发现好久没有记录东西了,百度blog改版之后太恶心了。。。。

流水帐,给自己看的,就不整理了,破烂百度编辑器,我linux mint下的火狐编辑的时候是好的,发布出来样式差这么多。

地址,介绍和文档:

http://tengine.taobao.org/index_cn.html


先下载最新的安装包,我安装的时候最新为Tengine-1.4.6,更新说明写了包含了CVE-2013-2070补丁


我的环境为centos6.4 X64 精简安装

所以需要先安装依赖

1
2
3
4
5
yum install gcc
yum install pcre-devel
yum install openssl-devel
yum install make
yum install perl





 


1
2
3
4
5
6
wget http: //tengine .taobao.org /download/tengine-1 .4.6. tar .gz
tar -zxvf tengine-1.4.6. tar .gz
cd tengine-1.4.6
. /configure
make
make install

这就安装完了。


运行看看

1
/usr/local/nginx/sbin/nginx

看看服务器端口开没

1
netstat -npltg



80端口开放

1
2
3
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
/etc/init .d /iptables save
service  iptables restart


用浏览器访问下

Welcome to tengine!

If you see this page, the tengine web server is successfully installed and working. Further configuration is required.


For online documentation and support please refer totengine.taobao.org.


Thank you for using tengine.


ok,服务正常,接下來是自启脚本。改别人的。。找不到原作者的来源了。。

建立脚本

1
2
cd /etc/init .d/
vi nginx

编写内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# chkconfig: 345 86 14
# description: Startup and shutdown script for nginx
NGINX_DIR= /usr/local/nginx
export NGINX_DIR
case $1 in
'start' )
echo "Starting nginx..."
$NGINX_DIR /sbin/nginx
;;
'reload' )
echo "Reload nginx configuration..."
kill -HUP ` cat $NGINX_DIR /logs/nginx .pid`
;;
'stop' )
echo "Stopping nginx..."
kill -15 ` cat $NGINX_DIR /logs/nginx .pid`
;;
'list' )
ps aux | egrep '(PID|nginx)'
;;
'testconfig' )
$NGINX_DIR /sbin/nginx -t
;;
*)
echo "usage: `basename $0` {start|reload|stop|list|testconfig}"
esac

修改权限


1
2
chmod +x nginx
chkconfig --add nginx
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值