{"id":2280,"date":"2016-05-28T12:00:53","date_gmt":"2016-05-28T19:00:53","guid":{"rendered":"http:\/\/192.168.3.4\/?p=2280"},"modified":"2018-01-09T06:50:24","modified_gmt":"2018-01-09T14:50:24","slug":"setting-up-webalizer-log-file-analysis","status":"publish","type":"post","link":"https:\/\/www.cloudacm.com\/?p=2280","title":{"rendered":"Setting up Webalizer log file analysis"},"content":{"rendered":"<p><strong>Introduction<\/strong><\/p>\n<p>Webmin has a module for Webalizer that will report web usage on the linux system.\u00a0 Most often, the install of Webmin will already have a working module of Webalizer.\u00a0 However, there are times when the log files may change location or are become available after Webmin was setup.<\/p>\n<p>In this topic, we will cover how to process web log files stored on a local host as well as web logs from a remote host.\u00a0 Once processed, we will then go through the steps on how to make the reports available through Apache.<\/p>\n<p>Here are the steps to point Webalizer to the new log file locations.<\/p>\n<p><strong>Creating a report from local web log files not loaded by default.<\/strong><\/p>\n<p>Finding the log path for the Linux system can be located in the Apache Webserver module of Webmin, it is listed under Servers.\u00a0 From here the Existing virtual hosts tab will be available with a Default Server listed along with any additional virtual hosts.<\/p>\n<p>In my example, I only have the Default Server, so I\u2019ll click on it.\u00a0 In the upper section is a Log Files icon, I\u2019ll click on that as well.<\/p>\n<p>This will list all of the logs associated with the virtual host.\u00a0 I\u2019ll be using the Ascess log files for Webalizer.\u00a0 Make a note of the path listed in File or program.\u00a0 Now we are ready to add that definition in Webalizer.<\/p>\n<p>Click on the Webalizer Logfile Analysis module under Servers in Webmin.\u00a0 In the log file list, I can see that the path and log file I found just a moment ago isn\u2019t listed. \u00a0\u00a0I do have another log file defined.\u00a0 Lets look at that first to use as a reference.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/05\/CronJob_Webalizer.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2283\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/05\/CronJob_Webalizer.png\" alt=\"CronJob_Webalizer\" width=\"773\" height=\"740\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/CronJob_Webalizer.png 773w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/CronJob_Webalizer-300x287.png 300w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/CronJob_Webalizer-768x735.png 768w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/CronJob_Webalizer-100x96.png 100w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/CronJob_Webalizer-150x144.png 150w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/CronJob_Webalizer-200x191.png 200w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/CronJob_Webalizer-450x431.png 450w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/CronJob_Webalizer-600x574.png 600w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/a><\/p>\n<p>Now we\u2019ll add our new log file to Webalizer.<\/p>\n<p>Return to the log file list, there is a link at the bottom of the page in Webmin.\u00a0 You will see an option to Add a new log for analysis, click it.<\/p>\n<p>Enter in the path found earlier in the Base logfile path.\u00a0 Set all other options to match the example found in the existing log file example and click Create.<\/p>\n<p>Now the log entry should be available with the other logs listed in the Webalizer module.\u00a0 Let\u2019s click on our newly created log entry.\u00a0 Now you should see the log files listed.\u00a0 At the bottom of the log file entry should be a Generate Report button, click it.<\/p>\n<p>Webmin will process the log files and generate a report.\u00a0 You can view this report or look at it later.\u00a0 Return to the log file list.<\/p>\n<p>Now we will view the report, click the log entry.\u00a0 Click the View Report button at the bottom of the page.\u00a0 The report should appear.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/05\/SummaryReport_Webalizer.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2285\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/05\/SummaryReport_Webalizer.png\" alt=\"SummaryReport_Webalizer\" width=\"725\" height=\"606\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/SummaryReport_Webalizer.png 725w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/SummaryReport_Webalizer-300x251.png 300w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/SummaryReport_Webalizer-100x84.png 100w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/SummaryReport_Webalizer-150x125.png 150w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/SummaryReport_Webalizer-200x167.png 200w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/SummaryReport_Webalizer-450x376.png 450w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/SummaryReport_Webalizer-600x502.png 600w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/a><\/p>\n<p>You can drill down through the months to get more granular information.<\/p>\n<p><strong>Generating log reports from external web hosts.<\/strong><\/p>\n<p>In this example, we will copy the web logs from a hosted Linux web site to the Webalizer system for analysis.\u00a0 Linux systems default to the Apache web log format, so in most cases these procedures should work.\u00a0 As always, be prepared to massage the data.<\/p>\n<p>The web logs files I have to work with are stored on a hosted Linux web site in a folder that FTP and SFTP cannot reach.\u00a0 This is the 1<sup>st<\/sup> hurdle because I won\u2019t be able to automate the process as easily.\u00a0 However, the log files can be access through the hosting providers web control panel and downloaded.<\/p>\n<p>The log files in my example are retained for a month and one week.\u00a0 The 2<sup>nd<\/sup> hurdle is that I\u2019m not able to bulk download all of the files.\u00a0 It takes about 10-15 minutes to download all of the log files.<\/p>\n<p>Now that all the individual log files have been downloaded, they will need to be concatenated.\u00a0\u00a0 This is the 3<sup>rd<\/sup> hurdle because Webalizer would need to be set to read each log file individually.<\/p>\n<p>Once the log file has been created, copy it to the Webalizer host using SFTP.\u00a0 Now Webalizer can be pointed to the log file and setup like any locally stored web log.\u00a0 After generating the report, it can then be viewed to show all the obscured information.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/05\/DailyUsage_Webalizer.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2289\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/05\/DailyUsage_Webalizer.png\" alt=\"DailyUsage_Webalizer\" width=\"518\" height=\"411\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/DailyUsage_Webalizer.png 518w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/DailyUsage_Webalizer-300x238.png 300w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/DailyUsage_Webalizer-100x79.png 100w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/DailyUsage_Webalizer-150x119.png 150w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/DailyUsage_Webalizer-200x159.png 200w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/DailyUsage_Webalizer-450x357.png 450w\" sizes=\"auto, (max-width: 518px) 100vw, 518px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Making the report available to view from a browser is the next step.<\/p>\n<p><strong>Web Reports<\/strong><\/p>\n<p>The Webalizer Logfile Analysis section in Webmin has our definition for what logs to process, were to store reports, how to process the logs, and at what interval to process them.<\/p>\n<p>Defining the Write report to directory in our existing definition is key.\u00a0 Choose a directory that doesn\u2019t have sensitive information in any sub folders.\u00a0 In this example, we\u2019ll define this path as the directory to write the report to.<\/p>\n<p>\/var\/www\/webalizer<\/p>\n<p>That\u2019s all that needs to be configured on Webalizer.\u00a0 The reports are on a schedule, so the information should update accordingly.<\/p>\n<p>Setting up Apache to display the reports on a browser is a matter of defining the report directory and creating an alias.\u00a0 Most information online steps through editing the Apache config file.\u00a0 We\u2019ll use Webmin to do the same thing.<\/p>\n<p>In Webmin go to Servers \/ Apache Webserver and click the Default Server.\u00a0 You could define the alias on other virtual hosts, but I wanted to keep this as simple as possible.\u00a0 However, the steps would be the same.<\/p>\n<p>Create a Per-Directory Option and set the path.\u00a0 In our example it is<\/p>\n<p>\/var\/www\/webalizer<\/p>\n<p>Next click the Alias and Redirects link.\u00a0 In the Document directory aliases, set the From and To fields as such.\u00a0 Then click Save.<\/p>\n<p>The Apache web service will need to be restarted so that the changes on the Apache config will take place.\u00a0 You can reboot the system or restart the Apache service.<\/p>\n<p>Once that is done, you should now be able to browse directly to the Webalizer reports.\u00a0 In our example, the web URL would be <a href=\"http:\/\/system_ip\/webalizer\">http:\/\/system_ip\/webalizer<\/a>.<\/p>\n<p><a href=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/05\/Statistics_Webalizer.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2294\" src=\"http:\/\/192.168.3.4\/wp-content\/uploads\/2016\/05\/Statistics_Webalizer.png\" alt=\"Statistics_Webalizer\" width=\"624\" height=\"383\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/Statistics_Webalizer.png 624w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/Statistics_Webalizer-300x184.png 300w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/Statistics_Webalizer-100x61.png 100w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/Statistics_Webalizer-150x92.png 150w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/Statistics_Webalizer-200x123.png 200w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/Statistics_Webalizer-450x276.png 450w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2016\/05\/Statistics_Webalizer-600x368.png 600w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><strong>Conclusion<\/strong><\/p>\n<p>That covers how to add additional web logs to the default instance of Webalizer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Webmin has a module for Webalizer that will report web usage on the linux system.\u00a0 Most often, the install of Webmin will already have a working module of Webalizer.\u00a0 However, there are times when the log files may change location or are become available after Webmin was setup. In this topic, we will cover how to process web log files stored on a local host as well as web logs from a remote host.\u00a0 Once processed, we will then&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.cloudacm.com\/?p=2280\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-2280","post","type-post","status-publish","format-standard","hentry","category-rd"],"_links":{"self":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/2280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2280"}],"version-history":[{"count":15,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/2280\/revisions"}],"predecessor-version":[{"id":2296,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/2280\/revisions\/2296"}],"wp:attachment":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}