all repos — wp-ffpc @ 2cb41589c72ae8634a2433061811e695ee2d8bf6

added openlog functions
Peter Molnar hello@petermolnar.eu
Thu, 18 Apr 2013 16:10:40 +0100
commit

2cb41589c72ae8634a2433061811e695ee2d8bf6

parent

6b10505d7ccdcf4ecfc2209189d72e4907af7f51

3 files changed, 8 insertions(+), 18 deletions(-)

jump to
M wp-ffpc-abstract.phpwp-ffpc-abstract.php

@@ -377,14 +377,18 @@ return false;

switch ( $log_level ) { case LOG_ERR : - if ( function_exists( 'syslog' ) ) + if ( function_exists( 'syslog' ) && function_exists ( 'openlog' ) ) { + openlog('wordpress('.$_SERVER['HTTP_HOST'].')',LOG_NDELAY|LOG_PID,LOG_SYSLOG); syslog( $log_level , self::plugin_constant . $message ); + } /* error level is real problem, needs to be displayed on the admin panel */ throw new Exception ( $message ); break; default: - if ( function_exists( 'syslog' ) && $this->config['debug'] ) + if ( function_exists( 'syslog' ) && function_exists ( 'openlog' ) && $this->config['debug'] ) { + openlog('wordpress('.$_SERVER['HTTP_HOST'].')',LOG_NDELAY|LOG_PID,LOG_SYSLOG); syslog( $log_level , self::plugin_constant . $message ); + } break; }
M wp-ffpc-class.phpwp-ffpc-class.php

@@ -766,8 +766,8 @@ set $memcached_request 0;

}'; /* replace the data prefix with the configured one */ - $to_replace = array ( 'DATAPREFIX' , 'SERVERROOT' ); - $replace_with = array ( $this->options['prefix_data'], ABSPATH ); + $to_replace = array ( 'DATAPREFIX' , 'SERVERROOT', 'SERVERLOG' ); + $replace_with = array ( $this->options['prefix_data'], ABSPATH, $_SERVER['SERVER_NAME'] ); $nginx = str_replace ( $to_replace , $replace_with , $nginx ); /* set upstream servers from configured servers, best to get from the actual backend */
M wp-ffpc-nginx-sample.confwp-ffpc-nginx-sample.conf

@@ -47,24 +47,10 @@ location ~ [a-zA-Z0-9_]=http:// { deny all; }

location ~ [a-zA-Z0-9_]=(\.\.//?)+ { deny all; } location ~ [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ { deny all; } - ## Disable Akeeba Remote Control 2.5 and earlier - if ($http_user_agent ~ "Indy Library") { return 403; } - - ## Common bandwidth hoggers and hacking tools. - if ($http_user_agent ~ "libwww-perl") { return 403; } - if ($http_user_agent ~ "GetRight") { return 403; } - if ($http_user_agent ~ "GetWeb!") { return 403; } - if ($http_user_agent ~ "Go!Zilla") { return 403; } - if ($http_user_agent ~ "Download Demon") { return 403; } - if ($http_user_agent ~ "Go-Ahead-Got-It") { return 403; } - if ($http_user_agent ~ "TurnitinBot") { return 403; } - if ($http_user_agent ~ "GrabNet") { return 403; } - ## wordpress security location ~* wp-config.php { deny all; } location ~* wp-admin/includes { deny all; } location ~* wp-app\.log { deny all; } - location ~* wp-includes/.*\.php$ { deny all; } location ~ /wp-content/plugins/akismet/readme\.txt { deny all; } location ~ (licence|readme|license)\.(html|txt) { deny all; }