Nginx1.14.1安装部署
1.环境: 所有源码在跳板机kx的/web/soft下
2.安装依赖:
[root@bogon src]# yum install -y libxml2 openssl openssl-devel pcre-devel libxml2-devel libxslt libxslt-devel gd gd-devel perl-ExtUtils-Embed perl-devel geoip geoip-dev

3.创建用户
[root@bogon src]# useradd -s /sbin/nologin -M w
4.解压源码包
[root@bogon src]#tar zxf nginx-1.14.1.tar.gz
[root@bogon src]#unzip nginx-module-vts-0.1.18.zip
[root@bogon src]#unzip nginx-upstream-fair-master.zip
5.编译安装:
[root@bogon src]# cd nginx-1.14.1
[root@bogon nginx-1.14.1]# ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-pcre --with-http_realip_module --with-http_sub_module --with-file-aio --with-http_addition_module --with-http_auth_request_module --with-http_xslt_module --with-http_image_filter_module --with-http_perl_module --with-http_gunzip_module --with-http_geoip_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_addition_module --with-debug --add-module=../nginx-upstream-fair-master --add-module=../nginx-module-vts-0.1.18
报错后执行:
[root@bogon nginx-1.14.1]# yum -y install GeoIP GeoIP-devel GeoIP-data
重复执行配置命令
[root@bogon nginx-1.14.1]# make
报错后执行:
[root@bogon nginx-1.14.1] vim /usr/local/src/nginx-1.14.1/src/http/ngx_http_upstream.h 在 ngx_http_upstream_srv_conf_s 函数里 找到 in_port_t port;
在后面添加 : in_port_t default_port;
[root@bogon nginx-1.14.1]# make
[root@bogon nginx-1.14.1]# make install
[root@youzhuan-online soft]# cat /etc/init.d/nginx

#!/bin/bash
# nginx Startup script for the Nginx HTTP Server
# it is v.0.0.2 version.
# chkconfig: - 85 15
# description: Nginx is a high-performance web and proxy server.
# It has a lot of features, but it's not for everyone.
# processname: nginx
# pidfile: /usr/local/nginx/logs/nginx.pid
# config: /usr/local/nginx/conf/nginx.conf
nginxd=/usr/local/nginx/sbin/nginx
nginx_config=/usr/local/nginx/conf/nginx.conf
nginx_pid=/usr/local/nginx/logs/nginx.pid
RETVAL=0
prog="nginx"
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x $nginxd ] || exit 0
# Start nginx daemons functions.
start() {
if [ -e $nginx_pid ];then
echo "nginx already running...."
exit 1
fi
echo -n $"Starting $prog: "
daemon $nginxd -c ${nginx_config}
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /usr/local/nginx/lock/subsys/nginx
return $RETVAL
}
# Stop nginx daemons functions.
stop() {
echo -n $"Stopping $prog: "
killproc $nginxd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /usr/local/nginx/lock/subsys/nginx /usr/local/nginx/logs/nginx.pid
}
# reload nginx service functions.
reload() {
echo -n $"Reloading $prog: "
#kill -HUP `cat ${nginx_pid}`
killproc $nginxd -HUP
RETVAL=$?
echo
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
stop
start
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|reload|status|help}"
exit 1
esac
exit $RETVAL

[root@bogon nginx-1.14.1]# chmod +x /etc/init.d/nginx
[root@bogon nginx-1.14.1]# /etc/init.d/nginx start
[root@bogon nginx-1.14.1]# systemctl enable nginx

  

centos 7.2 下 nginx 1.14.1 安装部署的更多相关文章

  1. 七、CentOS 6.5 下 Nginx的反向代理和负载均衡的实现

    CentOS 6.5 下 Nginx的反向代理和负载均衡的实现 * 修复上面文章的问题: 复制出一个tomcat2之后,修改service.xml文件时,要修改三个端口: 1. <!-- 800 ...

  2. <亲测>CentOS 7.3下Node.js 8.6安装配置(含NPM以及PM2)

    CentOS 7.3下Node.js 8.6安装配置 2017年09月30日 14:12:02 阅读数:2245更多 个人分类: Nodejs   版权声明:本文为博主原创文章,未经博主允许不得转载. ...

  3. Centos 7.3下 Linux For SQL Server安装及配置介绍

    Centos 7.3下 Linux For SQL Server安装及配置介绍 高文龙关注13人评论2828人阅读2017-03-05 21:46:21 Centos 7.3下Linux For SQ ...

  4. (转)linux下weblogic12c集群的安装部署

    本文介绍linux下weblogic12c集群的安装部署,版本12c,其他版本操作会有所不同,但其大体操作基本都是一样的 关于weblogic的集群,在此就不多做介绍了,如果有不了解的朋友可以百度搜索 ...

  5. [python][nginx][https] Nginx 服务器 SSL 证书安装部署

    目录 前言 1 申请证书 2 Nginx 服务器 SSL 证书安装部署 2.1.准备 Nginx 环境 2.2 证书部署 2.3 Nginx 配置 3 最后 参考链接 前言 博主博客中的图片,使用的是 ...

  6. CentOS 6.5 下Nginx服务的安装与配置

    参考网站: http://www.cnblogs.com/zhuhongbao/archive/2013/06/04/3118061.html http://www.cnblogs.com/jilia ...

  7. CentOS 7服务器下Nginx安装配置

    一.安装编译工具及库文件 $ yum -y install make zlib zlib-devel gcc gcc-c++ libtool openssl openssl-devel pcre pc ...

  8. mac下Nginx+lua模块编译安装

    Nginx的nb之处就不说了,lua也是一个小巧的脚本语言,由标准C编写而成,几乎可以运行在所有的平台上,也非常强大,其他特性请自行度娘.nginx_lua_module是由淘宝的工程师清无(王晓哲) ...

  9. Linux下Nginx+Tomcat整合的安装与配置

    因为nginx处理静态页面的速度很快,并且是免费的,它还可以配置负载均衡的服务器集群来搭建多个tomcat,所以nginx+tomcat是企业搭 建javaee项目很好的选择.nginx主要是通过反向 ...

随机推荐

  1. 来自学长&师兄们的应届校招经验

    PART1        记得三月的第一个星期五吧,小操场打球,偶遇一位研三师兄,就主动跟师兄聊起了校招求职.很高兴,能遇到一位愿意跟你分享他自己求职经验的师兄,师兄也很热情,我们聊了好多.下面,开始 ...

  2. Core官方DI解析(4)--CallSiteRuntimeResolver

    ​ CallSiteRuntimeResolver类型是一个创建或获取服务实例的类型,这个类型继承了CallSiteVisitor<TArgument, TResult>这个类型,也是使用 ...

  3. c# 上传图片到一个外链相册服务器

    这里一个免费上传图片的网站:https://imgbb.com 代码: private void post1(string filePath) { try { string fName = new F ...

  4. 你不需要 jQuery,但你需要一个 DOM 库

    写这篇文章的目的,一方面是介绍一下自己编写的模块化 DOM 库 domq.js,另一方面是希望大家对 jQuery 有一个正确的认识,即使 jQuery 已经逐渐退出历史舞台,但是它的 API 将会以 ...

  5. vuex直接修改state 与 用dispatch/commit来修改state的差异

    一. 使用vuex修改state时,有两种方式: 1.可以直接使用 this.$store.state.变量 = xxx; 2.this.$store.dispatch(actionType, pay ...

  6. postman Installation has failed: There was an error while installing the application. Check the setup log for more information and contact the author

    Error msg: Installation has failed: There was an error while installing the application. Check the s ...

  7. 11 Django RESTful framework 实现缓存

    01-安装 pip install drf-extensions 02-导入 from rest_framework_extensions.cache.mixins import CacheRespo ...

  8. 【alpha阶段】第八次Scrum Meeting

    每日任务内容 队员 昨日完成任务 明日要完成的任务 牛宇航 #26 评价总览接口编写https://github.com/rRetr0Git/rateMyCourse/issues/26 (任务较重, ...

  9. servlet(1)

    servlet类分级: 1.ServletConfig接口类:理解为读取servlet配置的类,里面有四个抽象方法如下: ①getServletName:获取servlet在web.xml中的名字 ② ...

  10. Async/Await 学习与示例

    参考:Async/await学习 es 7 提供了对 promise 对象的更好的操作,省去了很多丧心病狂的链式异步请求,promise 是回调地狱的福音,而 Async/Await 则是 promi ...