安装pcre-devel
sudo apt-get install libpcre3 libpcre3-dev
sudo apt-get install openssl libssl-dev
html
安装nginx-gridfs
git clone git://github.com/mdirolf/nginx-gridfs.git
cd nginx-gridfs/
git submodule init nginx
git submodule update git
cd /data/soft/nginx-1.6.2 (此处为下载好的nginx源码目录)github
./configure --add-module=/data/soft/nginx-gridfs (此处为上面git下载的gridfs的目录)mongodb
make
make installide
修改nginx的conf文件spa
server { orm
listen 80; server
server_name s1.111du.com; htm
//全部请求都映射到mongodb的服务中
location / {
//经过field=filename来作数据查询
gridfs imark field=filename type=string;
//mongodb的服务
mongo 127.0.0.1:30001;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /WEB-INF/ {
deny all;
}
}