[root@localhost ~]# wget http://nginx.org/download/nginx-0.7.67.tar.gz
--2010-09-24 14:48:12-- http://nginx.org/download/nginx-0.7.67.tar.gz
Resolving nginx.org... 81.19.68.137
Connecting to nginx.org|81.19.68.137|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 608462 (594K) [application/octet-stream]
Saving to: `nginx-0.7.67.tar.gz'
100%[<========================================>] 608,462 44.5K/s in 18s
2010-09-24 14:48:32 (32.8 KB/s) - `nginx-0.7.67.tar.gz' saved [608462/608462] [root@localhost ~]# tar -zxvf nginx-0.7.67.tar.gz /解压压缩文件
[root@localhost ~]# cd nginx-0.7.67 /进入安装文件目录
[root@localhost nginx-0.7.67]# ./configure –prefix=/usr/local/nginx /指定安装到/usr/local/nginx目录下,可用./configure –help查看需要哪些编译参数
[root@localhost nginx-0.7.67]#make /make
[root@localhost nginx-0.7.67]#make install /安装
[root@localhost nginx-0.7.67]# ll /usr/local/nginx/ /查看是否安装成功
drwxr-xr-x 2 root root 4096 Sep 24 15:12 conf
drwxr-xr-x 2 root root 4096 Sep 24 15:12 html
drwxr-xr-x 2 root root 4096 Sep 24 15:12 logs
drwxr-xr-x 2 root root 4096 Sep 24 15:12 sbin
[root@localhost nginx-0.7.67]#/usr/local/nginx/sbin/nginx –t /测试Nginx配置文件是否正确
[root@localhost nginx-0.7.67]#/usr/local/nginx/sbin/nginx /启动Nginx

  当出现如下情况时:

[root@web2 nginx-0.7.67]# /usr/local/nginx_test/sbin/nginx
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: still could not bind()

  就要修改nginx的端口或者关掉占用80端口的应用;

修改端口方法:

在 Linux 上该文件的路径下找到  /usr/local/nginx/conf/nginx.conf
server {
listen 80;
server_name localhost; ……
}

  改为:

server {
listen 81;
server_name localhost; location / {
root html;
index index.html index.htm;
}
……
}

  

nginx 安装启动的更多相关文章

  1. 聊聊、Nginx 安装启动

    首先说下安装 Nginx 的步骤: (1)window 下安装 进入 http://nginx.org/en/download.html 下载版本 Mainline version 或者 Stable ...

  2. nginX 安装 启动

    选择源码安装  下载安装包  nginx-1.8.0.tar.gz   解压                     tar -zxvf  nginx-1.8.0.tar.gz    进入文件夹   ...

  3. ubuntu 14.04(desktop amd 64) nginx 安装启动停止

    sudo apt-get install nginx 关闭: sudo service nginx stop 启动: sudo nginx

  4. nginx安装启动

    参考:http://network.51cto.com/art/201005/198198_4.htm 下载nginx tar.gz安装包下载pcre tar.gz安装包 安装pcretar zxvf ...

  5. centos7 nginx安装/启动/进程状态/杀掉进程

    1.安装     下载RPM:wget http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.10.0-1.el7.ngx.x86_64.rpm ...

  6. nginx安装,启动亲测有效

    一:安装编译工具及库文件 yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel 二:安装PCRE,让 N ...

  7. Linux下Nginx安装/启动/重启/停止

    Nginx是高性能的web服务器也是非常好用反向代理服务器,可以实现负载均衡,动静分离等策略,在linux下用的非常多.下面是下载地址   http://nginx.org/en/download.h ...

  8. Nginx安装启动过程报错libpcre.so.1 cannot open shared object file: No such file or directory

    具体报错信息如下: nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: ...

  9. Linux nginx 安装 启动

    nginx下载地址:https://nginx.org/download/ ## 解压 tar -zxvf nginx-1.9.9.tar.gz ##进入nginx目录 cd nginx-1.9.9 ...

随机推荐

  1. 蜘蛛牌 (DFS)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1584 全部状态都判断一遍 代码: #include <stdio.h> #include ...

  2. GPS转换为百度坐标

    原文地址:http://www.cnblogs.com/zhaohuionly/archive/2013/06/18/3142623.html 最近在做一个关于手机定位的小应用,需求是这样的,用户通过 ...

  3. android 登录推断是否邮箱或手机号

    /** * 验证邮件是合法的输入 *  * @param strEmail * @return */ public static boolean isEmail(String strEmail) { ...

  4. Android Fragment 真正彻底的解决(下一个)

    转载请注明出处:http://blog.csdn.net/lmj623565791/article/details/37992017 上篇博客中已经介绍了Fragment产生原因.以及一些主要的使用方 ...

  5. javascript中对字符串的操作总结

    原文:javascript中对字符串的操作总结 没听过一句话吗?程序员的世界,不处理字符串就是处理数组.这是群里的一位前辈和我说的,显然这和我之前理解的DOM是javascript的核心的不同的,看了 ...

  6. shell 命名管道,进程间通信

    命名管道基础 命名管道也被称为FIFO文件, 在文件系统中是可见的,并且跟其它文件一样可以读写! 命名管道特点: 当写进程向管道中写数据的时候,如果没有进程读取这些数据,写进程会堵塞 当读取管道中的数 ...

  7. C#将Excel数据导入数据库(MySQL或Sql Server)

    最近一直很忙,很久没写博客了.今天给大家讲解一下如何用C#将Excel数据导入Excel,同时在文章最后附上如何用sqlserver和mysql工具导入数据. 导入过程大致分为两步: 1.将excel ...

  8. 让Sqlite脱离VC++ Runtime独立执行

    前段时间在开发OrayTalk(傲瑞通企业即时通信系统)的聊天记录模块时用到了Sqlite,这是我第一次接触和使用Sqlite,整体感觉还是很不错的.这里把我使用Sqlite的经验跟大家分享一下. 一 ...

  9. [Elasticsearch] 分布式文件存储

    本文翻译自Elasticsearch官方指南的distributed document store一章. 分布式文档存储 在上一章中,我们一直在介绍索引数据和获取数据的方法.可是我们省略了非常多关于数 ...

  10. Facebook HHVM 和 Hack 手册----1.什么是Hack?

    什么是Hack? Hack 是一种基于HHVM(HipHop VM 是Facebook推出的用来执行PHP代码的虚拟机,它是一个PHP的JIT编译器,同时具有产生快速代码和即时编译的优点)的新型编程语 ...