banner
moeyy

moeyy

一条有远大理想的咸鱼。
github
mastodon
email

Tutorial for Web Protection with Baota + Cloud Lock Nginx Custom Compilation

This tutorial is written after the blogger's personal testing, shared for users who do not know how to compile the Yunsuo Nginx self-compiled module.

First, before operating, please confirm that you have configured the Baota panel and used the compilation method to configure the Nginx environment! (It is not a quick installation, but a compiled installation)

Also, properly back up the Nginx files, and confirm that this tutorial is not applicable to non-Baota users and Apache users.

Secondly, as long as you follow the steps one by one, even a fool can compile it well. The official tutorial can leave beginners confused; this tutorial is not that complicated.

Configure the compilation environment. If Baota has compiled Nginx, it is configured by default, so you can ignore this configuration environment...

yum install -y gcc gcc-c++ pcre-devel openssl openssl-devel

You can log in with ROOT permissions using an SSH tool and then download and back up Nginx, or you can directly use the command to back up Nginx.

Check the Nginx location

ps -elf | grep nginx

Enter the Baota Nginx directory

cd /www/server/nginx/sbin/

Back up Baota Nginx

cp nginx nginx.bak

Enter the root directory

cd /root

Download the Yunsuo protection module compressed package

wget https://codeload.github.com/yunsuo-open/nginx-plugin/zip/master -O nginx-plugin-master.zip

Unzip the Yunsuo protection module compressed package

unzip nginx-plugin-master.zip

Check the loaded modules of the compiled Nginx in Baota. When recompiling and loading the Yunsuo protection module, these modules still need to be loaded.

nginx -V

Note that this command uses a capital V; if you use a lowercase v, it will not display the modules.

Copy the content after ./configure arguments: to a text file for later use. For example, mine is:

--user=www --group=www --prefix=/www/server/nginx --with-openssl=/www/server/nginx/src/openssl --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --add-module=/www/server/nginx/src/nginx-sticky-module --with-http_stub_status_module --with-http_ssl_module --with-http_v2_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-http_concat_module --with-ld-opt=-Wl,-E --with-jemalloc --without-http_upstream_session_sticky_module --with-pcre=pcre-8.40

(My example is for reference only; please use your own.)

Enter the Nginx source code directory to recompile Nginx. Before operating, please confirm that your Nginx is installed in compiled mode, not the quick installation of the Baota panel.

cd /www/server/nginx/src

Compile content

./configure [content from the text file] --add-module=/root/nginx-plugin-master

There is a space between ./configure and the copied content from the text file, and there is also a space before the --add-module. For example, my compile command is:

./configure --user=www --group=www --prefix=/www/server/nginx --with-openssl=/www/server/nginx/src/openssl --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --add-module=/www/server/nginx/src/nginx-sticky-module --with-http_stub_status_module --with-http_ssl_module --with-http_v2_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-http_concat_module --with-ld-opt=-Wl,-E --with-jemalloc --without-http_upstream_session_sticky_module --with-pcre=pcre-8.40 --add-module=/root/nginx-plugin-master

(My example is for reference only; please use your own.)

Wait for the command to finish, then enter the compile command

make

After completion, replace the original Nginx in the system with the newly compiled Nginx file.

Stop Nginx

service nginx stop

Delete the original Nginx. Before operating, please confirm that your Nginx has been backed up.

rm -rf /www/server/nginx/sbin/nginx

Copy the newly compiled Nginx

cp /www/server/nginx/src/objs/nginx /www/server/nginx/sbin/

Start Nginx

service nginx start

Log in to Yunsuo from the PC side, refresh the PC side, and you can see that the Nginx plugin has been recognized (changed from gray to green).

Add /?order%20by to your URL to test Yunsuo.

image

Enable CAPTCHA to prevent CC attacks.

image

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.