1.首先下载ngix的源码linux版本【1.5.8版本】

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

2.下载PCRE library,是安装ngix的必备包之一

[root@localhost ngix]# wget http://downloads.sourceforge.net/project/pcre/pcre/8.34/pcre-8.34.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F&ts=1389689100&use_mirror=jaist
---------------------------------
[root@localhost pcre-8.34]# unzip pcre-8.34.zip
[root@localhost pcre-8.34]# cd pcre-8.34
[root@localhost pcre-8.34]# ./configure
.....shenglue
[root@localhost pcre-8.34]# make
[root@localhost pcre-8.34]# make install
make[]: Entering directory `/home/ngix/pcre-8.34'
make[]: Entering directory `/home/ngix/pcre-8.34'
/bin/mkdir -p '/usr/local/lib'
/bin/sh ./libtool --mode=install /usr/bin/install -c libpcre.la libpcreposix.la libpcrecpp.la '/usr/local/lib'

3.解压ngix,首先检测检测

[root@localhost nginx-1.5.]# ./configure 【--prefix=/ngix --with-pcre=/usr/local/pcre】
Configuration summary
+ using system PCRE library
+ OpenSSL library is not used
+ using builtin md5 code
+ sha1 library is not found
+ using system zlib library nginx path prefix: "/usr/local"
nginx binary file: "/usr/local/sbin/nginx"
nginx configuration prefix: "/usr/local/conf"
nginx configuration file: "/usr/local/conf/nginx.conf"
nginx pid file: "/usr/local/logs/nginx.pid"
nginx error log file: "/usr/local/logs/error.log"
nginx http access log file: "/usr/local/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"

通过后编译、安装:

[root@localhost nginx-1.5.]# make
[root@localhost nginx-1.5.]# make install

4.查看是否安装成功

[root@localhost sbin]# ./nginx -t
nginx: the configuration file /usr/local/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/conf/nginx.conf test is successful

有时会报错:

[root@localhost sbin]# ./nginx -t
./nginx: error while loading shared libraries: libpcre.so.: cannot open shared object file: No such file or directory

这样的话查看一下详细信息:

[root@localhost conf]# ldd $(which /usr/local/sbin/nginx)
linux-gate.so. => (0x0071b000)
libpthread.so. => /lib/libpthread.so. (×)
libcrypt.so. => /lib/libcrypt.so. (×)
libpcre.so. => not found
libcrypto.so. => /lib/libcrypto.so. (×)
libz.so. => /lib/libz.so. (×)
libc.so. => /lib/libc.so. (0x002d7000)
/lib/ld-linux.so. (0x006a8000)
libdl.so. => /lib/libdl.so. (0x008c3000)

链接文件导致,重新链接一下:

[root@localhost pcre]# cd /lib
[root@localhost lib]# ln -s libpcre.so.0.0. libpcre.so.
[root@localhost lib]#
[root@localhost lib]#

再次检查:

[root@localhost sbin]# ./nginx -t
nginx: the configuration file /usr/local/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/conf/nginx.conf test is successful
[root@localhost sbin]#

启动并访问浏览器http://172.20.70.251

Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required. For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com. Thank you for using nginx.

【原创】Linux下的ngix服务器安装步骤的更多相关文章

  1. OpenSuSE Linux下安装Oracle10g的步骤

    OpenSuSE Linux下安装Oracle10g的步骤: --root用户 --1.vi etc/profile 添加脚本: if [ \$USER = "oracle" ]; ...

  2. 总结 Linux 下安装 PHP 扩展步骤

    总结一下 Linux 下安装 PHP 扩展步骤,这里以安装 PHP 的 redis 扩展为例. 一.拿到扩展包下载地址,下载扩展包 pecl 上搜索 redis wget http://pecl.ph ...

  3. [原创]Linux下网络性能测试Netperf工具介绍及安装

    [原创]Linux下网络性能测试Netperf工具介绍及安装 1 官方网站 http://www.netperf.org/netperf/ 2 Netperf介绍 Netperf是一种网络性能的测试工 ...

  4. Linux下安装load generator步骤及问题解决

    Linux下安装load generator步骤及问题解决 上一篇 / 下一篇  2014-08-06 18:33:00 / 个人分类:loadrunner相关 查看( 146 ) / 评论( 0 ) ...

  5. Linux 下 Memcached 缓存服务器安装配置

    Linux 下 Memcached 缓存服务器安装配置 [日期:2011-08-06] 来源:Linux社区  作者:Linux [字体:大 中 小]   [安装Memcache服务器端]我目前的平台 ...

  6. Linux下安装网络软件的步骤

    Linux下安装网络软件的步骤(给linux初学者,linux大神请绕路) 首先下载你所需要的软件带有deb后缀的文件 然后切换到该文件的目录 切换到超级用户权限或者是(sudo) 使用sudo dp ...

  7. Linux下修改主机名步骤

    Linux下修改主机名为gpdb 步骤一.运行vi /etc/sysconfig/network命令 NETWORKING=yesHOSTNAME=gpdb 步骤二.运行hostname gpdb命令 ...

  8. (原创)linux下Microsoft/cpprestsdk支持https(server)

    原创,转载请标明源地址 之前看网上一堆的资料说Microsoft/cpprestsdk不支持https或者说只支持window下的https,差点就被误导了,没办法,只好自己去翻了下源代码 先说明下l ...

  9. [原创] Linux下几种文件传输命令 sz rz sftp scp介绍

    Linux下几种文件传输命令 sz rz sftp scp介绍 1.sftp Secure Ftp 是一个基于SSH安全协议的文件传输管理工具.由于它是基于SSH的,会在传输过程中对用户的密码.数据等 ...

随机推荐

  1. User_Login_Register_Shopping 1.0

    #!/usr/bin/env python# -*- coding: utf-8 -*-# @File : user_login_register_shopping.py# @Author: Anth ...

  2. python爬虫:爬取读者某一期内容

    学会了怎么使用os模块 #!/usr/bin/python# -*- encoding:utf-8 -*- import requestsimport osfrom bs4 import Beauti ...

  3. (转)硬盘结构,主引导记录MBR,硬盘分区表DPT,主分区、扩展分区和逻辑分区,电脑启动过程

    硬盘结构硬盘有很多盘片组成,每个盘片的每个面都有一个读写磁头.如果有N个盘片.就有2N个面,对应2N个磁头(Heads),从0.1.2开始编号.每个盘片的半径均为固定值R的同心圆再逻辑上形成了一个以电 ...

  4. Unity 动画资源与模型资源的区别

    动画资源: 模型资源: 对比: 模型文件多出来了 Materials + 贴图 + mesh文件,少了avatar文件 PS:动画资源,是指动画片段,即animation chip,它一般包含在模型资 ...

  5. poj1050查找最大子矩阵和

    题目: To the Max   Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 48507   Accepted: 2566 ...

  6. 【安装配置Redis】

    目录 安装 配置 Redis官网:https://redis.io Redis是完全开源免费的,遵守BSD协议. Redis是一个高性能的key-value数据库. @ *** Redis具有以下特点 ...

  7. PHP算法之四大基础算法

    前言 虽然工作中,你觉得自己并没有涉及到算法这方面的东西,但是算法是程序的核心,一个程序的好与差,关键是这个程序算法的优劣,所以对于冒泡排序.插入排序.选择排序.快速排序这四种基本算法,我想还是要掌握 ...

  8. Virtual Box 新建一个虚拟机安装系统(补充:WIN7 64 bit 系统虚拟机无法安装 64 bit 系统问题)

    1.安装Virtual Box好后,点击新建 2.配置内存大小,这个根据自己需要配置就好 3.创建虚拟硬盘 这里选择固定分配.动态分配都可以,接下来就分配硬盘大小了 4.新建好后我们点击刚才建立的虚拟 ...

  9. IE9以下版本兼容h5标签

    随着html5(后面用h5代表)标签越来越广泛的使用,IE9以下(IE6-IE8)不识别h5标签的问题让人很是烦恼. 在火狐和chrome之类的浏览器中,遇到不认识的标签,只要给个display:bl ...

  10. 在JAVA中将class文件编译成jar文件包,运行提示没有主清单属性

    在JAVA中将class文件编译成jar文件包,运行提示没有主清单属性 Maven 项目生成jar运行时提示“没有主清单属性” 新建了一个Maven的项目,mvn compile和mvn packag ...