Context:
Via een topic kwam ik op een applicatie die netwerk stats mooi kon bijhouden. Het programma heeft een 1.6 versie, en een 3.0 Beta. De 1.6 versie werkte zo goed, dat ik de 3.0 versie graag zou willen proberen.
Probleem:
Zo makkelijk als bij 1.6 via apt-get installeren ging helaas niet. Dus ik heb het volgende gedaan.
Om vnStat te installeren:
Before proceeding, make sure that libgd2 and libgd2-dev are installed. The
binary cannot be compiled otherwise. Also vnStat 1.4 or later needs to be
installed and configured. Then run as root the usual
make && make install
Vervolgens zit er een mapje examples een .cgi script.
Daarvoor moest ik het volgende doen:
Perl installeren
Enable CGI and perl support for apache2 server
You need to install the following package
sudo aptitude install libapache2-mod-perl2
Configure a cgi-bin directory
You need to create a cgi-bin directory using the following command
sudo mkdir /home/www/cgi-bin
Configuring Apache to allow CGI program execution is pretty easy. Create a directory to be used for CGI programs and add the following to the site configuration file (again between the <VirtualHost> tags).
ScriptAlias /cgi-bin/ /home/www/cgi-bin/
Nu probeer ik dus het CGI script aan te roepen en dan geeft apache de volgende errors.
Hierbij heb ik dus geprobeerd om zowel /nwstats.cgi als perltest.pl uit te voeren.
De rechten staan op dit moment als volgt:
-rwxr-xr-x 1 root root 182 2008-10-06 17:30 perltest.pl
-rwxrwxr-x 1 administrator administrator 4254 2008-10-06 17:08 vnstat.cgi
urls/how to's:
http://webmaster.iu.edu/tool_guide_info/cgi.shtml
http://www.ubuntugeek.com...ort-in-ubuntu-server.html
Via een topic kwam ik op een applicatie die netwerk stats mooi kon bijhouden. Het programma heeft een 1.6 versie, en een 3.0 Beta. De 1.6 versie werkte zo goed, dat ik de 3.0 versie graag zou willen proberen.
Probleem:
Zo makkelijk als bij 1.6 via apt-get installeren ging helaas niet. Dus ik heb het volgende gedaan.
Om vnStat te installeren:
Before proceeding, make sure that libgd2 and libgd2-dev are installed. The
binary cannot be compiled otherwise. Also vnStat 1.4 or later needs to be
installed and configured. Then run as root the usual
make && make install
Vervolgens zit er een mapje examples een .cgi script.
Daarvoor moest ik het volgende doen:
Perl installeren
Enable CGI and perl support for apache2 server
You need to install the following package
sudo aptitude install libapache2-mod-perl2
Configure a cgi-bin directory
You need to create a cgi-bin directory using the following command
sudo mkdir /home/www/cgi-bin
Configuring Apache to allow CGI program execution is pretty easy. Create a directory to be used for CGI programs and add the following to the site configuration file (again between the <VirtualHost> tags).
ScriptAlias /cgi-bin/ /home/www/cgi-bin/
code:
1
2
3
4
| <Directory /home/www/cgi-bin/> Options ExecCGI AddHandler cgi-script cgi pl </Directory> |
Nu probeer ik dus het CGI script aan te roepen en dan geeft apache de volgende errors.
code:
1
2
3
4
5
6
7
8
9
10
| [Mon Oct 06 17:24:23 2008] [error] [client IP] attempt to invoke directory as script: /var/www/cgi-bin/ [Mon Oct 06 17:24:26 2008] [error] [client IP] attempt to invoke directory as script: /var/www/cgi-bin/ [Mon Oct 06 17:24:30 2008] [error] [client IP] Negotiation: discovered file(s) matching request: /var/www/cgi-bin/vnstat (None could be negotiated). [Mon Oct 06 17:25:23 2008] [error] [client IP] Negotiation: discovered file(s) matching request: /var/www/cgi-bin/vnstat (None could be negotiated). [Mon Oct 06 17:25:32 2008] [error] [client IP] File does not exist: /var/www/vnstat/vnstat [Mon Oct 06 17:25:47 2008] [error] [client IP] attempt to invoke directory as script: /var/www/cgi-bin/ [Mon Oct 06 17:28:30 2008] [error] [client IP] (8)Exec format error: exec of '/var/www/cgi-bin/perltest.pl' failed [Mon Oct 06 17:28:30 2008] [error] [client IP] Premature end of script headers: perltest.pl [Mon Oct 06 17:30:37 2008] [error] [client IP] (8)Exec format error: exec of '/var/www/cgi-bin/perltest.pl' failed [Mon Oct 06 17:30:37 2008] [error] [client IP] Premature end of script headers: perltest.pl |
Hierbij heb ik dus geprobeerd om zowel /nwstats.cgi als perltest.pl uit te voeren.
De rechten staan op dit moment als volgt:
-rwxr-xr-x 1 root root 182 2008-10-06 17:30 perltest.pl
-rwxrwxr-x 1 administrator administrator 4254 2008-10-06 17:08 vnstat.cgi
urls/how to's:
http://webmaster.iu.edu/tool_guide_info/cgi.shtml
http://www.ubuntugeek.com...ort-in-ubuntu-server.html
Lux.Architectuur | Van Dromen tot Wonen | www.Lux-a.nl