Last active
November 16, 2021 03:28
-
-
Save gaptekupdate/53e4b461277ba8e072dc27916bc94d68 to your computer and use it in GitHub Desktop.
RunCloud OpenLitespeed Wordfence Bulk Add wordfence-waf.php Wordpress Plugin Rules in phpIniOverride section
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$files = glob("/etc/lsws-rc/conf.d/*/component/php.conf"); | |
foreach ($files as $data) { | |
echo "Editing: $data \n"; | |
$original = file_get_contents($data); | |
$replaced = preg_replace('/php_admin_value open_basedir\s+"(.*):\/var(.*)"/', 'php_admin_value open_basedir "$1:/var$2" | |
php_admin_value auto_prepend_file "$1/wordfence-waf.php"', $original); | |
echo $replaced; | |
/** Replace The File Contents, Uncomment Below Line with your own risk **/ | |
// file_put_contents($data, $replaced); | |
} | |
?> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Multiple Domain Bulk Add auto_prepend_file wordfence-waf.php rules in phpIniOverride section for Wordfence Plugin Running with OpenLiteSpeed webserver on RunCloud Web Panel. | |
1. Navigate to: /etc/lsws-rc/conf.d/ | |
2. Create/Upload: bulkaddwf.php | |
3. Run Php CLI command from your ssh: php bulkaddwf.php | |
4. Reload OLS: /usr/local/lsws/bin/lswsctrl reload | |
5. Enjoy ^^v | |
# Do not edit this file | |
# Editing this file manually might break RunCloud System | |
Unfortunately, we can’t guarantee your use of the script will be free from error and/or uninterrupted. | |
We take no responsibility or liability, so far as legally possible, for any damages including, but not limited to: | |
indirect or consequential damages; | |
damages for loss of opportunity or chance; | |
any damages arising from use or loss of use, data, or profits, whether in action of contract, | |
negligence or other tortious action, arising out of, or in connection with, | |
any information on the script or the use thereof. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment