wiki:InstallExample

How to install from Git

Here's how a typical installation would go. We will assume that you are going to keep the sources under ~/src.

Getting the sources…

...from Git

cd ~/src
git clone git://openhack.ru/nginx-patched.git

This will create a directory nginx-patched.

cd nginx-patched
git branch -a

The last command will show all available branches. If you want to install from the branch other than the current (marked with asterisk (*)), you have to create a local branch for it, and switch into it. For instance,

git branch memcached_hash origin/memcached_hash
git checkout memcached_hash

will create a local branch memcached_hash for remote branch origin/memcached_hash, and switch to it. You would be using only the second command if the branch has been created already. See description of all branches on nginx-patched.

...from snapshot

Follow the selected snapshot link on nginx-patched page. Then do

cd ~/src
tar -xvzf /path/to/downloaded/nginx-patched-<branch>.tgz
cd nginx-patched

where <branch> is the name of the chosen branch.

Installation

Now you have to configure nginx. If you already have it installed, you probably want to use the same options that you have used before. To learn them, type

/path/to/old/nginx -V

The output will look like this:

nginx version: nginx/0.5.35
built by gcc 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)
configure arguments: --with-http_ssl_module

(note the configure arguments: line).

Now you do

cd server
./configure <old_options> --add-module=../memcached_hash/

--add-module adds the named module to the build. In the example above we add memcached_hash, which is available on master (or memcached_hash) branch. ../memcached_hash is a path to it.

Note that configure script has lots of other options, try ./configure --help.

Finally, you do

make
make install

Don't forget to restart the server after installing it.