After searching the Web and here in the Gentoo forums, it appears that many people have had issues getting AWStats to work from the ebuild (I was no exception). After having past mixed success with webapp-config, I knew I did not want to go down that path. This howto illustrates which configuration files need to be modified to get you operational without needing to run webapp-config or any of the config tools that come with awstats. Hopefully this "mini" howto will provide some assistance to those in need.

Software

This howto was written using the current ebuild for awstats 6.1 and apache2

Code:

emerge awstats

My installs were for servers with virtual hosting, so if you plan on using AWStats with virtual hosts then add the USE flag:

Code:

USE="vhosts" emerge awstats

AWStats is installed into the following directory: /usr/share/webapps/awstats/6.1

Apache Configuration

Step 1:
Start by copying the file postinst-en.txt to the apache config directory

note the location of the password file (/etc/awstats/users.pwd), we will make this shortly.

Step 3:
Edit the Apache configuration file to include the newly created awstats.conf by adding the following to the /etc/apache2/conf/apache2.conf file:

Code:

Include conf/awstats.conf

If you are looking for a place to add the line, if you go just after the modules section (about a third down) there is a section for Global Configuration.

Step 4 (optional):
If you added the section for password protecting the awstats then you will need to create the /etc/awstats/users.pwd file using the htpasswd2 program by executing the following:

Code:

htpasswd2 -c /etc/awstats/users.pwd <username>

You will need to replace <username> with an actual username - the program will then prompt you for a password. You can also add additional users to the file by running htpasswd2 again, but without the create flag:

Code:

htpasswd2 /etc/awstats/users.pwd <anotheruser>

Note: For compatability, as of apache2, htpasswd was renamed to htpasswd2.

AWStats Modifications and Configuration

Step 1:
The permissions for some of the awstats directories and files need to be modified as such:

Note: the awstats instructions are a bit confusing, they say use your virtual domain. However, you really need to use the FQDN for your web server (or virtual host), because when you call the awstats script from the browser, it will use the FQDN for finding the config file and stat files.

Step 4:
You need to create a directory for storing the awstats statistical files. You may want to make the directory /var/www/localhost/awstats or if you are virtual hosting, then perhaps /var/www/mydomain.com/awstats. You will need to have an awstats directory for every site you are hosting if you have a virtual hosting setup.

Step 5:
Modify your awstats config file /etc/awstats/awstats.www.mydomain.com.conf so that the required directives are set accordingly. The following are the ones you will need to change:

I currently keep my log files for each virtual host seperate, however, if you want to consolidate all virtual hosting records into a single access_log file, the following site has great information for making awstats parse the file correctly for each virtual host:

enobis: thanks for the excellent howto. Saved me much time and effort!

As I have a lot of domains to tune, I came up whith a script for generating the awstats.$mydomain.conf files instead of copying the template and editing by hand. Here it is in case anyone would need a speed up:

Code:

# YD, 2005-01-20
# creating all awstats per-virtual-host configs and tunning them
# according to http://forums.gentoo.org/viewtopic.php?t=279860

This is a great how-to, been trying to get awstats to work for a while and now it does. One problem I have came across however. I tried to go back in to setup a second awstats for a virtual host and its not showing that virtual hosts informatiom, just one for the default server.

I changed all the important information in the new awstats.virtualhostname.conf file and reran the

you should also look into the javascript file. it can report information about the users settings but its a little more complex to set up. on ie it takes about 2 seconds to run the script, so you can try removing the plugin detection. I only cared about getting the users screen size so i removed the detectIE and detectNS functions completely. remember to edit the string at the bottom of the file then.

Nice guide. The only problem I'm having is with the icons. I have played with the DirIcons directive with no luck. I can post whatever config files you'd like.

deflin39_________________The musicians today, who don't do drugs, and in fact speak out against it-"We're rockers against drugs"-boy, they suck. Suck. Ball-less, soul-less, spirit-less, corporate little bitches, suckers of Satan's cock, each and every one of themBillHicks

Could someone plase show me their /etc/apache2/conf/awstats.conf file please so I can compare it to mine. I got the icons working finally, but I think I opened to big of a hole with my config file

Thanks!
deflin39_________________The musicians today, who don't do drugs, and in fact speak out against it-"We're rockers against drugs"-boy, they suck. Suck. Ball-less, soul-less, spirit-less, corporate little bitches, suckers of Satan's cock, each and every one of themBillHicks

I didn't have the last section in the config file, because I was not password protecting awstats. The how-to doesn't make it clear that section needs to be there, even if you are not using AUTH. I just removed the 3 AUTH commands and I get icons now.

deflin39_________________The musicians today, who don't do drugs, and in fact speak out against it-"We're rockers against drugs"-boy, they suck. Suck. Ball-less, soul-less, spirit-less, corporate little bitches, suckers of Satan's cock, each and every one of themBillHicks

3. Follow the instructions in /etc/apache2/conf/modules.d/12_mod_auth_mysql.conf - select ONE of the database templates (the last one being the most flexible for authentication needs) and create the database using the template. I strongly suggest that you choose some better password for authuser.

Populate the new database with required user/group accounts.

4. You need to modify the last section of /etc/apache2/conf/awstats.conf