aperezdc/ngx-fancyindex

Unclear CentOS7 Instructions

geoghegan opened this issue · 1 comments

The installation instructions for installing on CentOS7 are very unclear.

I installed the official nginx package from the Nginx repo per these instructions

yum --showduplicates list nginx | expand
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.coreix.net
 * epel: mirrors.coreix.net
 * extras: mirrors.coreix.net
 * updates: mirrors.coreix.net
Installed Packages
nginx.x86_64            1:1.12.0-1.el7.ngx            @nginx
Available Packages
nginx.x86_64            1:1.8.0-1.el7.ngx             nginx
nginx.x86_64            1:1.8.1-1.el7.ngx             nginx
nginx.x86_64            1:1.10.0-1.el7.ngx            nginx
nginx.x86_64            1:1.10.1-1.el7.ngx            nginx
nginx.x86_64            1:1.10.2-1.el7                epel
nginx.x86_64            1:1.10.2-1.el7.ngx            nginx
nginx.x86_64            1:1.10.3-1.el7.ngx            getpagespeed-extras-x86_64
nginx.x86_64            1:1.10.3-1.el7.ngx            nginx
nginx.x86_64            1:1.12.0-1.el7.ngx            nginx

And the nginx-module-fancyindex package from the getpagespeedextras repo

yum --showduplicates list nginx-module-fancyindex | expand
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.coreix.net
 * epel: mirrors.coreix.net
 * extras: mirrors.coreix.net
 * updates: mirrors.coreix.net
Installed Packages
nginx-module-fancyindex.x86_64 1:1.12.0.0.4.1-1.el7.gps @getpagespeed-extras-x86_64
Available Packages
nginx-module-fancyindex.x86_64 1:1.12.0.0.4.1-1.el7.gps getpagespeed-extras-x86_64

The module is installed on the filesystem.

ls -lah /etc/nginx/modules/
total 344K
drwxr-xr-x. 2 root root 4.0K Jun 15 18:09 .
drwxr-xr-x. 3 root root 4.0K Apr 12 15:23 ..
-rwxr-xr-x. 1 root root  29K Apr 16 22:32 ngx_http_fancyindex_module-debug.so
-rwxr-xr-x. 1 root root  25K Apr 16 22:32 ngx_http_fancyindex_module.so
-rwxr-xr-x. 1 root root  21K Oct 31  2016 ngx_http_geoip_module.so
-rwxr-xr-x. 1 root root  24K Oct 31  2016 ngx_http_image_filter_module.so
-rwxr-xr-x. 1 root root  24K Oct 31  2016 ngx_http_perl_module.so
-rwxr-xr-x. 1 root root  24K Oct 31  2016 ngx_http_xslt_filter_module.so
-rwxr-xr-x. 1 root root  99K Oct 31  2016 ngx_mail_module.so
-rwxr-xr-x. 1 root root  79K Oct 31  2016 ngx_stream_module.so

However it is not complied into the nginx binary as one would assume given the instructions given on README.md

nginx -V
nginx version: nginx/1.12.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --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-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

So the question is, what steps am I missing here in order to get fancyindex working?

The fix for this is to add the following to the top of /etc/nginx/nginx.conf

load_module "modules/ngx_http_fancyindex_module.so";