Juan Antonio Samaranch CentOS Nginx 163 installation process with WAF

Source: Internet
Author: User
wget http://nginx.org/download/nginx-1.6.3.tar.gz
wget http://nginx.org/download/nginx-1.8.1.tar.gz
wget http://zlib.net/zlib-1.2.8.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
wget http://www.openssl.org/source/openssl-fips-2.0.12.tar.gz
TAR-ZXVF nginx-1.6.3.tar.gz
TAR-ZXVF zlib-1.2.8.tar.gz
TAR-ZXVF pcre-8.38.tar.gz
TAR-ZXVF openssl-fips-2.0.12.tar.gz
CD openssl-fips-2.0.10
./config
Make
sudo make install
CD zlib-1.2.8
./configure
Make
sudo make install
CD pcre-8.38
./configure
Make
sudo make install
CD nginx-1.6.3
./configure--with-pcre=. /pcre-8.38--with-zlib=. /zlib-1.2.8--with-openssl=. /openssl-fips-2.0.12
Make
sudo make install
Cd/usr/local/nginx/sbin
sudo./nginx
----------------------------
Add Naxsi Module
wget Https://github.com/nbs-system/naxsi/archive/master.zip
MV Master.zip Naxsi-master.zip
Unzip Naxsi-master.zip
Execute the./nginx-v command under the installed nginx/sbin/to view the original nginx./configure after copying and adding the Naxsi module
Added:--add-module=. /naxsi-master/naxsi_src
./configure--with-pcre=. /pcre-8.38--with-zlib=. /zlib-1.2.8--with-openssl=. /openssl-fips-2.0.10--add-module=. /naxsi-master/naxsi_src
Make
sudo make install
CP ~/naxsi-master/naxsi_config/naxsi_core.rules/usr/local/nginx/conf/
Cd/usr/local/nginx/conf
Vim Mysite.rules
The contents are as follows:
#------------------------
#LearningMode; #Enables Learning Mode
secrulesenabled;
#SecRulesDisabled;
Deniedurl "/requestdenied";
# # Check Rules
Checkrule "$SQL >= 8" BLOCK;
Checkrule "$RFI >= 8" BLOCK;
Checkrule "$TRAVERSAL >= 4" BLOCK;
Checkrule "$EVADE >= 4" BLOCK;
Checkrule "$XSS >= 8" BLOCK;
#---------------------------
Vim nginx.conf
Add the following configuration in the HTTP section
Include/usr/local/nginx/conf/naxsi_core.rules;
The location of the server/{
#在这里面增加:
Include/usr/local/nginx/conf/mysite.rules;
}
#增加:
location/requestdenied {
return 403;
}
Main references:
http://blog.cnwyhx.com/centos-nginx-naxsi-install/

The above describes the Juan Antonio Samaranch CentOS Nginx 163 installation process with WAF, including the Juan Antonio Samaranch aspects of the content, I hope to be interested in PHP tutorial friends helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.