如何给在用的nginx添加新模块?
妙音
posted @ 2014年11月13日 11:29
in nginx
, 5060 阅读
有一个在用的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了
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 命令。
2014年11月17日 08:48
@依云: nginx的Makefile也是用cp
2014年11月17日 12:13
@妙音: 不是吧……
2014年11月17日 12:35
@妙音: 好吧,nginx 连在别的目录 build 都不支持,默认的安装路径也和 Apache httpd 之类的一样怪异无比…………
2014年11月17日 12:36
@妙音: 不过它在 cp nginx 前会把旧的 nginx 给移走,所以大部分时候不会覆盖旧的 nginx 文件。
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. 먹튀검증
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
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
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.
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
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.
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.
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. 먹튀폴리스
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. 토토사이트
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
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
2020年11月07日 19:16
Make the most of mainly premium substances - you will find him or her for:
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. 먹튀검증
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. 먹튀검증
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.. 먹튀폴리스
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
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.
2020年12月20日 19:02
This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. poetry sad love
2020年12月23日 23:20
This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work mollie abrechnung
2020年12月29日 19:50
Your site is truly cool and this is an extraordinary moving article. Holzpool
2020年12月31日 17:51
this is a very beautiful gig
2021年1月07日 17:21
I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. Ovalpools
2024年2月03日 23:04
Empower your certification journey with Certs4Exam's PDF Dumps 2k24. Quality resources, real success. Your path to excellence starts here.
2024年2月04日 00:08
Seeking PDF Dumps 2k24? Look no further. Certs4Exam offers reliable study materials to propel you towards certification success.
2024年2月04日 00:16
Embark on a journey of excellence with Certs4Exam 200-301 PDF Dumps 2k24. Unleash the power of authentic study resources for guaranteed success in your certifications.