AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Awstats for multiple domains2/3/2024 ![]() Copy the AWStats files into the web directory:.If you haven't already, create your stats website in the Dreamhost control panel.This installation must be done from the Unix command line. Log directory: /home/user2/log/example2.ca/http Using Dreamhosts standard method of creating websites, we have the following: username: statsuser ![]() ![]() Through group permissions, these accounts can write into the statsuser directory space. To get around this, the cron job that updates the stats site must run from user1 and user2. Log files can only be read from their user account. There are two sites: and These run under the user names user1 and user2 respectively. This site runs under the username statsuser. There will be a single site,, that presents an index of statistics pages. These are listed in the Reference section at the end of this article. The source information came from the Dreamhost wiki articles. Ostensively I'm making them available so they will benefit others, but in reality I'm posting them here so I can find them again if I need them! :-) AWStats isn't intended for install exactly the way I did it, but this configuration does work. The following are notes I made while installing AWStats. In my case, I wanted a dedicated statistics website for displaying statistics from other websites. Dreamhost has a number of good wiki articles on installing AWStats, but they presuppose installing in a website subdirectory. Dreamhost doesn't make it automatically available, you need to install it yourself. Thanks to Kilkanen for the methodology to work this out - ie start with the combined format and work forwards.AWStats is one of the more popular free open source statistics packages available. I haven't gone any further in getting AWStats working, but once I do I'll update this post with anything I find that's tricky. LogFormat="%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot %virtualname %other %other" # LogFormat="%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot" # This works with the Nginx combined log format SiteDomain="# 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
Read More
Leave a Reply. |