Nginx离线安装

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 20:40   2490   0

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

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP