Posts Tagged ‘nginx’

Installing Nginx-GridFS on OSX

Wednesday, October 7th, 2009

Follow these steps to install ’s on OSX. Linux coming soon.

cd ~/src # your sources directory
mkdir nginx_gridfs && cd nginx_gridfs
git clone git://github.com/mdirolf/nginx-gridfs.git  
wget http://sysoev.ru/nginx/nginx-0.7.62.tar.gz
tar -zxvf nginx-0.7.62.tar.gz
 
sudo port install boost pcre++ spidermonkey scons # macports!
 
cd nginx-0.7.62/
 
# i put mongodb at /mongodb - alter to fit your installation
export MONGO_INCLUDE_PATH=/mongodb/include/mongo/ 
export LIBMONGOCLIENT=/mongodb/lib/libmongoclient.a
export BOOST_INCLUDE_PATH=/opt/local/include/
export LIBBOOST_THREAD=/opt/local/lib/libboost_thread-mt.a
export LIBBOOST_FILESYSTEM=/opt/local/lib/libboost_filesystem-mt.a 
export LIBBOOST_SYSTEM=/opt/local/lib/libboost_system-mt.a 
 
./configure --add-module=/Users/sho/src/nginx_gridfs/nginx-gridfs
make
sudo make install

In nginx.conf:

server {
    listen       80;
    server_name  localhost;
 
    location / {
        root   html;
        index  index.html index.htm;
    }
 
    location /gridfs/ {
        gridfs;
        gridfs_db database-name;
 
        # these are the default values:
        mongod_host 127.0.0.1:27017;
        gridfs_root_collection fs;
    }
 
    # blah
 
}

You should now be able to start nginx using /usr/local/nginx/sbin/nginx and navigate to 127.0.0.1/gridfs/#{file_name}.

Installing nginx on RHEL4 x86_64

Thursday, October 11th, 2007

Want to use the new kid on the block, nginx, as a server on your old RHEL4 server? Well, guess what, it’s now available in EPEL so it’s incredibly easy.

First add EPEL as a repository on your system. They provide a package to do that:

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm

now install nginx. You’ll need to specify the testing repo. I use yum but the same thing will work with up2date

yum install nginx --enablerepo=epel-testing

Done. Now go edit /etc/nginx/nginx.conf to use an IP or port that doesn’t conflict with anything, and:

service nginx start

UPDATE: Updated EPEL RPM link with new version.