CentOS5.6 compile and install Nginx1.0.4

Source: Internet
Author: User
[Root@www.linuxidc.comnginx-] # Adduserwww [root@www.linuxidc.comnginx-] # Groupaddwww # wgethttp: // mirrors.sohu.com/nginx/nginx-1.0.4.tar.gz?tarzxvfnginx-1.0.4.tar.gz

[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 = 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

Execute again./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 start nginx

Verify that nginx runs successfully
$ 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

Nginx and pureftp cannot be started automatically at startup in lnmp.

The following is the/etc/rc. d/rc. local file.
#! /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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.