[CentOS] building ngx_cache_purge module on CentOS Linux release 7.9.2009 (Core).

Sat May 7 14:07:00 UTC 2022
Kaushal Shriyan <kaushalshriyan at gmail.com>

Hi,

I have installed the below packages on CentOS Linux release 7.9.2009 (Core)

# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
# nginx -v
nginx version: nginx/1.20.1
# rpm -qa | grep nginx
nginx-1.20.1-9.el7.x86_64
nginx-filesystem-1.20.1-9.el7.noarch
rh-nginx120-scldevel-1.20-1.el7.x86_64
nginx-mod-devel-1.20.1-9.el7.x86_64
php74-fpm-nginx-7.4.29-1.el7.ius.noarch
#

Best Regards,

Kaushal

On Sat, May 7, 2022 at 7:34 PM Kaushal Shriyan <kaushalshriyan at gmail.com>
wrote:

>
>
> On Sat, May 7, 2022 at 7:03 PM Anand Buddhdev <anandb at ripe.net> wrote:
>
>> On 07/05/2022 15:01, Kaushal Shriyan wrote:
>>
>> Hi Kaushal,
>>
>> > #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.
>> >
>> > # yum search nginx-devel
>>
>> Try "yum search nginx" instead and examine its output. You'll find your
>> answer.
>>
>> Regards,
>> Anand
>>
>
> Hi,
>
> # rpm -qil nginx-mod-devel-1.20.1-9.el7.x86_64 | grep nginx.h
> /usr/src/nginx-1.20.1-9.el7/src/core/nginx.h
> # ll /usr/src/nginx-1.20.1-9.el7/src/core/nginx.h
> -rw-r--r-- 1 root root 476 May 25  2021
> /usr/src/nginx-1.20.1-9.el7/src/core/nginx.h
> # ls
> CHANGES  config  LICENSE  ngx_cache_purge_module.c  README.md  t  TODO.md
> # ls -l
> total 76
> -rw-r--r-- 1 501 wheel  1980 Dec 23  2014 CHANGES
> -rw-r--r-- 1 501 wheel   516 Dec 23  2014 config
> -rw-r--r-- 1 501 wheel  1424 Dec 23  2014 LICENSE
> -rw-r--r-- 1 501 wheel 51501 Dec 23  2014 ngx_cache_purge_module.c
> -rw-r--r-- 1 501 wheel  5090 Dec 23  2014 README.md
> drwxr-xr-x 2 501 wheel    80 May  7 02:22 t
> -rw-r--r-- 1 501 wheel   281 Dec 23  2014 TODO.md
> #
> # 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.
> #
>
> It is unable to locate the header file. Please correct me if I am missing
> something. Thanks in advance.
>
> Best Regards,
>
> Kaushal
>