Debain7 编译安装 Nginx

Debain7 编译安装 Nginx

Debain 编译安装 Nginx  和 CentOS 下编译 Nginx 没什么差别 , 重点在于与之依赖的包  名称在两个系统中不同

已下述 参数为例 :

root@zhongzuzhu:/usr/local/src/nginx-1.8.0# ./configure –prefix=/usr/local/nginx –with-http_ssl_module –with-http_gzip_static_module –with-http_stub_status_module –with-http_realip_module –add-module=/usr/local/src/ngx_cache_purge-2.3 –with-pcre=/usr/local/pcre-8.37 –with-http_image_filter_module –with-http_dav_module –with-http_flv_module –with-http_random_index_module –with-http_secure_link_module –with-mail –with-mail_ssl_module –with-file-aio –with-ipv6  –with-http_v2_module –with-http_gunzip_module –with-http_auth_request_module  –with-http_geoip_module
添加的模块ngx_cache_purge-2.3 pcre-8.37不谈那是自己下载的和编译的 。编译过程中  出现 :

在configure时可能会报一些错误,简列如下

1. rewrite需要pcre支持
./configure: error: the HTTP rewrite module requires the PCRE library.

apt-get install libpcre3 libpcre3-dev

2. http cache需要openssl
./configure: error: the HTTP cache module requires md5 functions from OpenSSL library.

apt-get install libssl-dev openssl

3. 安装libxslt
./configure: error: the HTTP XSLT module requires the libxml2/libxslt libraries.

apt-get install libxslt-dev

4. 缺少GD library
./configure: error: the HTTP image filter module requires the GD library.

apt-get install libgd2-xpm libgd2-xpm-dev

5. 安装GeoIP library
./configure: error: the GeoIP module requires the GeoIP library.

apt-get install libgeoip-dev

发表回复

*您的电子邮件地址不会被公开。必填项已标记为 。

*
*