Linux——Nginx 安装

Posted cnloop

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux——Nginx 安装相关的知识,希望对你有一定的参考价值。

下载 nginx

安装依赖包

  • yum install -y pcre pcre-devel
  • yum install -y zlib zlib-devel yum
  • yum install -y openssl openssl-devel

解压安装包

  • tar -zxvf nginx-1.15.1.tar.gz
  • cd nginx-1.15.1

配置 nginx

  • ./configure --prefix=/usr/local/nginx
  • nginx 重要文件存放路径

  • nginx path prefix: "/user/local/nginx"
    nginx binary file: "/user/local/nginx/sbin/nginx"
    nginx modules path: "/user/local/nginx/modules"
    nginx configuration prefix: "/user/local/nginx/conf"
    nginx configuration file: "/user/local/nginx/conf/nginx.conf"
    nginx pid file: "/user/local/nginx/logs/nginx.pid"
    nginx error log file: "/user/local/nginx/logs/error.log"
    nginx http access log file: "/user/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"

安装 nginx

  • make
  • make install

启动 nginx

  • service httpd stop,apache 有可能占据了80端口
  • /usr/local/nginx/sbin/nginx

补充

以上是关于Linux——Nginx 安装的主要内容,如果未能解决你的问题,请参考以下文章

Linux源码安装nginx并配置

Linux 安装nginx

[nginx] linux nginx 安装

Nginx——Nginx启动报错Job for nginx.service failed because the control process exited with error code(代码片段

nginx安装

linux 安装 nginx 及反向代理配置