Provider installation

This manual have been written thanks to Lawrence Gray

HOW TO USE FTP TO SET UP THE W3PERL SCRIPT ON YOUR WEB SITE


- Note :

From W3Perl 2.98, you do not have to install W3Perl on your provider server if you have access to your logs. You can either download them locally or the scripts can do the job for you if they are available from an URL.
If so, just install W3Perl locally (W3Perl for Windows). Activate in the configuration file the option to retrieve automatically your logfiles if they are located in your web server tree or download them locally.
It is really easier to install W3Perl this way and it will save your provider CPU .. who will be very happy. But real time stats won't be available except if you download your current logfile quite often.

If you really want to install W3Perl on your provider, follow these instructions :

- Overview :

Basically what you'll need to do is :

  1. downloading the package (w3perl.tar.gz for an unix server)
  2. unzipping it
  3. editing two variables in a file (/w3perl/admin/scripts/init.pl)
  4. uploading the files using ftp
  5. changing some file permissions

Once done, you could use the web admin interface to build your configuration file. Then run your stats.

- 1st STAGE : Pre-requis

- Things to check :

  1. First of all, do you have access to your log files ? (*)
  2. Do you know the path to your log files ?
  3. Do you have cgi-bin rights ?

If the answer is yes, then you can use this package.

(*) If you do not have logfiles access, you can install the page tagging package. Inserting a small piece of javascript into your pages will create logfiles for you.

- The next things to know are the PATH to your account, the CGI PATH (location where you can upload cgi scripts), and the Perl PATH of your provider.
- If you do not know what the path are, ask your ISP. It's the most basic piece of information that you need for setting up CGI scripts.
- Now make two directories called w3perl in your web. Make one for your cgi-bin (W3Perl CGI PATH) and one for your root directory (W3Perl PATH).

- 2nd STAGE : Configure path

- Next you need the w3perl package. Download the w3perl.tar.gz package and unzip this on your own computer.
- In order to build your configuration file, a web interface is available. If you want to use it, you will need to open the file /w3perl/admin/scripts/init.pl in notepad. If you do not want to install the web interface on your website, skip the next two steps (configuration files can be edited manually or built from the w3perl website)
- Check your Perl path is right (first line)
- Set $cgipath = "/www/yourpath/cgi-bin/w3perl"; (W3Perl CGI PATH) and $w3perlpath = "/www/yourpath/w3perl"; (W3Perl PATH)

- 3rd STAGE : Install the scripts

- What you have here may confuse you because various files are scattered through a number of directories, but essentially find all the .pl files in the collection and put them into your cgi-bin's w3perl directory (W3Perl CGI PATH).
- Here are the files that I use in my cgi-bin and I assume that if you have them then yours will also work:

  • cron-pages.pl
  • cron.inc.pl
  • cron-w3perl.pl
  • cron-refer.pl
  • cron-agent.pl
  • cron-session.pl
  • cron-url.pl
  • libw3perl.pl
  • cron-hour.pl
  • cron-day.pl
  • cron-week.pl
  • cron-month.pl
  • cron-year.pl
  • cron-error.pl
  • cron-history.pl
  • cron-heatmap.pl
  • dayrange.pl
  • pagegraph.pl
  • check_modules.pl
  • dayrange.pl
  • pagesend.pl
  • confstat.pl (*)
  • delconf.pl (*)
  • runconf.pl (*)
  • init.pl (*)
(*) Install them if you want to use the web interface to manage your stats/configuration files

- Upload them in ASCII not Binary mode.
- Set them all to CHMOD 755

- 4th STAGE : Install the resource files

- In the w3perl directory (W3Perl PATH) in your root directory load in the following directories:

  • admin
  • config
  • docs
  • resources
  • logs
  • tools (windows server only)

With all their contents!

- Set /config/ and /resources/admin/ with CHMOD 777

- Then upload also :

  • index.html
  • VERSION

- 5th STAGE : Graphic tool installation

- If you want a Graphical display of your statistics you need a programme called Fly or Flydraw
- Ask your ISP what Operation System they are using and then go to http://www.unimelb.edu.au/fly/fly.html
- Download the READY COMPILED BINARY for that operating system. If they do not have one for your particular operation system then you can try asking the people there or you can get hold of the SOURCE file and give it to your ISP and ask them to do you one.
- If you can get hold of a READY COMPILED BINARY all you need do is download the zipped package,
- Unzip and ignore everything in the package apart from one file called FLY.
- Place this in your cgi-bin and CHMOD it 775
- Remember where you put it because you will have to fill that in during the configuration process.
- If you cannot get hold of a copy, the programme will still work except you won't be able to see some nice histograms and pie charts.

- 6th STAGE : Build configuration file

- If you have chosen to install the web interface, you can now open up your browser and go to http://<localhost>/w3perl/admin/ where <localhost> is the server name where files have been uploaded. If you want to edit manually your configuration file, some are provided in the /w3perl/config/ directory. You could always use the w3perl online tool
- Click on Make configuration files and follow the procedures outlined. By filling in the details you will create a file called config.pl. Best is to use your own configuration filename (config-<website_name> for instance).
- Once created, look for this file in your FTP area /w3perl/config/config-<website_name>.pl and copy it to the w3perl directory in your cgi-bin (if you have a warning message at the end of the process).
- CHMOD to 755

- 7th STAGE : Ready

- You should now be able to analyse your logs.
- Return to your browser. Go to admin and click on Launch scripts
- Select the 'Init' icon to launch stats that will start your statistics from zero.
- Then run the incremental statistics function every day/week to accumulate your statistics.
- You should be aware you could get some timeout if the scripts take too long to compute .... providers can't allow scripts to run too long. If it happens, try to compute stats within a shorter number of days ... or run the scripts from command lines instead of a web interface ... or disable some time consuming option (reverse dns or robot detection) ... or install W3Perl locally ;)