From e8d8ec142abcb5dc5933ede14ab6236efb60b873 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 24 Jun 2009 18:35:31 -0400 Subject: Add package log viewer for access log. TODO: error log --- config/apache_mod_security/apache_mod_security.xml | 6 +- .../apache_mod_security_settings.xml | 4 + .../apache_mod_security_view_logs.php | 109 +++++++++++++++++++++ 3 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 config/apache_mod_security/apache_mod_security_view_logs.php (limited to 'config/apache_mod_security') diff --git a/config/apache_mod_security/apache_mod_security.xml b/config/apache_mod_security/apache_mod_security.xml index efd7645a..d31dcf0e 100644 --- a/config/apache_mod_security/apache_mod_security.xml +++ b/config/apache_mod_security/apache_mod_security.xml @@ -65,7 +65,11 @@ Site Proxies /pkg.php?xml=apache_mod_security.xml - + + + + Logs + /pkg.php?xml=apache_mod_security_view_logs.php diff --git a/config/apache_mod_security/apache_mod_security_settings.xml b/config/apache_mod_security/apache_mod_security_settings.xml index 84421b11..473632ef 100644 --- a/config/apache_mod_security/apache_mod_security_settings.xml +++ b/config/apache_mod_security/apache_mod_security_settings.xml @@ -52,6 +52,10 @@ Site Proxies /pkg.php?xml=apache_mod_security.xml + + Logs + /pkg.php?xml=apache_mod_security_view_logs.php + diff --git a/config/apache_mod_security/apache_mod_security_view_logs.php b/config/apache_mod_security/apache_mod_security_view_logs.php new file mode 100644 index 00000000..be47f8e3 --- /dev/null +++ b/config/apache_mod_security/apache_mod_security_view_logs.php @@ -0,0 +1,109 @@ + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +require("guiconfig.inc"); + +if($_REQUEST['getactivity']) { + $apachelogs = `cat /var/log/httpd-access.log`; + echo "Apache+Mod_Security_Proxy Server logs as of " . date("D M j G:i:s T Y") . "\n\n"; + echo $apachelogs; + exit; +} + +$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); +if(strstr($pfSversion, "1.2")) + $one_two = true; + +$pgtitle = "Services: Mod_Security+Apache+Proxy: Logs"; +include("head.inc"); + +/* XXX */ +if ($_POST['clear']) { } + +?> + + + + + + +

+ + + + +
+ + +
+ + + + +
+
+
+
+
One moment please, loading Apache logs...
+
+
+ + +

+ " /> + + +

+ + + -- cgit v1.2.3