12/6/2023 0 Comments Install awstats ubuntu nginxSiteDomain="# Directory where to store the awstats data This parameter is used to analyze referer field in log file and to help AWStats to know if a referer URL is a local URL of same site or an URL of another site. Note that one problem was I had the SiteDomain wrong - I had omitted the "It's to This extends the /etc/awstats/ file with site specific values. # /etc/nginx/sites-enabled/Īccess_log /var/log/nginx/access.log combined_custom Of course I had to have my server use this configuration. '"$http_referer" "$http_user_agent" $host $request_time $upstream_cache_status' Log_format combined_custom '$remote_addr - $remote_user ' This is the standard Nginx combined log format, which maps to awstats LogFormat=1, plus three extra fields I wanted in my logs # /etc/nginx/nf They key problem was I had the AWStats site config incorrect, but I don't think my Nginx log format or my AWStats format string were right either. I finally worked it out, after about 6 hours of effort. Searching new records from beginning of log file.Ĭan anyone spot what's not right? I can't find any additional information or awstats logs that would give further information. Phase 1 : First bypass old records, searching new record. Running '"/usr/share/awstats/-configdir="/etc/awstats"' to update config Ĭreate/Update database for config "/etc/awstats/" by AWStats version 7.0 (build 1.971)įrom data in log file "/var/log/nginx/". Here's the awstats output # /usr/share/awstats/tools/awstats_ now -awstatsprog=/usr/share/awstats/wwwroot/cgi-bin/ HostAliases="LogFormat = "%host %logname %time1 %virtualname %methodurl %code %bytesd %refererquot %uaquot %otherquot %otherquot %otherquot %otherquot" # Other alias, basically other domain/subdomain that's the same as the domain above # Directory where to store the awstats data ![]() Anything not here is standard and inherited from the main configuration file # Path to you nginx vhost log file '"$upstream_cache_status" "$sent_http_content_encoding" ' '"$http_user_agent" "$http_x_forwarded_for" "$request_time" ' '$status $body_bytes_sent "$http_referer" ' Here's my Nginx log format log_format main '$remote_addr - $remote_user "$host" "$request" ' ![]() I've tried many variations and I just can't get it working. I'm having trouble getting AWStats to parse my logs - I suspect it's because I can't get the LogFormat right. I've installed AWStats 7.0 (the latest version in the Amazon Linux repository) to try to get additional information about bandwidth usage.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |