![]() ![]() You’re free to add more setting if some of your vhost requires additional customization. You could change that to another directory, or have a subdirectory for each vhost, like /var/lib/awstats//.īut even if you use the default setting, you have to set it in each config, as it can not be inherited from. We start with an empty file, insert the following lines # Path to you nginx vhost log file LogFile = "/var/log/nginx/" # Domain of your vhost SiteDomain = "# Directory where to store the awstats data DirData = "/var/lib/awstats/" # Other alias, basically other domain/subdomain that's the same as the domain above HostAliases = "By default, awstats store all its data inside /var/lib/awstats/, which is the default settings. 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. ![]() 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.On debian squeeze, awstats install things in 3 places : Install Awstats apt - get install awstats Creating a configuration file for each vhost.You will then get redirected to a new page showing you your Website Statistics, you can select whatever information you want to view from the left pane. Click on the V iew icon on the right of domain name for which you wish to view statistics.Login to your cPanel account, search for Awstats and click on its icon.Here I’m going to help you to access Awstats using cPanel: The statistics report gives details about the amount of people coming to your website and other information such as: Once your website is live over the internet, you may want to keep a track of how many people are visiting your website.ĬPanel offers several built-in statistic reports, and Awstats is one of the more popular programs to see the Website statistics. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |