1.首先需要安装必要的库,PCRE,zlib
sudo apt-get install libpcre3 libpcre3-dev
假设找不到文件的话就下载源文件进行安装。


2.解压下载的nginx源代码。进入文件夹: sudo ./configure 得到的输出例如以下:
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"

  nginx binary file: "/usr/local/nginx/sbin/nginx"

  nginx configuration prefix: "/usr/local/nginx/conf"

  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"

  nginx pid file: "/usr/local/nginx/logs/nginx.pid"

  nginx error log file: "/usr/local/nginx/logs/error.log"

  nginx http access log file: "/usr/local/nginx/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"

3. sudo make
4. sudo make install 
5. 查看配置文件,然后启动
vonzhou@de16:~/nginx-1.0.15$ sudo /usr/local/nginx/sbin/nginx -t

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok

nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

vonzhou@de16:~/nginx-1.0.15$ sudo /usr/local/nginx/sbin/nginx

此时查看进程有:

vonzhou@de16:~/nginx-1.0.15$ ps -axu | grep nginx

root      9723  0.0  0.0  22536   592 ?

Ss   22:49   0:00 nginx: master process /usr/local/nginx/sbin/nginx

nobody    9724  0.0  0.0  22936  1052 ?

S    22:49   0:00 nginx: worker process


6. 然后能够通过curl简单測试index页面:
vonzhou@de16:~$ curl http://localhost:80/

<html>

<head>

<title>Welcome to nginx!</title>

</head>

<body bgcolor="white" text="black">

<center><h1>Welcome to nginx!</h1></center>

</body>

</html>

依据nginx.conf的配置。响应文件是html/index.html页面:
server {

        listen       80;

        server_name  localhost;

  

        location / {

            root   html;

            index  index.html index.htm;

        }
}

版权声明:本文博主原创文章,博客,未经同意不得转载。

Nginx 在安装入门的更多相关文章

  1. Nginx - Windows下Nginx初入门,附CentOS下Nginx的安装

    公司刚使用nginx,预先学习下.鉴于机器没有Linux环境,在Windows熟悉下. 下载 目前(2015-07-11),nginx的稳定版本是1.8.0,在官网下载先,windows版的nginx ...

  2. Nginx 的安装配置入门(mac)

    1.安装Nginx服务器: 执行命令 brew install nginx 安装完以后,可以在终端输出的信息里看到一些配置路径: /usr/local/etc/nginx/nginx.conf (配置 ...

  3. 【工具-Nginx】从入门安装到高可用集群搭建

    文章已收录至https://lichong.work,转载请注明原文链接. ps:欢迎关注公众号"Fun肆编程"或添加我的私人微信交流经验 一.Nginx安装配置及常用命令 1.环 ...

  4. Nginx开发从入门到精通 学习目录分享学习 (阿里著作)

    Nginx开发从入门到精通   缘起 nginx由于出色的性能,在世界范围内受到了越来越多人的关注,在淘宝内部它更是被广泛的使用,众多的开发以及运维同学都迫切的想要了解nginx模块的开发以及它的内部 ...

  5. 【转】Nginx模块开发入门

    转自: http://kb.cnblogs.com/page/98352/ 结论:对Nginx模块开发入门做了一个helloworld的示例,简单易懂.也有一定的深度.值得一看. Nginx模块开发入 ...

  6. Nginx模块开发入门

    前言 Nginx是当前最流行的HTTP Server之一,根据W3Techs的统计,目前世界排名(根据Alexa)前100万的网站中,Nginx的占有率为6.8%.与Apache相比,Nginx在高并 ...

  7. [转] Nginx模块开发入门

    前言 Nginx是当前最流行的HTTP Server之一,根据W3Techs的统计,目前世界排名(根据Alexa)前100万的网站中,Nginx的占有率为6.8%.与Apache相比,Nginx在高并 ...

  8. Nginx模块开发入门(转)

    前言 Nginx是当前最流行的HTTP Server之一,根据W3Techs的统计,目前世界排名(根据Alexa)前100万的网站中,Nginx的占有率为6.8%.与Apache相比,Nginx在高并 ...

  9. Nginx模块开发入门(转)

    前言 Nginx是当前最流行的HTTP Server之一,根据W3Techs的统计,目前世界排名(根据Alexa)前100万的网站中,Nginx的占有率为6.8%.与Apache相比,Nginx在高并 ...

随机推荐

  1. COCI 2015/2016 Day 8 PROKLETNIK

    PROKLETNIK 题目描述:给出\(n\)个数,定义一段连续的数为魔法串是该区间的左右端点值正好是区间的最小值与最大值(最小值可以在左也可以在右,最大值也一样).\(Q\)个询问,每次询问一个区间 ...

  2. 【具体数学--读书笔记】1.1 The Power of Hanoi

    这一节借助汉诺塔问题引入了"Reccurent Problems". (Reccurence, 在这里解释为“the solution to each problem depend ...

  3. phonegap开发app中踩过的那些坑

    把遇到的问题列出来,假设有解决方式的,偶也会写下来.假设大家有更好解决方法的.欢迎留言噢 phonegap 2.9无法触发deviceready事件 亲们能够看下控制台有木有报错.假设有提示cordo ...

  4. Swift自定义Class实现Hashable

    假如有个Bit类,其中含有CGPoint类型的point属性,Class定义如下 class Bit { var point : CGPoint init(point : CGPoint) { sel ...

  5. 张冬:OpenPOWER CAPI为什么这么快?(二)

     张冬:OpenPOWER CAPI为什么这么快?(二) PMC公司数据中心存储架构师张冬 有了CAPI的FPGA是怎么做的? 首先认识一下这个体系里的三个角色: AFU(Acceleration ...

  6. java 命令行制定logback参数

    -Dlogback.configurationFile=file:///export/Workspace/apache-cassandra/apache-cassandra-main/target/b ...

  7. git创建分支

    1.创建本地分支名称为dev的本地分支 git branch dev 2.将本地分支添加到远程分支 git push origin dev 3.查看创建的本地分支, 带有*符号的分支,代表当前所在分支 ...

  8. poj 2431

    大意: 有n个加油点,给出每个加油点距离终点的位置和能加多少油,最后一行给出总长度和最初的油量.求最少加几次油能到终点,不能到的话输出-1. Sample Input 4 4 4 5 2 11 5 1 ...

  9. Nullable<T> 与 T?

    Nullable<T> : 基础类型为值类型的对象,值类型的对象和引用类型的对象一样也可以分配 null.可空类型. Nullable<int> 与 int?是同样的意思. ; ...

  10. iOS self和super的区别

    self和super的区别 #import <Foundation/Foundation.h> 首先先写两个类 fist和two,two继承fist类 @interface First:N ...