Thursday, April 10, 2008

Installing Nginx on CentOS 5

[root@rubyplus etc]# yum install pcre
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
base 100% |=========================| 1.1 kB 00:00
updates 951 B 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for pcre to pack into transaction set.
pcre-6.6-2.el5_1.7.i386.r 100% |=========================| 7.4 kB 00:00
---> Package pcre.i386 0:6.6-2.el5_1.7 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Updating:
pcre i386 6.6-2.el5_1.7 updates 112 k

Transaction Summary
=============================================================================
Install 0 Package(s)
Update 1 Package(s)
Remove 0 Package(s)

Total download size: 112 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): pcre-6.6-2.el5_1.7.i386.rpm 112 kB 00:02
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : pcre ######################### [1/2]
Cleanup : pcre ######################### [2/2]

Updated: pcre.i386 0:6.6-2.el5_1.7
Complete!
[root@rubyplus etc]# yum install pcre-devel
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for pcre-devel to pack into transaction set.
pcre-devel-6.6-2.el5_1.7. 100% |=========================| 10 kB 00:00
---> Package pcre-devel.i386 0:6.6-2.el5_1.7 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
pcre-devel i386 6.6-2.el5_1.7 updates 176 k

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 176 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): pcre-devel-6.6-2.el5_1.7.i386.rpm 176 kB 00:02
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: pcre-devel ######################### [1/1]

Installed: pcre-devel.i386 0:6.6-2.el5_1.7
Complete!
[root@rubyplus etc]# yum install zlib
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Nothing to do
[root@rubyplus etc]# yum install zlib-devel
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Nothing to do
[root@rubyplus etc]# yum install openssl
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Nothing to do
[root@rubyplus etc]# yum install openssl-devel
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Nothing to do
[root@rubyplus etc]# ./configure --sbin-path=/usr/local/sbin --with-http_ssl_module --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with
-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-cc-opt="-I /usr/include/pcre" --pid-path=/var/run/ngin
x.pid --lock-path=/var/lock/subsys/nginx --conf-path=/etc/nginx/nginx.conf
-bash: ./configure: No such file or directory
[root@rubyplus etc]#
[root@rubyplus etc]# wget http://sysoev.ru/nginx/nginx-0.5.35.tar.gz
--12:44:58-- http://sysoev.ru/nginx/nginx-0.5.35.tar.gz
Resolving sysoev.ru... 81.19.69.70
Connecting to sysoev.ru|81.19.69.70|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 488926 (477K) [application/octet-stream]
Saving to: `nginx-0.5.35.tar.gz'

100%[===============================================================================================================================>] 488,926 48.7K/s in 9.3s

12:45:08 (51.3 KB/s) - `nginx-0.5.35.tar.gz' saved [488926/488926]

[root@rubyplus etc]# tar xzvf nginx-0.5.35.tar.gz
nginx-0.5.35/



nginx-0.5.35/contrib/unicode2nginx/koi-utf
[root@rubyplus etc]# cd nginx-0.5.35
[root@rubyplus nginx-0.5.35]# ./configure --sbin-path=/sbin/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module
--with-md5=auto/lib/md5 --with-sha1=auto/lib/sha1
checking for OS
+ Linux 2.6.18-53.1.6.el5.028stab053.6PAE i686
checking for C compiler ... not found

./configure: error: C compiler gcc is not found

[root@rubyplus nginx-0.5.35]# yum install gcc
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for gcc to pack into transaction set.
gcc-4.1.2-14.el5.i386.rpm 100% |=========================| 64 kB 00:00
---> Package gcc.i386 0:4.1.2-14.el5 set to be updated
--> Running transaction check
--> Processing Dependency: libgomp.so.1 for package: gcc
--> Processing Dependency: binutils >= 2.17.50.0.2-8 for package: gcc
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc
glibc-common-2.5-18.el5_1 100% |=========================| 723 kB 00:00
---> Package glibc-common.i386 0:2.5-18.el5_1.1 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
gcc i386 4.1.2-14.el5 base 5.2 M
Installing for dependencies:
binutils i386 2.17.50.0.6-5.el5 base 2.9 M
cpp i386 4.1.2-14.el5 base 2.6 M
glibc-devel i386 2.5-18.el5_1.1 updates 2.0 M
glibc-headers i386 2.5-18.el5_1.1 updates 609 k
libgomp i386 4.1.2-14.el5 base 76 k
Updating for dependencies:
glibc i686 2.5-18.el5_1.1 updates 5.1 M
glibc-common i386 2.5-18.el5_1.1 updates 16 M
libgcc i386 4.1.2-14.el5 base 87 k

Transaction Summary
=============================================================================
Install 6 Package(s)
Update 3 Package(s)
Remove 0 Package(s)

Total download size: 35 M
Is this ok [y/N]: y
Downloading Packages:
(1/9): binutils-2.17.50.0 100% |=========================| 2.9 MB 00:03
(2/9): gcc-4.1.2-14.el5.i 100% |=========================| 5.2 MB 00:07
(3/9): libgcc-4.1.2-14.el 100% |=========================| 87 kB 00:00
(4/9): libgomp-4.1.2-14.e 100% |=========================| 76 kB 00:00
(5/9): glibc-2.5-18.el5_1 100% |=========================| 5.1 MB 00:02
(6/9): cpp-4.1.2-14.el5.i 100% |=========================| 2.6 MB 00:02
(7/9): glibc-headers-2.5- 100% |=========================| 609 kB 00:00
(8/9): glibc-common-2.5-1 100% |=========================| 16 MB 00:07
(9/9): glibc-devel-2.5-18 100% |=========================| 2.0 MB 00:01
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : libgcc ####################### [ 1/12]
Updating : glibc-common ####################### [ 2/12]
Updating : glibc ####################### [ 3/12]
Installing: binutils ####################### [ 4/12]
Installing: libgomp ####################### [ 5/12]
Installing: cpp ####################### [ 6/12]
Installing: glibc-headers ####################### [ 7/12]
Installing: glibc-devel ####################### [ 8/12]
Installing: gcc ####################### [ 9/12]
Cleanup : libgcc ####################### [10/12]
Cleanup : glibc ####################### [11/12]
Cleanup : glibc-common ####################### [12/12]

Installed: gcc.i386 0:4.1.2-14.el5
Dependency Installed: binutils.i386 0:2.17.50.0.6-5.el5 cpp.i386 0:4.1.2-14.el5 glibc-devel.i386 0:2.5-18.el5_1.1 glibc-headers.i386 0:2.5-18.el5_1.1 libgomp.i386 0:4.1.2-14.el5
Dependency Updated: glibc.i686 0:2.5-18.el5_1.1 glibc-common.i386 0:2.5-18.el5_1.1 libgcc.i386 0:4.1.2-14.el5
Complete!
[root@rubyplus nginx-0.5.35]# ./configure --sbin-path=/sbin/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module
--with-md5=auto/lib/md5 --with-sha1=auto/lib/sha1
checking for OS
+ Linux 2.6.18-53.1.6.el5.028stab053.6PAE i686
checking for C compiler ... found
+ using GNU C compiler
+ gcc version: 4.1.2 20070626 (Red Hat 4.1.2-14)
checking for gcc -pipe switch ... found
checking for gcc variadic macros ... found
checking for C99 variadic macros ... found
checking for unistd.h ... found

checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found

Configuration summary
+ threads are not used
+ using system PCRE library
+ using system OpenSSL library
+ using md5 library: auto/lib/md5
+ using sha1 library: auto/lib/sha1
+ using system zlib library

nginx path prefix: "/usr/local/nginx"
nginx binary file: "/sbin/nginx"
nginx configuration file: "/usr/local/nginx/nginx.conf"
nginx pid file: "/usr/local/nginx/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "/usr/local/nginx/client_body_temp"
nginx http proxy temporary files: "/usr/local/nginx/proxy_temp"
nginx http fastcgi temporary files: "/usr/local/nginx/fastcgi_temp"

Run:
make
make install

5 comments:

  1. That was very useful. Thanks!

    ReplyDelete
  2. Although the formatting made this a bit tough to read the procedure did help me successfully get ngnix installed on my new centos 5 slice.

    Thanks,
    Greg

    ReplyDelete
  3. Great config. I tried to find this. I follow you step by step and my nginx work great!

    Thank you

    ReplyDelete
  4. thank you for good information.

    ReplyDelete
  5. thanks for good information.

    ReplyDelete