Last update at :2024-02-14,Edit by888u
How to solve the problem that the Pagoda panel installation firewall/website monitoring report prompts Nginx configuration rule error: unknown directive “lua_shared_dict”? The current latest version of Pagoda Panel 7.9.2 is really a bit confusing. No matter if you use centos7.6, debian10 or ubuntu20 system, after installing Pagoda 7.9.2, you can normally install Pagoda Professional Edition firewall and website monitoring report, but these two things are It will not work properly. If you restart nginx, the following error will be prompted:
nginx: [emerg] unknown directive "lua_shared_dict" in /www/server/panel/vhost/nginx/total.conf:1 nginx: configuration file /www/server/nginx/conf/nginx.conf test failedI was really confused when I saw this error. Don’t ask, there is no solution to this problem on Baidu. I also posted on the Baota Forum for help. The official operation and maintenance obviously has not realized the bug of 7.9.2. , only gave a very general solution. I tried it, but it didn’t work as expected. This article will record how the webmaster solved this problem. If you have the same problem with children's shoes, you can refer to it.
Pagoda server panel, one-click all-round deployment and management, give you a 3188 yuan gift package, click me to receive it .cn/?invite_code=MV9kaG5wYWk=
1. Error prompt
This bug should only be encountered if you newly install the latest version of Pagoda 7.9.2. The specific bug is that when installing Pagoda Firewall, whether it is a professional firewall or a free firewall, and installing the website monitoring report, it will prompt the error at the beginning of the article. Here’s a picture:
2. Find the reason
1) The official solution given to me is as follows. Of course, this method may be useful, but it is useless for the problem encountered by Big Bird.
The reason for the error is: the system lacks the luajit component, resulting in abnormal use of nginx; Solution: Uninstall nginx firewall/nginx free firewall, website acceleration (if these plug-ins are not installed, you can ignore this step) uninstall the current version of nginx, use the compile mode to install nginx1.20, the compilation and installation will automatically install the luajit component; After installing nginx, reinstall the plug-ins you uninstalled before to use them normally.2) The crux of the problem
The specific reason for this problem is the lack of two nginx modules: ngx_devel_kit and lua_nginx_module. We only need to compile these two modules into nginx to solve the problem. But you'd better use the command: nginx -V to check your nginx extension. Big Bird used this command to check and found that these two modules are indeed missing.
3. Solve the problem
Now that we have found the crux, we only need to start compiling and installing these two modules. The specific method is as follows:
1) Use the command to check your nginx version number. The v here is lowercase. The command is as follows:
nginx -v2) Go to the /www/server/nginx/src directory to see if the two modules ngx_devel_kit and lua_nginx_module are there. Baota has compiled these two modules by default, which means 7.9.2 is too weird. Usually there are, as shown in the picture:
3) Modify nginx.sh
Pagoda panel found the path: /www/server/panel/install found the file nginx.sh, opened it and started editing. About line 278, we add --add-module=srclib/ngx_devel_kit --add-module=srclib/lua_nginx_module. The code will not be added. The underlined places are the two modules we want to add:
./configure --user=www --group=www --prefix=${Setup_Path} ${ENABLE_LUA} --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/ server/nginx/src/lua_nginx_module --add-module=${Setup_Path}/src/ngx_cache_purge --add-module=${Setup_Path}/src/nginx-sticky-module --with-openssl=${Setup_Path}/ src/openssl --with-pcre=pcre-${pcre_version} ${ENABLE_HTTP2} --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-ipv6 - -with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt="-Wl,-E" --with-cc-opt="-Wno -error" ${jemallocLD} ${ENABLE_WEBDAV} ${ENABLE_NGX_PAGESPEED} ${ADD_EXTENSION} ${i_make_args}4) Because these two modules already exist by default, we can compile it directly. We go back to the ssh client and use the command to start compiling according to our own version, because the version installed on the Big Bird server is nginx1 .20.2 So use the compilation command as follows:
sh /www/server/panel/install/nginx.sh install 1.205) After the compilation is completed, use the command: nginx -V to see that the module has been compiled. Note that the "v" here is capitalized.
4. Finally
After the compilation of these two modules is completed, we can install the Pagoda firewall and website monitoring report again and they can be used normally.
Recommended site search: php website space, server space, website registration process, registration center, site group server rental, Korean virtual host, Hong Kong vps host rental, free web server website, cm domain name, domain name transfer,
发表评论