Project

General

Profile

Support #763

Install Mailgraph on FreeBSD

Added by Daniel Curtis over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Mail Server
Target version:
Start date:
03/01/2016
Due date:
% Done:

100%

Estimated time:
1.00 h
Spent time:

Description

This is a guide on setting up Mailgraph on FreeBSD 9.

Prepare the Environment

  • Make sure the system is up date:
    pkg update && pkg upgrade
    
  • Edit permissions of mail log so Mailgraph can read it:
    chmod 0644 /var/log/maillog
    

Install Mailgraph

  • Install mailgraph:
    pkg install mailgraph
    
  • Start and enable mailgraph at boot:
    echo 'mailgraph_enable="YES"' >> /etc/rc.conf
    service mailgraph start
    

Install Nginx

  • Install nginx and fcgiwrap:
    pkg install nginx fcgiwrap
    
  • Start and enable fcgiwrap at boot:
    echo 'fcgiwrap_enable="YES"' >> /etc/rc.conf
    echo 'fcgiwrap_profiles="main"' >> /etc/rc.conf
    echo 'fcgiwrap_main_socket="unix:/tmp/fcgiwrap.sock"' >> /etc/rc.conf
    echo 'fcgiwrap_main_user="www"' >> /etc/rc.conf
    service fcgiwrap start
    

Mailgraph Website

  • Create a directory for the web application:
    mkdir -p /usr/local/www/mailgraph.example.com
    
  • And copy the mailgraph files to the mailgraph web folder:
    cp /usr/local/www/cgi-bin/mailgraph.cgi /usr/local/www/mailgraph.example.com/
    cp -r /usr/local/www/data/mailgraph /usr/local/www/mailgraph.example.com/
    
  • Add a mailgraph.example.com server block:
    vi /usr/local/etc/nginx/conf.d/mailgraph.example.com.conf
    
    • Add the following:
      upstream fcgiwrap {
         server unix:/tmp/fcgiwrap.sock;
      }
      
      server {
          listen       80;
          server_name  cgi-app.example.com;
          root         /usr/local/www/mailgraph.example.com;
          access_log   /var/log/mailgraph.example.com-access.log;
          error_log    /var/log/mailgraph.example.com-error.log;
      
          location / {
              index mailgraph.cgi;
              try_files $uri $uri/ =404;
          }
      
          location ~ \.cgi$ {
              include /usr/local/etc/nginx/fastcgi_params;
              fastcgi_index mailgraph.cgi;
              fastcgi_pass fcgiwrap;
              fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
          }
      }
      
  • Change the ownership of the mailgraph website to the web server user:
    chown -R www:www /usr/local/www/mailgraph.example.com
    
  • Restart nginx:
    service nginx restart
    

Resources

History

#1 Updated by Daniel Curtis over 4 years ago

  • Description updated (diff)
  • Status changed from New to In Progress
  • % Done changed from 0 to 30

#2 Updated by Daniel Curtis over 4 years ago

  • Description updated (diff)

#3 Updated by Daniel Curtis over 4 years ago

  • Description updated (diff)

#4 Updated by Daniel Curtis over 4 years ago

  • Description updated (diff)
  • Status changed from In Progress to Resolved
  • % Done changed from 30 to 100

#5 Updated by Daniel Curtis over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF