国外设计欣赏网站 - DOOOOR.com

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,微信登陆

搜索

[Drupal优化/SEO/环境] Drupal:Nginx高效能和低耗能的 Web Server

[复制链接]
发表于 2-7-2012 15:57 | 显示全部楼层 |阅读模式
Howfar用一套国外Drupal源码,无奈本地和网上的运行速度都相当慢,小宝建议试试nginx的环境。搜了些相关文章,先放个百度百科里的文章,比较全面:3 J5 z0 t6 R3 f% y6 H

( K# R+ C( ~$ }  E1 D" \Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,第一个公开版本0.1.0发布于2004年10月4日。其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名。2011年6月1日,nginx 1.0.4发布。0 c% N! @1 K. l$ k
8 C% D8 ?" Q3 C  e  b5 i8 e

' R& f- O2 K$ N. J优点
7 b# _  V4 K* o6 @- F2 B! _
: u: O$ F6 t, V% U    nginx mapNginx 可以在大多数 Unix like OS 上编译运行,并有 Windows 移植版。目前 Nginx 的1.0.9稳定版已经于2011年11月1日发布,开发版本已完成的为1.1.8,如果新建站点,建议使用最新稳定版作为生产版本,已有站点升级急迫性不高。 Nginx 的源代码使用 2-clause BSD-like license。
' `2 d  n8 H( r# I  Nginx 是一个很牛的高性能Web和反向代理服务器,它具有很多非常优越的特性:% d4 `) ?. d* p* D$ E0 ]& a0 g
  在高连接并发的情况下,Nginx是Apache服务器不错的替代品:Nginx在美国是做虚拟主机生意的老板们经常选择的软件平台之一。能够支持高达 50,000 个并发连接数的响应,感谢Nginx为我们选择了 epoll and kqueue作为开发模型。& |0 t" `8 q1 f8 |% o) C5 c7 O
  Nginx作为负载均衡服务器:Nginx 既可以在内部直接支持 Rails 和 PHP 程序对外进行服务,也可以支持作为 HTTP代理服务器对外进行服务。Nginx采用C进行编写,不论是系统资源开销还是CPU使用效率都比 Perlbal 要好很多。
$ t* B$ r. [3 j% q( G  作为邮件代理服务器:Nginx 同时也是一个非常优秀的邮件代理服务器(最早开发这个产品的目的之一也是作为邮件代理服务器),Last. fm 描述了成功并且美妙的使用经验。
/ j( E# B: r: Y2 C  Nginx 是一个安装非常的简单,配置文件非常简洁(还能够支持perl语法),Bugs非常少的服务器:Nginx 启动特别容易,并且几乎可以做到7*24不间断运行,即使运行数个月也不需要重新启动。你还能够不间断服务的情况下进行软件版本的升级。2 f  R& n9 G' Q0 R# N+ o3 y

& i( S" g: {8 f. F7 RNginx性能概述
0 s- ~" v1 m0 O2 N
4 y5 x' R- I" c4 ~HTTP基础功能8 K9 ]( o( Z! ]
  处理静态文件,索引文件以及自动索引;" I+ T: z- N+ n6 W) ^; W) J
  反向代理加速(无缓存),简单的负载均衡和容错;. @9 A" ?5 C9 E" F& N- P4 M/ A
  FastCGI,简单的负载均衡和容错;
# S3 n" ^, J$ Q; \' @- z  模块化的结构。过滤器包括gzipping, byte ranges, chunked responses, 以及 SSI-filter 。在SSI过滤器中,到同一个 proxy 或者 FastCGI 的多个子请求并发处理;5 s$ x7 v8 A. ~' c6 A. n* A( F
  SSL 和 TLS SNI 支持;
& x0 i, c2 |4 O3 T  IMAP/POP3 代理服务功能:8 @6 o! J$ S3 @2 u* M) O
  使用外部 HTTP 认证服务器重定向用户到 IMAP/POP3 后端;0 s2 Z; O: N! d  W4 ^; B0 q) q
  使用外部 HTTP 认证服务器认证用户后连接重定向到内部的 SMTP 后端;8 x  ]. @2 {) G: F! s# c) a
" u+ x1 T- ]- E" L% J( D
其他HTTP功能
/ b0 F- d" ]  ]. ?+ f9 b  基于名称和基于IP的虚拟服务器;
7 ~+ j# N# ~( _( U  Keep-alive and pipelined connections support;保持活动和支持管线连接;' T% u" n) U! k5 @. c1 X- \
  Flexible configuration;灵活的配置;: e+ c1 g7 t+ ?3 q9 b: ~4 ]
  Reconfiguration and online upgrade without interruption of the client processing;重构,未经客户处理中断在线升级;. ^% {) U+ A9 e) S% e, V
  Access log formats, bufferred log writing, and quick log rotation;访问日志格式,bufferred日志写,快速登录旋转;+ K  {6 Q" K6 c& ?- X
  3xx-5xx error codes redirection; 3xx的- 5xx错误代码重定向;: f. g0 Y; Q+ b( k' r8 W4 V
  The rewrite module;重写模块;/ X$ V0 m2 @- P) d7 l: R  R
  Access control based on client IP address and HTTP Basic authentication;访问控制基于客户端IP地址和HTTP基本认证;, i: a/ z8 s) \& q
  The PUT, DELETE, MKCOL, COPY and MOVE methods;在PUT,DELETE键,MKCOL,复制和移动方法;
6 @1 {, D  c* i) @6 Q  FLV streaming;的FLV流;% `2 E# D. c" ]
  Speed limitation;车速限制;  E0 M# z  q6 T$ N3 Q) A) |. v7 u2 ?
  Limitation of simultaneous connections or requests from one address.限制同时连接或从一个地址的请求。4 r0 Y( w0 t; U! D
  Embedded perl.嵌入式的Perl。
; ]2 P2 E/ }, V5 V! D% E8 C; P/ h. Y
邮件代理服务器功能
2 [& Z. a, {, x0 L) R  用户重定向到IMAP/POP3后端使用外部HTTP认证服务器;. G( C4 M  e1 {* [( }
  User authentication using an external HTTP authentication server and connection redirection to internal SMTP backend;用户身份验证使用外部HTTP认证服务器和连接重定向到内部的SMTP后端;
: G; ?# Y# x, O" I% }, B  Authentication methods:验证方法:0 q7 H/ L1 f5 z
  POP3: USER/PASS, APOP, AUTH LOGIN/PLAIN/CRAM-MD5;的POP3:用户名/密码,的APOP,AUTH的LOGIN/PLAIN/CRAM-MD5;
+ O$ ^' ?/ Z+ K. o  IMAP: LOGIN, AUTH LOGIN/PLAIN/CRAM-MD5; IMAP的:登录,AUTH的LOGIN/PLAIN/CRAM-MD5;; @# C6 I; i2 i2 s" C
  SMTP: AUTH LOGIN/PLAIN/CRAM-MD5;的SMTP:AUTH的LOGIN/PLAIN/CRAM-MD5;
' X. C  ?  \# |+ L9 U& s  SSL support; SSL支持;
$ j! [9 g- J- q* {' M/ f  STARTTLS and STLS support. STARTTLS的和补充的支持。; r! Z8 }( y, a$ a; r
9 b" }& d* D$ D
认证方法1 K: [8 w% s& Y4 I' T% T5 z
  POP3: POP3 USER/PASS, APOP, AUTH LOGIN PLAIN CRAM-MD5;
, Z! S3 G* @+ f* ?- s  IMAP: IMAP LOGIN;+ I2 O) V' [7 X4 _3 m/ V+ n6 K9 S
  SMTP: AUTH LOGIN PLAIN CRAM-MD5;
3 }; W* N" K3 C9 V$ M& W  SSL 支持;5 a" m8 ~, W: v9 e! F
  在 IMAP 和 POP3 模式下的 STARTTLS 和 STLS 支持;" X' W3 f) L0 m! h" C/ J
6 j0 i" g% T+ k
支持的操作系统) i; V; [( ^1 h; l8 R
  FreeBSD 3.x, 4.x, 5.x, 6.x i386; FreeBSD 5.x, 6.x amd64;
! ?( n% ?4 o. S9 `0 Z& H; f  Linux 2.2, 2.4, 2.6 i386; Linux 2.6 amd64;0 @9 \1 u  y3 Z$ m; r8 N) [( `
  Solaris 8 i386; Solaris 9 i386 and sun4u; Solaris 10 i386;
- {7 T# U( j2 c1 w  q  MacOS X (10.4) PPC;
1 l) X$ I0 r5 S' s/ s  Windows XP和Windows Server 2003中。
0 P4 b, D, v+ `: Q: v- p& \: N9 `
, U$ ~$ A3 R2 K6 Z) |- r结构与扩展6 n8 c5 _/ H0 T1 t- X
  一个主进程和多个工作进程。工作进程是单线程的,且不需要特殊授权即可运行;" K' {7 g' s/ |- i. X/ N5 O- a8 H
  kqueue (FreeBSD 4.1+), epoll (Linux 2.6+), rt signals (Linux 2.2.19+), /dev/poll (Solaris 7 11/99+), select, 以及 poll 支持;$ S( ?# W3 u9 K/ n% J# G  K5 Z
  kqueue支持的不同功能包括 EV_CLEAR, EV_DISABLE (临时禁止事件), NOTE_LOWAT, EV_EOF, 有效数据的数目,错误代码;
% F9 H5 b. l1 y& W4 \* n" f  sendfile (FreeBSD 3.1+), sendfile (Linux 2.2+), sendfile64 (Linux 2.4.21+), 和 sendfilev (Solaris 8 7/01+) 支持;
" ^; S, O/ S# L' f0 f  输入过滤 (FreeBSD 4.1+) 以及 TCP_DEFER_ACCEPT (Linux 2.4+) 支持;; I6 o0 p4 }" v: }3 B8 q) ?
  10,000 非活动的 HTTP keep-alive 连接仅需要 2.5M 内存。
0 @4 \$ m! F& I8 p" c, E  最小化的数据拷贝操作;" G! o, E& I+ D5 ~# @2 N# G4 A
  其他HTTP功能:6 Q# j- M$ T% r; m
  基于IP 和名称的虚拟主机服务;
% d, |( ~5 u5 Y) l: x, U0 o  Memcached 的 GET 接口;
9 f1 |  S6 v  P4 A: @  支持 keep-alive 和管道连接;
3 l( A7 R& K3 L- W5 a4 v  灵活简单的配置;
3 H2 w7 F$ y* c* s% P  重新配置和在线升级而无须中断客户的工作进程;
" P- ]5 ?3 y$ }* B% q* W2 z2 _! l  可定制的访问日志,日志写入缓存,以及快捷的日志回卷;
0 U7 Y4 H2 U; p( ], R  L* E/ l  4xx-5xx 错误代码重定向;8 r! N: L  D" F
  基于 PCRE 的 rewrite 重写模块;
4 v' U$ C1 l6 a5 B/ f& Y  基于客户端IP 地址和 HTTP 基本认证的访问控制;% w0 ^0 f7 j2 v2 T" L# I- C* F
  PUT, DELETE, 和 MKCOL 方法;
. g( ?$ C3 r6 ?2 q' C# A, r  支持 FLV (Flash 视频);7 `/ \: U7 a7 }/ p; V! ]
  带宽限制;( u" D" ^( M/ q& x: e& ~  v8 Z$ w: y
+ p* L8 {9 M( L: A8 l& \
实验特性
' U- _% W* R, M$ t( Z  内嵌的 perl
: H) v; ^" q8 B% R8 U: W' D  通过 aio_read()/aio_write() 的套接字工作的实验模块,仅在 FreeBSD 下。( O* E! g0 z9 Y% c/ N9 W6 m5 P
  对线程的实验化支持,FreeBSD 4.x 的实现基于 rfork()
# y7 X5 u2 ~% O- I  Nginx 主要的英语站点是 http://sysoev. ru/en/) f' H  H$ |( {0 d- O4 e1 r
  英语文档草稿由 Aleksandar Lazic 完成 点击。9 H: J* m8 u4 b0 ^4 O" S; h3 `; G) B4 }, n
! ]2 F( b7 v6 w' d5 }8 }7 A
常见问题(FAQ)
4 C' G+ W1 R; W) O# x1 E; T2 [; ]
. g; x9 z  r6 a/ X1 N5 ]7 f某些东东不工作
! i9 K: @2 T0 A5 j8 e5 a% e  (URL重写, 代理, 路径, ...). [8 j( S  o8 n1 P/ H% g! m7 u
  例如: 如URL重写(rewrite)不工作了或者是unix的路径(/$PATH)的问题云云...
6 F" i- o: `7 e+ Z  请仔细阅读 [NginxDebugging] 并且 逐行 查看错误日志。
% [; ~7 P" Y. V! Y7 D! {, e  如果你没找到错误 打起精神 试着到IRC或邮件列表里说明一下你碰到的问题。+ j$ X. A( t% G4 V  j$ [
  有没有其它类似的Web服务器
: F7 V9 L- R" u6 m) o4 z3 I  Cherokee
% a7 t2 T# v6 u4 l9 m0 }' b% ]  Lighttpd (Lighty)( J: F3 Z  H  ?) o0 o
  thttpd
" G( L5 [, C3 e7 t: i  关于各自的优缺点请使用自己喜欢的搜索引挚查找) z7 D! g. ~3 @! E; R
对于chroot的支持是否在计划之中- Y: A+ W1 k* q1 Z6 Q) g0 x
  在什么情况下使用Nginx比使用squid要好? 反之亦然。& z5 R- l; R$ Y- o; o
  大体上来说nginx主要用于反向加速代理而不是像squid那样做为常规代理服务器。Nginx的最大优势在于高负载情况下内存和CPU的低消耗。 我不认为squid能给你带来比nginx更好的性能。6 }, z6 m- s3 l2 {" u0 Y
  有没有人能给出一个完整的.conf配置文件来详细的解读一下怎么配置和测试 IMAP 模块, 而不只是关于 IMAP 的只言片语啊?
( U4 @: W" g9 C7 W  依照 [NginxImapProxyExample] 开始你的配置. 关于不同配置参数的具体信息,请查看 [NginxMailCoreModule] 页。. ]( X- f1 V9 j( x
  示例1: 用运行于apache上的php脚本做后端验证# I, E8 z1 o* _: \* T0 x9 \3 H" q
  示例2: 使用运行于同一个服务器的 nginx-embedded-perl 模块作为 imap/pop代理和认证后端
/ J; ]' l7 g8 L让Nginx成为以postfix做为后端的SMTP代理5 ?  _. p. M+ S3 r$ a& B
  Nginx使用什么算法来实现负载均衡? 它能实现基于连接数的负载均衡吗?
0 C8 ]  K. ]9 D6 z  O+ B; o  目前Nginx使用简单的轮巡算法,所以无法做基本链接计数的负载均衡。 这个可能会在将来的版本中有所改变。
3 r! W; O6 j0 ]  我能关闭从代理服务器到后端服务器的缓存吗或者使用上传进度特性?8 ?. g& R7 n  e8 P
基于太多人询问下面的问题:4 A' D( T0 X6 B
  我能为了得到上传进度而关闭代理的缓存吗
0 Q  i7 d9 j3 F! W  使用nginx我怎么才能给用户显示上传进度: x- P2 c1 }- w. @
  ...
" F6 C6 I! F5 A! i# [  到目前为止 (2007-Apr-26) 还没有办法关闭到后端服务器的缓存.' {2 Q1 S9 A, J! w. v, `

; @' Q) L! @. V8 Z% c0 ~/ F安装Nginx
) d8 i( J* p. |8 {5 k0 |: s  f& S2 U. V4 |) V" b; v" n3 P
模块依赖性# x3 T' u4 [1 u" v8 g& l
  gzip 模块需要 zlib 库6 S4 H* d5 u) g  P2 D$ }
  rewrite 模块需要 pcre 库
4 j0 ~  c3 {6 b+ P9 r% e5 ~$ I  ssl 功能需要 openssl 库
, ?! _5 Y% x$ H预先编译好的安装包; }8 c9 N- q/ S* ~: q
  Nginx在一些Linux发行版和BSD的各个变种版本的安装包仓库中都会有,通过各个系统自带的软件包管理方法即可安装。需要注意的是,很多预先编译好的安装包都比较陈旧,大多数情况下还是推荐直接从源码编译。$ p2 b2 r  ?; p& @& O) V0 Y. ^
官方源代码下载
* V; P7 Q7 D7 f# s) k3 e  特定平台的安装和记录6 x8 S7 ~3 f% j: f0 g3 m  ^
  Nginx 在 Slackware 上的编译安装脚本
; I* ?, Y4 Q$ w7 {+ D* b  Nginx 在ubuntu和debian上的安装及脚本, debian针对nginx包的官方下载站点8 h- j6 l1 g$ g5 B
  使用源代码进行构建) j% X3 V& a6 D
  Nginx 使用 Unix 下常用的 './configure && make && make install' 过程来编译安装。, q+ p5 U( t7 N, L% J: D
  configure 脚本确定系统所具有一些特性,特别是 nginx 用来处理连接的方法。然后,它创建 Makefile 文件。: \9 U) Y3 E- n# B+ x, z
  configure 支持下面的选项:
  D0 R6 I# V& L7 @( u/ s3 P  --prefix=<path> - Nginx安装路径。如果没有指定,默认为 /usr/local/nginx。1 k# f: E4 }5 x5 D$ B' e* t% n
  --sbin-path=<path> - Nginx可执行文件安装路径。只能安装时指定,如果没有指定,默认为<prefix>/sbin/nginx。
. i# ?2 t" W8 b  --conf-path=<path> - 在没有给定-c选项下默认的nginx.conf的路径。如果没有指定,默认为<prefix>/conf/nginx.conf。1 v) ~" k- w. H0 @1 R- C
  --pid-path=<path> - 在nginx.conf中没有指定pid指令的情况下,默认的nginx.pid的路径。如果没有指定,默认为 <prefix>/logs/nginx.pid。
% E2 Z' k6 Q1 a% H- P  --lock-path=<path> - nginx.lock文件的路径。
8 f1 s' G1 H$ F, T, O! b" f7 J  --error-log-path=<path> - 在nginx.conf中没有指定error_log指令的情况下,默认的错误日志的路径。如果没有指定,默认为 <prefix>/logs/error.log。* w. t! \: A, n2 ^
  --http-log-path=<path> - 在nginx.conf中没有指定access_log指令的情况下,默认的访问日志的路径。如果没有指定,默认为 <prefix>/logs/access.log。
% X4 n. i" T5 H+ [* J+ n' A  --user=<user> - 在nginx.conf中没有指定user指令的情况下,默认的nginx使用的用户。如果没有指定,默认为 nobody。
- \6 P, @4 o5 Q( f0 m# }& {  --group=<group> - 在nginx.conf中没有指定user指令的情况下,默认的nginx使用的组。如果没有指定,默认为 nobody。
7 M! w0 N- i' N1 r' _" G* a  --builddir=DIR - 指定编译的目录! L) s5 r3 N1 l; |& m
  --with-rtsig_module - 启用 rtsig 模块
; m' z: I* A" I2 `( J  --with-select_module --without-select_module - Whether or not to enable the select module. This module is enabled by default if a more suitable method such as kqueue, epoll, rtsig or /dev/poll is not discovered by configure.1 N. \- D7 J4 j
  //允许或不允许开启SELECT模式,如果 configure 没有找到更合适的模式,比如:kqueue(sun os),epoll (linux kenel 2.6+), rtsig(实时信号)或者/dev/poll(一种类似select的模式,底层实现与SELECT基本相 同,都是采用轮训方法) SELECT模式将是默认安装模式/ t. D# p7 }! G
  --with-poll_module --without-poll_module - Whether or not to enable the poll module. This module is enabled by default if a more suitable method such as kqueue, epoll, rtsig or /dev/poll is not discovered by configure./ y4 N3 a5 z4 A
  --with-http_ssl_module - Enable ngx_http_ssl_module. Enables SSL support and the ability to handle HTTPS requests. Requires OpenSSL. On Debian, this is libssl-dev.
9 c: d3 v6 J) e8 `  //开启HTTP SSL模块,使NGINX可以支持HTTPS请求。这个模块需要已经安装了OPENSSL,在DEBIAN上是libssl- ]) U* P5 S# r: p
  --with-http_realip_module - 启用 ngx_http_realip_module
6 Q! S6 o: U/ b* h. D/ R5 }  --with-http_addition_module - 启用 ngx_http_addition_module
0 m5 f; i8 u0 r& ^4 Y; _  --with-http_sub_module - 启用 ngx_http_sub_module: A# @$ v: b6 D' U8 _8 h, G6 B
  --with-http_dav_module - 启用 ngx_http_dav_module
2 o& q' {9 o5 c1 h9 O$ Z  --with-http_flv_module - 启用 ngx_http_flv_module
* c6 N: E9 ^% b1 _3 k: O  --with-http_stub_status_module - 启用 "server status" 页) z' `8 y( R5 i9 D3 x
  --without-http_charset_module - 禁用 ngx_http_charset_module
" V  l% m8 C! t+ X- G3 S5 P9 ^* }  --without-http_gzip_module - 禁用 ngx_http_gzip_module. 如果启用,需要 zlib 。
0 C# {2 o; y9 A/ y- d& [8 T  --without-http_ssi_module - 禁用 ngx_http_ssi_module
6 e% O, p: v6 k  S. o( O$ U' ?  --without-http_userid_module - 禁用 ngx_http_userid_module
: y1 T5 _: K7 q" N6 J  --without-http_access_module - 禁用 ngx_http_access_module9 V! w  F% [' `4 F/ j
  --without-http_auth_basic_module - 禁用 ngx_http_auth_basic_module
: L( F+ k* e6 G+ S3 y  --without-http_autoindex_module - 禁用 ngx_http_autoindex_module
4 a% B! Y7 E1 _8 }' n: b* v  --without-http_geo_module - 禁用 ngx_http_geo_module
9 m- F( O/ b4 f" q9 i: k  --without-http_map_module - 禁用 ngx_http_map_module. D( A5 a* @. T
  --without-http_referer_module - 禁用 ngx_http_referer_module
7 j5 b9 H/ Z* [) o  --without-http_rewrite_module - 禁用 ngx_http_rewrite_module. 如果启用需要 PCRE 。
# K& s( J2 e2 S! X, v8 O& S" P. f  --without-http_proxy_module - 禁用 ngx_http_proxy_module; d- T# z- ?2 Y& z
  --without-http_fastcgi_module - 禁用 ngx_http_fastcgi_module
9 w$ K% x$ q! D* X( _" g/ B; S: Y3 R. A  --without-http_memcached_module - 禁用 ngx_http_memcached_module
4 c* T$ r9 ]& J1 G) h% j  --without-http_limit_zone_module - 禁用 ngx_http_limit_zone_module2 g1 U) B# k7 |/ M. w
  --without-http_empty_gif_module - 禁用 ngx_http_empty_gif_module
4 X0 |7 ?, \* }1 u  --without-http_browser_module - 禁用 ngx_http_browser_module# v: S5 t- c1 J7 x! s$ n% ?
  --without-http_upstream_ip_hash_module - 禁用 ngx_http_upstream_ip_hash_module
0 f7 s9 P$ I/ Q8 D/ ]' L) l  --with-http_perl_module - 启用 ngx_http_perl_module
0 N  B8 K. U# H, b* N* P  --with-perl_modules_path=PATH - 指定 perl 模块的路径- c( C+ j& q/ H& w
  --with-perl=PATH - 指定 perl 执行文件的路径# R5 N, Y3 {3 M; }# e2 U' L. K+ G
  --http-log-path=PATH - Set path to the http access log4 t) t% ^2 v+ u7 ?7 Q2 b
  --http-client-body-temp-path=PATH - Set path to the http client request body temporary files
4 [, M6 F1 w' }; ?( ]  --http-proxy-temp-path=PATH - Set path to the http proxy temporary files
% s& b" P+ D* T  --http-fastcgi-temp-path=PATH - Set path to the http fastcgi temporary files& x% d0 }1 p( w0 N: x! v& ?
  --without-http - 禁用 HTTP server
" ~! L7 e4 e  V  [  --with-mail - 启用 IMAP4/POP3/SMTP 代理模块2 C; Q0 K5 I* F& C2 M$ ~
  --with-mail_ssl_module - 启用 ngx_mail_ssl_module
: y4 o  q. g0 o) f# q: d  --with-cc=PATH - 指定 C 编译器的路径
0 T/ S3 |6 M3 _$ L  --with-cpp=PATH - 指定 C 预处理器的路径
: X0 W' O8 A( ]8 J+ i  --with-cc-opt=OPTIONS - Additional parameters which will be added to the variable CFLAGS. With the use of the system library PCRE in FreeBSD, it is necessary to indicate --with-cc-opt="-I /usr/local/include". If we are using select() and it is necessary to increase the number of file descriptors, then this also can be assigned here: --with-cc-opt="-D FD_SETSIZE=2048".7 D4 r0 L  ?! l3 x) j
  --with-ld-opt=OPTIONS - Additional parameters passed to the linker. With the use of the system library PCRE in FreeBSD, it is necessary to indicate --with-ld-opt="-L /usr/local/lib".
( c$ r( O6 Z/ E# i) t9 I+ |  --with-cpu-opt=CPU - 为特定的 CPU 编译,有效的值包括:pentium, pentiumpro, pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64, ppc64
- H+ e3 A+ z* Y! B* D1 l: j  --without-pcre - 禁止 PCRE 库的使用。同时也会禁止 HTTP rewrite 模块。在 "location" 配置指令中的正则表达式也需要 PCRE 。
8 S& J8 R/ \9 E7 Z+ p* a  --with-pcre=DIR - 指定 PCRE 库的源代码的路径。9 Q' X; F. i# p$ B2 H0 n
  --with-pcre-opt=OPTIONS - Set additional options for PCRE building.
; f8 j0 X  \( e. z+ \! y, m  --with-md5=DIR - Set path to md5 library sources.
# `  R. b5 O5 H3 V1 p! Q  --with-md5-opt=OPTIONS - Set additional options for md5 building.4 {6 `) O0 Y# ~' f" Q
  --with-md5-asm - Use md5 assembler sources.
8 D, a5 c5 z, n) J+ g. V" c4 u  --with-sha1=DIR - Set path to sha1 library sources.3 ?, A+ r$ M: L
  --with-sha1-opt=OPTIONS - Set additional options for sha1 building.: J4 H# t1 E$ S
  --with-sha1-asm - Use sha1 assembler sources.
+ p: V1 b( f, v  --with-zlib=DIR - Set path to zlib library sources.& i6 n, U( ]0 `- f
  --with-zlib-opt=OPTIONS - Set additional options for zlib building.
7 Q$ M+ k  I- R. A* }$ Z  --with-zlib-asm=CPU - Use zlib assembler sources optimized for specified CPU, valid values are: pentium, pentiumpro
* x  z' i% u& M6 R  --with-openssl=DIR - Set path to OpenSSL library sources
$ c, w4 r8 w0 e5 Q' ~0 B7 n! @" A( `  --with-openssl-opt=OPTIONS - Set additional options for OpenSSL building% E/ h! {9 b; P7 D: s* z
  --with-debug - 启用调试日志$ u* `% V" a( N6 [! W
  --add-module=PATH - Add in a third-party module found in directory PATH' W; S7 M; u& S9 M$ j
  在不同版本间,选项可能会有些许变化,请总是使用 ./configure --help 命令来检查一下当前的选项列表。
! C" o/ m! D5 Q' L$ I+ K示例 (最好能在同一行)9 P! }  N& T1 V, f' }
  ./configure \" S( d5 F& \$ p* m
  --sbin-path=/usr/local/nginx/nginx \
7 V0 ?1 ^1 W: o5 X$ A  --conf-path=/usr/local/nginx/nginx.conf \& @4 T" `7 }4 U
  --pid-path=/usr/local/nginx/nginx.pid \
/ a! n7 {) e9 d* h+ B( P  --with-http_ssl_module \
/ K0 t( K, I" z: r& J, B  --with-pcre=../pcre-4.4 \- S+ |1 ~. h: J& e' W& R& M1 K
  --with-zlib=../zlib-1.1.3
( `1 ]/ S  K9 h4 s/ V  Example on Ubuntu/debian with libgcrypt11-dev, libpcre3-dev and libssl-dev installed (choose EITHER --with-md5 OR --with-sha1, but not both; on debian and ubuntu, they should both point to /usr/lib)% [% {4 H4 f6 X* Q6 \" i
  ./configure --with-openssl=/usr/lib/ssl/ --with-md5=/usr/lib! D# T! V# s/ n. K; N% L
  An Ubuntu Edgy .deb for version 0.5.2 can be found here: nginx_0.5.2-1_i386.deb.6 I% G% Q' c, b0 x* ?0 o
  (NOTE: According to an October 2006 message md5 was used in a now broken http cache module and sha1 is used in an incomplete mysql library module and so are currently not needed.)
- |6 }- v, D" [' G
' C0 o, j& r5 M  ^/ e6 R. e; Z8 g' Z: O1 a/ m2 e  f
5 M" |4 c0 @9 h
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------2 e" T( \$ E* |4 `7 h1 A8 K

9 T0 s' a2 R1 P- y9 S4 JDrupal + Nginx + Fastcgi - setup and configuration- c$ g" c6 h- m' p
http://www.kirkdesigns.co.uk/drupal-nginx-fastcgi-setup-and-configuration5 O# M! |0 J7 b8 y5 p: _6 Q2 z
Running Drupal with Clean URL on Nginx or Lighttpd6 h4 C) J' E9 w4 n- t/ S
http://hostingfu.com/article/running-drupal-with-clean-url-on-nginx-or-l...
- `; f0 ]3 L/ b4 Q7 {Nginx, Fastcgi, PHP, rewrite config for Drupal
; q+ p3 t& ~1 P1 v( Jhttp://drupal.org/node/110224
( U; S! G$ c7 o6 F  ~/ S5 v3 s
  V4 D) f  s* M* K- l* z& x1 P( u# ~' C+ s4 A- N

! M( y! J" h! [& M9 m先发这些,有时间再贴!
" r6 P5 u. O& A& `3 V3 \! e) L; F! y7 g" b3 M7 F
# y$ c- K( f7 q. q7 I4 b

|2011-2026-版权声明|平台(网站)公约|DOOOOR 设计网 ( 吉ICP备2022003869号 )

GMT+8, 2-15-2025 22:02 , Processed in 0.428349 second(s), 27 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表