Here are the step by step instructions to install
AWSTATS 6.5
Locally under mac osX Panther/Tiger.
And on OS X SERVER 10.4
Many thanks to Gene Hobbs for the MacOSX Server part.
How was your system Installed?
If you installed panther from updating a previous version of mac OS X(10.1 or 10.2)
you might end up having problems running complex perl applications later on,
I strongly suggest you reinstall Panther(10.3) from the cd,
selecting "Archive and Install" in the custom installation settings.
This will keep you current user settings
Be aware that this will disable some 3rd party applications or drivers,and that you will have to
reconfigure printers. simply reinstalling those drivers will work afterward.
Use your MAc OS install CD to install Xcode Tools, since some features/scripts needs it for install and runtime of awstats
Since we need to edit files that belong to the system, we must enable the SuperUser of the computer.


Root user is now enabled.!
top
Go in System preferences, under the sharing pane, and disable Personal Web Sharing
by unchecking it

Then you can close the system Preferences.
**Mac OS X Server: Simply turn off WEB SERVICES in the Server admin tool

Now for the fun Part!
here are a bunch of commands to be executed in Terminal,
when you seee <enter>, don't type it.. just hit the enter key :)

SCRIPT EXECUTION:
The script will introduce himself, then detect the OS type, dont worry if it displays:
-----> Running OS detected: Linux, BSD or Unix
We are in fact runninx a Linux port
then the script will tell you a warning about directory structure..like this:

To this question Answer YES (y).
Then it will check for the webserver config file(httpd.conf) and ask you if you want to setup Apache to write 'combined' log files [y/N] ?
ANSWER YES
Then it will add directives to the config files.
You will then be prompted to build a New aswtats config/profile
again answer yes
then enter the name of your site/profilename
it can be anything but no spaces are allowed
for example: www.domain.com or localhost or blahblah
then it will ask where you want the config file saved
keep the default settings(/etc/awstats/)
then it will try to restart apache and tell that there is no such service httpd, no worries
then tell you how to update, press enter twice to end the config script
CONFIG PART IS DONE(almost)!!!
Before we can succesfully update awstats, we must make the folder where Awstats will save the processed files writable.:
In terminal,type:
cd /library/webserver/documents/awstats/wwwroot/cgi-bin<enter>
then type
chmod 777 .
(don't forget the dot at the end)
Now we need to adapt the newly created awstats.yourprofile.conf file a bit.


Done editing the config file...
top
This is a little tricky part if you never did it.
Mac OS X have some hidden maintenance scripts that run by night that will flush the web acces log
from time to time, to prevent this we must tell Apache to write a different logfile,
so that the Hidden script don't erase any of our hits.
Here's how:


**Mac OS X Server: In httpd.conf, change the lines :
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
To read
LogFormat " %{PC-Remote-Addr}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat " %{PC-Remote-Addr}i %l %u %t \"%r\" %>s %b" common
Go back in System preferences, under the sharing pane, and enable Personal Web Sharing
by checking it or pressing the start button

Then you can close the system Preferences.
**Mac OS X Server: Turn WEB SERVICES back on in the Server admin tool
Since we just created a new log file within apache, we must create a hit for the log file to be created,
so simply click here
This will open your Browser and hit your local web page( the main apache page)
if you prefer to see the user area, add ~username/ in the adress bar.
Now updating for the first time..
Open terminal, if you closed it earlier, and type:
cd /library/webserver/documents/awstats/wwwroot/cgi-bin<enter>
then type :
perl awstats.pl -update -config=theconfigname
Where Theconfigname is the name you have entered in the awstats configure script.
When the update is done, point your web Browser to:
http://localhost/awstats/awstats.pl?config=Theconfigname
You can now exit terminal, and you have awstats working locally.

Isn't that cool?
Hope this helps,