第一步:在centos下面下载 nginx 
         wget http://nginx.org/download/nginx-1.2.9.tar.gz

解压 tar zxf nginx-1.2.9.tar.gz
第二部:新建一个用户nginx在安装操作
        useradd nginx
        passwd nginx
第三步、解压和测试安装环境 ./configure --prefix=/var/nginx 
      安装过程中报错

checking for OS
 + Linux 2.6.32-220.el6.x86_64 x86_64
checking for C compiler ... not found

./configure: error: C compiler gcc is not found

解决方法:安装gcc
   yum install gcc

./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-devel解决问题 (root用户下安装)
yum -y install pcre-devel

继续报错误

./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.

需要安装 yum install -y zlib-devel

在继续执行 ./configure --prefix=/opt/nginx  安装编译成功

第四步:

make && make install
第五步:

cd /var/nginx/sbin
./nginx

如果报错:

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

那说明80端口被占用,用命令netstat -ltunp查看一下是哪个服务占用了端口

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1547/mysqld
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 1247/vsftpd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1233/sshd
tcp 0 0 :::80 :::* LISTEN 1258/httpd
tcp 0 0 :::22 :::* LISTEN 1233/ssh

可以看出需要把httpd服务关掉

service httpd stop

然后再运行./nginx就行了

然后打开浏览器输入IP地址  显示
Welcome to nginx!

xxxxxxxxx

安装成功

centos6安装nginx最详细步骤的更多相关文章

  1. 转载《centos6安装nginx最详细步骤》

    出处:https://www.cnblogs.com/hltswd/p/6956264.html 第一步:在centos下面下载 nginx          wget http://nginx.or ...

  2. CentOS7中使用yum安装Nginx的详细步骤

    1.添加源 rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarc ...

  3. windows10用WMware安装Linux虚拟机详细步骤

    windows10用WMware安装Linux虚拟机详细步骤   一.安装环境 windows10操作系统物理机VMware Workstation 软件(可以在网上下载)CentOS6.9镜像文件( ...

  4. 安装WebLogic的详细步骤

    安装WebLogic的详细步骤 1.在官网上下载WebLogic,详细地址如下 WebLogic 2.将WebLogic从官网上下载后wls1036_generic.jar 3.双击"wls ...

  5. bootcamp安装win7的详细步骤 (光盘安装)

      bootcamp安装win7的详细步骤 首先是要您确定以下内容(1)您的Mac系统下是一个盘符,也就是“macintosh hd”一个磁盘.如果不是的话,首先您需要做的是备份您分区下面的资料,让磁 ...

  6. Linux安装ftp服务-详细步骤

    最近项目中用到了FTP服务器,于是整理了一份在Linux服务器上安装FTP的详细步骤供大家分享. 1.首先连接上自己的Linux服务器.我的Linux是CentOS 6 2.检查Linux服务器上是否 ...

  7. Linux上centOs6+安装mysql5.7详细教程 - 前端小鱼塘

    https://coyhom.github.io/ 人类的本质是复读机,作为一个非linux专业人员学习linux最好的办法是重复 环境centos6.5 版本5.7 1: 检测系统是否自带安装mys ...

  8. 完全卸载nginx的详细步骤

    一个执着于技术的公众号 前言 在开局配置Nginx时有可能会配置错误,报各种错误代码.看不懂或者懒得去看这个报错时,其实最简单的方式是卸载并重装咯.今天就带大家一起学习下,如何彻底卸载nginx程序. ...

  9. MATLAB 安装使用libsvm详细步骤

    根据本文后面部分博友提出的在配置过程中出现的问题,其中需要特别强调的一点:整个过程,都是在 libsvm-3.12\matlab目录下操作的.如果这一点你忽视了,你不可能解决配置中报的Bug,即使重新 ...

随机推荐

  1. postman(一)批量执行接口测试用例

    postman(一)批量执行接口测试用例 学习了:https://blog.csdn.net/github_36032947/article/details/78611405 还可以把collecti ...

  2. CocoaPods安装及相关命令

    具体安装参考: http://www.jianshu.com/p/dfe970588f95 http://www.jianshu.com/p/9e4e36ba8574 我就说一个,安装cocoapod ...

  3. 运用JS导出ecxel表格、实现文件重命名

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  4. react-native AsyncStorage 数据持久化方案

    1,AsyncStorage介绍 AsyncStorage 是一个简单的.异步的.持久化的 Key-Value 存储系统,它对于 App 来说是全局性的.它用来代替 LocalStorage. 由于它 ...

  5. 关于\r和\n的一些问题总结

    \r表示"回车"(carriage return).\n表示"换行"(line feed),在Windows系统下.输入回车键会自己主动变成\r\n 相同的,在 ...

  6. Nginx 限制单个IP的并发连接数及对每个连接速度(限速)

    使用Nginx限制单个IP的并发连接数能够减少一些采集程序或者DDOS的攻击. 再lnmp的nginx配置中已经添加了部分代码,但是是注释掉的,可以编辑/usr/local/nginx/conf/ng ...

  7. iOS仿支付宝首页的刷新布局效果

    代码地址如下:http://www.demodashi.com/demo/12753.html XYAlipayRefreshDemo 运行效果 动画效果分析 1.UI需要变动,向上滑动的时候,顶部部 ...

  8. android中依据不同分辨率dp和px的相互转算

    public class PxAndDp { /** * 依据手机的分辨率从 dp 的单位 转成为 px(像素) */ public static int dip2px(Context context ...

  9. java统计中英文字数 Java问题通用解决代码

    http://yangchao20020.blog.163.com/blog/static/483822472011111635424751/   这个不适用于新浪微博字数的统计,结果有差别,若需要可 ...

  10. Android开发环境搭建 for windows (linux类似) 详细可参考“文件”中“Android开发环境搭建.pdf ”

    ADT-Bundle for Windows 是由Google Android官方提供的集成式IDE,已经包含了Eclipse,你无需再去下载Eclipse,并且里面已集成了插件,它解决了大部分新手通 ...