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-2.2.1.1/postfixadmin-2.2.1.1.tar.gz/download
--20:21:31-- http://sourceforge.net/projects/postfixadmin/files/postfixadmin/postfixadmin-2.2.1.1/postfixadmin-2.2.1.1.tar.gz/download
Resolving sourceforge.net... 216.34.181.60
Connecting to sourceforge.net|216.34.181.60|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://downloads.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-2.2.1.1/postfixadmin-2.2.1.1.tar.gz?use_mirror=garr [following]
--20:21:31-- http://downloads.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-2.2.1.1/postfixadmin-2.2.1.1.tar.gz?use_mirror=garr
Resolving downloads.sourceforge.net... 216.34.181.59
Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://garr.dl.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-2.2.1.1/postfixadmin-2.2.1.1.tar.gz [following]
--20:21:32-- http://garr.dl.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-2.2.1.1/postfixadmin-2.2.1.1.tar.gz
Resolving garr.dl.sourceforge.net... 193.206.140.34, 2001:760:ffff:b0::34
Connecting to garr.dl.sourceforge.net|193.206.140.34|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 966600 (944K) [application/x-gzip]
Saving to: `postfixadmin-2.2.1.1.tar.gz'

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

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

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

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

Postfix database creation

# mysql -u root -p
Enter password: <YOUR_SECURE_PASSWORD_GOES_HERE>
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)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye



Comments