This manual covers the installation and configuration of the Atomia Awstats Agent to enable your customers to fetch statistics for their websites.
Before you begin
The Atomia Awstats Agent is part of the Atomia agents package. You should start by reading the general package overview and instructions here.
Pre-installation actions
The agent doesn’t require anything special before the installation.
Post-installation actions
In order to properly function, the agent must use root
Linux user. So, the first thing to change is the default agent user in the /etc/atomia/config
. Open the file and replace atomia-agent
with root
.
One more thing to do is to create and set up the agent’s configuration file. Start by copying the example config file:
sudo cp /etc/atomia/awstats-agent.json.example /etc/atomia/awstats-agent.json
Edit new copy and change some default properties if needed.
Example file and what each option means:
{
"auth": {
"username":"someauthusername",
"password":"someauthpassword"
},
"awstats_config": {
"dir": "/etc/awstats/",
"template": "/usr/lib/atomia/awstats/awstats.conf.template",
"https_force_enabled": false,
"https_file_path": "/storage/configuration/awstats-https-enabled.lst"
},
"port": 6000,
"host": "192.168.33.19",
"reports_dedicated_site_path": "/storage/content/awstats-sites",
"protected_stats_list_file": "/usr/lib/atomia/awstats/protected-stats-list",
"log_path": "/var/log/atomia/awstats-agent.log"
}
Option | Meaning |
---|---|
auth | Basic access authentication (username and password) for the atomia Awstats agent. Without these fields, the client won’t be able to use the Awstats agent. |
https_force_enabled | If you want to force the Awstats agent to go through HTTPS (true/false) |
https_file_path | Absolute path for the list of websites (awstats.{HOSTNAME}) which should use HTTPS |
port | Port for the management interface to listen on. |
host | The IP address of the machine which gonna be used for listening by the Awstats agent. |
reports_dedicated_site_path | |
protected_stats_list_file | |
log_path | The file where should Awstats agent log info and errors. |
Changes in the Automation Server
In order to connect the Cron agent with the Atomia provisioning module, Resource and ProvisioningDescription files should be updated on the server where Atomia Automation Server is installed.
Resource description
Make sure you have the following resource in the resource file (C:\Program Files (x86)\Atomia\AutomationServer\Common\Resources.xml
):
<?xml version="1.0"?>
<resourceDescription xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<bindings>
<moduleList>
<module name="Atomia.Provisioning.Modules.AWStatsRest.AWStats" resourceAsignmentPolicy="RoundRobin" />
</moduleList>
<resourceList>
<resource name="AWStats">
<property name="AwstatsBaseUrl">http://192.168.33.19:6000</property>
<property name="Username">someauthusername</property>
<property name="Password">someauthpassword</property>
<property name="ReportsSiteIP">192.168.33.19</property>
</resource>
</resourceList>
</bindings>
</resourceDescription>
In the transformation file example above, the AwstatsBaseUrl
property should match exactly the host
and port
properties in the awstats-agent.json
file (as defined in the example at the beginning of this section). Also, the Username
and Password
properties should be equivalent to the corresponding fields in the auth
section of the same config file.
Provisioning description
Make sure that all Awstats simple services have REST client set as a providing module. You can do that by placing the following transformation file on the Automation server inside the folder: C:\Program Files (x86)\Atomia\AutomationServer\Common\ProvisioningDescriptions\Transformation Files
<?xml version="1.0" encoding="utf-8"?>
<provisioningDescription xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<simpleService providingModule="Atomia.Provisioning.Modules.AWStatsRest.AWStats" xdt:Locator="XPath(//*[@providingModule='Atomia.Provisioning.Modules.AWStats.AWStats'])" xdt:Transform="SetAttributes(providingModule)" />
</provisioningDescription>
Setting up support packages
On each Linux web server make sure that the package atomiastatisticscopy
is installed and the Cron job is running.
On each Windows web server make sure that the program WindowsStatisticsLogCopy
is installed and its windows service running.
On the Awstats agent server make sure that the program statisticsprocess
is installed and running.
Running the service
systemctl start atomia-awstats-agent