温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

nginx-1.16.1安装

发布时间:2020-09-09 13:02:58 来源:网络 阅读:360 作者:Mart_sea 栏目:系统运维

一、官网下载源码
http://nginx.org/en/download.html

二、上传到指定的安装目录

tar vxf nginx-1.16.1.tar.gz
cd cd nginx-1.16.1 && ./config --prefix=/etc/nginx

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

安装需要的插件

yum -y install openssl openssl-devel

checking for zlib library ... not found

./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.

安装需要的插件

yum install zlib-devel -y

./configure --prefix=/usr/local/nginx

make

三、启动nginx
./sbin/nginx

四、查看nginx 启动配置详情
./sbin/nginx -t

五、隐藏nginx版本号
vim conf/nginx.conf
http server 路径下添加 server_tokens off;

        vim conf/fastcgi.conf
        修改  fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
        fastcgi_param  SERVER_SOFTWARE    nginx;

        重启或者reload nginx
        pkill nginx && ./sbin/nginx
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI