第一步:首先安装Nginx所需依赖包

CentOS 6.5 安装 Nginx

第二步:创建所需运行的用户及组

CentOS 6.5 安装 Nginx

第三步:编译安装Nginx

            1)解压nginx源码包

                CentOS 6.5 安装 Nginx

            2)配置源码包(为了安全我们需要把一下配置更改一下)

                vim src/core/nginx.h                 #这是隐藏Nginx的软件名称及版本号

                CentOS 6.5 安装 Nginx

                vim src/http/ngx_http_header_filter_module.c                   #修改HTTP头connection字段,防止回显具体版本号

                CentOS 6.5 安装 Nginx

           3)完成上述则开始编译选项

                ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module --with-http_addition_module --with-http_sub_module --with-http_flv_module --with-http_mp4_module --with-http_ssl_module --with_gzip_static_module

                1、将安装目录设为/usr/local/ngin 2、设置用户和组设为nginx 3、启用状态统计模块 4、支持不完全缓存

                5、允许一些文本代替Nginx相应一些文本 6、支持flv/mp4格式视频音频 7、启用ssl模块 8、提供对gzip的基本支持

                make && make install 安装Nginx

第四步:安装完毕后为了使Nginx服务器的运行更加方便,可以为主程序Nginx创建链接文件,以便管理员直接执行nginx买了可以调用Nginx的主程序

CentOS 6.5 安装 Nginx

第五步:检查配置文件

CentOS 6.5 安装 Nginx

第六步:启动Nginx

CentOS 6.5 安装 Nginx

测试一下

CentOS 6.5 安装 Nginx

先前我们在第三步2/3小节的时候,修改了一些配置,隐藏服务器名称及版本号,现在我们看一看

CentOS 6.5 安装 Nginx

                


相关文章:

  • 2021-12-23
  • 2021-06-13
  • 2021-06-25
  • 2021-05-18
  • 2021-08-11
  • 2021-04-06
  • 2021-07-28
  • 2021-05-20
猜你喜欢
  • 2021-12-12
  • 2021-06-16
  • 2021-04-04
  • 2021-08-30
  • 2021-08-30
  • 2021-09-27
  • 2021-08-30
相关资源
相似解决方案