预装gcc gcc++,openssl
yum install -y httpd-devel pcre perl pcre-devel zlib zlib-devel GeoIP GeoIP-devel
一,pcre编译安装
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
./configure --prefix=/usr/local/nginx/pcre-8.36 --libdir=/usr/local/lib/pcre --includedir=/usr/local/include/pcre
make
make install
二,nginx-gridfs源码下载 安装nginx-gridfs和mongodb-mongo-c-driver 用git下载nginx-gridfs的代码(这个地址里两个包都带了):
git clone git://github.com/mdirolf/nginx-gridfs.git
cd nginx-gridfs
git submodule init
git submodule update
三,nginx源码下载编译安装
./configure --prefix=/usr/local/nginx --with-pcre=../pcre-8.36 --with-http_ssl_module --with-http_stub_status_module --with-http_flv_module --with-http_gzip_static_module --add-module=../nginx-gridfs --with-poll_module --without-select_module --with-http_realip_module --with-cc-opt=-Wno-error
make
make install
四,配置nginx.conf
五,配置mongodb
mkdir data
touch logs
#无认证启动mongo
./mongod -dbpath=/usr/local/mongodb/data -logpath=/usr/local/mongodb/logs -logappend
#认证启动mongo
./mongod -dbpath=/usr/local/mongodb/data -logpath=/usr/local/mongodb/logs -logappend -auth