Ngx_http_accesskey_module error

I follow http://wiki.codemongers.com/NginxHttpAccessKeyModule#accesskey
to install the ngx_http_accesskey_module,but get an error:

2008/10/15 22:48:56 [emerg] 31870#0: unknown directive “accesskey” in
/usr/local/nginx/conf/nginx.conf71

What’s the problem?

On Wed, Oct 15, 2008 at 10:33:03PM +0800, lhmwzy wrote:

I follow http://wiki.codemongers.com/NginxHttpAccessKeyModule#accesskey
to install the ngx_http_accesskey_module,but get an error:

2008/10/15 22:48:56 [emerg] 31870#0: unknown directive “accesskey” in
/usr/local/nginx/conf/nginx.conf71

What’s the problem?

You’re not running a binary with accesskey compiled in.
Have you recompiled Nginx after configuring the module?
Installed the newly compiled version?
Restarted/upgraded the binary?

Best regards,
Grzegorz N.

I download the file nginx-accesskey-2.0.3.tar.gz and untar and put it
in $nginxsrchome/src/addons
then run:
1…/configure --user=www --group=www --prefix=/usr/local/nginx
–with-http_stub_status_module --with-http_ssl_module --with-md5=/usr
–with-http_gzip_static_module --with-http_realip_module
–with-poll_module --add-module=src/addons/nginx-accesskey-2.0.3/
2.make
3.make install
4.kill the old nginx pid and run the new nginx

Any thing is wrong?

2008/10/15 Grzegorz N. [email protected]:

Use the full path
./configure --user=www --group=www --prefix=/usr/local/nginx
–with-http_stub_status_module --with-http_ssl_module --with-md5=/usr
–with-http_gzip_static_module --with-http_realip_module
–with-poll_module
–add-module=/root/src/nginx-0.7.18/src/addons/nginx-accesskey-2.0.3/

strings objs/nginx | grep accesskey_signature outputs:
accesskey_signature

But the error is the same:
2008/10/16 00:11:58 [emerg] 7566#0: unknown directive “accesskey” in
/usr/local/nginx/conf/nginx.conf:70

2008/10/15 Grzegorz N. [email protected]:

On Wed, Oct 15, 2008 at 10:47:24PM +0800, lhmwzy wrote:

Any thing is wrong?

Looks OK to me, but there was a thread some time ago about Nginx not
liking relative paths to addon modules (IIRC), so you might try using
the full path, e.g. --add-module=$PWD/src/addons/nginx-accesskey-2.0.3/

Save the output of configure somewhere, do you see a message about
configuring the accesskey module?

Just in case, does the following command output anything (while you are
in the Nginx source directory where you compiled it)?

strings objs/nginx | grep accesskey_signature

Best regards,
Grzegorz N.

On śro, paź 15, 2008 at 11:54:16 +0800, lhmwzy wrote:

But the error is the same:
2008/10/16 00:11:58 [emerg] 7566#0: unknown directive “accesskey” in
/usr/local/nginx/conf/nginx.conf:70

So it looks like the binary is compiled with the module.

Make sure you ran make install successfully (you may need root
privileges), compare the binaries (objs/nginx and
/wherever/you/installed/nginx) using e.g. md5sum and if they match,
restart Nginx. Make sure the pid changed :slight_smile:

Best regards,
Grzegorz N.

All you said is right.But nginx can not do the job well.

2008/10/16 Grzegorz N. [email protected]:

I ran into the same issue with nginx-0.7.24 and accesskey-2.0.3. Found a
Russian post and the solution is modify the “config” file of accesskey
as following:

-HTTP_MODULES=“$HTTP_MODULES $HTTP_ACCESSKEY_MODULE”
+HTTP_MODULES=“$HTTP_MODULES ngx_http_accesskey_module”

refer: Lexa Software: [email protected] archive