eldy / AWStats

AWStats Log Analyzer project (official sources)
https://www.awstats.org
374 stars 120 forks source link

local server monitoring #242

Open maravento opened 12 months ago

maravento commented 12 months ago

I would like to know what the configuration is to use this monitor on a local server. All the procedures I have read are for monitoring websites, but not local servers (localhost 127.0.0.1) The objective is to monitor the local network. So, in case it can be done, please fix this installation and configuration procedure (or provide one for Ubuntu server 22.04):

apt install awstats

# configure
nano /etc/awstats/awstats.conf
replace:
LogFormat=4 with LogFormat=1
and
SiteDomain="" with SiteDomain="127.0.0.1" or SiteDomain="localhost" or SiteDomain="0.0.0.0" (???)

PD: unnecessary? `cp /etc/awstats/awstats.conf /etc/awstats/domain-example.conf`

# apache
nano etc/apache2/conf-available/awstats.conf
# create new
Alias /awstats-icon/ /usr/share/awstats/icon/
Alias /awstatsclasses/ /usr/share/java/awstats/

<Directory /usr/share/awstats>
    Options FollowSymLinks
    AllowOverride None
    # access permission for your local network
    Require ip 127.0.0.1
</Directory>

# activate and restart
a2enconf awstats
a2enmod cgid
systemctl restart apache2

# generate reports ( reports are updated for hourly by Cron )
*/10 * * * * www-data [ -x /usr/share/awstats/tools/update.sh ] && /usr/share/awstats/tools/update.sh
# Generate static reports:
10 03 * * * www-data [ -x /usr/share/awstats/tools/buildstatic.sh ] && /usr/share/awstats/tools/buildstatic.sh

# access (?):
https://localhost/awstats/awstats.pl

thk

chuckhoupt commented 11 months ago

The SiteDomain directive should be set to the hostname you typically use to access the site. So if you typically browse via http://localhost, then set SiteDomain="localhost". Note that the SiteDomain Doc say it is only used if you also activate ShowLinksOnUrl (for single site logs).

maravento commented 11 months ago

by default:

# Each URL, shown in stats report views, are links you can click.
# Possible values: 0 or 1
# Default: 1
#
ShowLinksOnUrl=1

Please review the procedure described above and confirm if it is correct, since there is no access, I don't know which port I should use with localhost, the url https://localhost/awstats/awstats.pl does not work, etc etc

what about: cp /etc/awstats/awstats.conf /etc/awstats/domain-example.conf (it is necessary?)

chuckhoupt commented 11 months ago

I don't know which port I should use with localhost, the url https://localhost/awstats/awstats.pl does not work

Possibly there is confusion here. For a localhost web-server you'd usually use port 80. This means you'd use http not https (note s), i.e. http://localhost. If you're running the website on a different port, you can add it to the url, e.g. http://localhost:8080.

maravento commented 11 months ago

Please, I would appreciate it if, in order not to waste time, you describe yourself, in your own words, the installation and configuration procedure, step by step, for localhost (not website) ubuntu (22.04)