您的位置:首页 > 运维架构 > Nginx

Mac下安装nginx

2011-08-04 23:10 441 查看
Mac下安装nginx

Installing GnuPG 1.4.11 on Mac OS X 10.6.6 Snow Leopard

Another day, another GPG install. Different machine, and slightly different versions of Mac OS X and GPG.

Unlike other times, I found I didn't need to pass the --disable-asm flag to ./configure (see "Installing GnuPG on Mac OS X 10.6 Snow Leopard" for a counter-example).

$ curl -O ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.11.tar.bz2 \

-O ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.11.tar.bz2.sig

$ openssl sha1 gnupg-1.4.11.tar.bz2 # 78e22f5cca88514ee71034aafff539c33f3c6676

$ tar xjvf gnupg-1.4.11.tar.bz2

$ cd gnupg-1.4.11

$ ./configure

$ make && make check

$ sudo make install

$ cd ..

$ gpg --verify gnupg-1.4.11.tar.bz2.sig

$ gpg --recv-keys 1CE0C630 # only needed the first time

$ gpg --verify gnupg-1.4.11.tar.bz2.sig

===============================================

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.

还有一片中文的可以参考。虽然是再ubuntu下的。
http://www.ligaofeng.com/?p=1107
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: