Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
installing [2013-05-21 08:45]
wikiadmin
installing [2013-12-06 08:47] (current)
rspencer Fix formatting
Line 1: Line 1:
-=====Installing=====+====== Installing ​======
  
-  * Set up your database +Set up your database
-    ​* ​In database/ run the following:​ + 
-    ​* ​<code bash>for i in core.tsql access_control.tsql quotas.tsql amavis.tsql checkhelo.tsql checkspf.tsql greylisting.tsql accounting.tsql+In database/ run the following:​ 
 + 
 +<code bash> 
 +for i in core.tsql access_control.tsql quotas.tsql amavis.tsql checkhelo.tsql checkspf.tsql greylisting.tsql accounting.tsql
 do do
 ./​convert-tsql mysql $i ./​convert-tsql mysql $i
-done > policyd.sql</​code>​ +done > policyd.sql 
-    * This will build policyd.mysql,​ be sure to //always// load core.tsql first, you only really need the schema for the modules you plan to use but there is no harm in adding all of them. +</​code>​
-    * Load policyd.mysql into your database, in this case MySQL: +
-    * <code bash>​mysql -u root -p policyd < policyd.mysql</​code>​+
  
-  ​Move cluebringer.conf to your /etc directory and edit your database details ​in cluebringer.conf+This will build policyd.mysql,​ be sure to **always*load core.tsql first, you only really need the schema for the modules you plan to use but there is no harm in adding all of them.
  
-  * Copy the cbp/ & awitpt/ directories into /​usr/​local/​lib/​cbpolicyd-2.1/​ +Load policyd.mysql into your database, in this case MySQL: 
-  ​* ​<code bash>​mkdir /​usr/​local/​lib/​cbpolicyd-2.1+ 
 +<code bash> 
 +mysql -u root -p policyd < policyd.mysql 
 +</​code>​ 
 + 
 +Move cluebringer.conf to your /etc directory and edit your database details in cluebringer.conf. 
 + 
 +Copy the cbp/ & awitpt/ directories into /​usr/​local/​lib/​cbpolicyd-2.1/​
 + 
 +<code bash> 
 +mkdir /​usr/​local/​lib/​cbpolicyd-2.1
 cp -r cbp /​usr/​local/​lib/​cbpolicyd-2.1/​ cp -r cbp /​usr/​local/​lib/​cbpolicyd-2.1/​
-cp -r awitpt/​awitpt /​usr/​local/​lib/​cbpolicyd-2.1/</​code>​+cp -r awitpt/​awitpt /​usr/​local/​lib/​cbpolicyd-2.1/​ 
 +</​code>​ 
 + 
 +Copy cbpolicyd and cbpadmin into /​usr/​local/​bin:​ 
 + 
 +<code bash> 
 +cp cbpadmin /​usr/​local/​bin/​ 
 +cp cbpolicyd /​usr/​local/​sbin/​ 
 +</​code>​ 
 + 
 +Setup system directories:​ 
 + 
 +<code bash> 
 +mkdir /​var/​log/​cbpolicyd 
 +mkdir /​var/​run/​cbpolicyd 
 +</​code>​ 
 + 
 +If you are running cbpolicyd as an unprivileged user, then: 
 + 
 +<code bash> 
 +chown cbpolicyd.cbpolicyd /​var/​log/​cbpolicyd /​var/​run/​cbpolicyd 
 +</​code>​ 
 + 
 +Install the webui/​* ​ into your apache directory, check out includes/​config.php and adjust the database details. 
 + 
 +Setup Postfix to use cbpolicyd. 
 + 
 +Add the following Postfix config setting in **BOTH** smtpd_recipient_restrictions and smtpd_end_of_data_restrictions:​ 
 + 
 +<​code>​ 
 +check_policy_service inet:​127.0.0.1:​10031 
 +</​code>​
  
-  * Copy cbpolicyd and cbpadmin into /​usr/​local/​bin +It's recommended to add these parameters first, i.e.:
-  * <code bash>cp cbpadmin /​usr/​local/​bin/​ +
-cp cbpolicyd /​usr/​local/​sbin/</​code>​+
  
-  * Setup system directories +<​code>​ 
-  * <​code ​bash>mkdir /​var/​log/​cbpolicyd +smtpd_recipient_restrictions = check_policy_service inet:​127.0.0.1:​10031,​ permit_mynetworks,​ ..., ... 
-mkdir /​var/​run/​cbpolicyd</​code>​+</​code>​
  
-  * If you are running cbpolicyd as an unprivileged user, then +===== Optional Amavisd Support =====
-  * <code bash>​chown cbpolicyd.cbpolicyd /​var/​log/​cbpolicyd /​var/​run/​cbpolicyd</​code>​+
  
-  * Install the webui/​* ​ into your apache directory, check out includes/config.php ​and adjust the database details.+Copy your amavisd from /usr/​sbin/​amavisd ​and patch it with contrib/​amavisd-new-2.5.3_policyd-200802070918.patch
  
-  * Setup Postfix to use cbpolicyd +<​code ​bash> 
-    * Add the following Postfix config setting in //BOTH// smtpd_recipient_restrictions and smtpd_end_of_data_restrictions +patch contrib/amavisd-new-2.5.3_policyd-200802070918.patch 
-    * <​code>​check_policy_service inet:​127.0.0.1:​10031</code> +</​code>​
-    * It's recommended to add these parameters first, ie: +
-    * <​code>​smtpd_recipient_restrictions = check_policy_service inet:​127.0.0.1:​10031,​ permit_mynetworks,​ ..., ...</​code>​+
  
-__Optional Amavisd Support__+Change your initscripts to start the patched amavisd.
  
-  * Copy your amavisd from /​usr/​sbin/​amavisd and patch it with contrib/amavisd-new-2.5.3_policyd-200802070918.patch +Copy amavisd-policyd.pm where you see fit, and add this configuration line to amavisd.conf:
-  * <code bash>​patch < contrib/amavisd-new-2.5.3_policyd-200802070918.patch</​code>​+
  
-  * Change your initscripts ​to start the patched ​amavisd+<code perl> 
 +include_config_files('/​path/​to/amavisd-policyd.pm'​);​ 
 +</​code>​
  
-  * Copy amavisd-policyd.pm ​where you see fit, and add this configuration line to amavisd.conf +Edit the top of amavisd-policyd.pm and change:
-  * <code perl>​include_config_files('/​path/​to/​amavisd-policyd.pm'​);</​code>​+
  
-  * Edit the top of amavisd-policyd.pm and change: +<code perl> 
-  * <code perl>use lib('/​root/​cluebringer-trunk'​); ​ # to point to the directory which contains cbp/ +use lib('/​root/​cluebringer-trunk'​);​ # to point to the directory which contains cbp/ 
-my $DB_dsn = "​DBI:​mysql:​database=policyd;​host=localhost"; ​ # to point to your MySQL DB</​code>​+my $DB_dsn = "​DBI:​mysql:​database=policyd;​host=localhost";​ # to point to your MySQL DB 
 +</​code>​
  
-  * Fire everything up and browse to the web gui to set up policyd+Fire everything up and browse to the web gui to set up policyd.