Installing nginx 0.8.54 on Mac OS X 10.6.6 Snow LeopardEdit

Created , updated

Note: these notes show the use gpg which is not a standard part of Mac OS X. See "Installing GnuPG 1.4.11 on Mac OS X 10.6.6 Snow Leopard" for details.

PCRE

PCRE is a prerequisite of nginx so must be installed first:

$ curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.12.tar.gz \
       -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.12.tar.gz.sig 
$ gpg --verify pcre-8.12.tar.gz.sig 
$ tar xzvf pcre-8.12.tar.gz 
$ cd pcre-8.12
$ ./configure 
$ make
$ make check
$ sudo make install
$ cd ..

nginx and the nginx upload module

$ curl -O http://nginx.org/download/nginx-0.8.54.tar.gz \
       -O http://nginx.org/download/nginx-0.8.54.tar.gz.asc
$ gpg --verify nginx-0.8.54.tar.gz.asc 
$ tar xzvf nginx-0.8.54.tar.gz 
$ curl -L https://github.com/vkholodkov/nginx-upload-module/tarball/2.2.0 -o nginx_upload_module-2.2.0.tar.gz
$ tar xzvf nginx_upload_module-2.2.0.tar.gz 
$ cd nginx-0.8.54
$ ./configure --prefix=/usr/local/nginx --with-http_ssl_module --add-module=../vkholodkov-nginx-upload-module-2ec4e4f
$ make
$ sudo make install

As this version of nginx will be running as an unprivileged user, I need to set up some directories with appropriate ACLs first:

$ cd /usr/local/nginx
$ sudo mkdir scgi_temp uwsgi_temp
$ sudo chmod +a 'wincent:allow add_file,delete_child' scgi_temp
$ sudo chmod +a 'wincent:allow add_file,delete_child' uwsgi_temp
$ sudo chmod +a 'wincent:allow add_file,delete_child' logs

This will allow the nginx process running as the unprivileged user to create files in this subdirectories and also delete them. The created files will be owned by the unprivileged user, which is fine as I am only doing development on this machine as a single user.