Nginx离线安装

1.依赖库安装

yum -y install openssl openssl-devel gcc perl-devel perl-ExtUtils-Embed

2.nginx编译安装

root用户操作

./configure \

  --prefix=/usr/local/nginx \

  --error-log-path=/usr/local/nginx/logs/error.log \

  --http-log-path=/usr/local/nginx/logs/access.log \

  --pid-path=/usr/local/nginx/nginx.pid  \

  --lock-path=/usr/local/nginx/nginx.lock \

  --with-http_ssl_module \

  --with-http_flv_module \

  --with-http_realip_module \

  --with-http_sub_module \

  --with-http_stub_status_module \

  --with-http_gzip_static_module \

  --with-http_perl_module \

  --http-client-body-temp-path=/usr/local/nginx/client_temp/ \

  --http-proxy-temp-path=/usr/local/nginx/proxy_temp/ \

  --http-fastcgi-temp-path=/usr/local/nginx/fcgi_temp/ \

  --http-uwsgi-temp-path=/usr/local/nginx/uwsgi_temp/ \

  --http-scgi-temp-path=/usr/local/nginx/scgi_temp/ \

  --add-module=/root/nginx_upstream_check_module-master/ \   #此行可去除

  --with-pcre

make && make install

chown -R nmcuser:nmc /usr/local/nginx

chmod -R 755 /usr/local/nginx

chown root:root /usr/local/nginx/sbin/nginx

chmod 755 /usr/local/nginx/sbin/nginx

chmod u+s /usr/local/nginx/sbin/nginx

3.nginx基本操作

启动 /usr/local/nginx/sbin/nginx

指定配置文件启动 /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

重启 /usr/local/nginx/sbin/nginx -s reopen

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值