Linux安装nginx

1.上传nginx-1.8.1.tar.gz到Linux上

2.解压nginx

[[email protected] upload]# tar -zxvf nginx-1.8.1.tar.gz -C /usr/local/src

3.编译nginx

[[email protected] upload]# cd /usr/local/src/nginx-1.8.1/
[[email protected] nginx-1.8.1]# ./configure --prefix=/usr/local/nginx-1.8.1
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
#使用YUM安装缺少的包

[[email protected] nginx-1.8.1]# yum -y install gcc pcre-devel openssl openssl-devel

再次执行:

[[email protected] nginx-1.8.1]# ./configure --prefix=/usr/local/nginx-1.8.1

4.编译安装nginx

[[email protected] nginx-1.8.1]# make && make install

5.启动nginx

[[email protected] sbin]# cd /usr/local/nginx-1.8.1/sbin
[[email protected] sbin]# ./nginx

6.访问

http://192.168.100.10

Linux安装nginx