今年准备认真一下nginx源码,目的是学习网络编程,我用的源码公开发布的第一个版本 nginx-0.1.0-RELEASE,代码地址:
http://hg.nginx.org/nginx/rev/551102312e19
在浏览器里直接点左边的zip或gz就可以下载了。解压后源码目录下有4个文件夹:
- auto
- conf
- docs
- src
把auto目录下的configure文件拷贝到源码目录,运行
.configure
就可以生成Makefile,同时configure命令的输出,在我的ubuntu上看起来是这样的:
Configuration summary
+ PCRE library is not found
+ md5 library is not used
+ OpenSSL library is not used
+ using system zlib library./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using –without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using –with-pcre= option.`
未找到PCRE库,因此无法正确安装HTTP rewrite模块。
执行命令:
sudo apt-get install libpcre3 libpcre3-dev
后再执行make clean,configure;显示结果:
Configuration summary
+ using system PCRE library
+ md5 library is not used
+ OpenSSL library is not used
+ using system zlib librarynginx path prefix: /usr/local