当前位置:
凯发ag旗舰厅登录网址下载 >
运维知识
> centos
>内容正文
centos
centos7安装tengine-凯发ag旗舰厅登录网址下载
凯发ag旗舰厅登录网址下载
收集整理的这篇文章主要介绍了
centos7安装tengine-2.3.2版本
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
凯发ag旗舰厅登录网址下载官网最新版本是tengine-2.3.2
使用wget下载
我们下载到该路径下:
tar -zxvf tengine-2.3.2.tar.gz yum install gcc gcc-devel openssl-devel zlib-devel pcre-devel groupadd -r nginx useradd -r -g nginx -m nginx进入到解压后的目录:
默认安装的路径是“/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 chown -r nginx:nginx /usr/local/nginx chmod -r 755 /usr/local/nginx 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 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 chmod x /etc/init.d/tengine chkconfig --add tengine chkconfig --list chkconfig tengine on systemctl start tengine service tengine start vim /etc/profile添加下面这句
export path=$path:/usr/local/tengine-2.3.2/sbin最后刷新一下配置文件
source /etc/profile最后的最后,重启一下nginx即可。
微信扫一扫:关注我个人订阅号“猿小飞”,更多精彩文章在这里及时发布:
总结
以上是凯发ag旗舰厅登录网址下载为你收集整理的centos7安装tengine-2.3.2版本的全部内容,希望文章能够帮你解决所遇到的问题。
如果觉得凯发ag旗舰厅登录网址下载网站内容还不错,欢迎将凯发ag旗舰厅登录网址下载推荐给好友。
- 上一篇:
- 下一篇: