INSTALL 3.12 KB
Newer Older
Nigel Kukard's avatar
Nigel Kukard committed
1
Installing PolicyD v2.
Nigel Kukard's avatar
Nigel Kukard committed
2
3


4
*
Nigel Kukard's avatar
Nigel Kukard committed
5
* Requirements for PolicyD v2
6
7
8
9
*

Note: For CentOS you will need to use RPMForge repositories.

10
- MySQL or PostgreSQL or SQLite
11
12
13
	Debian based: mysql-server
	RPM based: mysql-server

Nigel Kukard's avatar
Nigel Kukard committed
14
- Net::Server >= 0.96
15
16
17
	Debian based: libnet-server-perl
	RPM based: perl-Net-Server

Nigel Kukard's avatar
Nigel Kukard committed
18
- Net::CIDR
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
	Debian based: libnet-cidr-perl
	RPM based: perl-Net-CIDR

- Net::DNS
	Debian based: libnet-dns-perl
	RPM based: perl-Net-DNS

- Config::IniFiles
	Debian based: libconfig-inifiles-perl
	RPM based: perl-Config-IniFiles

- Cache::FastMmap
	Debian based: libcache-fastmmap-perl
	RPM based: perl-Cache-FastMmap

- DBI
35
	Debian based: libdbi-perl
36
37
	RPM based: perl-DBI

38
- Mail::SPF (Required for CheckSPF module)
39
40
41
	Debian based: libmail-spf-perl

- Date::Parse  (TimeDate)
42
	Debian based: libtimedate-perl
43
44
	RPM based: perl-TimeDate

Nigel Kukard's avatar
Nigel Kukard committed
45

46
* Requirements for webui
47
- PHP v5+ (compiled with PDO support for your DB)
Nigel Kukard's avatar
Nigel Kukard committed
48
49


50
51


Nigel Kukard's avatar
Nigel Kukard committed
52
53
54
1. Setup MySQL  (or whichever database you plan to use)

a. In database/ run...
55
$ for i in  core.tsql access_control.tsql quotas.tsql amavis.tsql checkhelo.tsql checkspf.tsql greylisting.tsql accounting.tsql
Nigel Kukard's avatar
Nigel Kukard committed
56
57
58
59
$ do 
$        ./convert-tsql mysql $i
$ done > policyd.mysql

60
61
62
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, no harm in adding all of them though.

Nigel Kukard's avatar
Nigel Kukard committed
63
b. Load policyd.mysql into MySQL
64
$ mysql -u root -p policyd < policyd.mysql
Nigel Kukard's avatar
Nigel Kukard committed
65
66


67
68
69
70
71
72
73
74
2. Put cluebringer.conf in your /etc/cbpolicyd directory and adjust cluebringer.conf with your MySQL database details
mkdir /etc/cbpolicyd
cp cluebringer.conf /etc/cbpolicyd/cluebringer.conf

3. Copy the cbp/ & awitpt/ directories into /usr/local/lib/cbpolicyd-2.1/
mkdir /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/
Nigel Kukard's avatar
Nigel Kukard committed
75
76

4. Copy cbpolicyd and cbpadmin into /usr/local/bin
77
78
cp cbpadmin /usr/local/bin/
cp cbpolicyd /usr/local/sbin/
Nigel Kukard's avatar
Nigel Kukard committed
79
80


81
82
83
5. Setup system dirs ...
mkdir /var/log/cbpolicyd
mkdir /var/run/cbpolicyd
Nigel Kukard's avatar
Nigel Kukard committed
84

85
86
If you are running cbpolicyd as an unpriv user, then ...
chown cbpolicyd.cbpolicyd /var/log/cbpolicyd /var/run/cbpolicyd
Nigel Kukard's avatar
Nigel Kukard committed
87

88
89
90
91
92

6. Install the webui/*  into your apache directory, check out   includes/config.php  and adjust the MySQL server details.


7. Setup Postfix to use cbpolicyd...
Nigel Kukard's avatar
Nigel Kukard committed
93
94
95
96
97
Add the following Postfix config...
	check_policy_service inet:127.0.0.1:10031
in BOTH  smtpd_recipient_restrictions and smtpd_end_of_data_restrictions.


98
99
** Optional Amavisd Supprt ***

100
8. Copy your amavisd from /usr/sbin/amavisd and patch it with contrib/amavisd-new-2.5.3_policyd-200802070918.patch like this...
Nigel Kukard's avatar
Nigel Kukard committed
101
102
103
104
$ patch < contrib/amavisd-new-2.5.3_policyd-200802070918.patch
After this change your initscripts to start the patched amavisd.


105
9. Copy amavisd-policyd.pm where you see fit, and add this configuration line to your amavisd.conf file...
Nigel Kukard's avatar
Nigel Kukard committed
106
107
include_config_files('/path/to/amavisd-policyd.pm');

108
10. Edit the top of amavisd-policyd.pm and change ...
Nigel Kukard's avatar
Nigel Kukard committed
109
110
use lib('/root/cluebringer-trunk');  # to point to the directory which contains cbp/

111
my $DB_dsn = "DBI:mysql:database=policyd;host=localhost";  # to point to your MySQL DB
Nigel Kukard's avatar
Nigel Kukard committed
112

Nigel Kukard's avatar
Nigel Kukard committed
113

114
11. Fire everything up and browse to the web gui to configure