I am trying to compile openresty 1.13.6 with modsec 2.9.2 on centos 7. I have installed all necessary packages but after installation I am getting below error.
nginx: [error] init_by_lua error: /usr/local/openresty/site/lualib/resty/waf/translate.lua:5: module 'rex_pcre' not found:
no field package.preload['rex_pcre']
no file '/usr/local/openresty/site/lualib/rex_pcre.ljbc'
no file '/usr/local/openresty/site/lualib/rex_pcre/init.ljbc'
no file '/usr/local/openresty/lualib/rex_pcre.ljbc'
no file '/usr/local/openresty/lualib/rex_pcre/init.ljbc'
no file '/usr/local/openresty/site/lualib/rex_pcre.lua'
no file '/usr/local/openresty/site/lualib/rex_pcre/init.lua'
no file '/usr/local/openresty/lualib/rex_pcre.lua'
no file '/usr/local/openresty/lualib/rex_pcre/init.lua'
no file './rex_pcre.lua'
no file '/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/rex_pcre.lua'
no file '/usr/local/share/lua/5.1/rex_pcre.lua'
no file '/usr/local/share/lua/5.1/rex_pcre/init.lua'
no file '/usr/local/openresty/luajit/share/lua/5.1/rex_pcre.lua'
no file '/usr/local/openresty/luajit/share/lua/5.1/rex_pcre/init.lua'
no file '/usr/local/openresty/site/lualib/rex_pcre.so'
no file '/usr/local/openresty/lualib/rex_pcre.so'
no file './rex_pcre.so'
no file '/usr/local/lib/lua/5.1/rex_pcre.so'
no file '/usr/local/openresty/luajit/lib/lua/5.1/rex_pcre.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
/usr/local/openresty/site/lualib/resty/waf/translate.lua:5: in main chunk
[C]: in function 'require'
/usr/local/openresty/site/lualib/resty/waf.lua:14: in main chunk
[C]: in function 'require'
init_by_lua:3: in main chunk
nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test failed
Based on error it looks like pcre package related error but I have already below pcre installed in my centos machine.
Not sure where I am missing. Any help would be appreciate.