How to install PowerMTA on CentOS?
PowerMTA is a Commercial Mail Transfer Agent used by leading email service providers. Here are the steps to install PowerMTA on CentOS.
Step 1- Create a record for your domain name
- Note down your Server IP such as 108.34.100.105
- Login into your hosting account and access the Control Panel of your current domain name
- Go to DNS Zone File under your hosting account
- Change your current A record with the Server IP address
Step 2 – Set a hostname
Note – Assume your new domain name is – mydomain.com
You will need it to set a hostname or change server’s hostname in CentOS. Here are the steps to follow
- Open the command terminal of your SSD Cloud Server
- Type hostname –f
Change your current hostname with a subdomain by following command
- hostname server1.mydomain.com
Now you have to change the domain name in your hosting account as well. Follow the steps given below
- Go to command terminal and type hostname –f
You should see a result like server1.yourdomain.com
Add a CNAME to your DNS name in your hosting record by following steps give below
- Login to your hosting account and go to control panel
- Find yourdomain in the list
- Click Manage DNS
- On the Records page, click “Add” to add a new record
- In the Type drop-down menu- select CNAME
- Enter the required details and save the configuration
Step 3 – Install Php, Apache, Mysql, Perl, Zip, Unzip, iptables, net-tools, telnet
Type the commands below in your server SSH Command line
- yum -y install httpd
- yum -y install mysql.x86_64 mysql-devel.x86_64 mysql-server.x86_64 mod_auth_mysql.x86_64
- yum -y install php.x86_64 php-cli.x86_64 php-common.x86_64 php-mysql.x86_64
- yum -y install wget nano
- yum -y install perl zip unzip iptables* net-tools telnet
- yum search php-
Step 4- Installing PowerMTA on your SSD Cloud Server
Note- the steps given here are applicable to CentOS 64-bit
- Upload your RPM file to the /Home/ folder using any FTP software
Open the SSH command line and type the following commands
- rpm -ivh /home/PowerMTA-4.0r6.x86_64.rpm
- chmod 755 PowerMTA-4.0r6.x86_64.rpm
You will get a message signifying successful installation of PowerMTA on your SSD Cloud Server. Now, you have to create some folders for PowerMTA to work. Type the following command at SSH command line
- chown pmta:pmta /etc/pmta/config;
- chmod 640 /etc/pmta/config;
- mkdir -p /var/spool/pmtaPickup/;
- mkdir -p /var/spool/pmtaPickup/Pickup;
- mkdir -p /var/spool/pmtaPickup/BadMail;
- mkdir -p /var/spool/pmtaIncoming;
- chown pmta:pmta /var/spool/pmtaIncoming;
- chmod 755 /var/spool/pmtaIncoming;
- chown pmta:pmta /var/spool/pmtaPickup/*
- mkdir -p /var/log/pmta;
- mkdir -p /var/log/pmtaAccRep;
- mkdir -p /var/log/pmtaErr;
- mkdir -p /var/log/pmtaErrRep;
- chown pmta:pmta /var/log/pmta;
- chown pmta:pmta /var/log/pmtaAccRep;
- chown pmta:pmta /var/log/pmtaErr;
- chown pmta:pmta /var/log/pmtaErrRep;
- chmod 755 /var/log/pmta;
- chmod 755 /var/log/pmtaAccRep;
- chmod 755 /var/log/pmtaErr;
- chmod 755 /var/log/pmtaErrRep;
Now, you need to configure the HTTPD service. At command terminal type the following commands
- nano /etc/httpd/conf/httpd.conf
Change the domain name values to yourdomain
- ServerName mydomain.com
- ServerAlias mydomain.com
- DocumentRoot /var/www/
- ErrorLog /var/log/httpd/error_log. mydomain.com
- TransferLog /var/log/httpd/access_log. mydomain.com
- ServerName XXX.XXX.XXX
- ServerAlias XXX.XX.XXX.XXX
- DocumentRoot /var/www/
- ErrorLog /var/log/httpd/error_log
- TransferLog /var/log/httpd/access_log