Linux服务器上tengine的安装配置

yum install gcc gcc-c++ autoconf automake
yum install pcre pcre-devel
yum install -y openssl openssl-devel


cd /appdata/soft/tengine-2.1.2

./configure --prefix=/appdata/server/tengine --with-http_sub_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_spdy_module

make

make install


以上为安装成功显示结果

编写启动脚本tengine
进入到/etc/init.d/
vi tengine
内容如下:
#!/bin/sh
#
# tengine - this script start and stop the tengine daemon
#
# chkconfig: 2345 55 25
# description: Startup script for tengine
# processname: nginx
# config: /appdata/server/tengine/conf/nginx.conf
# pidfile: /appdata/server/tengine/logs/nginx.pid
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

DAEMON=/appdata/server/tengine/sbin/nginx
CONFIGFILE=/appdata/server/tengine/conf/nginx.conf
PIDFILE=/appdata/server/tengine/logs/nginx.pid
SCRIPTNAME=/etc/init.d/tengine
LOCKFILE=/var/lock/nginx.lock

set -e
[ -x "$DAEMON" ] || exit 0

start() {
echo "Startting Tengine......"
[ -x $DAEMON ] || exit 5
[ -f $CONFIGFILE ] || exit 6
$DAEMON -c $CONFIGFILE || echo -n "Tengine already running!"
[ $? -eq 0 ] && touch $LOCKFILE
}

stop() {
echo "Stopping Tengine......"
MPID=`ps aux | grep nginx | awk '/master/{print $2}'`

if [ "${MPID}X" != "X" ]; then
kill -QUIT $MPID
[ $? -eq 0 ] && rm -f $LOCKFILE
else
echo "Tengine server is not running!"
fi
}

reload() {
echo "Reloading Tengine......"
MPID=`ps aux | grep nginx | awk '/master/{print $2}'`

if [ "${MPID}X" != "X" ]; then
kill -HUP $MPID
else
echo "Tengine can't reload!"
fi
}

case "$1" in
start)
start
;;

stop)
stop
;;

reload)
reload
;;

restart)
stop
sleep 1
start
;;

*)
echo "Usage: $SCRIPTNAME {start|stop|reload|restart}"
exit 3
;;

esac

exit 0


保存后退出。
为文件添加可执行权限
chmod +x tengine

chkconfig tengine on #设置开机启动
service tengine restart #启动服务

转载于:https://www.cnblogs.com/liyingxian5/p/6549266.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值