2011年11月27日 星期日

Unbuntu 11.04 nginx新增proxy_cache_purge

$apt-get update
$apt-get upgrade
$apt-get install nginx build-essential libpcre3-dev libssl-dev zlib1g-dev
$sudo nginx –V  可以查原始安裝路徑
$sudo nginx –v  可以查套件版本

$tar –xvf nginx-0.8.54.tar.gz
$tar –xvf ngx_cache_purge-1.4.tar.gz

$cd nginx-0.8.54
$./configure --prefix=/usr  --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module --add-module=../ngx_cache_purge-1.4

出現./configure: error: the HTTP XSLT module requires the libxml2/libxslt
libraries. You can either do not enable the module or install the libraries.

$dpkg –l | grep libxml2
ii  libxml2    2.7.8.dfsg-2ubuntu0.1   GNOME XML library
$sudo apt-cache search libxml2
libxml2-dev - Development files for the GNOME XML library
$sudo apt-get install libxml2-dev
$dpkg -l | grep libxslt
ii  libxslt1.1  1.1.26-6build1   XSLT 1.0 processing library - runtime library
$sudo apt-cache search libxslt
libxslt1-dev - XSLT 1.0 processing library - development kit
$sudo apt-get install libxslt1-dev

再次執行./configure,又出現錯誤
./configure: error: the HTTP image filter module requires the GD library.
You can either do not enable the module or install the libraries.
$dpkg -l | grep GD
ii  libgd2-xpm         2.0.36~rc1~dfsg-5ubuntu2    GD Graphics Library version 2
ii  libgdk-pixbuf2.0-0   2.23.3-0ubuntu1   GDK Pixbuf library
ii  libgdk-pixbuf2.0-dev 2.23.3-0ubuntu1   GDK Pixbuf library (development files)
ii  php5-gd    5.3.5-1ubuntu7.2   GD module for php5
$sudo apt-get install libgdchart-gd2-xpm-dev

再次執行./configure,又出現錯誤
./configure: error: the GeoIP module requires the GeoIP library.
You can either do not enable the module or install the library.

$ dpkg -l | grep GeoIP
ii  geoip-database  1.4.7~beta6+dfsg-1  IP lookup command line tools that use the GeoIP library (country database)
$sudo apt-cache search Geoip
libgeoip-dev - Development files for the GeoIP library
$sudo apt-get install libgeoip-dev
再次執行./configure,不會再出現錯誤後,即可執行打包了
$make
將原本在/etc/nginx/nginx.conf/etc/nginx/site- available/default做備份,備份到家目錄底下。
完成後,即執行make install
$make install


 參考資料來源:
http://blog.sina.com.cn/s/blog_474cf12b0100g278.html

沒有留言:

張貼留言