Question about installation via "yum install ngix" and optional modules

Events happening in the community are now at Drupal community events on www.drupal.org.
superfedya's picture

Hi,

I just installed nginx via yum install nginx (Cent OS 6). But how can I enable optional modules? Like: --with-http_realip_module or --with-http_image_filter_module?

Thanks!

Comments

Recompile

attiks's picture

AFAIK the only way is to do it at compile time, so you have to recompile nginx with the optional modules you want.

FWIW - you can see what it

rellimevad's picture

FWIW - you can see what it was compiled with by 'nginx -V'.

Thanks. nginx -V helped my a

superfedya's picture

Thanks. nginx -V helped my a lot.

Simular issue

janton's picture

I want to add two modules to my nginx in CentOS 5:
https://github.com/gnosek/nginx-upstream-fair
http://wiki.nginx.org/HttpUploadProgressModule

I previously installed nginx very simple with YUM like this:

Create the file named /etc/yum.repos.d/nginx.repo with the following contents:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/5/$basearch/
gpgcheck=0
enabled=1

yum install nginx

But now I want to add these modules, i'm still new with linux.. so should I first delete the old nginx?

nginx -v

copy all code to a text editor or something, this was how my nginx was build:
--prefix=/etc/nginx/ --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --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_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 --with-cc-opt='-O2 -g -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables'

When I remove with Yum remove nginx do I lose my nginx settings in /etc/nginx (ofcourse i will backup that directory before I run remove but always good to ask?)

yum remove nginx

and then download the gid:
git clone https://github.com/gnosek/nginx-upstream-fair.git
git clone https://github.com/masterzen/nginx-upload-progress-module.git

and then reinstall nginx with:

wget http://nginx.org/download/nginx-1.2.0.tar.gz
tar -zxvf nginx-1.2.0.tar.gz
cd nginx-1.2.0

./configure --prefix=/etc/nginx/ --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --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_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 --with-cc-opt='-O2 -g -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables'--add-module=/nginx-upstream-fair --add-module=/nginx-upload-progress-module

make

make install

Am I forgetting something?

Yes - you should remove the

rellimevad's picture

Yes - you should remove the package first. You shouldn't lose your /etc/nginx directory. Yum, and apt for that matter, is good about not trampling anything. Yum, for example, will save existing config files as .rpmsave.

I believe you'll need to copy the modules into the nginx source directory to compile. I've only installed via a Chef recipe, but I needed to.

Good luck.

Debian solution

jasmineah's picture

I know @superfedya asked about installing extra modules on centos and not debian but thought i would share how i installed the modules on debian squeeze, as this might help a debian user reading this post.

I added the dot deb repos to my sources.list. Having done that i updated the system (aptitude update) and I installed nginx with additional modules using this command- aptitude install nginx-extras. This installed all the modules i wanted to install.

Hope this helps someone.

Nginx

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: