Virtual Host Installation (Apache)

If you need to install w3perl for each of your virtual hosts, you only need to install the package once (easier for upgrade !). You'll need to make first a master installation on one server and then use the installation described here for others.

* Master installation

The first step is to install a master installation of w3perl. If you are using an Apache server, just use 'install.pl -a'. If it fails, edit $pathcgi and $pathw3perl and run it. See specific documentation if you need more help.

* Virtual host installation

Your virtual host doesn't need to have a cgi directory to be able to install w3perl.

  1. As a webmaster

    - All virtual host : install.pl -e
    If you want to install w3perl on each virtual hosts, use the '-e' flag. The script will read the Apache server configuration file and will install w3perl for each virtual hosts found in this file.

    - One virtual host : install.pl -b
    Edit $virtual_web (virtual web directory) , $virtual_web_log (virtual logfile directory), $virtual_www (virtual web name). Then run 'install -b'

  2. As a client

    Make a symbolic link to the w3perl install.pl script (either in the cgi virtual web directory or in your main directory if you don't have cgi).
    (cd /<vhosts>/cgi-bin/ ; ln -s /<master_install>/cgi-bin/w3perl/install.pl install.pl).
    By running the script with the -u flag, the current directory will be read from the script and will find the right parameters from the Apache configuration server.

If the script fail to find your Apache configuration file, you could load it from command line via the -j flag.

* Virtual host stats

  1. As a webmaster

    To run the stats for your virtual hosts, just select the right configuration file and run cron-w3perl.pl -a -c <virtual_host_config>

  2. As a client

    You need first to activate the w3perl installation with the 'install.pl -u' script. Once done, a new script is created in your directory : cron-w3perl.pl You just need to run this script with the '-a' flag. So two steps are required :

    • install.pl -u
    • cron-w3perl.pl -a

* Virtual host crontab

Once the stats completed, you can choose to add the cron-w3perl.pl script in your crontab. You need to call the 'crontab -e' command from telnet. A text window will appears, then enter your crontab entry for cron-w3perl.pl (something like 01 00 * * * * /<your_path>/cron-w3perl.pl -e). Then check with 'crontab -l' your entry is valid.

The '-e' flag will run all scripts in a incremental way (saving CPU), 01 00 means the scripts will be launch at 00 h 01 the night. You need to run this script only ONCE a day with this flag.

If you want to get more stats update (every hour), don't use the '-e' flag. Use 'cron-w3perl.pl -b' to see actual time launch and edit the script if you need changes. Default should be ok for most people. Then add cron-w3perl.pl to your crontab without the '-e' flag.

Client (virtual host) don't need to specify a configuration file to launch their own cron-w3perl.pl script but webmaster should specify which one they want to run via the '-c' flag (if no flag, default is config.pl)


Examples
* Master installation
  1. Download fly.tar.gz
  2. Uncompress the package in /<master>/htdocs/
  3. cd fly and type 'make'
  4. Move the fly binary to /<master>/cgi-bin/
  5. Download w3perl.tar.gz
  6. Uncompress the package in your /<master>/htdocs/
  7. cd w3perl and edit install.pl
  8. Change $pathcgi to /<master>/cgi-bin/w3perl/ and $pathw3perl to /<master>/htdocs/w3perl/
  9. Run install.pl
  10. Use your browser to http://<your_webserver>/w3perl/admin/
  11. Make your configuration file by following the forms
  12. cd to /<master>/cgi-bin/w3perl/
  13. Run cron-w3perl.pl -a to init your main stats
  14. Add cron-w3perl.pl -e for daily update of your stats in your crontab

* Vhost installation

  1. cd /<vhost>/
  2. Make a symbolic link to /<master>/htdocs/w3perl/install.pl
  3. Run install.pl -u
  4. A cron-w3perl.pl will be created. Run it with cron-w3perl.pl -a
  5. Add cron-w3perl.pl -e in your crontab