操作系统:小红帽6.7
下载
直接下载最新版的包即可
编译
#安装前置的依赖包,可以挂在系统镜像后使用yum命令安装即可
yum install -y gc gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel ncurses-devel perl
#编译,必须编译 stream 模块
./configure --user=root --group=root --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-stream
make && make install
使用
启动
启动代码格式:nginx安装目录地址 -c nginx配置文件地址
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
停止
正常停止
方法1.命令停止
/usr/local/nginx/sbin/nginx -s stop
方法2.杀进程停止
#查看进程号
ps -ef|grep n