1.安装lib库:
sudo yum install gcc-c++
sudo yum install pcre pcre-devel
sudo yum install zlib zlib-devel
sudo yum install openssl openssl-devel
2.查看是否已经安装好nginx
3.从nginx.org下载稳定版本
解压:tar -zxvf nginx-1.10.2.tar.gz,进入文件夹
执行:sudo ./configure然后sudo make然后sudo make install
检查:whereis nginx(/usr/local/nginx表示成功)
4.启动nginx:
进入 nginx目录:/usr/local/nginx/后进入sbin/执行./nginx(也许需要sudo)
查看进程:ps aux | grep nginx出现如下:
root 5895 0.0 0.0 26012 820 ? Ss 17:57 0:00 nginx: master process ./nginx
nobody 5896 0.0 0.1 26432 1400 ? S 17:57 0:00 nginx: worker process
root 5927 0.0 0.0 105368 880 pts/0 S+ 18:01 0:00 grep nginx
启动成功