淘宝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

你可能感兴趣的:(web)