源码安装nginx
2015-12-18 19:36
691 查看
1.安装nginx前,需要先安装pcre
这一步我先安装了较新版本的pcre2,后来编译nginx的时候出错,原因是找不到pcre.h,因为新的版本生成的是pcre2.h,装回老版本后问题解决
./configure --prefix=/usr/local/webserver/pcre
make && make install
2. nginx安装(以下为参考网上资料)
编译参数:
--[root@localhost nginx-1.4.6]# ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/pcre/
NGINX编译通过后,make时报错如下:
[root@localhost nginx-1.4.6]# makemake -f objs/Makefilemake[1]: Entering directory `/usr/src/nginx-1.4.6'cd /usr/local/pcre/ \&& if [ -f Makefile ]; then make distclean; fi \&& CC="cc" CFLAGS="-O2 -fomit-frame-pointer -pipe " \./configure --disable-shared/bin/sh:
line 2: ./configure: No such file or directorymake[1]: *** [/usr/local/pcre//Makefile] Error 127make[1]: Leaving directory `/usr/src/nginx-1.4.6'make: *** [build] Error 2[root@localhost nginx-1.4.6]#
主要错误:make[1]: *** [/usr/local/pcre//Makefile] Error 127
查看了下帮助
[root@localhost nginx-1.4.6]# ./configure --help | grep '\--with-pcre' --with-pcreforce PCRE library usage --with-pcre=DIRset path to PCRE library sources --with-pcre-opt=OPTIONSset additional build options for PCRE --with-pcre-jitbuild PCRE with JIT compilation
support[root@localhost nginx-1.4.6]#
发现--with-pcre=DIR是设置pcre的源码目录,而不是pcre的安装目录
重新修改Nginx编译参数
[root@localhost nginx-1.4.6]# ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/src/pcre-8.10/
编译通过后执行make && make install 都应该不会有问题
本文出自 “小科” 博客,请务必保留此出处
这一步我先安装了较新版本的pcre2,后来编译nginx的时候出错,原因是找不到pcre.h,因为新的版本生成的是pcre2.h,装回老版本后问题解决
./configure --prefix=/usr/local/webserver/pcre
make && make install
2. nginx安装(以下为参考网上资料)
编译参数:
--[root@localhost nginx-1.4.6]# ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/pcre/
NGINX编译通过后,make时报错如下:
[root@localhost nginx-1.4.6]# makemake -f objs/Makefilemake[1]: Entering directory `/usr/src/nginx-1.4.6'cd /usr/local/pcre/ \&& if [ -f Makefile ]; then make distclean; fi \&& CC="cc" CFLAGS="-O2 -fomit-frame-pointer -pipe " \./configure --disable-shared/bin/sh:
line 2: ./configure: No such file or directorymake[1]: *** [/usr/local/pcre//Makefile] Error 127make[1]: Leaving directory `/usr/src/nginx-1.4.6'make: *** [build] Error 2[root@localhost nginx-1.4.6]#
主要错误:make[1]: *** [/usr/local/pcre//Makefile] Error 127
查看了下帮助
[root@localhost nginx-1.4.6]# ./configure --help | grep '\--with-pcre' --with-pcreforce PCRE library usage --with-pcre=DIRset path to PCRE library sources --with-pcre-opt=OPTIONSset additional build options for PCRE --with-pcre-jitbuild PCRE with JIT compilation
support[root@localhost nginx-1.4.6]#
发现--with-pcre=DIR是设置pcre的源码目录,而不是pcre的安装目录
重新修改Nginx编译参数
[root@localhost nginx-1.4.6]# ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/src/pcre-8.10/
编译通过后执行make && make install 都应该不会有问题
本文出自 “小科” 博客,请务必保留此出处
相关文章推荐
- Linux socket 初步
- nginx代理指定目录
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 访问Nginx发生SSL connection error的一种情况
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户
- Scientific Linux 5.5 图形安装教程
- Nginx+Naxsi部署专业级Web应用防火墙