4. Postfixadmin installation

To use postfixadmin you need a web server, with PHP support enabled. It's time to check if the httpd package is installed, along with php. CentOS default php package does support MySQL, so it doesn't require modifications.

Check prerequisites: httpd and php

# yum list httpd php
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: ftp.ines.lug.ro
 * updates: ftp.ines.lug.ro
 * centosplus: ftp.ines.lug.ro
 * addons: ftp.ines.lug.ro
 * extras: ftp.ines.lug.ro
460 packages excluded due to repository priority protections
Installed Packages
httpd.i386                        2.2.3-22.el5.centos.2                         installed
php.i386                          5.1.6-23.2.el5_3                              installed

If the packages are missing, then install them:

Install httpd and php

# yum install httpd php

Postfix scripts are available to download at http://sourceforge.net/projects/postfixadmin/files/. Download get the .tar.gz file and extract the files from the tarball into a directory, preferably below /var/www/.

Fetch and unpack postfixadmin

# cd /var/tmp
# wget http://sourceforge.net/projects/postfixadmin/files/postfixadmin/postfixadmin-
--20:21:31-- http://sourceforge.net/projects/postfixadmin/files/postfixadmin/postfixadmin-
Resolving sourceforge.net...
Connecting to sourceforge.net||:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://downloads.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin- [following]
--20:21:31-- http://downloads.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-
Resolving downloads.sourceforge.net...
Connecting to downloads.sourceforge.net||:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://garr.dl.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin- [following]
--20:21:32-- http://garr.dl.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-
Resolving garr.dl.sourceforge.net..., 2001:760:ffff:b0::34
Connecting to garr.dl.sourceforge.net||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 966600 (944K) [application/x-gzip]
Saving to: `postfixadmin-'

100%[======================================================================================================================>] 966,600 463K/s in 2.0s

20:21:34 (463 KB/s) - `postfixadmin-' saved [966600/966600]

# cd /var/www/html
# tar -zxf /var/tmp/postfixadmin-
# mv postfixadmin- pfadm

Now, create the database which will store information about domains, users, passwords, etc:

Postfix database creation

# mysql -u root -p
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 268
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE postfix;
Query OK, 1 row affected (0.00 sec)

mysql> CREATE USER 'postfix'@'localhost' IDENTIFIED BY 'a_secure_password';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON `postfix`.* TO 'postfix'@'localhost';
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql> quit