nginx增加nginx_concat_module

由于需要减少http请求数,所以要在nginx上增加一个模块,叫nginx_concat_moduel.这个模块是tb的开源项目.可以去code.taobao.org上搜索.

之前的nginx是在ubuntu下用 apt-get install nginx命令安装的,我不知道如何增加模块,因为找不到源代码文件.

所以只能删除掉,apt-get remove nginx-full nginx-common . 然后从官网上down下源码,从源码安装nginx.

我的安装命令如下:

--prefix=/etc/nginx --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_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 --with-pcre=/root/pcre --with-openssl=/root/openssl-1.0.0l --with-zlib=/root/zlib-1.2.8 --add-module=/root/nginx_concat_module 


//geoip  gdlibrary
//geoip的安装 http://www.mike.org.cn/articles/ubuntu-install-geoip/

//PCRE的安装

sudo apt-get update
sudo apt-get install libpcre3 libpcre3-dev


//GeoIP安装
http://www.mytechlogy.com/professionals/questions/forum-details/807/how-to-install-geoip-in-ubuntu-server/#.UxnwIfS1Zpc
Please try the simple 4 steps:
We installed the package using below 4 steps.
1.First, make a temporary directory to download the GeoLite City database.
mkdir /tmp/geoip
Now move into the directory that you just created.
cd /tmp/geoip
Now, that you're in the /tmp/geoip directory, go ahead and download the GeoLite City binary database from MaxMind.
wget geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat
You'll notice that the database is gzip compressed, so you'll have to uncompress the database before you can use it.
gunzip GeoLiteCity.dat.gz
Now, it's time to copy the uncompressed database to the location where it will be accessed by the mod-geoip Apache module and also by the C API binary.
First create the GeoIP directory
sudo mkdir /usr/local/share/GeoIP
Now, move the GeoLite City binary database to it's new location.
sudo mv GeoLiteCity.dat /usr/local/share/GeoIP/
2. Install the GeoIP C Library
NOw you need to install the GeoIP C library. Nothing's going to work unless you have this library installed.
Here's all you have to do.
If you're not already there, go back to the directory you created earlier in the /tmp directory.
cd /tmp/geoip
Now download the GeoIP C library.
wget geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz
Extract the archived GeoIP C library that you just downloaded.
gunzip < GeoIP.tar.gz | tar xvf -
Now move to the new directory that was created when you extracted the archived GeoIP C library.
cd GeoIP-*
Now, configure and install the GeoIP C library by issuing the following commands.
./configure
make
make check
sudo make install
3. Install the MaxMind mod-geoip module for Apache2
Install the Apache module for Ubuntu
Installing the mod-geoip module on Ubuntu Linux (and probably other Debian variants) is done easily with the following command.
sudo apt-get install libapache2-mod-geoip2.1.2
(Keep in mind though, that when a newer version of mod-geoip is released, the proper version number will need to replace the 2.1.2 version in the above example. Also, the install command might work by removing the version number from the package. However, the following is what I used at the time of this writing to install mod-geoip.)
Enabling mod-geoip
Nothing's going to work unless mod-geoip is enabled in your apache2 configuration. You'll need the following lines in your apache2.conf file (located on Ubuntu systems at /etc/apache2/apache2.conf)

nginx_concat_module的配置很简单.


location /js/  {

 concat on;

这样即可.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值