![]() Statistics for yourdomain.ext should now be available at:įor if you have multiple config files. Reload apache2: /etc/init.d/apache2 reload.Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Otherwise, add this code inside the VirtualHost tag for each domain you want to monitor: Alias /awstatsclasses "/usr/share/awstats/lib/"Īlias /awstats-icon "/usr/share/awstats/icon/"Īlias /awstatscss "/usr/share/doc/awstats/examples/css" If you have no VirtualHosts set up, place the following code in '/etc/apache2/sites-available/default'. Navigate to /etc/apache2/sites-available/ cd /etc/apache2/sites-available/.In order to access Awstats, we have to tell Apache2 where it is. generate the initial stats for AWStats based on existing var/log/apache2/access.log: /usr/lib/cgi-bin/ -config=yourdomain.ext -updateįirst tell your apache to use mod_cgi if you haven't enabled it yet a2enmod cgi.make the following changes: LogFile="/var/log/apache2/access.log" SiteDomain="yourdomain.ext" HostAliases="localhost 127.0.0.1 yourdomain.ext".Open file with vi or nano: vi /etc/awstats/ or nano /etc/awstats/.Create a copy of nf for each domain: cp /etc/awstats/nf /etc/awstats/.Install AWStats with Synaptic or sudo apt-get install awstatsĪwstats configuration files in Ubuntu are located in /etc/awstats. For more help, get XChat and subscribe to channel "#awstats" on the Ubuntu Server. It assumes you already have an Apache2 web server up and running. The following documentation contains specific information on installing and configuring Awstats with Ubuntu and Apache2. It can analyze log files from all major server tools like Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp servers. It uses a partial information file to be able to process large log files, often and quickly. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. This script will fetch the Apache log from the peer server, merge it with the local apache log into a single file, sort it by time stamps to avoid awstats complaining about dates out of order and finally parse it and create a new database file.AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. usr/bin/awstats -config =-update -showcorrupted -showdropped # Remove the temp file rm -rf /tmp/ *. # Clean up rm -f $PARSE_LOG $AWSTATS_LOG # Fetch the log from the other server sudo -u ssh $\)|/\1\2-\3-\4 \5:\6:\7|/' > $AWSTATS_LOG # Update the AWStats database (the LogFile=/tmp/awstats.log in nf) #!/bin/bash OTHER_SERVER = "" APACHE_LOG = "/var/log/apache2/access.log" AWSTATS_LOG = "/tmp/awstats.log" PARSE_LOG = "/tmp/parse.log" trap 'rm -rf /tmp/*.$$' 2 3 4 9 I will create a script first /usr/local/bin/awstats_parse_apache_log.sh: By default it runs once per day collecting data and generating daily and monthly reports. Now that we have the tool configured we can go on and schedule it to run as frequently as we need. If DNS lookup was already made by the logger (web server ), you should change your setup DNSLookup =1 into DNSLookup =0 to increase awstats speed. Phase 2 : Now process new records (Flush history on disk after 20000 hosts ).ĭropped record (method/protocol '-' not qualified when LogType =W ): -|-|226||-|-|400| 06:25:28|64|-|Dropped record (method/protocol 'CONNECT' not qualified when LogType =W ): 141.212.121.184|US|0||-|CONNECT|301| 21:54:19|638534|/index.php|Warning: awstats has detected that some hosts names were already resolved in your logfile /tmp/awstats.log. Searching new records from beginning of log file. Phase 1 : First bypass old records, searching new record. $ sudo /usr/bin/awstats -config =-update -showdropped -showcorruptedĬreate/Update database for config "/etc/awstats/nf" by AWStats version 7.2 (build 1.992 )įrom data in log file "/tmp/awstats.log".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |