nginx启用spdy支持
nginx限制访问速度

如何给在用的nginx添加新模块?

妙音 posted @ 2014年11月13日 11:29 in nginx , 3063 阅读
有一个在用的nginx,以yum方法安装的,怎样在不改动配置的情况下,为它添加模块.
以添加spdy模块为例.

编译新模块

预编译
./configure  --prefix=/etc/nginx \
   --sbin-path=/usr/sbin \
   --conf-path=/etc/nginx/nginx.conf \
   --pid-path=/run/nginx.pid  \
   --error-log-path=/var/log/nginx/error.log \
   --with-http_spdy_module \
   --with-http_ssl_module \
   --with-ipv6 
--sbin-path, --pid—path, --conf—path,--erro—path三个参数是设定默认配置路径.
如果旧的nginx不是以/usr/local/nginx为安装路径,则需要指定上面参数,可以在旧nginx的nginx.conf文件中取到.
 
编译
make之后复制

验证新nginx是否可用

验证编译后的nginx是否可以使用已有的配置
./obj/nginx -t

使用新nginx

备份 cp /usr/sbin/nginx /usr/sbin/nginx-bak
替换 cp ./obj/nginx /usr/sbin/nginx
ok了
 
Avatar_small
依云 说:
2014年11月15日 00:11

不 OK。完全错了。

cp ./obj/nginx /usr/sbin/nginx 这句很可能会导致运行中的旧 nginx 崩溃。参见 http://en.chys.info/2009/05/install-vs-cp-and-mmap/ 安装二进制文件应该使用 install 命令。

Avatar_small
妙音 说:
2014年11月17日 08:48

@依云: nginx的Makefile也是用cp

Avatar_small
依云 说:
2014年11月17日 12:13

@妙音: 不是吧……

Avatar_small
依云 说:
2014年11月17日 12:35

@妙音: 好吧,nginx 连在别的目录 build 都不支持,默认的安装路径也和 Apache httpd 之类的一样怪异无比…………

Avatar_small
依云 说:
2014年11月17日 12:36

@妙音: 不过它在 cp nginx 前会把旧的 nginx 给移走,所以大部分时候不会覆盖旧的 nginx 文件。

Avatar_small
ibmseo 说:
2020年10月08日 20:41

I’m excited to uncover this page. I need to to thank you for ones time for this particularly fantastic read !! I definitely really liked every part of it and i also have you saved to fav to look at new information in your site. 먹튀검증

Avatar_small
farhan 说:
2020年10月11日 19:35 They're produced by the very best degree developers who will be distinguished for your polo dress creating. You'll find polo Ron Lauren inside exclusive array which include particular classes for men, women. Capital Gains Tax Advice
Avatar_small
farhan 说:
2020年10月12日 16:23

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates. Tax Advisors Tax Accountants

Avatar_small
안전놀이터 说:
2020年10月13日 18:29

I did so appreciate reading through content articles submitted on this website. They're amazing and it has lots of helpful info.

Avatar_small
farhan 说:
2020年10月13日 19:56

Took me time to understand all of the comments, but I seriously enjoyed the write-up. It proved being really helpful to me and Im positive to all of the commenters right here! Its constantly nice when you can not only be informed, but also entertained! I am certain you had enjoyable writing this write-up. top sites de rencontre

Avatar_small
먹튀 说:
2020年10月21日 04:02

I've got not long ago started off some sort of blog site, the internet people produce here possesses served everyone enormously. Appreciate it intended for all of your current time period & do the job.

Avatar_small
먹튀검증커뮤니티 说:
2020年10月25日 14:40

That is a good write-up When i viewed on account of write about the item. Really it is what exactly I need to to discover trust with foreseeable future you might go on intended for giving a really fantastic write-up.

Avatar_small
farhan 说:
2020年10月27日 20:00

Great Article it its really informative and innovative keep us posted with new updates. its was really valuable. thanks a lot. 먹튀폴리스

Avatar_small
farhan 说:
2020年10月29日 18:39

Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. 토토사이트

Avatar_small
farhan 说:
2020年10月31日 20:03

It should be noted that whilst ordering papers for sale at paper writing service, you can get unkind attitude. In case you feel that the bureau is trying to cheat you, don't buy term paper from it. buy instagram story views and impressions

Avatar_small
Digital ALi 说:
2020年11月03日 19:37

What is an outstanding post! “I’ll be back” (to read more of your content). Thanks for the nudge! shaw internet plans

Avatar_small
먹튀폴리스 说:
2020年11月07日 19:16

Make the most of mainly premium substances - you will find him or her for:

Avatar_small
farhan 说:
2020年11月12日 13:31 You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. 먹튀검증
Avatar_small
farhan 说:
2020年11月16日 14:30

Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up. 먹튀검증

Avatar_small
Top SEO 说:
2020年11月19日 13:54

This blog is so nice to me. I will keep on coming here again and again. Visit my link as well.. 먹튀폴리스

Avatar_small
Top SEO 说:
2020年11月24日 08:01 The website is looking bit flashy and it catches the visitors eyes. Design is pretty simple and a good user friendly interface. CBD Bud
Avatar_small
안전놀이터 说:
2020年11月24日 20:03

As i purchased with your blog site while positioning fascination purely a little bit little submits. Fulfilling technique for extended, We will be book-marking during a period attain forms finish happens further up.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter