Newbie help - unknown directive memc_pass

I’m a newbie to unix and nginx so please be gentle :slight_smile: I’m starting to
pull
my hair out a bit now so figured I’d ask for some pointers.

Im trying to build a nginx version which includes memc functionality but
I
can’t for the life of me figure out what I’m missing as memc_pass is
always
reported as an unknown directive in my error log.

I’ve tried compiling on v1.4.4 with the following configure string

./configure
–prefix=/usr/local/nginx
–sbin-path=/usr/local/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=/run/nginx.pid
–lock-path=/run/lock/subsys/nginx
–user=nginx --group=nginx
–with-file-aio
–with-ipv6
–with-pcre
–with-debug
–with-http_ssl_module
–with-http_spdy_module
–with-http_realip_module
–with-http_addition_module
–with-http_xslt_module
–with-http_image_filter_module
–with-http_geoip_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_degradation_module
–with-http_stub_status_module
–with-http_perl_module
–with-mail
–with-mail_ssl_module
–with-google_perftools_module
–add-module=…/ngx_openresty-1.5.8.1/bundle/srcache-nginx-module-0.25
–add-module=…/ngx_openresty-1.5.8.1/bundle/memc-nginx-module-0.14
–add-module=…/ngx_openresty-1.5.8.1/bundle/ngx_devel_kit-0.2.19
–add-module=…/ngx_openresty-1.5.8.1/bundle/echo-nginx-module-0.51
–add-module=…/ngx_openresty-1.5.8.1/bundle/set-misc-nginx-module-0.24

I see the following reported in the compile stage

adding module in
…/ngx_openresty-1.5.8.1/bundle/srcache-nginx-module-0.25

  • ngx_http_srcache_filter_module was configured
    adding module in …/ngx_openresty-1.5.8.1/bundle/memc-nginx-module-0.14
  • ngx_http_memc_module was configured
    adding module in …/ngx_openresty-1.5.8.1/bundle/ngx_devel_kit-0.2.19
  • ngx_devel_kit was configured
    adding module in …/ngx_openresty-1.5.8.1/bundle/echo-nginx-module-0.51
  • ngx_http_echo_module was configured
    adding module in
    …/ngx_openresty-1.5.8.1/bundle/set-misc-nginx-module-0.24
    found ngx_devel_kit for ngx_set_misc; looks good.
  • ngx_http_set_misc_module was configured

but still get the error when trying to restart nginx.

2014/02/23 17:20:59 [emerg] 31056#0: unknown directive “memc_pass” in
/etc/nginx/sites-enabled/irj972.co.uk:55

here’s the nginx -V which illustrates the memo lib is compiled in ok.

nginx version: nginx/1.4.4
built by gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx
–sbin-path=/usr/local/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=/run/nginx.pid
–lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx
–with-file-aio --with-ipv6 --with-pcre --with-debug
–with-http_ssl_module
–with-http_spdy_module --with-http_realip_module
–with-http_addition_module --with-http_xslt_module
–with-http_image_filter_module --with-http_geoip_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_degradation_module
–with-http_stub_status_module --with-http_perl_module --with-mail
–with-mail_ssl_module --with-google_perftools_module
–add-module=…/ngx_openresty-1.5.8.1/bundle/srcache-nginx-module-0.25
–add-module=…/ngx_openresty-1.5.8.1/bundle/memc-nginx-module-0.14
–add-module=…/ngx_openresty-1.5.8.1/bundle/ngx_devel_kit-0.2.19
–add-module=…/ngx_openresty-1.5.8.1/bundle/echo-nginx-module-0.51
–add-module=…/ngx_openresty-1.5.8.1/bundle/set-misc-nginx-module-0.24

and also tried compiling the openresty build but identical results -
still
no known directive for memc_pass.

think Ive gone blind trying to read all the manuals, guides & blogs on
line
but still no joy of understanding what Im doing wrong.

thx in adv for any help,
Ian

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,247877,247877#msg-247877

Hello!

On Sun, Feb 23, 2014 at 9:40 AM, vikingboy wrote:

but still get the error when trying to restart nginx.

2014/02/23 17:20:59 [emerg] 31056#0: unknown directive “memc_pass” in
/etc/nginx/sites-enabled/irj972.co.uk:55

One common cause is that your nginx startup script invokes a different
nginx in another path which does not include the ngx_memc module.

Try starting your new nginx with its absolute path directly, that is,

/path/to/your/new/nginx/sbin/nginx -c /path/to/nginx.conf -p

/path/to/your/prefix/

and also tried compiling the openresty build but identical results - still
no known directive for memc_pass.

The ngx_openresty bundle installs nginx into
/usr/local/openresty/nginx/ by default, so ensure your startup script
start the nginx in the right path, that is,

/usr/local/openresty/nginx/sbin/nginx

See the following sample for more details:

http://openresty.org/#GettingStarted

Regards,
-agentzh

it does look like there are some fundamental config issues causing
problems.
After I posted I spun up a clean VPS and installed openresty with memc
support in about 15 minutes so can confirm my problem its somehow
related to
updating my primary machine setup.
Thanks for your pointers and info, your documentation and contribution
to
nginx is awesome Agentzh.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,247877,247880#msg-247880

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs