0

I need to disable mod_security for /admin/ location, this is a full config of my virtual host:

<VirtualHost *:443>
    DocumentRoot /home/example/sites/example.com
    ServerName example.com
    ServerAlias www.example.com

    UseCanonicalName Off

    ErrorLog /usr/local/apache/domlogs/example.com.error.log

    LogLevel trace8

    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/example.com.cert
    SSLCertificateKeyFile /etc/pki/tls/private/example.com.key
    SSLCertificateChainFile /etc/pki/tls/certs/example.com.bundle
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown

    <IfModule mod_userdir.c>
        UserDir disabled
        UserDir enabled /home/example/sites/example.com
    </IfModule>

    <IfModule mod_suphp.c>
        suPHP_UserGroup example example
        suPHP_ConfigPath /home/example
    </IfModule>

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid example example
    </IfModule>

    <IfModule itk.c>
        AssignUserID example example
    </IfModule>

    <Directory "/home/example/sites/example.com">
        AllowOverride All 
        SSLRequireSSL
        Require all granted
    </Directory>

    <Directory "/home/example/public_html">
        AllowOverride All 
        SSLRequireSSL
        Require all granted
    </Directory>

    <LocationMatch "^/admin/?.*"> # Here is trouble
        <IfModule mod_security2.c>
            SecRuleEngine Off 
        </IfModule>
    </LocationMatch>
</VirtualHost>

ModSecurity still won't let the request pass. Logs are not contain any information about LocationMatch work.

What is wrong?

System Info: CWP admin on CentOS 7.

0

You must log in to answer this question.

Browse other questions tagged .