查看

[[email protected] ~]# ls

anaconda-ks.cfg  nginx-1.11.2.tar.gz

关闭防火墙

[[email protected] ~]# iptables -F

[[email protected] ~]# iptables -X

[[email protected] ~]# iptables -L

[[email protected] ~]# setenforce 0

二进制编译NJINX

安装yum

[[email protected] ~]# yum list

二进制编译NJINX

安装zlib-devel-1.2.7-13.el7.x86_64.rpm这个包

[[email protected] yum.repos.d]# rpm -ivh /opt/dvd/Packages/zlib-devel-1.2.7-13.el7.x86_64.rpm

二进制编译NJINX

[[email protected] ~]# rpm -q zlib-devel pcre-devel

 

 

 

二进制编译NJINX

[[email protected] ~]# id sshd

二进制编译NJINX

[[email protected] ~]#  useradd -s /sbin/nologin -M nginx

[[email protected] ~]# id nginx

二进制编译NJINX

压缩zxf nginx-1.11.2.tar.gz ;查看

[[email protected] ~]# ls

[[email protected] ~]# tar zxf nginx-1.11.2.tar.gz

[[email protected] ~]# ll

二进制编译NJINX

运行脚本

[[email protected] nginx-1.11.2]# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx

二进制编译NJINX

[[email protected] nginx-1.11.2]# make

二进制编译NJINX

安装net-tools

[[email protected] nginx-1.11.2]#  yum install net-tools

二进制编译NJINX

进入/usr/local/nginx/sbin/目录下

查看端口等信息

[[email protected] nginx]# cd  /usr/local/nginx/sbin/

[[email protected] sbin]#  /usr/local/nginx/sbin/nginx

[[email protected] sbin]#  ps aux | grep nginx

[[email protected] sbin]#  /usr/local/nginx/sbin/nginx

二进制编译NJINX

端口80

查看信息

[[email protected] sbin]#  ss -tanml | grep 80

[[email protected] sbin]#  ps aux | grep nginx

二进制编译NJINX

复制nginx-running.sh nginx;nginx /etc/init.d/在浏览器上输入ip地址

[[email protected] ~]# cp nginx-running.sh nginx

[[email protected] ~]#  cp nginx /etc/init.d/

[[email protected] ~]#  cd /etc/init.d

 

二进制编译NJINX

相关文章: