Linux 下安装nginx的总结 (之前写的有问题))
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的总结 (之前写的有问题))的更多相关文章
- 【云服务器部署】---Linux下安装nginx
[云服务器部署]---Linux下安装nginx 之前两篇,分别讲了:Linux下安装MySQL 和 springboot项目部署云服务器 nginx安装也是挺简单的.具体步骤如下: 第一步,下载 ...
- linux下安装nginx及初步认识
linux下安装配置nginx nginx:是一个高性能的反向代理服务器正向代理代理的是客户端,反向代理代理的是服务端. 这里以nginx-1.12.2版本为例子 1.首先去官网下载nginx-1.1 ...
- linux 下 安装nginx及压力测试
linux 编译安装nginx,配置自启动脚本 下载nginx: wget http://nginx.org/download/nginx-1.8.0.tar.gz下载openssl : wget h ...
- linux 下安装 nginx
安装nginx版本为1.7.5 一.下载nginx 官方地址:http://www.nginx.org/ 下载地址:http://nginx.org/download/ Nginx官网提供了三个类型的 ...
- Linux下安装Nginx并配置一个图片服务器
首先安装nginx安装环境 nginx是C语言开发,建议在linux上运行,本教程使用Centos6.5作为安装环境. gcc 安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没 ...
- linux下安装nginx和配置
1.系统:centos6.8 2.安装准备: 安装nginx前,我们首先要确保系统安装了g++.gcc.openssl-devel.pcre-devel和zlib-devel软件,可通过如图所示命令进 ...
- 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 ...
- Linux下安装Nginx并实现socket代理
nginx可以使用各平台的默认包来安装,本文是介绍使用源码编译安装,包括具体的编译参数信息. 正式开始前,编译环境gcc g++ 开发库之类的需要提前装好,这里默认你已经装好. ububtu平台编译环 ...
- Linux下安装Nginx服务器
安装Nginx之前,首先要安装好编译环境gcc和g++,然后以CentOS为例安装Nginx,安装Nginx需要PRCE库.zlib库和ssl的支持,除了ssl外其他的我们都是去官网下载: Nginx ...
随机推荐
- day4-课堂笔记
变量 成员变量-构造方法里定义 self.xxx 使用:类内部: self.xxx 类外部: 先创建实例 实例.xxx 类变量 类定义下面直接定义 使用:类方法内 cls.xxx 类名.xxx sel ...
- leetcode349—Intersection of Two Arrays
Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1 ...
- keepalived 做全端口映射
global_defs { lvs_id BACKUP } vrrp_sync_group VGM { group { VI_1 } } vrrp_inst ...
- python3 raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 403: Forbid
1.分析: 如果用 urllib.request.urlopen 方式打开一个URL,服务器端只会收到一个单纯的对于该页面访问的请求,但是服务器并不知道发送这个请求使用的浏览器,操作系统,硬件平台等信 ...
- 一、CnPack源码模板功能快速添加注释
Delphi通过CnPack源码模板功能,能快速添加注释,非常之好用,使用方法如下图: 1.选择CnPack的源码模板专家 2.设置Pacal标准过程头 3.设置内容如下,并且设置了Ctrl+W的快捷 ...
- 20155237 《JAVA程序设计》实验三(敏捷开发与XP实践)实验报告
20155237 <JAVA程序设计>实验三(敏捷开发与XP实践)实验报告 实验内容 敏捷开发与XP实践 XP基础 XP核心实践 相关工具 实验要求 1.没有Linux基础的同学建议先学习 ...
- RocEDU.课程设计2018 第二周进展 博客补交
本周计划完成的任务 (1).将开发板和平板电脑及其相关配件连通,并和电脑连接. (2).将代码的运行设备从安卓模拟器改为试验箱的平板电脑,平板电脑上实现软件. 本周实际完成情况 (1).计划完成的第一 ...
- 微信小程序 Echarts 异步数据更新
微信小程序 Echarts 异步数据更新的练习,被坑了很多次,特作记录. 作者:罗兵 地址:https://www.cnblogs.com/hhh5460/p/9989805.html 0.效果图 ...
- sql——inner join,where,left join的区别
1.select a.name,a.sex,a.subject,a.age from TableA a, TableB b where a.name = b.name 2.select a.name, ...
- [SHOI2015]聚变反应炉[树dp、贪心]
题意 给定一棵 \(n\) 个点的树,每个点有一个启动能量 \(d\) 和传递能量 \(c\) ,如果一个点被启动了,就会向和他直接相连的点发送 \(c\) 的能量,初始所有节点能量为0,问最少多少能 ...