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. input[type='file']获取上传文件路径案例

    最近在项目时,需要获取用户的上传文件的路径,便写了一个demo: <body> <input type="file" name="" valu ...

  2. 自定义view 之多个引导层动画效果

    SupernatantView 如果我英文还可以的话这个应该叫做漂浮在上层的view---引导层 今天闲来无事看了网上的一些引导层案例总感觉如果不是很舒服,就是类似于很死板的显示和消失 我在想能不能弄 ...

  3. LIst和map的遍历

    1. public static void main(String[] args) { // ArrayList类实现一个可增长的动态数组 List<String> list = new ...

  4. 移除HTML5 input在type="search"时的清除按钮

    input[type="search"]::-webkit-search-cancel-button { display: none; }

  5. java中常用的转义字符

    Day02_SHJavaTraing_4-3-2017 Java中允许使用转义字符‘\’来将其后的字符转变为特殊字符型常量. 一.JAVA中常用的转义字符

  6. windows 2008 中IIS7.0以上如何设置404错误页面

    404错误页面的设置,不仅仅可以提高用户体验度,从SEO方面考虑,也是非常重要的.今天,笔者在这里介绍一下在windows 2008下如何设置404错误页面. 注意:设置404有我这里介绍2种方式,推 ...

  7. Python多线程原理与实现

    Date: 2019-06-04 Author: Sun Python多线程原理与实战 目的: (1)了解python线程执行原理 (2)掌握多线程编程与线程同步 (3)了解线程池的使用 1 线程基本 ...

  8. Ubuntu14.0 + CUDA9.0 + cudnn7.0 + TensorFlow-gpu1.7.0

    在安装好nvidia驱动的基础上安装 CUDA9.0 + cudnn7.0 + TensorFlow-gpu1.7.0 这三个是匹配的版本 别的匹配(CUDA8.0 + cudnn6.0 + Tens ...

  9. 再次理解JS的prototype,__proto__和constructor

    个人总结: 下面这篇文章很好的讲解了js原型,原型链,个人的总结是要记住这三个属性 prototype.__proto__和constructor 首先明确,js中一切都是对象object(A). ( ...

  10. 说说Shell在代码重构中的应用

    说说Shell在代码重构中的应用    出处信息 出处:http://blogread.cn/it/article/3426?f=wb 代码重构(Code refactoring)有时是很枯燥的,字符 ...