资讯专栏INFORMATION COLUMN

Nginx 安装

williamwen1986 / 1629人阅读

摘要:安装快速安装官网地址使用对实现扩展。安装步骤下载源码包并解压。详细命令如下安装依赖和编译工具。安装见官网进源码目录,配置。使用查看参数说明翻译见命令示例注安装默认在和,可以使用,查看相关文件。运行结果示例编译并安装。

Nginx 安装 快速安装

Ngnix官网地址:http://nginx.org/

使用OpenResty对Nginx实现扩展。https://openresty.org/cn/

安装步骤

下载源码包,并解压。详细命令如下:

wget http://nginx.org/download/nginx-1.15.3.tar.gz

tar zxvf nginx-1.15.3.tar.gz

安装依赖:pcre、openssl、lua和编译工具:gcc。详细命令如下:

yum install -y pcre pcre-devel

yum install -y openssl openssl-devel

yum install -y lua lua-devel

yum install -y gcc

注:LuaJIT与Lua均可以(配置依赖分别为--with-luajit… 和--with-lua…,模块使用一致),但LuaJIT效率比Lua高。LuaJIT安装见官网:http://luajit.org/

进源码目录cd nginx-1.15.3,配置nignx。

文档地址:http://nginx.org/en/docs/conf...。使用` ./configure --help

`查看参数说明,翻译见:https://www.jianshu.com/p/f46...

* 命令示例

```sh
./configure  
--with-http_lua_module 
--with-lua-lib=/usr/lib64 
--with-lua-inc=/usr/include 
--with-stream 
--with-stream_ssl_module
```

* 注:yum 安装默认在/usr/lib64 和/usr/include,可以使用 `rpm -ql pcre-devel`,`rpm -ql lua-devel` 查看相关文件。
* 运行结果示例:
        Configuration summary
        + using system PCRE library
        + using system OpenSSL library
        + using system zlib library

        nginx path prefix: "/usr/local/nginx"
        nginx binary file: "/usr/local/nginx/sbin/nginx"
        nginx modules path: "/usr/local/nginx/modules"
        nginx configuration prefix: "/usr/local/nginx/conf"
        nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
        nginx pid file: "/usr/local/nginx/logs/nginx.pid"
        nginx error log file: "/usr/local/nginx/logs/error.log"
        nginx http access log file: "/usr/local/nginx/logs/access.log"
        nginx http client request body temporary files: "client_body_temp"
        nginx http proxy temporary files: "proxy_temp"
        nginx http fastcgi temporary files: "fastcgi_temp"
        nginx http uwsgi temporary files: "uwsgi_temp"
        nginx http scgi temporary files: "scgi_temp"

编译并安装。

make

make install

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/40116.html

相关文章

  • nginx服务器详细安装过程(使用yum 和 源码包两种安装方式,并说明其区别)

    摘要:网上看别人写的服务器配置,有的是源码包安装的,有的时安装的。通过源码包编译安装的软件,通常都放在包名路径下。正则表达式使用在指令和模块中。 网上看别人写的 nginx 服务器配置 ,有的是源码包安装的,有的时 yum 安装的。如果是新手,可能会有疑问,这两种安装方式有什么区别?我应该使用哪种方式?系统里可以两个都安装可以吗?怎么卸载?等等问题,那么在这里,我做下总结,详细介绍下这两种方...

    waruqi 评论0 收藏0
  • Nginx笔记-0-Centos环境下安装

    摘要:如果发现运行只有一行回显,可能是当前端口被占用,使用端口号,默认,如果打印结果为两行或以上,即端口被占用,需要修改配置文件的端口号再重新运行。 概述 记录一下 Nginx 通过安装包以及通过源代码安装两种方式。目标是第一次接触 Nginx 的人也能看懂直接用。 一. 使用安装包配置 Tip: 这种安装方式比较简单,官方文档也说得比较清楚详细。这里搭建的环境是 Centos7, 可以sy...

    Rindia 评论0 收藏0

发表评论

0条评论

williamwen1986

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<