1、安装ngnix一些依赖包
[[email protected]_39_157_centos ~]# yum -y install gcc gcc-c++ openssl-devel pcre-devel httpd-tools
2、从官网下载nginx二进制包解压
[[email protected]_39_157_centos ~]# tar -zxf nginx-1.15.9.tar.gz
3、执行配置文件,指定需要的模块
[[email protected]_39_157_centos nginx-1.14.0]# useradd nginx
[[email protected]_39_157_centos nginx-1.14.0]# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_mp4_module --with-http_flv_module
4、执行编译和安装
[[email protected]_39_157_centos nginx-1.14.0]# make && make install
5、发配软链接
ln -s /usr/local/nginx/sbin/nginx /usr/sbin
6、启动nginx
[[email protected]_39_157_centos ~]# nginx
7、查看nginx占用的端口
[[email protected]_39_157_centos ~]# netstat -anptu | grep nginx
原文地址:https://www.cnblogs.com/qikeyishu/p/10601138.html