centOS6.8安装nginx

centOS6.8安装nginx

1.安装nginx所需环境:
yum install gcc
yum install pcre-devel
yum install zlib zlib-devel
yum install openssl openssl-devel
或者一键安装:yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
2.下载nginx压缩包:
wget http://nginx.org/download/nginx-1.10.2.tar.gz
下载在当前目录
3.解压缩:tar -zxvf nginx-1.10.2.tar.gz
4.进入nginx-1.10.2目录:cd nginx-1.10.2
5.  执行  ./configure
6.  执行make
7.  执行make install
8. 查找nginx安装目录:whereis nginx
9.进入niginx安装目录,默认在 cd /usr/local/nginx/
10. cd sbin
11. 执行 ./nginx
12.打开浏览器,输入ip地址,看到welcome to nginx!即安装成功

你可能感兴趣的:(linux)