linux下源码包安装nginx

系统环境:CentOS 6.5               nginx源码包:nginx-1.13.3.tar.gz

-------------------------------------------------------------------------------------------

安装编译nginx所用到的包

yum -y install gcc openssl-devel pcre-devel zlib-devel

-------------------------------------------------------------------------------------------

下载nginx源码包,并解压

tar -zxvf nginx-1.13.3.tar.gz 

-------------------------------------------------------------------------------------------

进入解压后的目录

cd nginx-1.13.3

-------------------------------------------------------------------------------------------

编译文件       ---隐藏版本信息修改   nginx/src/core/nginx.h

./configure
参数:
--prefix=/usr/local/nginx/  设置nginx安装路径 

linux下源码包安装nginx_第1张图片

-------------------------------------------------------------------------------------------

安装

make &&make install

-------------------------------------------------------------------------------------------

关闭防火墙 service iptables stop

启动:/usr/local/nginx/sbin/nginx [-c  /usr/local/nginx/conf/nginx.conf] 可指定配置文件位置

重启:/usr/local/nginx/sbin/nginx -s reload

停止:/usr/local/nginx/sbin/nginx -s stop           

强行终止进程:pkill -9 nginx

你可能感兴趣的:(linux,nginx)