手机版
你好,游客 登录 注册
背景:
阅读新闻

CentOS 5.6 编译安装Nginx 1.0.4

[日期:2011-07-15] 来源:Linux社区  作者:weizhensong [字体:大 中 小]

[root@www.linuxidc.comnginx-]#Adduser www

[root@www.linuxidc.comnginx-]#Groupadd www

#wget http://mirrors.sohu.com/nginx/nginx-1.0.4.tar.gz
#tar zxvf nginx-1.0.4.tar.gz
#cd nginx-1.0.4

[root@www.linuxidc.comnginx-0.6.26]#./configure --user=www --group=www --prefix=/usr/local/nginx/ --with-http_stub_status_module --with-openssl=/usr/local/openssl

./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=<path> option.

[root@www.linuxidc.com nginx-0.6.26]# rpm -qa|grep pcre
pcre-6.6-1.1
[root@www.linuxidc.com suantop]# yum install pcre
[root@www.linuxidc.com suantop]# rpm -qa|grep pcre
pcre-6.6-1.1
pcre-devel-6.6-1.1

等再次执行./configure

[root@www.linuxidc.com nginx-0.6.26]# ./configure --user=www --group=www --prefix=/usr/local/nginx/ --with-http_stub_status_module --with-openssl=/usr/local/openssl
 
[root@www.linuxidc.com nginx-0.6.26]# make
[root@www.linuxidc.com nginx-0.6.26]# make install
[root@www.linuxidc.com nginx-0.6.26]#/usr/local/nginx/sbin/nginx   启动nginx

验证nginx运行是否成功
$ curl -i http://localhost
HTTP/1.1 200 OK
Server: nginx/0.9.1
Date: Fri, 03 Dec 2010 02:34:01 GMT
Content-Type: text/html
Content-Length: 151
Last-Modified: Fri, 03 Dec 2010 02:00:40 GMT
Connection: keep-alive
Accept-Ranges: bytes

lnmp下nginx和pureftp无法开机自动启动

下面是 /etc/rc.d/rc.local 文件
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/usr/local/nginx/sbin/nginx

linux
相关资讯       Nginx 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款