日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > centos >内容正文

centos

Centos7安装tengine-2.3.2版本

發布時間:2025/1/21 centos 98 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Centos7安装tengine-2.3.2版本 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

#1.下載

官網最新版本是tengine-2.3.2
使用wget下載

wget?http://tengine.taobao.org/download/tengine-2.3.2.tar.gz

我們下載到該路徑下:

#2.解壓

tar -zxvf tengine-2.3.2.tar.gz

#3.安裝依賴

yum install gcc gcc-devel openssl-devel zlib-devel pcre-devel

#4.新建tengine用戶組

groupadd -r nginx useradd -r -g nginx -M nginx

#5.預編譯

進入到解壓后的目錄:

默認安裝的路徑是“/usr/local/nginx”,我們也可以通過?--prefix=這個參數來指定安裝的路徑,例如:?--prefix=/usr/local/tengine-2.3.2

./configure --prefix=/usr/local/nginx --with-http_ssl_module --add-module=./modules/ngx_http_upstream_check_module

進到/usr/local/src/tengine-2.3.2目錄下執行上面代碼,進行編譯。

安裝

make install

#6.更改tengine的權限,將該目錄給nginx用戶

chown -R nginx:nginx /usr/local/nginx chmod -R 755 /usr/local/nginx

#7.增加啟動文件

vim /etc/init.d/tengine #!/bin/sh # # nginx - this script starts and stops the nginx daemin # # chkconfig: - 85 15 # description: Nginx is an HTTP(S) server, HTTP(S) reverse # proxy and IMAP/POP3 proxy server # processname: nginx # config: /usr/local/tengine-2.3.2/conf/nginx.conf # pidfile: /usr/local/tengine-2.3.2/logs/nginx.pid# Source function library. . /etc/rc.d/init.d/functions# Source networking configuration. . /etc/sysconfig/network# Check that networking is up. [ "$NETWORKING" = "no" ] && exit 0 nginx="/usr/local/tengine-2.3.2/sbin/nginx" prog=$(basename $nginx)NGINX_CONF_FILE="/usr/local/tengine-2.3.2/conf/nginx.conf"lockfile=/var/lock/subsys/nginxstart() {[ -x $nginx ] || exit 5[ -f $NGINX_CONF_FILE ] || exit 6echo -n $"Starting $prog: "daemon $nginx -c $NGINX_CONF_FILEretval=$?echo[ $retval -eq 0 ] && touch $lockfilereturn $retval }stop() {echo -n $"Stopping $prog: "killproc $prog -QUITretval=$?echo[ $retval -eq 0 ] && rm -f $lockfilereturn $retval }restart() {configtest || return $?stopstart }reload() {configtest || return $?echo -n $"Reloading $prog: "killproc $nginx -HUPRETVAL=$?echo }force_reload() {restart }configtest() {$nginx -t -c $NGINX_CONF_FILE }rh_status() {status $prog }rh_status_q() {rh_status >/dev/null 2>&1 }case "$1" instart)rh_status_q && exit 0$1;;stop)rh_status_q || exit 0$1;;restart|configtest)$1;;reload)rh_status_q || exit 7$1;;force-reload)force_reload;;status)rh_status;;condrestart|try-restart)rh_status_q || exit 0;;*)echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"exit 2 esac

#8.systemd 啟動配置文件

vi /lib/systemd/system/tengine.service [Unit] Description=The NGINX TTT HTTP and reverse proxy server After=network.target remote-fs.target nss-lookup.target [Service] Type=forking PIDFile=/usr/local/tengine-2.3.2/logs/nginx.pid ExecStartPre=/usr/local/tengine-2.3.2/sbin/nginx -t ExecStart=/usr/local/tengine-2.3.2/sbin/nginx ExecReload=/usr/local/tengine-2.3.2/sbin/nginx -s reload ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target

#9.給腳本添加執行權限

chmod +x /etc/init.d/tengine

#10.添加服務項

chkconfig --add tengine chkconfig --list

#11.加入開機啟動

chkconfig tengine on

#12.啟動tengine

systemctl start tengine service tengine start

#13.把nginx的執行命令配置到環境變量中去

vim /etc/profile

添加下面這句

export PATH=$PATH:/usr/local/tengine-2.3.2/sbin

最后刷新一下配置文件

source /etc/profile

最后的最后,重啟一下nginx即可。

微信掃一掃:關注我個人訂閱號“猿小飛”,更多精彩文章在這里及時發布:

?

總結

以上是生活随笔為你收集整理的Centos7安装tengine-2.3.2版本的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。