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
补充
- 重载配置文件
- /usr/local/nginx/sbin/nginx -s reload
- 卸载编译安装的软件
- 必须先停止软件
- rm -rf 软件安装目录
- 安装帮助
以上是关于Linux——Nginx 安装的主要内容,如果未能解决你的问题,请参考以下文章
Nginx——Nginx启动报错Job for nginx.service failed because the control process exited with error code(代码片段