ubuntu 12.04 server编译安装nginx

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 statable 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)

时间: 2024-08-25 21:44:23

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

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-1.9.3.tar.gz .能够进入到根文件夹的Downloads文件夹下运行该命令.这样就能够直接下载该文件夹下 (2).windows或ubuntu浏览器中下载,地址为 http://nginx.org/en/download.html. 本人是下载到根文件夹 ~/Downloads中的 2,安

Ubuntu 12.04.1 编译安装 Tinyproxy socks 版本

1.安装相关依赖包 sudo apt-get build-dep tinyproxysudo apt-get install flex bison 2.追加如下补丁 --- tinyproxy-1.6.3-orig/src/grammar.y    2004-08-06 13:23:50.000000000 -0300+++ tinyproxy-1.6.3/src/grammar.y    2006-07-18 22:52:09.000000000 -0300@@ -57,6 +57,9 @@ 

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

使用ubuntu server安装lamp主机非常的方便,只要在安装系统的步骤中选择就是了 .但是很多时候我需要在图形界面下管理主机更加方便.今天的教程就是教大家安装图形界面. 首先你需要确定你的源文件中 /etc/apt/sources.list 已经使用Universe和Multiverse库.然后使用下面的命令来进行更新源列表和安装图形桌面. sudo apt-get update sudo apt-get upgrade sudo apt-get install ubuntu-deskt

ubuntu 12.04 server 安装nginx

下载源码: wget http://nginx.org/download/nginx-1.6.1.tar.gz 解压,编译安装 ./configure ./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 li

Ubuntu 12.04 Server LTS下安装桌面及vncserver

亲测通过 1. 安装相关的包: apt-getupdate apt-get install ubuntu-desktop apt-getinstall vnc4server apt-get install x-window-system-core apt-get install gdm apt-get install gnome-panel 2. 设置vncserver Vncpasswd 以root身份chmod +x/etc/X11/xinit/xinitrc Vi /root/.vnc/x

U盘安装 Ubuntu 12.04 Server LTS

折腾了半天12.04 server版,遇到的问题,貌似难度比10.04大很多: 首先是低版本的ultraISO不支持12.04映像刻录,只显示出EFI, 所以只能下个高版本的9.5.5(UUI被证明是不可行的) 其次是按照10.04来做的话,Help->F6根本没有地方输入installcdrom-detect/try-usb=true.(找了好久,实在是找不到,网上没有找到的...好吧,其实就是没有) 经过各种折腾,在网上看到一个很有价值的文章,终于试成功了一个办法: 1. 用UltraISO

Ubuntu 12.04 Server OpenStack Havana多节点(OVS+GRE)安装

1.需求 节点角色 NICs 控制节点 eth0(10.10.10.51)eth1(192.168.100.51) 网络节点 eth0(10.10.10.52)eth1(10.20.20.52)eth2(192.168.100.52) 计算结点 eth0(10.10.10.53)eth1(10.20.20.53) 注意1:你总是可以使用dpkg -s <packagename>确认你是用的是Havana版本 注意2:这个是当前网络架构 2.控制节点 2.1.准备Ubuntu 安装好Ubuntu

Ubuntu 12.04 Openstack Essex 安装(单节点)

这是陈沙克一篇非常好的博文,当时在进行openstack排错的时候,多亏了这篇文章里面有些内容 帮我找到了问题的所在: 原文:http://www.chenshake.com/ubuntu-12-04-openstack-essex-installation-single-node/#Nova-volume =============以下是转载内容========================== 亲自测试,成功! 测试环境: esx5.0 虚拟机环境   修改配置虚拟机配置文件 在esxi

Ubuntu 14.04 Server 上安装git源 mono 3.6.1 错误记录及成功步骤

看到ASP.NET vNext要支持Linux后,终于按捺不住折腾的心,决定先架个环境出来,只是实在没想到,因为相对熟悉点才选择的Ubuntu 14.04,会让过程会如此坎坷,有时呆看着屏幕上提示的种种error,真有点别人碰到的错都被我碰到了的荣幸,所以目标达成后,回头将这些错误回顾一遍,记录下来,以为将来鉴. 安装时主要参照的教程,是宇内流云写的<在Ubuntu操作系统上安装mono的具体方法>,简称文1:在排错过程中,还有参考园子里 逆水寒龙 的<Ubuntu Server(Ubu