---
title: "nginx的编译选项"
author: "tedeyang"
date: "2012-04-25T17:30:29Z"
tags: ["nginx"]
categories: ["开源软件"]
slug: "nginx"
draft: false
lastmod: "2012-04-25T17:31:51Z"
id: 1498228
url: "https://hitery.iteye.com/blog/1498228"
---

下载nginx源码包，编译命令之一：

```
./configure
--prefix=/usr/local/nginx
 --conf-path=/usr/local/webserver/nginx/nginx_tomcat.conf
 --pid-path=/usr/local/webserver/nginx/nginx.pid
 --error-log-path=/var/log/nginx/error.log
 --http-log-path=/var/log/nginx/access.log 
 --user=apache
 --group=apache
 --with-http_stub_status_module
 --with-http_ssl_module
 --with-http_gzip_static_module
 --with-http_flv_module
 --with-cc-opt="-I /usr/include/pcre"
```

或者用pcre的源码来编译。

\--------------------------------------------------------

```
./configure \
--prefix=/usr/local/nginx \
--conf-path=/usr/local/webserver/nginx/nginx.conf \
--pid-path=/usr/local/webserver/nginx/nginx.pid \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log  \
--user=nginx \
--group=nginx \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_gzip_static_module \
--with-http_flv_module \
--with-pcre=/usr/local/webserver/source/pcre \  
--with-openssl=/usr/local/webserver/source/openssl \
--with-http_ssl_module \
--with-zlib=/usr/local/webserver/source/zlib
```