1. 下载niginx的 tar包

下载路径

http://nginx.org/en/download.html

也可以直接使用命令下载

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

2. 下载目录下解压缩

tar -zxvf nginx-1.15.1.tar.gz

3. cd 到目录里面进行处理

./configure

4. 安装时会报错 主要有:

./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. 需要pcre ./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. 需要zlib

一般linux里面安装了 prce和 zlib 但是没有安装devel 包 需要进行安装

yum install -y prce-devel
yum install -y zlib-devel

5. 再次执行 ./confiure命令成功

反馈安装信息

Configuration summary
+ using system PCRE library
+ OpenSSL library is not used
+ 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"

6. 执行 make 和 make install 进行安装

make and make install

9. 创建软连接

ln /usr/local/nginx/sbin/nginx /usr/local/bin/nginx

10. 直接启动

nginx

遇到报错如图示时

nginx: [emerg] bind() to 0.0.0.0: failed (: Address already in use)
nginx: [emerg] bind() to 0.0.0.0: failed (: Address already in use)
nginx: [emerg] bind() to 0.0.0.0: failed (: Address already in use)
nginx: [emerg] bind() to 0.0.0.0: failed (: Address already in use)
nginx: [emerg] bind() to 0.0.0.0: failed (: Address already in use)
nginx: [emerg] still could not bind()

11. 修改配置文件

查看配置文件位置

nginx -t
结果为

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

修改配置文件

vim /usr/local/nginx/conf/nginx.conf

将端口绑定修改一下

再次启动即可

Linux 下安装nginx的总结 (之前写的有问题))的更多相关文章

  1. 【云服务器部署】---Linux下安装nginx

    [云服务器部署]---Linux下安装nginx 之前两篇,分别讲了:Linux下安装MySQL  和  springboot项目部署云服务器 nginx安装也是挺简单的.具体步骤如下: 第一步,下载 ...

  2. linux下安装nginx及初步认识

    linux下安装配置nginx nginx:是一个高性能的反向代理服务器正向代理代理的是客户端,反向代理代理的是服务端. 这里以nginx-1.12.2版本为例子 1.首先去官网下载nginx-1.1 ...

  3. linux 下 安装nginx及压力测试

    linux 编译安装nginx,配置自启动脚本 下载nginx: wget http://nginx.org/download/nginx-1.8.0.tar.gz下载openssl : wget h ...

  4. linux 下安装 nginx

    安装nginx版本为1.7.5 一.下载nginx 官方地址:http://www.nginx.org/ 下载地址:http://nginx.org/download/ Nginx官网提供了三个类型的 ...

  5. Linux下安装Nginx并配置一个图片服务器

    首先安装nginx安装环境 nginx是C语言开发,建议在linux上运行,本教程使用Centos6.5作为安装环境. gcc 安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没 ...

  6. linux下安装nginx和配置

    1.系统:centos6.8 2.安装准备: 安装nginx前,我们首先要确保系统安装了g++.gcc.openssl-devel.pcre-devel和zlib-devel软件,可通过如图所示命令进 ...

  7. linux下安装nginx+php+mysql环境 详细教程

    话不多说上代码 linux环境:centos 7.0 64位 nginx:nginx-1.8.0.tar.gz php: php-7.1.1.tar.gz mysql: mysql-5.6.21.ta ...

  8. Linux下安装Nginx并实现socket代理

    nginx可以使用各平台的默认包来安装,本文是介绍使用源码编译安装,包括具体的编译参数信息. 正式开始前,编译环境gcc g++ 开发库之类的需要提前装好,这里默认你已经装好. ububtu平台编译环 ...

  9. Linux下安装Nginx服务器

    安装Nginx之前,首先要安装好编译环境gcc和g++,然后以CentOS为例安装Nginx,安装Nginx需要PRCE库.zlib库和ssl的支持,除了ssl外其他的我们都是去官网下载: Nginx ...

随机推荐

  1. pytorch faster_rcnn

    代码地址:https://github.com/jwyang/faster-rcnn.pytorch 1.fasterRCNN.train():这个不是让网络进行训练,而是让module in tra ...

  2. vmware中装的ubuntu上不了网

    背景 上周末重装了windows主机的系统,之后就重新安装了vmware软件,今天使用的时候就发现git pull代码仓库的时候,发现代码仓库无法获取,检查后发现是虚拟机上不了网了. 查看了一系列教程 ...

  3. 大页内存(HugePages)

    原文转载自:http://blog.csdn.net/yutianzuijin/article/details/41912871 今天给大家介绍一种比较新奇的程序性能优化方法—大页内存(HugePag ...

  4. Mapnik初学笔记

    前言:夏天总是感觉想要睡觉,一心想颓废的我却要一周六天都要处于工作状态,但有些事虽然麻烦,但还是要去做,不由得想起火影忍者里面鹿丸这一个角色,有时候真能理解他的心理状态,或许我应该向他学习:善于思考的 ...

  5. x window的奥秘

    阅读目录 了解自己机器上的 X Window 理解 display 和虚拟控制台 远程连接 X Server 理解 lightdm 和 X Window 桌面环境的启动过程 搞定 xauth X Se ...

  6. 2.4《想成为黑客,不知道这些命令行可不行》(Learn Enough Command Line to Be Dangerous)——小结

    下Table 3本章重要命令小结 命令 描述 示例 > 将输出内容重定向到指定文件中 $ echo foo > foo.txt >> 将输出内容添加到指定问价中 $ echo ...

  7. Python基础之公共方法

    公共方法:就是列表,元组,字典,字符串能共同使用的方法: Python内置函数 内置函数罗列 函数 描述 备注 len(item) 计算容器中的元素个数 del(item) 删除变量 del有两种方法 ...

  8. 20155204 王昊《网络对抗技术》EXP3

    20155204 王昊<网络对抗技术>EXP3 一.基础问题回答 1.杀软是如何检测出恶意代码的? 答: 基于特征码:一段特征码就是一段或多段数据.(如果一个可执行文件(或其他运行的库.脚 ...

  9. cmake源码包安装后的卸载问题

    cmake源码包安装 CMake是一个跨平台的安装(编译)工具,可以用简单的语句来描述所有平台的安装(编译过程),具体学习请移步官网CMake 本文介绍的就是用cmake去安装的别人的包. 一般流程: ...

  10. MFC CHotKeyCtrl控件

    知识点: CHotKeyCtrl控件 获取热键数据 注册热键 响应热键事件 一.CHotKeyCtrl控件 void SetHotKey( WORD wVirtualKeyCode, WORD wMo ...