INSTALLING NGXINX FROM SOURCE ON OS X 10.5 Leopard
March 18, 2009
This is a re-deux of an earlier article I wrote on how to install nginx on os x via macports. It has been a while since I got my hands dirty with server installs and configuration so I thought why not do an update to the latest version of nginx while learning how to install it from source?
These are the steps I took:
Install nginx
sudo mkdir nginx_source
sudo curl -O http://sysoev.ru/nginx/nginx-0.6.35.tar.gz
sudo tar xvzf nginx-0.6.35.tar.gz
cd nginx-0.6.3.5
sudo ./configure --add-module=../nginx_uploadprogress_module/ --prefix=/usr/local --with-http_ssl_mmodule
sudo make
sudo make install
Once the above is successful, you should be able to type which nginx on your terminal and it should show up as ‘/usr/local/sbin/nginx’. If not you need to add /usr/local/sbin to your environment path.
To start it just type sudo nginx. The install will put a default config file in /usr/local/conf/nginx.conf and a html file in /usr/local/html. Type http://localhost into the browser and it should show the welcome page if all the paths are correct.
Note that I added the ‘add-module’ option in the configure step. This is to load any third party external modules into the compilation process. The module is the upload progress module which tracks and provides real-time feedback of your file uploads on the server side. I can verify it works as advertised.
To add additional modules simply chain the add module commands like so:
sudo ./configure --add-module=/path/to/first module --add-module=/path/to/second module There are plenty of configuration and installation instructions on http://wiki.nginx.org/
Check back for part two of this series where I will discuss and show how to use external modules such as the uploadprogressmodule and configuration files and how they work.