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 #启动服务