tar -xvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./config
make
make install

above is for zlib(refers http://zlib.net/ for zlib),and below is for pcre-devel

apt-get install libpcre3 libpcre3-dev

then, compile and install nginx(get the newest stable source code from nginx.org)

virtualenv nginx_env
cd nginx_env
source bin/activate
tar -xvf nginx-1.6.2.tar.gz
cd nginx-1.6.2
./configure
make
make install

output log with "make"

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"

=========================test it ==========================

/usr/local/nginx/nginx

 just open page 'http://127.0.0.1' in web browser and see what happens.

and one more effort, let's try to use nginx with gunicorn.

first, install gunicorn.

pip install gunicorn

then, django

easy_install django

next, start a project ,and run it with gunicorn

django-admin startproject test_gn
cd test_gn
gunicorn -D test_gn.wsgi

finally ,configure nginx

vi /usr/local/nginx/conf/nginx.conf

and add a server like below down

server{
listen localhost:88;
location / {
proxy_pass http://127.0.0.1:8000;
} location /static/ {
autoindex:on;
alias absolute/path/to/static/dir;
}
}

 

restart the nginx server(kill the older progress and start a new one)

------------------编译源码有时候不一定能解决问题---------------

可以参考这个来升级nginx: https://www.binss.me/blog/install-lastest-nginx-on-ubuntu/

ubuntu 12.04 server编译安装nginx的更多相关文章

  1. Ubuntu 12.04 server 如何安装 OpenERP 7(转)

    不经意的一次看到OpenERP这个开源ERP,就被其丰富的功能,简洁的画面,熟悉的语言所吸引.迫不及待的多方查询资料,自己架设一个测试环境来进行了解.以下为测试安装时候的步骤说明,以备查询,并供有需要 ...

  2. ubuntu 12.04下编译安装nginx-1.9.3

    1,下载nginx-1.9.3.tar.gz 两种方式: (1).ubuntu 下终端中(ctrl+alt+t) 运行命令: wget http://nginx.org/download/nginx- ...

  3. Ubuntu 12.04本地编译安装Vim

    1.下载Vim,参考http://www.vim.org/git.php 2.编译安装Vim,参考https://github.com/Valloric/YouCompleteMe/wiki/Buil ...

  4. 如何在Ubuntu 12.04 Server 中安装图形用户界面

    root@ubuntu:~# gedit /etc/environment root@ubuntu:~# gedit /etc/profile ---------------------------- ...

  5. 安装Redmine 2.3.0(Ubuntu 12.04 Server)

    怀揣着为中小企业量身定做一整套开源软件解决方案的梦想开始了一个网站的搭建.http://osssme.org/ 安装Redmine 2.3.0(Ubuntu 12.04 Server) 翻译源\参考源 ...

  6. dell r710 安装ubuntu 12.04 server 启动后进入initramfs解决办法

    dell r710 安装ubuntu 12.04 server 启动后进入initramfs解决办法 grub 启动菜单后加入 rootdelay=90, 如下:/boot/vmlinuz-2.6.3 ...

  7. OpenStack Havana 部署在Ubuntu 12.04 Server 【OVS+GRE】(三)——计算节点的安装

    序:OpenStack Havana 部署在Ubuntu 12.04 Server [OVS+GRE] 计算节点: 1.准备结点 安装好ubuntu 12.04 Server 64bits后,进入ro ...

  8. OpenStack Havana 部署在Ubuntu 12.04 Server 【OVS+GRE】(二)——网络节点的安装

    序:OpenStack Havana 部署在Ubuntu 12.04 Server [OVS+GRE] 网络节点: 1.安装前更新系统 安装好ubuntu 12.04 Server 64bits后,进 ...

  9. OpenStack Havana 部署在Ubuntu 12.04 Server 【OVS+GRE】(一)——控制节点的安装

      序:OpenStack Havana 部署在Ubuntu 12.04 Server [OVS+GRE] 控制节点: 1.准备Ubuntu 安装好Ubuntu12.04 server 64bits后 ...

随机推荐

  1. 第十四章:Annotation(注释)

    一:注解 1.当成是一种修饰符吧,修饰类及类的所有成员. 代码里的特殊标记,这些标记可以在编译.类加载.运行时被读取. 2.@Override:强制子类覆盖(重写)父类的方法. @Deprecated ...

  2. .Net MVC中访问PC网页时,自动切换到移动端对应页面

    随着移动端的流行,越来越的网站,除了提供PC网页之外,也提供了移动端的H5页面,手机在访问www.xxx.com的时候,能自动跳转到mobile.xxx.com.网上很多在实现时也能使用JS直接进行跳 ...

  3. Day4_计算器

    read me 1.构造三个函数,乘除(mad),加减(aas),去括号(par): 2.获取表达式字符串之后,判断是否包含“+-*/()”等字符,包含则下一步3:不包含,返回字符串: 3.par 函 ...

  4. 14.Android之Layout布局学习

    Android布局主要有5种,接下来学习总结下. 1) 最常见的线性布局 LinearLayout 线性布局是Android布局中最简单的布局,也是最常用,最实用的布局. android:orient ...

  5. Adele的生活

    3个小时的电影,有点冗长,中间抽空吃了个饭,跑出去抽了3根烟,接着洗了个脸才回来接着看完,法国人做事真是拖沓啊有木有. 电影看完后给人一种淡淡的忧伤,第一次了解lesbians的真实世界(如果电影是来 ...

  6. CentOS 7 使用经验(更新中)

    首先说一下写这篇博客的初衷. 由于公司这一期的产品准备支持的环境有CentOS 7.MySql 5.6.Java 8.Tomcat 8等等,并且因为人员严重不足,我本月的开发任务在原有的基础上又加上了 ...

  7. Linux下修改计算机名

    SuSe操作系统: 1.  修改/etc/HOSTNAME 文件  ,其内容为计算机名. 输入命令:vi /etc/HOSTNAME 使用键盘上的 x 键一个一个删除所有内容 ,然后使用键盘上的 i ...

  8. prototype.js $F()函数介绍

    $F()是一个能够简化编码量的函数, 对于字段输入控件有效,包括input.textarea.select等,该函数的输入参数为这些输入控件元素对象的id或元素对象本身,函数负责返回 这些输入控件元素 ...

  9. MySQL日期数据类型、MySQL时间类型使用总结

    MySQL:MySQL日期数据类型.MySQL时间类型使用总结 MySQL 日期类型:日期格式.所占存储空间.日期范围 比较. 日期类型 存储空间 日期格式 日期范围 ------------ --- ...

  10. sql server case when 判断为空

    代码如下 select distinct G.* ,(select BUSINESS_NAME from BusinessInfo where BusinessInfo.BUSINESS_BID=G. ...