CentOS 6.4 Email Gateway (Part 6)

Now for the most complicated aspect of the whole exercise in my view - setting up MailWatch. Before commencing, if you're creating this within a VM I highly advise you take a snapshot of your system before starting. If you're doing this on physical hardware create an image of your current state using backup imaging software like Clonezilla. Let's begin.

First we need to install PHP, MySQL and Apache. Open up Putty and type the following:

yum install mysql mysql-server

Next set MySQL to start automatically when the OS is rebooted:

chkconfig --levels 235 mysqld on
service mysqld start

Next, set passwords for the MySQL root account:


Follow the prompts for setting the root password for MySQL.

Now we'll install Apache:

yum install httpd

Now edit the /etc/httpd/conf/httpd.conf file:


#ServerName www.example.com:80

Change To:

ServerName mx.Matrix7.com.au

Change mx.Matrix7.com.au to reflect the FQDN of your server.

Now configure your system to start Apache at when the OS is rebooted:

chkconfig --levels 235 httpd on
service httpd start

Now direct your browser to, and you should see the Apache Default Test Page:


Finally, we'll install PHP:

yum install php

For PHP to become available to Apache we need to restart the Apache service:

service httpd restart

Now to test our install of PHP we need to create a file called info.php in the following location:


Within the info.php file paste the following:


Save and close the info.php file. Now direct your browser to and if PHP is configured correctly you should see the following page:


Go to Part 7

No Comments Yet.

Leave a comment

Sign up to our newsletter where you’ll receive notices on when we post new articles and helpful “how tos” to make your IT life easier.