• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Plesk+LiteSpeedENT+WP Tookit rules

IronDonDon

New Pleskian
Hi,

I installed a Litespeed extension and switched the server to LS, but WP toolkit security rules/settings for Apache do not work or work only partially if switched to LS.
Most of the rules that dont work are <LocationMatch> rules. LS ignores them, which makes security settings in /var/www/vhosts/system/DOMAIN/conf/httpd.conf obsolete. My knowlage of apache is very basic (moving from nginx to Litespeed), so I've replaced LocationMatch with FilesMatch, which had a positive effect with LS. Here are the rules which do not work with LS:
Apache config:
        #extension wp-toolkit begin
        # "Block unauthorized access to wp-config.php"
        # To remove this rule, revert this security measure on each WordPress installation on this domain
        <Files wp-config.php>
            Require all denied
        </Files>

        # "Block directory browsing"
        # To remove this rule, revert this security measure on each WordPress installation on this domain
        <Directory "/var/www/vhosts/domain.example/httpdocs">
            Options -Indexes
        </Directory>

        # "Forbid execution of PHP scripts in the wp-content/uploads directory"
        # To remove this rule, revert this security measure for WordPress installation #1
        <Directory "/var/www/vhosts/domain.example/httpdocs/wp-content/uploads">
            <FilesMatch \.php$>
                Require all denied
            </FilesMatch>
        </Directory>

        # "Forbid execution of PHP scripts in the wp-includes directory"
        # To remove this rule, revert this security measure for WordPress installation #1
        <IfModule mod_rewrite.c>
            <Directory "/var/www/vhosts/domain.example/httpdocs/wp-includes">
                <FilesMatch \.php$>
                    RewriteEngine on
                    RewriteCond %{REQUEST_FILENAME} !^/var/www/vhosts/domain\.example/httpdocs/wp\-includes/js/tinymce/wp\-tinymce\.php$ [NC]
                    RewriteRule .* - [NC,F,L]
                </FilesMatch>
            </Directory>
        </IfModule>

        # "Disable scripts concatenation for WordPress admin panel"
        # To remove this rule, revert this security measure for WordPress installation #1
        <Directory "/var/www/vhosts/domain.example/httpdocs/wp-admin">
            <FilesMatch (load-styles|load-scripts)\.php$>
                Require all denied
            </FilesMatch>
        </Directory>

        # "Block author scans"
        # To remove this rule, revert this security measure for WordPress installation #1
        <IfModule mod_rewrite.c>
            <Directory "/var/www/vhosts/domain.example/httpdocs">
                RewriteEngine on
                RewriteCond %{QUERY_STRING} author=\d+
                RewriteCond %{REQUEST_FILENAME} !^/var/www/vhosts/domain\.example/httpdocs/wp\-admin/ [NC]
                RewriteRule .* - [F,L]
            </Directory>
        </IfModule>

        # "Block author scans"
        # To remove this rule, revert this security measure on each WordPress installation on this domain
        <LocationMatch "(?i:(?:wp-config\\.bak|\\.wp-config\\.php\\.swp|(?:readme|license|changelog|-config|-sample)\\.(?:php|md|txt|htm|html)))">
            Require all denied
        </LocationMatch>

        # "Block access to potentially sensitive files"
        # To remove this rule, revert this security measure on each WordPress installation on this domain
        <LocationMatch ".+\\.(?i:psd|log|cmd|exe|bat|csh|ini|sh)$">
            Require all denied
        </LocationMatch>

        # "Disable PHP execution in cache directories"
        # To remove this rule, revert this security measure on each WordPress installation on this domain
        <LocationMatch "(?i:.*/cache/.*\\.ph(?:p[345]?|t|tml))">
            Require all denied
        </LocationMatch>

        # "Block access to .htaccess and .htpasswd"
        # To remove this rule, revert this security measure on each WordPress installation on this domain
        <FilesMatch ^(?i:\.ht.*)$>
            Require all denied
        </FilesMatch>

        # "Enable bot protection"
        # To remove this rule, revert this security measure on each WordPress installation on this domain
        <IfModule mod_rewrite.c>
            <Directory "/var/www/vhosts/domain.example/httpdocs">
                RewriteEngine on
                RewriteCond %{HTTP_USER_AGENT} "(?:acunetix|BLEXBot|domaincrawler\\.com|LinkpadBot|MJ12bot/v|majestic12\\.co\\.uk|AhrefsBot|TwengaBot|SemrushBot|nikto|winhttp|Xenu\\s+Link\\s+Sleuth|Baiduspider|HTTrack|clshttp|harvest|extract|grab|miner|python-requests)" [NC]
                RewriteRule .* - [F,L]
            </Directory>
        </IfModule>
        #extension wp-toolkit end

Also, # "Block author scans" part does not work both on Apache and LS. I would appreciate any help in solving this issue with WP toolkit. Is it acctually correct to replace LocationMatch with FilesMatch?

Thank you.
Regards, Alex
 
Back
Top