From 4a9874a66c97961e4b818c8c6a1c732c00d19d9f Mon Sep 17 00:00:00 2001 From: Michael Ramsey Date: Sun, 2 Feb 2020 23:15:34 -0500 Subject: [PATCH 1/3] Setup combined logging for access logs to use better standards. Add missing lsphp74 to scriptHandler. Setup Cloudflare/Sucuri IP's to not be throttled via LS via trusted IP --- install/litespeed/httpd.conf | 2 +- install/litespeed/httpd_config.xml | 130 +++++++---------------------- 2 files changed, 30 insertions(+), 102 deletions(-) diff --git a/install/litespeed/httpd.conf b/install/litespeed/httpd.conf index 8e9d5f821..00002127c 100755 --- a/install/litespeed/httpd.conf +++ b/install/litespeed/httpd.conf @@ -36,7 +36,7 @@ DirectoryIndex index.php index.html ErrorLog "/usr/local/lsws/logs/error.log" LogLevel warn -LogFormat '"%v %h %l %u %t \"%r\" %>s %b"' combined +LogFormat '%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"' combined CustomLog "/usr/local/lsws/logs/access.log" combined diff --git a/install/litespeed/httpd_config.xml b/install/litespeed/httpd_config.xml index cdc4b43c7..f17ec8bf6 100755 --- a/install/litespeed/httpd_config.xml +++ b/install/litespeed/httpd_config.xml @@ -1,6 +1,7 @@ $HOSTNAME + 1 nobody nobody 0 @@ -18,6 +19,7 @@ 5 $SERVER_ROOT/conf/mime.properties 0 + 0 86400 1 usman@cyberpersons.com @@ -33,9 +35,10 @@ $SERVER_ROOT/logs/access.log + %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" 10M 30 - 0 + 1 index.html, index.php @@ -48,12 +51,10 @@ image/*=A604800, text/css=A604800, application/x-javascript=A604800, application/javascript=A604800 - best 10000 10000 300 1000 - 0 5 0 0 @@ -70,9 +71,9 @@ 1 4 1 + text/*,application/x-javascript,application/javascript,application/xml, image/svg+xml 1 1 - text/*,application/x-javascript,application/javascript,application/xml, image/svg+xml 1 6 1M @@ -157,7 +158,7 @@ SecFilterSelective ARGS "into[[:space:]]+outfile|load[[:space:]]+data|/\*.+ $SERVER_ROOT/admin/conf/* - ALL + ALL, localhostT, 127.0.0.1T, 103.21.244.0/22T, 103.22.200.0/22T, 103.31.4.0/22T, 104.16.0.0/12T, 108.162.192.0/18T, 131.0.72.0/22T, 141.101.64.0/18T, 162.158.0.0/15T, 172.64.0.0/13T, 173.245.48.0/20T, 188.114.96.0/20T, 190.93.240.0/20T, 197.234.240.0/22T, 198.41.128.0/17T, 2400:cb00::/32T, 2405:8100::/32T, 2405:b500::/32T, 2606:4700::/32T, 2803:f800::/32T, 2a06:98c0::/29T, 2c0f:f248::/32T, 192.88.134.0/23T, 185.93.228.0/22, 66.248.200.0/22T, 208.109.0.0/22T, 2a02:fe80::/29T @@ -181,86 +182,6 @@ SecFilterSelective ARGS "into[[:space:]]+outfile|load[[:space:]]+data|/\*.+ 400 500 - - lsapi - lsphp53 -
uds://tmp/lshttpd/lsphp53.sock
- 35 - PHP_LSAPI_CHILDREN=35 - 60 - 0 - 1 - 0 - 3 - $SERVER_ROOT/lsphp53/bin/lsphp - 100 - 1 - 0 - 2047M - 2047M - 400 - 500 -
- - lsapi - lsphp54 -
uds://tmp/lshttpd/lsphp54.sock
- 35 - PHP_LSAPI_CHILDREN=35 - 60 - 0 - 1 - 0 - 3 - $SERVER_ROOT/lsphp54/bin/lsphp - 100 - 1 - 0 - 2047M - 2047M - 400 - 500 -
- - lsapi - lsphp55 -
uds://tmp/lshttpd/lsphp55.sock
- 35 - PHP_LSAPI_CHILDREN=35 - 60 - 0 - 1 - 0 - 3 - $SERVER_ROOT/lsphp55/bin/lsphp - 100 - 1 - 0 - 2047M - 2047M - 400 - 500 -
- - lsapi - lsphp56 -
uds://tmp/lshttpd/lsphp56.sock
- 35 - PHP_LSAPI_CHILDREN=35 - 60 - 0 - 1 - 0 - 3 - $SERVER_ROOT/lsphp56/bin/lsphp - 100 - 1 - 0 - 2047M - 2047M - 400 - 500 -
lsapi lsphp70 @@ -281,7 +202,7 @@ SecFilterSelective ARGS "into[[:space:]]+outfile|load[[:space:]]+data|/\*.+ 400 500 - + lsapi lsphp71
uds://tmp/lshttpd/lsphp71.sock
@@ -301,7 +222,7 @@ SecFilterSelective ARGS "into[[:space:]]+outfile|load[[:space:]]+data|/\*.+ 400 500
- + lsapi lsphp72
uds://tmp/lshttpd/lsphp72.sock
@@ -321,13 +242,13 @@ SecFilterSelective ARGS "into[[:space:]]+outfile|load[[:space:]]+data|/\*.+ 400 500
- + lsapi lsphp73
uds://tmp/lshttpd/lsphp73.sock
35 PHP_LSAPI_CHILDREN=35 - 60 + 300 0 1 0 @@ -373,47 +294,54 @@ SecFilterSelective ARGS "into[[:space:]]+outfile|load[[:space:]]+data|/\*.+ lsapi lsphp5 - + php53 lsapi lsphp53 - - + + php54 lsapi lsphp54 - - + + php55 lsapi lsphp55 - - + + php56 lsapi lsphp56 - + php70 lsapi lsphp70 - + php71 lsapi lsphp71 - + php72 lsapi lsphp72 - + php73 lsapi lsphp73 + + php74 + lsapi + lsphp74 + + + 1 5 @@ -430,4 +358,4 @@ SecFilterSelective ARGS "into[[:space:]]+outfile|load[[:space:]]+data|/\*.+ 400 500 -
+ \ No newline at end of file From 06afc1bd0f22e20bc24d3332384d2d2ee8e75758 Mon Sep 17 00:00:00 2001 From: Michael Ramsey Date: Sun, 2 Feb 2020 23:25:25 -0500 Subject: [PATCH 2/3] Setup combined logging for access logs to use better standards. Add missing lsphp74 to scriptHandler. Setup Cloudflare/Sucuri IP's to not be throttled via LS via trusted IP. Fix formatting and omitted lsphp5x handlers on previous commit --- install/litespeed/httpd_config.xml | 87 ++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/install/litespeed/httpd_config.xml b/install/litespeed/httpd_config.xml index f17ec8bf6..0a4faa4d3 100755 --- a/install/litespeed/httpd_config.xml +++ b/install/litespeed/httpd_config.xml @@ -1,7 +1,6 @@ $HOSTNAME - 1 nobody nobody 0 @@ -51,10 +50,12 @@ image/*=A604800, text/css=A604800, application/x-javascript=A604800, application/javascript=A604800 + best 10000 10000 300 1000 + 0 5 0 0 @@ -71,9 +72,9 @@ 1 4 1 - text/*,application/x-javascript,application/javascript,application/xml, image/svg+xml 1 1 + text/*,application/x-javascript,application/javascript,application/xml, image/svg+xml 1 6 1M @@ -181,6 +182,86 @@ SecFilterSelective ARGS "into[[:space:]]+outfile|load[[:space:]]+data|/\*.+ 2047M 400 500 + + + lsapi + lsphp53 +
uds://tmp/lshttpd/lsphp53.sock
+ 35 + PHP_LSAPI_CHILDREN=35 + 60 + 0 + 1 + 0 + 3 + $SERVER_ROOT/lsphp53/bin/lsphp + 100 + 1 + 0 + 2047M + 2047M + 400 + 500 +
+ + lsapi + lsphp54 +
uds://tmp/lshttpd/lsphp54.sock
+ 35 + PHP_LSAPI_CHILDREN=35 + 60 + 0 + 1 + 0 + 3 + $SERVER_ROOT/lsphp54/bin/lsphp + 100 + 1 + 0 + 2047M + 2047M + 400 + 500 +
+ + lsapi + lsphp55 +
uds://tmp/lshttpd/lsphp55.sock
+ 35 + PHP_LSAPI_CHILDREN=35 + 60 + 0 + 1 + 0 + 3 + $SERVER_ROOT/lsphp55/bin/lsphp + 100 + 1 + 0 + 2047M + 2047M + 400 + 500 +
+ + lsapi + lsphp56 +
uds://tmp/lshttpd/lsphp56.sock
+ 35 + PHP_LSAPI_CHILDREN=35 + 60 + 0 + 1 + 0 + 3 + $SERVER_ROOT/lsphp56/bin/lsphp + 100 + 1 + 0 + 2047M + 2047M + 400 + 500
lsapi @@ -248,7 +329,7 @@ SecFilterSelective ARGS "into[[:space:]]+outfile|load[[:space:]]+data|/\*.+
uds://tmp/lshttpd/lsphp73.sock
35 PHP_LSAPI_CHILDREN=35 - 300 + 60 0 1 0 From d60dddf3a0aa349eb359c6298568e8cf289f1984 Mon Sep 17 00:00:00 2001 From: Michael Ramsey Date: Sun, 2 Feb 2020 23:42:31 -0500 Subject: [PATCH 3/3] Setup combined logging for access logs to use better standards in vhostConfs.py for OLS --- plogical/vhostConfs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plogical/vhostConfs.py b/plogical/vhostConfs.py index abb1546c8..3e19e20e9 100755 --- a/plogical/vhostConfs.py +++ b/plogical/vhostConfs.py @@ -29,7 +29,7 @@ errorlog $VH_ROOT/logs/$VH_NAME.error_log { accesslog $VH_ROOT/logs/$VH_NAME.access_log { useServer 0 - logFormat "%v %h %l %u %t "%r" %>s %b" + logFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" logHeaders 5 rollingSize 10M keepDays 10 compressArchive 1 @@ -98,7 +98,7 @@ errorlog $VH_ROOT/logs/{masterDomain}.error_log { accesslog $VH_ROOT/logs/{masterDomain}.access_log { useServer 0 - logFormat "%v %h %l %u %t "%r" %>s %b" + logFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" logHeaders 5 rollingSize 10M keepDays 10 compressArchive 1 @@ -320,7 +320,7 @@ errorlog $VH_ROOT/logs/$VH_NAME.error_log { accesslog $VH_ROOT/logs/$VH_NAME.access_log { useServer 0 - logFormat "%v %h %l %u %t "%r" %>s %b" + logFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" logHeaders 5 rollingSize 10M keepDays 10 compressArchive 1