Tips / Nginx

How to install Nginx from source

Installing nginx from source using Fedora, CentOS or RHEL is pretty easy, you just have to download the sources file from and follow this simple steps.

Download latest stable file from website. At the time I write this, the latest stable version is 1.4.1 and that’s the one we will use for this tutorial.

cd /usr/src


tar -xvpzf nginx-1.4.1.tar.gz
cd nginx-1.4.1

Configure and install nginx

make install

Note: for Ubuntu/Debian, you may add “sudo” before make install command:

sudo make install

This are very useful modules you should add to your ./configure command, this is the way you can compile nginx with all this modules:

./configure --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6

How do I start nginx?

Check out this posts: Nginx Init Script for CentOS/RHEL and the Nginx Init Script for Ubuntu/Debian‎

Popular search terms:

  • updating nginx from source rhel

Esteban Borges

Linux Geek, Webperf Addict, Nginx Fan. CTO @Infranetworking