Welcome! Log In Create A New Profile

Advanced

Re: building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core)

All files from this thread

File Name File Size   Posted by Date  
nginxpurge.conf 6 KB open | download kaushalshriyan 05/08/2022 Read message
nginxpurgecache.conf 6 KB open | download kaushalshriyan 05/08/2022 Read message
May 07, 2022 11:16PM
Hi Sergey,

I followed
https://www.nginx.com/blog/compiling-dynamic-modules-nginx-plus/#load_module
to generate the third party dynamic module

Nginx Version :- nginx version: nginx/1.20.1
OS Version :- CentOS Linux release 7.9.2009 (Core)

cd /home/kaushal/ngx-cache-purge/
# ls -l
total 64
-rw-r--r-- 1 root root 728 May 8 02:48 config
-rw-r--r-- 1 root root 51501 May 8 02:48 ngx_cache_purge_module.c
-rw-r--r-- 1 root root 5090 May 8 02:48 README.md
# cat config
if [ "$HTTP_PROXY" = "YES" ]; then
have=NGX_HTTP_PROXY . auto/have
fi

if [ "$HTTP_FASTCGI" = "YES" ]; then
have=NGX_HTTP_FASTCGI . auto/have
fi

if [ "$HTTP_SCGI" = "YES" ]; then
have=NGX_HTTP_SCGI . auto/have
fi

if [ "$HTTP_UWSGI" = "YES" ]; then
have=NGX_HTTP_UWSGI . auto/have
fi

if test -n "$ngx_module_link"; then
ngx_module_type=HTTP
ngx_module_name=ngx_http_cache_purge_module
ngx_module_srcs="$ngx_addon_dir/ngx_cache_purge_module.c"

have=NGX_CACHE_PURGE_MODULE . auto/have

. auto/module
else
HTTP_MODULES="$HTTP_MODULES ngx_http_cache_purge_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_cache_purge_module.c"

have=NGX_CACHE_PURGE_MODULE . auto/have
fi
#

#wget http://nginx.org/download/nginx-1.20.2.tar.gz
#tar zxvf nginx-1.20.2.tar.gz
#cd /home/kaushal/nginx-1.20.2/
#./configure --with-compat --add-dynamic-module=../ngx-cache-purge

#cat /usr/share/nginx/modules/ngx-http-cache-purge-module.conf
load_module "/usr/lib64/nginx/modules/ngx_http_cache_purge_module.so";

#cat /etc/nginx/nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

#nginx -t -c /etc/nginx/nginx.conf
nginx: [emerg] module
"/usr/lib64/nginx/modules/ngx_http_cache_purge_module.so" version 1020002
instead of 1020001 in
/usr/share/nginx/modules/ngx-http-cache-purge-module.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

Please correct and guide me if I am missing something. Thanks in advance.

Best Regards,

Kaushal

On Sat, May 7, 2022 at 7:32 PM Sergey A. Osokin <osa@freebsd.org.ru> wrote:

> Hi Kaushal,
>
> On Sat, May 07, 2022 at 06:31:59PM +0530, Kaushal Shriyan wrote:
> >
> > #gcc -o ngx_cache_purge_module ngx_cache_purge_module.c
> > ngx_cache_purge_module.c:30:19: fatal error: nginx.h: No such file or
> > directory
> > #include <nginx.h>
> > ^
> > compilation terminated.
>
> I'd recommend to follow this [1] blog post to create a dynamic module
> for nginx.
>
> References:
> 1. https://www.nginx.com/blog/compiling-dynamic-modules-nginx-plus/
>
> --
> Sergey A. Osokin
> _______________________________________________
> nginx mailing list -- nginx@nginx.org
> To unsubscribe send an email to nginx-leave@nginx.org
>
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core)

kaushalshriyan May 07, 2022 09:06AM

Re: building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core)

Sergey A. Osokin May 07, 2022 10:04AM

Re: building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core)

kaushalshriyan May 07, 2022 11:16PM

Re: building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core) Attachments

kaushalshriyan May 08, 2022 01:04AM

Re: building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core)

kaushalshriyan May 08, 2022 02:14AM

Re: building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core)

kaushalshriyan May 08, 2022 04:14AM

Re: building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core) Attachments

kaushalshriyan May 08, 2022 06:26AM

Re: building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core)

kaushalshriyan May 08, 2022 08:36AM

Re: building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core)

Sergey A. Osokin May 08, 2022 04:36PM

Re: building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core)

kaushalshriyan May 08, 2022 10:32PM

Re: building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core)

Sergey A. Osokin May 08, 2022 11:02PM

Re: building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core)

kaushalshriyan May 08, 2022 11:20PM

Re: building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core)

Sergey A. Osokin May 09, 2022 09:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 223
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready