

What I do is I copy all the contents of nf into, and just put the important rules inside each vhost config, so they’re easier to read, and shorter. If you have some rules that are shared among all your config, you put them here. It’s the parent of all the other config files. It’ll also fallback to this file if no other config file exists.Ī is an empty file. If you have ls the /etc/awstats folder, you’ll see that there’s by default 2 files here :Īnf is the main conf file, origin of all the other conf files. I’m personally not interested into having multiples conf files, for 1500 lines each, with each files differing of just 4 lines. If you take a look at nf, you’ll see that it’s a very complete conf, with plenty of comments, and all the available settings, all of that for just * suspense music * … 1500 lines. Then you just edit these files to your needs… Method I’m not fond of. Documentation says to clone that file when creating your own config files, with cp / ect / awstats / awstats. There is already a model configuration file inside the /ect/awstats/ directory : nf. So, for the vhost and, you should create these two files : Creating a configuration file for each vhostĪwstats is picky about the configuration files : you should have one config file by vhost, they should be named following the convention :, and should be placed inside the /ect/awstats/ directory. The last token ( %otherquot) means that “Oh, that string here does not mean anything.”. We teach awstats the meaning of each field when parsing the log. It’s used to set the settings shared by all your awstats config. In /etc/awstats/, add : LogFormat = " %host - %host_r %time1 %methodurl %code %bytesd %refererquot %uaquot %otherquot" log main Īs this last field is not used by awstats, we should tell it to ignore it. To use this format, add main at the end of your error_log directive.
#Awstats buildstaticpages plus
It’s the same as the combined format, plus the $http_x_forwarded_for bit at the end. In the server scope, add : log_format main '$remote_addr - $remote_user "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"' ). It’s used to capture the client IP address when he is connecting through a proxy of load balancer.įor that, we define another log format, named main in /etc/nginx/nf.

Using the default format is fine, but you can log one more field, that could be pertinent : the http_x_forwarded_for.

It’s equivalent to error_log / path / to / log. If you set your errors log like this : error_log / path / to / log. Nginx by default output logs that already can be read by awstats, as long as you use the Combined format. /usr/share/doc/awstats : docs, tools for building the static html pages, icons and other static files used by html./usr/share/awstats : contains all tools and libraries used by awstats./etc/awstats : contains all the conf files for each of your awstats installation.
#Awstats buildstaticpages install
On debian squeeze, awstats install things in 3 places : Install Awstats apt - get install awstats
