W3perl
W3Perl ist ein Loganalyzer Tool für Web-, Mail-, Ftp- oder Proxyserver.
Install
Hier eine Anleitung zum Installieren.
cd /var/www wget http://w3perl.com/download/w3perl.tar.gz tar xfz w3perl.tar.gz
Nun Wechselt man in das neue Verzeichnis und erstellt sich eine
„htpasswd“ zum Authentifizieren und eine pass.txt im „admin“ Verzeichnis.
cd w3perl htpasswd -c htpasswd.users <LOGIN> cd admin cp pass.txt.default pass.txt vi pass.txt
Diese „pass.txt“ muss wie beschrieben editiert werden.
Nun editiert man in der „install.pl“ folgende Pfade:
cd /var/www/w3perl vi install.pl
Diese Pfade anpassen:
$pathcgi = "<PFAD_ZU_CGI-BIN_VERZEICHNIS/w3perl"; $pathw3perl = "<PFAD_ZU_WEBSERVERROOT/W3PERL";
mkdir /usr/lib/cgi-bin/w3perl chown -R www-data.www-data /usr/lib/cgi-bin/w3perl
Zum Schluss führt man diese Datei aus.
Vorher aber noch die Dateirechte anpassen.
chown -R www-data.www-data /var/www/w3perl cd /var/www/w3perl su -c ./install.pl www-data
Webserver
Ich nutze als Webserver „nginx“. Hier eine Mögliche Konfiguration
location /w3perl {
try_files $uri $uri/ /index.html;
}
location /w3perl/admin {
auth_basic "W3Perl erfordert ein Login";
auth_basic_user_file <PFAD_ZU_HTPASSWD.USERS>;
}
include fcgiwrap.conf;
location ~ ^/cgi-bin/.*\.cgi$ {
include fastcgi_params;
fastcgi_param AUTH_USER $remote_user;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
fastcgi_pass fcgiwrap;
}
location /<PFAD_ZUM_STATISTIK_VERZEICHNIS> {
index index.html;
# try_files $uri $uri/ /index.html;
auth_basic "W3Perl erfordert ein Login";
auth_basic_user_file <PFAD_ZU_HTPASSWD.USERS>;
}
Hier noch die dazugehörige fcgiwrap.conf
# Include this file on your nginx.conf to support debian cgi-bin scripts using
# fcgiwrap
location /cgi-bin/ {
# Disable gzip (it makes scripts feel slower since they have to complete
# before getting gzipped)
gzip off;
# Set the root to /usr/lib (inside this location this means that we are
# giving access to the files under /usr/lib/cgi-bin)
root <PFAD_ZUM_ROOT_VERZEICHNIS_IN_DEM_CGI-BIN_LIEGT>;
# Fastcgi socket
fastcgi_pass unix:/var/run/fcgiwrap.socket;
# Fastcgi parameters, include the standard ones
include /etc/nginx/fastcgi_params;
# Adjust non standard parameters (SCRIPT_FILENAME)
fastcgi_param SCRIPT_FILENAME /usr/lib$fastcgi_script_name;
}
Konfigurieren
Nun können erste Konfigurationsdateien im „Admin-Bereich“ angelegt werden.
Am besten ist es die Konfigurationen einmal in der Konsole zu testen.
/usr/lib/cgi-bin/w3perl/cron-w3perl.pl -a -c <KONFIGURATIONSDATEI>