CentOS7安装nginx1.8
1、安装gcc
yum -y install gcc
2、安装pcre-devel
yum -y install pcre-devel
3、安装openssl-devel
yum -y install openssl openssl-devel
4、下载nginx包:nginx-1.8.1.tar.gz
5、解压nginx包
tar -zxvf nginx-1.8.1.tar.gz
6、安装nginx (进入nginx目录)
./configure (要保证安装pcre-devel、openssl openssl-devel,否则可能报错:./configure: error: the HTTP rewrite module requires the PCRE library)
make
make install
7、开启nginx
cd /usr/local/nginx/sbin
./nginx
8、查看nginx是否启动成功
ps -ef|grep nginx
9、访问ip地址,显示 welcome to nginx (注意:关闭防火墙,或者开启访问端口)