Mailgraph on FreeBSD

Categories: BSD

Have you just installed mailgraph and are you asking yourself “and now???”
Let’s see how to get it running on FreeBSD.
After installation copy your /usr/local/www/cgi-bin/mailgraph.cgi to your cgi-bin directory, default is /usr/local/www/apache24/cgi-bin/ and change the owner to www:www :

cp /usr/local/www/cgi-bin/mailgraph.cgi /usr/local/www/apache24/cgi-bin/
chown www:www /usr/local/www/apache24/cgi-bin/mailgraph.cgi

Be sure to have this line:
ScriptAlias /cgi-bin/ “/usr/local/www/apache24/cgi-bin/”
not commented in your httpd.conf and check also on “Options” directive to have +ExecCGI and AddHandler cgi-script .cgi.
If you use virtual domains simply add Options and AddHandler line on your virtual domain section:

<VirtualHost *:80>
  DocumentRoot /www/
  <Directory "/www/">
     Options +ExecCGI
     AddHandler cgi-script .cgi

Don’t forget to reload Apache and test if cgi-bin work, with
If it’s all ok, i’ve a little bad news for you, seems that mailgraph rc script doesn’t work very well. I don’t know why, script seems ok, but mailgraph perl script simply wont’ start…
I’ll check later, if someone know what is wrong please leave a comment, thanks!
Anyway that’s not a big deal, you can easily launch the script manually, for the moment, with
/usr/local/bin/perl -w /usr/local/sbin/ –logfile /var/log/maillog –daemon-rrd=/var/db/mailgraph –ignore-localhost –daemon –daemon-pid=/var/db/mailgraph/
Or add that line in a script and put it in /usr/local/etc/rc.d/.
Now wait a bit and point your browser to your mailgraph.cgi… WOW! graphs!


    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.