1.下载ngin
[root@localhost src]# wget http://nginx.org/download/nginx-1.10.2.tar.gz --2016-12-10 11:42:20-- http://nginx.org/download/nginx-1.10.2.tar.gz Resolving nginx.org... 95.211.80.227 Connecting to nginx.org|95.211.80.227|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 910812 (889K) [application/octet-stream] Saving to: “nginx-1.10.2.tar.gz” 100%[==========================================================================>] 910,812 12.5K/s in 54s 2016-12-10 11:43:30 (16.4 KB/s) - “nginx-1.10.2.tar.gz” saved [910812/910812]
[root@localhost src]# ls nginx-1.10.2.tar.gz
2. 解压nginx
# ls nginx-1.10.2.tar.gz
# pwd
/usr/local/src
# ls
nginx-1.10.2.tar.gz
tar zxvf nginx-1.10.2.tar.gz
[root@localhost src]# cd nginx-1.10.2 [root@localhost nginx-1.10.2]# ls auto CHANGES CHANGES.ru conf configure contrib html LICENSE man README src [root@localhost nginx-1.10.2]#
安装nginx 可能会出现某个库没有安装,Configure是一个可执行脚本 –prefix选项是配置安装的路径
root@localhost nginx-1.10.2]# ./configure --prefix=/usr/local/nginx checking for OS + Linux 2.6.32-431.el6.x86_64 x86_64 checking for C compiler ... not found ./configure: error: C compiler cc is not found
如果安装出现在下面的错误是缺少编译环境。
./configure: error: C compiler cc is not found
[root@localhost src]
# pwd /usr/local/src