How to install Awstats with XAMPP or WAMPP on Windows

Installing AWStats with XAMPP or the WAMPP build can be quite tricky. The AWStats website doesn’t really clarify how to install it correctly on a windows machine. This is the exact reason this tutorial is being made. To save you the hassle of banging your head against the desk for hours on end!


  • XAMPP/WAMPP must be installed, preferably to the C: Drive.
  • You must have a text editor installed to edit certain files. Try Netbeans, it is free.

Important things to do and take note of before we start

Please read through the following two steps, it is vital for you to understand before configuring your development environment with this how-to-tutorial.

  1. At any time that ‘XAMPP_WAMPP_INSTALL_DIRECTORY’ is specified within this tutorial, it needs to be replaced with Your XAMPP or WAMPP install directory. Example C:\XAMPP
  2. Add the PERL path variable to your computer (It may already be there after installing but just check in case). This will make it much easier when using the command prompt, meaning you won’t have to specify explicit paths to the perl.exe.
    • Right Click My Computer -> Properties -> Advanced System Settings -> Environment Variables.
    • Find the PATH variable and click edit -> Add the full path to the perl.exe folder eg in my case – C:\xampp_\perl\bin If there are already values in here, separate the last value with a semi-colon EG: C:\appData;C:\xampp\perl\bin
    • If you can’t find a PATH Variable, then simply click new and create one – Variable Name must be PATH and the value must be the path to your perl.exe directory eg in my case C:\xampp\perl\bin

Configuring And Installing Awstats

    1. Download the latest build from –, for this tutorial version 7.7 was used.
    2. Open the zip file that downloaded from the AWStats website.
    3. The zip will consist of a few folders and a file.
      1. docs (Folder)
      2. tools (Folder)
      3. wwwroot (Folder)
      4. (File)
    4. Open the wwwroot folder.
    5. Extract the js, CSS and icon folders to your XAMPP or your WAMPP root directory.
      1. If your using XAMPP, the root directory will be located in C:/XAMPP_WAMPP_INSTALL_DIRECTORY/htdocs/
      2. If your using XAMPP, the root directory will be located in C:/XAMPP_WAMPP_INSTALL_DIRECTORY/www/
    6. Find and open the CGI-bin folder located in the XAMPP or WAMPP install directory, for example, C:/XAMPP_WAMPP_INSTALL_DIRECTORY
    7. Create a new folder called ‘awstats’.
    8. Open the new AWStats folder and create another folder called CGI-bin.
    9. Go back to the zip file and extract the contents of the CGI-bin to the new awstats/cgi-bin folder. The path will be something like the following C:/XAMPP_WAMPP_INSTALL_DIRECTORY/cgi-bin/awstats/cgi-bin
    10. Go back to the zip file and drag the full classes folder to sit inside the new awstats/cgi-bin folder.
    11. Within the awstats\cgi-bin folder rename the awstats.model.conf to awstats.conf.
    12. Then go ahead and open the awstats.conf file in a text editor.
    13. Change the following lines
      1. LogFile=”/var/log/httpd/mylog.log” to LogFile=”C:/XAMPP_WAMPP_INSTALL_DIRECTORY/apache/logs/access.log”
      2. DirCgi=”/cgi-bin ” to DirCgi=”/cgi-bin/awstats”
      3. SiteDomain=”” to SiteDomain=”localhost” (Or your actual site url, eg: SiteDomain=””)
    14. Save and close the awstats.conf file.
    15. Within the awstats/cgi-bin folder, open the in a text editor.
    16. Change the first line #!/usr/bin/perl to #!C:/XAMPP_WAMPP_INSTALL_DIRECTORY/perl/bin/perl.exe
    17. Save and close the file.
    18. Go to C:/XAMPP_WAMPP_INSTALL_DIRECTORY/apache/conf and open httpd.conf in a text editor.
    19. Add the following to the bottom of the file and save it.
    20. Locate your apache httpd.conf file, it will be under C:/XAMPP_WAMPP_INSTALL_DIRECTORY/apache/conf
    21. Open it with a text editor and paste the following settings to the bottom of the file and save.
# Directives to add to your Apache conf file to allow use of AWStats as a CGI. 
# Note that path "/usr/local/awstats/" must reflect your AWStats Installation path. 
Alias /awstatsclasses "C:/XAMPP_WAMPP_INSTALL_DIRECTORY/cgi-bin/awstats/classes/" 
Alias /awstatscss "C:/XAMPP_WAMPP_INSTALL_DIRECTORY/htdocs/css/" 
Alias /awstatsicons "C:/XAMPP_WAMPP_INSTALL_DIRECTORY/htdocs/icon/" 
ScriptAlias /awstats/ "C:/XAMPP_WAMPP_INSTALL_DIRECTORY/cgi-bin/awstats/cgi-bin/" 
# This is to permit URL access to scripts/files in AWStats directory. 
<Directory "C:/XAMPP_WAMPP_INSTALL_DIRECTORY/cgi-bin/awstats/cgi-bin/"> 
Options None 
AllowOverride None 
Order allow,deny 
Allow from all 

Executing AWStats

Now that all the configuration is set up for Apache and AWStats to work together, we can now use Perl to run the stats build and give us those informative statistics.

  1. Hit the windows key + R on the keyboard together and type cmd and hit enter. Or go to start and search for ‘run’ and open it, type cmd and hit enter.
  2. The command prompt will now be open.
  3. Type the following command (Replacing WWW_YOURHOST_COM with the SiteDomain you specified earlier, eg: localhost) – perl C:/XAMPP_WAMPP_INSTALL_DIRECTORY/cgi-bin/awstats/cgi-bin/ -config=WWW_YOURHOST_COM –update
  4. If you got the error that Perl wasn’t recognized, then you will need to explicitly reference it like the following C:/XAMPP_WAMPP_INSTALL_DIRECTORY/perl C:/XAMPP_WAMPP_INSTALL_DIRECTORY/cgi-bin/awstats/cgi-bin/ -config=WWW_YOURHOST_COM –update
    1. Make note of what you set the -config parameter as it is needed to be supplied in the URL for viewing the statistics.
  5. Perl should now be executed, this may take a long time, depending on how long your website has been in development.
  6. Once phase 1 and phase 2 have completed in the command prompt, you can go ahead and view the statistics.
  7. Firstly, make sure you’re web server is switched on.
  8. Open a browser and type the following URL – http://WWW_YOURHOST_COM/awstats/ – In my case, the URL is http://localhost/awstats/
  9. Aw Stats will be loaded successfully in the browser.

Common Errors

If you get an error when navigating to your statistics data within the browser – For example, something along the lines of – couldn’t create child process: 720002: Go back to step 16 of the Configuring And Installing section and make sure that it has been changed properly.

If you get an object/file ‘not found error’, check the httpd.conf file within the Apache folder and make sure all the paths are parallel to your hard drives directories. Check out Steps 18 – 21 of the Configuring And Installing section again.


Hopefully, this will save you some major wasted time. If you have any problems setting this up, feel free to leave a comment and I will get back to you.

2 thoughts on “How to install Awstats with XAMPP or WAMPP on Windows

  1. Great tutorial! Very clear to follow. Thank you very much!

    There is an error, though. For step 10, the classes folder should be under awstats directory instead of awstats/cgi-bin.

    It is better to put Alias and StriptAlias inside … .

    I think that

    Order allow,deny
    Allow from all

    is deprecated and should be replaced by “Require all granted”.

  2. Very cool! Your instructions were very helpful, just set up awstats in 5 minutes!
    Only one note: For step 13 under Configuring And Installing Awstats, I set
    DirCgi=”/cgi-bin ” to DirCgi=”/cgi-bin/awstats/cgi-bin”

    Thank you for putting these instructions together!

Leave a Reply