[root@localhost]# cd /opt/[root@localhost opt]# rz -E[root@localhost opt]# ls
nginx-1.5.1.tar.gz rh
[root@localhost opt]# tar xf nginx-1.5.1.tar.gz [root@localhost opt]# cd nginx-1.5.1/[root@localhost nginx-1.5.1]# ls
auto CHANGES CHANGES.ru conf configure contrib html LICENSE man README src
[root@localhost nginx-1.5.1]# ll
总用量 568
drwxr-xr-x. 6 tom tom 4096 5月 25 18:20 auto
-rw-r--r--. 1 tom tom 222750 6月 4 2013 CHANGES
-rw-r--r--. 1 tom tom 339122 6月 4 2013 CHANGES.ru
drwxr-xr-x. 2 tom tom 168 5月 25 18:20 conf
-rwxr-xr-x. 1 tom tom 2369 6月 4 2013 configure
drwxr-xr-x. 3 tom tom 61 5月 25 18:20 contrib
drwxr-xr-x. 2 tom tom 40 5月 25 18:20 html
-rw-r--r--. 1 tom tom 1397 6月 4 2013 LICENSE
drwxr-xr-x. 2 tom tom 21 5月 25 18:20 man
-rw-r--r--. 1 tom tom 49 6月 4 2013 README
drwxr-xr-x. 8 tom tom 77 5月 25 18:20 src
[root@localhost nginx-1.5.1]# ./configure --prefix=/usr/local/nginx
checking for OS
.........
报错1:缺少编译器gcc-c++
解决方法:yum install -y gcc-c++
报错2:缺少pcre函数库
./configure: error: the HTTP rewrite module requires the PCRE library......
解决方法:yum install -y pcre-devel
报错3:缺少zlib函数库
./configure: error: the HTTP rewrite module requires the zlib library......
解决方法:yum install -y zlib-devel
报错4:缺少openssl函数库
./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library......
解决方法:yum -y install openssl openssl-devel
解决完问题后继续进行安装,检测安装无误后进行编译
[root@localhost nginx-1.5.1]# ./configure --prefix=/usr/local/nginx[root@localhost nginx-1.5.1]# echo $?
0
[root@localhost nginx-1.5.1]# make[root@localhost nginx-1.5.1]# make install[root@localhost nginx-1.5.1]# cd /usr/local/nginx/ [root@localhost nginx]# pwd/usr/local/nginx
[root@localhost nginx]# ls
conf html logs sbin
配置文件 网页 日志 启动程序