nginx-1.13.x源码安装

Nginx 安装配置

【依赖库】
[ zlib ]
(下载)http://download.chinaunix.net/download.php?id=24013&ResourceID=12241
[ pcre ]
apt-get install libpcre-dev
[ openssl ]
(下载)http://download.chinaunix.net/download.php?id=39379&ResourceID=11

【configure】
[ 编译命令 ]
./configure 
--prefix=/work/nginx/ 
--with-pcre 
--with-http_ssl_module 
--with-openssl=/usr/local/ssl	
#--with-zlib=/usr/local/zlib 	#此处会导致 make distclean 异常


[ 成功提示 ]
creating objs/MakefileConfiguration summary+ using system PCRE library+ using OpenSSL library: /usr/local/ssl+ using zlib library: /usr/local/zlibnginx path prefix: "/work/nginx/"nginx binary file: "/work/nginx//sbin/nginx"nginx modules path: "/work/nginx//modules"nginx configuration prefix: "/work/nginx//conf"nginx configuration file: "/work/nginx//conf/nginx.conf"nginx pid file: "/work/nginx//logs/nginx.pid"nginx error log file: "/work/nginx//logs/error.log"nginx http access log file: "/work/nginx//logs/access.log"nginx http client request body temporary files: "client_body_temp"nginx http proxy temporary files: "proxy_temp"nginx http fastcgi temporary files: "fastcgi_temp"nginx http uwsgi temporary files: "uwsgi_temp"nginx http scgi temporary files: "scgi_temp"	


【 make 错误 】
[ .openssl 目录问题 ]
/bin/sh: line 2: ./config: No such file or directory
make[1]: *** [/usr/local/ssl/.openssl/include/openssl/ssl.h] Error 127
make[1]: Leaving directory `/usr/local/src/nginx-1.9.9'
make: *** [build] Error 2	

[ 解决方式 ]
修改文件:/usr/local/src/nginx-1.9.9/auto/lib/openssl/conf
找到:
CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"	

替换为:
CORE_INCS="$CORE_INCS $OPENSSL/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"	

其实就是去掉 .openssl 目录。

[ make distclean ]
make -f objs/Makefile
make[1]: Entering directory `/home/newton/nginx-1.13.4'
cd /usr/local/zlib \&& make distclean \&& CFLAGS="-O2 -fomit-frame-pointer -pipe " CC="cc" \./configure \&& make libz.a
/bin/sh: 3: Syntax error: "&&" unexpected
make[1]: *** [/usr/local/zlib/libz.a] Error 2
make[1]: Leaving directory `/home/newton/nginx-1.13.4'
make: *** [build] Error 2

[ 解决方案 ]
将 configure 的编辑模块中,去掉 --with-zlib
** 如果有其它解决方案,欢迎分享 **

【make & make install】
[ make ]
	objs/src/http/modules/ngx_http_upstream_zone_module.o \objs/ngx_modules.o \-ldl -lpthread -lcrypt -lpcre /usr/local/openssl/lib/libssl.a /usr/local/openssl/lib/libcrypto.a -ldl -lz \-Wl,-E
sed -e "s|%%PREFIX%%|/work/nginx/|" \-e "s|%%PID_PATH%%|/work/nginx//logs/nginx.pid|" \-e "s|%%CONF_PATH%%|/work/nginx//conf/nginx.conf|" \-e "s|%%ERROR_LOG_PATH%%|/work/nginx//logs/error.log|" \< man/nginx.8 > objs/nginx.8
make[1]: Leaving directory `/home/newton/nginx-1.13.4'	


[ make install ]
make -f objs/Makefile install
make[1]: Entering directory `/home/newton/nginx-1.13.4'
test -d '/work/nginx/' || mkdir -p '/work/nginx/'
test -d '/work/nginx//sbin' \|| mkdir -p '/work/nginx//sbin'
test ! -f '/work/nginx//sbin/nginx' \|| mv '/work/nginx//sbin/nginx' \'/work/nginx//sbin/nginx.old'
cp objs/nginx '/work/nginx//sbin/nginx'
test -d '/work/nginx//conf' \|| mkdir -p '/work/nginx//conf'
cp conf/koi-win '/work/nginx//conf'
cp conf/koi-utf '/work/nginx//conf'
cp conf/win-utf '/work/nginx//conf'
test -f '/work/nginx//conf/mime.types' \|| cp conf/mime.types '/work/nginx//conf'
cp conf/mime.types '/work/nginx//conf/mime.types.default'
test -f '/work/nginx//conf/fastcgi_params' \|| cp conf/fastcgi_params '/work/nginx//conf'
cp conf/fastcgi_params \'/work/nginx//conf/fastcgi_params.default'
test -f '/work/nginx//conf/fastcgi.conf' \|| cp conf/fastcgi.conf '/work/nginx//conf'
cp conf/fastcgi.conf '/work/nginx//conf/fastcgi.conf.default'
test -f '/work/nginx//conf/uwsgi_params' \|| cp conf/uwsgi_params '/work/nginx//conf'
cp conf/uwsgi_params \'/work/nginx//conf/uwsgi_params.default'
test -f '/work/nginx//conf/scgi_params' \|| cp conf/scgi_params '/work/nginx//conf'
cp conf/scgi_params \'/work/nginx//conf/scgi_params.default'
test -f '/work/nginx//conf/nginx.conf' \|| cp conf/nginx.conf '/work/nginx//conf/nginx.conf'
cp conf/nginx.conf '/work/nginx//conf/nginx.conf.default'
test -d '/work/nginx//logs' \|| mkdir -p '/work/nginx//logs'
test -d '/work/nginx//logs' \|| mkdir -p '/work/nginx//logs'
test -d '/work/nginx//html' \|| cp -R html '/work/nginx/'
test -d '/work/nginx//logs' \|| mkdir -p '/work/nginx//logs'
make[1]: Leaving directory `/home/newton/nginx-1.13.4'

【配置快捷方式】
ln /work/nginx/sbin/nginx /usr/bin/nginx

【启动Nginx】
nginx

【查看进程】
root@umaster:/work/project# ps awx|grep nginx
33665 ? Ss 0:00 nginx: master process nginx
33666 ? S 0:00 nginx: worker process
34029 pts/0 S+ 0:00 grep --color=auto nginx

【Nginx配置】
主要是:日志、端口号、脚本目录、首页文件名;
打开配置文件: /work/nginx/conf/nginx.conf
#[ 错误日志 ]
error_log  logs/error.log;
#[ 服务相关 ]
server {listen       88;				#监听HTTP端口;server_name  localhost;		#访问地址;#charset koi8-r;#access_log  logs/host.access.log  main;location /work {			#脚本根目录root   html;				#入口目录index  index.html index.htm;	#默认执行的首页文件}


【重启Nginx】
nginx -s reload :修改配置后重新加载生效

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/276031.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

小技巧!CSS 整块文本溢出省略特性探究

大家好&#xff0c;我是若川。欢迎加我微信 ruochuan12&#xff0c;长期交流学习。今天的文章很有意思&#xff0c;讲一讲整块文本溢出省略打点的一些有意思的细节。点击下方卡片关注我&#xff0c;或者查看源码系列文章。文本超长打点我们都知道&#xff0c;到今天&#xff08…

linux配置ip地址 suse_SUSE Linux下设置IP的两种方法

第一种SUSE Linux IP设置方法ifconfig eth0 192.168.1.22 netmask 255.255.255.0 uproute add default gw 192.168.1.2释义&#xff1a;#IP配置&#xff0c;包括子网掩码,看情况修改eth0和192.168.1.22#网关修改 ,看情况修改192.168.1.2第二种SUSE Linux IP设置方法在suse操作系…

寒假作业3:抓老鼠啊

7-1 抓老鼠啊~亏了还是赚了&#xff1f; &#xff08;20 分&#xff09; 某地老鼠成灾&#xff0c;现悬赏抓老鼠&#xff0c;每抓到一只奖励10元&#xff0c;于是开始跟老鼠斗智斗勇&#xff1a;每天在墙角可选择以下三个操作&#xff1a;放置一个带有一块奶酪的捕鼠夹(T)&…

笔记本移交_创建完美的设计移交

笔记本移交重点 (Top highlight)Design specifications (specs) are guidelines that developers will use to implement a design. Think of an architect providing building blueprints to the construction team. Many designers think of specs as mindless zombie work. …

大手笔,送¥1599的Apple AirPods Pro和独家礼物等

大家好&#xff0c;我是若川。为感谢公众号读者们长久以来的支持&#xff0c;本次我联合几位前端界大佬给大家送超级福利了。除了联合福利之外&#xff0c;每位前端大佬还带了专属礼品送给大家&#xff0c;所有抽奖均可重复参与、可重复中奖&#xff0c;详情见下文每个公众号的…

jQuery1.4新特性

1. 传参给 jQuery(…) 之前&#xff0c;jQuery可以通过 attr 方法设置元素的属性&#xff0c;既可传属性的名和值&#xff0c;也可以是包含几组特定 属性名值对 的 对象。在 jQuery 1.4 中&#xff0c;你可以把一个参数对象作为第二个参数传给 jQuery 函数本身&#xff0c;同时…

python pack unpack_golang 仿python pack/unpack

package includesimport ("bytes""encoding/binary""fmt"_"os""strconv""strings")type Protocolstruct{Format []string}//封包func (p *Protocol) Pack(args ...interface{}) []byte{la :len(args)ls :len(p.Fo…

JavaScript递归应用与实践

递归简单来说就是函数内调用自生的一种方法&#xff0c;形如&#xff1a; function foo(){foo() } 复制代码下面我列举一些常用的递归应用。 1. 求和&#xff0c;例如求1234...100之和 分析如下&#xff1a; sum(100)sum(99)100 sum(99)sum(98)99 ... sum(1)sum(0)1 复制代码代…

一个好的设计师_是什么让一个好的设计师

一个好的设计师重点 (Top highlight)The design manager role has grown considerably over the past five years. As design has been recognised as a business value-driver and organisations have increased their design maturity, we’ve seen lots more design managem…

PHP-Redis扩展安装 error: ext/standard/php_smart_str.h: No such file or directory

在源码编译PHP-redis扩展时&#xff0c;遇到缺少头文件问题【问题描述】error: ext/standard/php_smart_str.h: No such file or directory 【问题原因】PHP安装好的头文件目录&#xff1a;/php/include/php/ext/standard/&#xff0c;这些头文件&#xff0c;在php7之前的版本&…

相见恨晚的一款前端布局神器!

大家好&#xff0c;我是若川。欢迎加我微信 ruochuan12&#xff0c;长期交流学习。今天给大家推荐一款非常实用的前端页面布局神器&#xff0c;点击下方卡片关注我&#xff0c;或者查看源码系列文章。页面和布局是一门前端程序员的必修课&#xff0c;css 从来也不是停留在面试八…

IC设计前端几本经典书籍

No.1 Writing Testbenches, Functional Verification of HDL Modelsby Janick Bergeron本书主要以HDL&#xff08;verilog/vhdl&#xff09;为例&#xff0c;详细讲述了在IC DESIGN FLOW中Verification 以及Test的设计思想、方法和技巧&#xff0c;涵概了测试的各个方面&#x…

unreal无损音乐百度云_将网易云音乐专用的无损音乐格式转换成全平台通用的无损格式...

前几天发现网易云音乐的ncm格式很坑爹&#xff0c;由于网易云的部分音乐采取了这种流媒体平台模式&#xff0c;这种格式的歌曲下载到设备本地以后只有在网易云音乐的app上面才能播放&#xff0c;而且还要在会员生效期间才能播今天网易云弄出一个ncm&#xff0c;明天百度音乐来一…

锁升级

JavaSE1.6为了减少获得锁和释放锁带来的性能消耗&#xff0c;引入了“偏向锁”和“轻量级锁”。 在JavaSE1.6中&#xff0c;锁一共有4种状态&#xff0c;级别从低到高依次是&#xff1a;无锁状态、偏向锁状态、轻量级锁状态和重量级锁状态&#xff0c;这几个状态会随着竞争情况…

ux和ui_首先要做的— UX / UI案例研究

ux和ui休息一下&#xff01; (Get some rest!) After four weeks of four-day design sprints each week, I welcomed the opportunity to work on this 9-day design challenge. With this also being an individual project, I allocated 50% of my time on the UX process a…

微信消息模板换行符转义问题处理

通常的微信模板&#xff1a; Hello &#xff01;\n\n Are you OK&#xff1f; ① 直接定义字符串&#xff1b; ② 数据库中读取&#xff1b;这里需要说明的是 数据库读取 的内容&#xff0c;如果直接推送&#xff0c;\n\n是没有被转移为换行符的。此时需要&#xff1a; $tplStr…

Vue2 彻底从 Flow 重构为 TypeScript,焕然一新!

大家好&#xff0c;我是若川。欢迎加我微信 ruochuan12&#xff0c;长期交流学习。今天分享一篇技术热点&#xff0c;众所周知&#xff0c;前不久vue3不打算支持IE11&#xff0c;vue2将支持composition API&#xff0c;现在vue2用ts重构&#xff0c;试问&#xff1a;还学得动嘛…

红米note5linux刷机包__最新最全的红米Note5ROM刷机包下载、刷机教程_红米Note5论坛_移动叔叔...

本帖最后由 压力山大大叔 于 2018-5-15 00:52 编辑20180513跟新全屏手势。看最后一张载图。1&#xff1a;先解锁&#xff0c;刷第三方&#xff0c;都是这个流程。2非常干净&#xff0c;只有670兆&#xff0c;刷完没有找到浏览器&#xff0c;刷前下载一个浏览器在手机里备用。3电…

每个网页设计者都自以为是

&#xff08;一&#xff09;垃圾还是经典网页技术更新很快&#xff0c;一个网站的界面设计寿命仅仅2-3年而已。不管是垃圾还是精品&#xff0c;都没有所谓的经典。经典只存在于是哪个首次成功创新性的应用。网页设计 者不管自己的学识、技术和经验如何&#xff0c;都自以为自己…

文件夹的拷贝

文件夹用来把文件包裹起来&#xff0c;褪去这些外衣&#xff0c;说到底拷贝文件夹也就是拷贝文件 模拟实例&#xff1a;将F:/Picture/test 文件夹 拷贝到 F:/Picture/dir文件夹 该实例中test文件夹下只包含了test.txt文件 步骤分析&#xff1a; 1.通过路径得到File对象 2.递归查…