• Resolved silico26

    (@silico26)


    I am on a shared hosting plan running Litespeed. Host is http://www.wirenine.com

    I can’t seem to get Wordfence scans to complete… never had a problem with my Hostgator accounts. It gets to “Scanning for known malware files” and then just hangs up for hours. My site is here: http://tinyurl.com/nfj5w92

    1. I’ve tried editing Htaccess as outlined here:
    https://support.wordfence.com/support/solutions/articles/1000129050-running-wordfence-under-litespeed-web-server-and-preventing-process-killing-or-aborting

    2. I’ve tried this:
    Go to wordfence “options” page
    Scroll to the bottom Set “Maximum execution time for each scan stage” to 15 seconds. Don’t forget to “Save”.
    Try another scan.

    3. I’ve tried this below as well (which gets me past the malware step, but alternatively hangs at the “Scanning files for URLs in Google’s Safe Browsing List” step)
    Go to the bottom of Wordfence “options” page.
    Click the option to view your configuration.
    Look for max_execution_time
    Set the “Maximum execution time for each scan stage” to about 80% of that value. So if it’s 90, try setting the option to 75.
    Try another scan and see if that works.

    I assume the issue is hosting related (have a fresh copy of Wordfence installed) – any idea what I should tell my host that will set them on the right path to finally correcting this?

    Thanks.

    https://ww.wp.xz.cn/plugins/wordfence/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author WFMattR

    (@wfmattr)

    The LiteSpeed .htaccess fix has recently been revised, and a new version is available here:
    LiteSpeed aborts Wordfence scans and updates. How do I prevent that?

    The old one that you read should be removed soon. The problem was that some plugins cause .htaccess to be rewritten somewhat frequently, which can wipe out the change.

    If this does not help, try turning on the option “Enable debugging mode” near the bottom of the Wordfence Options page, and run a scan. You can see the detailed results in a separate page by clicking “View activity log” below the box. This may tell you if it’s getting hung up on a specific file, or if there are any different error messages that appear.

    Make sure to turn off debugging mode when done, as it does cause more data to be written to the database.

    -Matt R

    Thread Starter silico26

    (@silico26)

    @wfmattr thanks for the response. i’ll try out the method in your link. first, is it best for me to backtrack my previous steps?

    Thread Starter silico26

    (@silico26)

    I removed the previous settings from my og post and started over. Interestingly, my htaccess doesn’t have a “# BEGIN WordPress” section – I assume because I am using the Bulletproof plugin which modified it.

    Alternatively I have put the code from your link at the top of my htaccess:

    # BEGIN litespeed noabort
    <IfModule rewrite_module>
            RewriteEngine On
            RewriteRule .* - [E=noabort:1]
    </IfModule>
    # END litespeed noabort

    Unfortunately it’s still getting hung up at “Scanning for known malware files”. I then enabled debugging, is it okay for me to post this code? Is there a preferred method for posting it? It’s gigantic. Here’s a screenshot of the only red error which could be telling: http://s21.postimg.org/44svnmuif/Screen_Shot_2015_09_30_at_12_02_15_PM.png

    and here’s the top portion:
    http://s1.postimg.org/ckam6mjhr/Screen_Shot_2015_09_30_at_12_04_46_PM.png

    Thanks

    Plugin Author WFMattR

    (@wfmattr)

    For your first reply above, I think that changing the max execution time back to 15 would be best. You might even try 12, in case the host is a bit overloaded. If the host could increase the “max_execution_time” variable in the file “php.ini”, that may help as well.

    It could also be a memory issue — normally memory problems show up clearly in the scan results, but it’s possible that the host prevents them from appearing. You can try increasing “How much memory should Wordfence request when scanning” on the Wordfence Options page, to 300 or 350.

    The red error message is actually ok — that’s part of WordPress, which normally hides the error, but Wordfence turns on extra error reporting.

    When you edited the .htaccess file, was it the one in the root of your site? I’m surprised the “quote” link on your site works without the “BEGIN WordPress” section! You might also try temporarily disabling bulletproof security — you may have some options selected in there that are stopping the scan from working properly. (If that helps, we can look at what options you have set.)

    -Matt R

    Thread Starter silico26

    (@silico26)

    * EDITi re-uploaded my htaccess.. in the correct directory this time 😉 …scans now working! i haven’t seen what a completed wordfence scan looks like in over a year, this is awesome! i’ll backtrack some of my steps to see exactly which step(s) are necessary and report back here.

    – tried max host at 15 and then 12

    – changed memory request scanning to 300 and then 350mb

    – increased max execution in cpanel php.ini to 0 (no time limit)

    then i deactivated and deleted bulletproof and tried all of the above. still can’t get it to work. all continue to hang at “Scanning for known malware files”

    to confirm there’s no lingering traces of bulletproof, my htaccess looks like this:

    # BEGIN litespeed noabort
    <IfModule rewrite_module>
            RewriteEngine On
            RewriteRule .* - [E=noabort:1]
    </IfModule>
    # END litespeed noabort
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    Thread Starter silico26

    (@silico26)

    – changed my php.ini settings in cpanel back to their default settings and the scan ran fine.

    – changed wordfence memory setting back to default 256mb and scan ran fine

    – changed wordfence max host setting back to default (blank) and scan ran fine

    conclusion: removing ALL traces of bulletproof (not a simple deactivate/delete as you will likely have traces of BP references in your htaccess) and using your litespeed fix here fixed the scanning issue for me:
    http://docs.wordfence.com/en/LiteSpeed_aborts_Wordfence_scans_and_updates._How_do_I_prevent_that%3F

    i guess your host isn’t always to blame 😉

    i’ll reach out to bulletproof dev’s and see why their plugin doesn’t want to get along with yours.. i get that they are both security plugins so these issues are not uncommon but i think both of your plugins have unique benefits so it would be nice to be able to run them both simultaneously.

    i appreciate your help.

    Plugin Author WFMattR

    (@wfmattr)

    Great, thanks for the follow-up!

    With certain settings, sometimes multiple security plugins will work together ok, but you’re right that various issues are not uncommon, since they do cross over on some functions. We usually recommend using one or the other, or going through the settings and trying to make sure both aren’t working on the same function. Sometimes also, they’ll also work for a while, but one of the plugins has an update and affects something in the other.

    -Matt R

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘scan won't complete with litespeed shared hosting’ is closed to new replies.