View Full Version : mailgraph
radox
14th November 2006, 23:50
I am following this howto
Postfix Monitoring With Mailgraph And pflogsumm - Page 2
I have Apache/2.0.54 (Debian GNU/Linux) PHP/5.1.6-1~bpo.1 mod_ssl/2.0.54 OpenSSL/0.9.7e Server installed
http://www.myexample.com/apache2-default/
at prsent this is showing above
i have reached this stage
cp -p /usr/lib/cgi-bin/mailgraph.cgi /var/www/www.example.com/cgi-bin
in my case its
[url]http://www.myexample.com/apache2-default/cgi-bin
on this page there is a script which starts like this:
#!/usr/bin/perl -w
# mailgraph -- a postfix statistics rrdtool frontend
# copyright (c) 2000-2004 David Schweikert <dws@ee.ethz.ch>
# released under the GNU General Public License
use RRDs;
use POSIX qw(uname);
my $VERSION = "1.10";
but in
[url]http://www.myexample.com/apache2-default/cgi-bin/mailgraph.cgi/
there is nothing although there is plenty of mail going through the server?
radox
falko
15th November 2006, 17:48
Please post your vhost configuration. I assume this is in /etc/apache2/sites-available/default on your system.
radox
16th November 2006, 00:56
here is the default file as requested
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
falko
16th November 2006, 17:18
here is the default file as requested
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
Please copy mailgraph.cgi to /usr/lib/cgi-bin. In your browser, you must use http://www.example.com/cgi-bin/mailgraph.cgi .
Tenaka
24th January 2007, 09:13
I had set it up according to the how-to from howtoforge but yesterday I had to mass change a lot of owners in my web directory and it seems I somehow also affected the cgi-bin folder as I stopped seeing output. I installed it months ago and everything was working fine.
output was here: http://www.web-designerz.de/cgi-bin/mailgraph.cgi
my vhost (partially):
<VirtualHost 85.214.51.208:80>
SuexecUserGroup web1_postmaster web1
ServerName www.web-designerz.de:80
ServerAdmin webmaster@web-designerz.de
DocumentRoot /var/www/web1/web
ServerAlias web-designerz.de
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 $
ScriptAlias /cgi-bin/ /var/www/web1/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
stuff is inside: /var/www/web1/cgi-bin/ and the cgi-bin folder is owned by web1_postmaster:web1
h898552:/var/www/web1# ls -al cgi-bin/
total 16
drwxr-xr-x 2 web1_postmaster web1 4096 Sep 12 08:58 .
drwxr-xr-x 20 web1_postmaster web1 4096 Jan 16 13:54 ..
-rw-r--r-- 1 web1_postmaster web1 0 Feb 28 2006 .csc
-r-------- 1 web1_postmaster web1 0 Feb 28 2006 .no_delete
-rwxr-xr-x 1 web1_postmaster web1 7009 Nov 27 2004 mailgraph.cgi
h898552:/var/www/web1#
so what could be the problem?
falko
25th January 2007, 19:34
Please check the permissions of the image directory (where mailgraph writes the graphs).
Tenaka
26th January 2007, 08:33
I opened mailgraph.cgi and found these lines:
my $rrd = '/var/lib/mailgraph/mailgraph.rrd'; # path to where the RRD database is
my $rrd_virus = '/var/lib/mailgraph/mailgraph_virus.rrd'; # path to where the Virus RRD database is
my $tmp_dir = '/var/lib/mailgraph'; # temporary directory where to store the images
then I did a chown -R web1_postmaster:web1 /var/lib/mailgraph/
h898552:/var/www/web5/web/wp-content/plugins#
as the mailgraph.cgi is inside my web1 and I use suexec. Also did a chmod -R 775 /var/lib/mailgraph/ and now I am waiting for some graphs to show up - right?
and btw. the directory /var/lib/mailgraph was completely missing....
or shall I reinstall it all, following the tutorial again?
falko
27th January 2007, 14:47
and now I am waiting for some graphs to show up - right?
Yes. Maybe you must do a chmod 777. Is it working now?
Tenaka
27th January 2007, 19:02
I think 775 is enough, but anyway even a chmod -R 777 didn't change anything.... strange...
shall I PM you a link?
falko
28th January 2007, 21:14
Then there must be still another directory that mailgraph needs for creating the graphs.
Tenaka
28th January 2007, 22:52
I narrowed it down, its a ownership problem...
if I chown web1_postmaster:web1 I get permission denied errors 403 (this is the user and group for suexec for this client) if I chown web1_postmaster:www-data I get suexec errors... saying anyone is allowed to write ([2007-01-28 18:44:21]: uid: (10001/web1_postmaster) gid: (10001/10001) cmd: mailgraph.cgi
[2007-01-28 18:44:21]: directory is writable by others: (/var/www/web1/cgi-bin)
which is not true I chmoded to 774 ?
can anyone using suexec for cgi scripts tell me who owns his cgi-bin directory and the containing mailgraph.cgi script? and how the folder and files are chmoded please so I can compare.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.