Centos6.5(Linux)安装Nginx
1、安装nginx依赖的库pcre
下载地址:http://sourceforge.net/projects/pcre/
2、解压pcre
zip解压方式:unzip pcre-xxx
tar解压方式:tar -xzvf pcre-xxx
3、执行configure
cd prce-xxx
./configure
假设执行出错:You need a C++ compiler for C++ support
则须要安装C++编译环境:yum install -y gcc gcc-c++
4、安装和编译prce
make && make install
5、解压nginx
tar -xzvf nginx-xxx
6、执行configure
cd nginx-xxx
./configure
假设执行出错:./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库:yum install zlib-devel
7、安装nginx
make && make install
8、启动nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
启动出错:/usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
解决的方法:ldd /usr/local/nginx/sbin/nginx =====>查看链接库是否正常
linux-vdso.so.1 => (0x00007fff1e3ff000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003ea5800000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x0000003eb0400000)
libpcre.so.1 => not found
libz.so.1 => /lib64/libz.so.1 (0x0000003ea6800000)
libc.so.6 => /lib64/libc.so.6 (0x0000003ea5000000)
/lib64/ld-linux-x86-64.so.2 (0x0000003ea4c00000)
libfreebl3.so => /lib64/libfreebl3.so (0x0000003eb1000000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003ea5400000)
9、ln -s libpcre.so.0.0.1 libpcre.so.1
10、再次启动nginx
./usr/local/nginx/sbin/nginx
11、ps -ef | grep nginx
查看nginx是否启动成功
- wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
- tar -xzvf pcre-8.41.tar.gz
- cd pcre-8.41
- ./configure
- make && make install
- wget https://www.openssl.org/source/openssl-1.1.0g.tar.gz
- tar -xzvf openssl-1.1.0g.tar.gz
- cd openssl-1.1.0g
- ./config
- make && make install
- wget http://www.zlib.net/zlib-1.2.11.tar.gz
- tar -xzvf zlib-1.2.11.tar.gz
- cd zlib-1.2.11
- ./configure
- make && make install
- cd /work
- wget http://nginx.org/download/nginx-1.12.2.tar.gz
- tar -xzvf nginx-1.12.2.tar.gz
- cd nginx-1.12.2
- ./configure
- make & make install
Centos6.5(Linux)安装Nginx的更多相关文章
- linux安装Nginx 以及 keepalived 管理Nginx
linux安装Nginx 1.1将Nginx素材内容上传到/usr/local目录(pcre,zlib,openssl,nginx)(注意:必须登录用对这个文件具有操作权限的) 1.2安装pcre库 ...
- linux学习(十一)linux安装nginx
一.前言 由于本地练手的小demo用的是vue+spring boot来玩的,所以部署的时候想着用Nginx来实现反向代理[即请求转发,解决前后端分离的跨域请求问题],既然要用,那么首先得在服务器上面 ...
- linux安装nginx 并配置文件服务器和代理服务器
linux安装nginx搭建服务并实现文件服务器和代理服务器配置 1.课题的背景和意义 由于编码过程中需要进行文件上传服务,文件上传后 需要有http资源的路径需要访问.原则上可以通过Apache . ...
- linux 安装nginx
linux系统为Centos6.5 64位 nginx为1.4.7 从http://nginx.org/download/上下载相应的版本 解压 tar -zxvf nginx-1.4.7.tar.g ...
- linux 安装nginx 详解
1 nginx安装环境 nginx是C语言开发,建议在linux上运行,本教程使用Centos6.5作为安装环境. n gcc 安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没 ...
- Linux 安装Nginx具体图解教程
系统:Centos6.6 64位 Nginx: http://nginx.org/en/download.html 眼下最新版本号1.9.4 我下载1.8.0 watermark/2/text/a ...
- Linux安装nginx的环境要求
# Linux下切记不能乱删东西!我把pcre强制删除后,什么命令都不能使用了,系统奔溃,血的教训! nginx是C语言开发,建议在linux上运行,本教程使用Centos6.4作为安装环境. 一. ...
- linux安装nginx步骤
转载自:https://blog.csdn.net/t8116189520/article/details/81909574,修改部分内容 本文已收录至博客专栏linux安装各种软件及配置环境教程中 ...
- linux 安装 nginx 及反向代理配置
Nginx ("engine x") 是一个高性能的HTTP和反向代理服务器,以下为Linux centos平台下安装nginx并配置反向代理的过程(采用源码安装的方式) 一:安装 ...
随机推荐
- ASP.Net Core 发布ABP项目遇到的错误
1.HTTP 错误 500.19 - Internal Server Error 无法访问请求的页面,因为该页的相关配置数据无效. 与ASP.NET时代不同,ASP.NET Core不再是由IIS工作 ...
- nginx 反向代理导致的session丢失的问题
[原文链接] https://blog.csdn.net/xiaweiyidengzhewo/article/details/80921750 注意这篇文章解释的是“丢失”而不是“一致性”
- Oracle ASM 常用命令
01, 查看磁盘路径 select name,path,group_number from v$asm_disk_stat; 02, 查看磁盘组信息 select state,name,type,to ...
- Docker_network相关指令
docker network create创建docker网卡docker network create -d overlay --ip-range=192.168.2.0/24 --gateway= ...
- query的参数解析
SQLiteDatabase dbInstance;Cursor cursor = dbInstance.query(String table,String []Columns, String sel ...
- 牛客网Java刷题知识点之HashMap的实现原理、HashMap的存储结构、HashMap在JDK1.6、JDK1.7、JDK1.8之间的差异以及带来的性能影响
不多说,直接上干货! 福利 => 每天都推送 欢迎大家,关注微信扫码并加入我的4个微信公众号: 大数据躺过的坑 Java从入门到架构师 人工智能躺过的坑 ...
- IE678不兼容CSS3 user-select:none(不可复制功能),需要JS解决
[方法一:CSS3实现文本不可复制] .content {-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o- ...
- javascript中for in与in的用法
1.For...In 声明用于对数组或者对象的属性进行循环/迭代操作. 对于数组 ,迭代出来的是数组元 素,对于对象 ,迭代出来的是对象的属性: var x var mycars = new Arra ...
- 获取全球dns统计信息
# -*- coding:UTF-8 -*- import requests, time import json from bs4 import BeautifulSoup as bp t3 = ti ...
- js.css嵌入dll
处理请求,返回 public ActionResult Get() { //传递一个部分名称 var n = Request["n"]; n = n.Replace('/', '. ...